/* =========================================================
   layout.css — ヘッダー / メニュー / 本文枠 / フッター /
                カスタムスクロールバー / 表示アニメーション
   ========================================================= */

/* ---------------------------------------------------------
   ヘッダー
   --------------------------------------------------------- */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px var(--gutter-edge);
  /* 背景の帯は敷かず、常に映像を透かしたままにする */
  background: transparent;
}

.header__logo {
  flex: none;
  display: block;
}

.header__logo img {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.header__nav {
  display: flex;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(20px, 3vw, 48px);
  font-size: 15px;
  font-weight: 500;
}

.header__nav-link {
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s ease;
}

.header__nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}

.header__nav-link:hover {
  color: var(--c-accent-hi);
}

.header__nav-link:hover::after {
  transform: scaleX(1);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: none;
}

/* ---------------------------------------------------------
   ハンバーガー
   --------------------------------------------------------- */

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.hamburger__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-fg);
  transition: transform 0.3s var(--ease-out), opacity 0.2s ease;
}

.hamburger[aria-expanded='true'] .hamburger__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded='true'] .hamburger__bar:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded='true'] .hamburger__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------------------------------------------------------
   モバイルメニュー
   --------------------------------------------------------- */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: #000;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu.is-open {
  opacity: 1;
}

.mobile-menu__nav {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: calc(var(--header-h) + 32px) 24px 48px;
  font-size: 24px;
  font-weight: 500;
}

.mobile-menu__link {
  transition: color 0.2s ease;
}

.mobile-menu__link:hover {
  color: var(--c-accent);
}

/* ---------------------------------------------------------
   本文枠（左右のガイドライン）
   --------------------------------------------------------- */

/* 背景映像を透かすため、本文側に地の色は敷かない */
.site-main {
  position: relative;
  z-index: 2;
}

/* 左右のガイドライン。position:absolute なので flex の
   .hero に付けてもレイアウトには影響しない */
.hero::before,
.hero::after,
.site-main::before,
.site-main::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--c-hairline);
  pointer-events: none;
}

.hero::before,
.site-main::before { left: var(--rail); }

.hero::after,
.site-main::after  { right: var(--rail); }

.section {
  position: relative;
  padding: var(--section-y) var(--gutter);
  /* 固定ヘッダーの下に隠れないようにアンカー位置をずらす */
  scroll-margin-top: var(--header-h);
}

.section__title {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.25;
  font-weight: 500;
  font-style: italic;
  max-width: 1000px;
}

.section__lead {
  margin-top: 16px;
  max-width: 640px;
  font-size: 14px;
  line-height: 1.7;
  font-style: italic;
  opacity: 0.6;
}

.section__rule {
  margin-top: 40px;
  height: 1px;
  background: var(--c-rule);
}

/* ---------------------------------------------------------
   フッター
   --------------------------------------------------------- */

.footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(30px, 5vw, 50px) var(--gutter-edge);
  border-top: 1px solid var(--c-hairline);
}

.footer__logo img {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 3vw, 48px);
  font-size: 15px;
  font-weight: 500;
}

.footer__nav-link {
  transition: color 0.2s ease;
}

.footer__nav-link:hover {
  color: var(--c-accent);
}

.footer__copy {
  width: 100%;
  font-size: 12px;
  letter-spacing: 0.5px;
  opacity: 0.35;
}

/* ---------------------------------------------------------
   カスタムスクロールバー
   --------------------------------------------------------- */

.scrollbar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 120;
  width: 14px;          /* 掴みやすさのための当たり判定。見た目は透明 */
  height: 100%;
  background: transparent;
  touch-action: none;
}

/* レール（見た目の実体） */
.scrollbar::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: rgba(206, 54, 43, 0.25);
}

.scrollbar__thumb {
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--c-accent);
  will-change: transform;
}

.scrollbar:hover .scrollbar__thumb    { background: var(--c-accent-hi); }
.scrollbar.is-dragging .scrollbar__thumb { background: var(--c-accent-lo); }

/* ---------------------------------------------------------
   スクロール表示アニメーション
   --------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* 子要素を順番に送り出す */
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: calc(var(--stagger-index, 0) * 110ms);
}

[data-reveal].is-visible [data-reveal-stagger] > *,
[data-reveal-stagger].is-visible > * {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal-stagger] > * {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------
   レスポンシブ
   --------------------------------------------------------- */

@media (max-width: 1024px) {
  :root {
    --rail: 24px;
  }

  .header__nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .header__actions .btn--pill-light {
    display: none;
  }

  .hero::before,
  .hero::after,
  .site-main::before,
  .site-main::after {
    display: none;
  }
}

@media (max-width: 640px) {
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer__nav {
    gap: 16px 28px;
    font-size: 14px;
  }
}
