/* ========================================
   リセット・基本設定
======================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: "Noto Serif JP", serif;
  color: #2a2a2a;
  background-color: #ffffff;
  line-height: 1.8;
  letter-spacing: 0.05em;
  overflow-x: hidden;
}

/* ========================================
   ヘッダー（トップページ用）
======================================== */
.header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background-color: transparent;
  border-bottom: none;
  z-index: 20;
  padding: 20px 0;
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 32px;
  padding: 0 32px;
}

.nav-link {
  font-size: 20px;
  font-weight: 400;
  color: #777;
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: #555;
}

.nav-link.active {
  color: #555;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: #555;
}

/* ========================================
   ファーストビュー（トップページ専用）
======================================== */
.hero {
  position: relative;
  width: 100%;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: auto;
  display: block;
}

/* トップページ 初回表示演出 */
/* 1. ヒーロー画像（2.0秒フェードイン） */
.top-page .hero-image {
  opacity: 0;
  transition: opacity 2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.top-page.is-ready .hero-image {
  opacity: 1;
}

/* 2. タイトル／ナビ／下部要素（ヒーロー完了後に0.5秒フェード） */
.top-page .header,
.top-page .hero-subtitle-wrapper,
.top-page .hero-title-wrapper,
.top-page .creator,
.top-page .footer {
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  transition-delay: 2s;
}

.top-page.is-ready .header,
.top-page.is-ready .hero-subtitle-wrapper,
.top-page.is-ready .hero-title-wrapper,
.top-page.is-ready .creator,
.top-page.is-ready .footer {
  opacity: 1;
}

/* （トップページ用の画像直下ブロックは削除済み） */

/* ヒーロー内ナビゲーション（右上） */
.hero-nav {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: flex-end;
  z-index: 10;
}

.hero-nav-link {
  font-size: 14px;
  font-weight: 300;
  color: #777;
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}

.hero-nav-link:hover {
  color: #555;
}

/* サブタイトル（左寄り・中段） */
.hero-subtitle-wrapper {
  position: absolute;
  top: 22%;
  left: 8%;
  max-width: 420px;
}

.hero-subtitle {
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 300;
  color: #333;
  line-height: 1.8;
  letter-spacing: 0.05em;
  text-align: left;
}

/* メインタイトル（下部） */
.hero-title-wrapper {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  text-align: center;
}

.hero-title {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(80px, 14vw, 144px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.1em;
  color: #2a2a2a;
}

.hero-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 16px 40px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-outline {
  color: #2a2a2a;
  background-color: transparent;
  border: 1px solid #d0d0d0;
}

.btn-outline:hover {
  background-color: #2a2a2a;
  color: #ffffff;
  border-color: #2a2a2a;
}

/* ========================================
   制作者情報
======================================== */
.creator {
  padding: 80px 32px 40px;
  text-align: center;
  background-color: #ffffff;
}

.creator-name {
  font-size: 19px;
  font-weight: 400;
  color: #666;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.creator-contact {
  font-size: 18px;
  font-weight: 300;
  color: #999;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.creator-contact:last-child {
  margin-bottom: 0;
}

/* ========================================
   フッター
======================================== */
.footer {
  padding: 40px 32px;
  text-align: center;
  background-color: #ffffff;
  border-top: 1px solid #f0f0f0;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer p {
  font-size: 12px;
  color: #999;
  letter-spacing: 0.05em;
}

.footeropyright {
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: #999;
}

.footer-legal-links {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 18px;
  font-size: 12px;
  color: #999;
}

.footer-legal-links a {
  color: inherit;
  text-decoration: underline;
  padding: 4px 6px;
}

.footer-legal-links a:hover {
  color: #666;
}

/* ========================================
   動きの少ない表示を希望する環境向け
   （アニメーションはスキップして即時表示）
======================================== */
@media (prefers-reduced-motion: reduce) {
  .top-page .hero-image,
  .top-page .header,
  .top-page .hero-subtitle-wrapper,
  .top-page .hero-title-wrapper,
  .top-page .creator,
  .top-page .footer {
    transition: none !important;
  }
}

/* ========================================
   レスポンシブ
======================================== */
@media (min-width: 768px) {
  /* PC表示時のサブタイトル改行調整 */
  .hero-subtitle-wrapper {
    max-width: 580px;
  }

  .hero-subtitle {
    word-break: keep-all;
    line-break: strict;
    white-space: normal;
  }
}

@media (max-width: 768px) {
  .nav {
    gap: 24px;
    padding: 0 20px;
  }

  .nav-link {
    font-size: 11.5px;
  }

  /* ヒーロー：スマホ専用調整 */
  .hero {
    aspect-ratio: 2 / 3.5;
  }

  .hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .hero-nav {
    top: 15px;
    right: 15px;
    gap: 12px;
  }

  .hero-nav-link {
    font-size: 12px;
  }

  .hero-subtitle-wrapper {
    top: 25%;
    left: 7%;
    max-width: 86%;
  }

  .hero-subtitle {
    font-size: clamp(10px, 2.6vw, 12px);
  }

  .hero-title-wrapper {
    bottom: 5%;
    width: 90%;
  }

  .hero-title {
    font-size: clamp(36px, 10.5vw, 56px);
  }

  .hero-cta {
    flex-direction: column;
    gap: 16px;
  }

  .btn {
    width: 100%;
    max-width: 280px;
  }

  .creator {
    padding: 48px 20px 26px;
  }

  .creator-name {
    font-size: 12px;
    margin-bottom: 14px;
  }

  .creator-contact {
    font-size: 11px;
    margin-bottom: 6px;
  }

  .footer-legal-links {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .nav {
    gap: 16px;
  }

  .nav-link {
    font-size: 9.2px;
  }

  .hero-nav {
    gap: 10px;
  }

  .hero-nav-link {
    font-size: 11px;
  }

  .hero-subtitle {
    font-size: clamp(9px, 2.8vw, 11px);
  }

  .hero-title {
    font-size: clamp(32px, 12vw, 48px);
  }
}

/* ========================================
   LINE 内ブラウザ向けヒーロー保険
   他ブラウザの表示は一切変更しない
======================================== */
@media (max-width: 768px) {
  body.line-browser .hero {
    height: 175vw;
    max-height: 910px;
    overflow: hidden;
  }
}

/* ========================================
   トップページ最終固定（旧CSS無効化の保険）
   ※ 現在の見た目を変えない前提で上書き
======================================== */
header,
.header,
.nav {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

/* ヒーロー領域の高さに旧CSSの min/max を効かせない */
body:not(.line-browser) .hero {
  height: auto !important;
  min-height: unset !important;
}

/* ========================================
   内蔵ブラウザ向けヒーロー保険（スマホのみ）
   通常ブラウザでは既存 aspect-ratio を優先
======================================== */
@media (max-width: 768px) {
  /* aspect-ratio に非対応な環境向けフォールバック */
  @supports not (aspect-ratio: 1 / 1) {
    .hero {
      width: 100%;
      height: 175vw;
      max-height: 1120px;
      overflow: hidden;
    }

    .hero-image {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  /* aspect-ratio 対応環境では従来挙動を維持 */
  @supports (aspect-ratio: 1 / 1) {
    .hero {
      height: auto;
      aspect-ratio: 2 / 3.5;
      max-height: none;
    }
  }
}
