/* Layout — header (centred split), mobile menu, sections, zigzag, inner-page
 * hero, footer, tab bar, route rail. From the approved mockup; the full footer
 * and the inner-page hero are new, built in the same language. */

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.container--text { max-width: calc(var(--container-text) + var(--gutter) * 2); }

/* ================= HEADER (centred split) ================= */
.hdr { position: sticky; top: 0; z-index: var(--z-header); height: var(--hdr-h); pointer-events: none; }
.hdr__bar {
  pointer-events: auto; height: var(--hdr-h); position: relative;
  background: linear-gradient(180deg, rgb(11 17 29 / .78), rgb(16 24 39 / .45));
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  transition: height .35s var(--ease), background .35s var(--ease), box-shadow .35s;
}
.hdr__bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--hair-gold) 18%, var(--color-brand) 50%, var(--hair-gold) 82%, transparent); }
.hdr__in { height: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.hdr.is-scrolled .hdr__bar { height: 66px; background: rgb(11 17 29 / .88); box-shadow: 0 12px 32px -18px rgb(0 0 0 / .8); }
.hdr.is-scrolled .logo { font-size: 1.38rem; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav--r { justify-self: end; }
.nav__a { position: relative; display: inline-flex; align-items: center; height: 44px; padding: 0 13px; font: 500 .9rem/1 var(--font-body); color: var(--color-text-2); transition: color var(--dur); white-space: nowrap; }
.nav__a::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 8px; height: 1px; background: var(--color-brand); transform: scaleX(0); transition: transform .3s var(--ease); }
.nav__a:hover { color: var(--color-text); }
.nav__a:hover::after { transform: scaleX(1); }
.nav__a[aria-current] { color: var(--color-text); }
.nav__a[aria-current]::before { content: ""; position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--color-brand); }
.nav__sep { width: 1px; height: 22px; background: var(--hair-2); margin: 0 8px; }
.login { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; font: 600 .9rem/1 var(--font-body); color: var(--color-text); white-space: nowrap; }
.login:hover { color: var(--color-brand); }

/* signed-in: wallet balance + account chip */
.wallet-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 10px; border-radius: var(--r-pill); background: var(--surface-1); box-shadow: 0 0 0 1px var(--hair-gold) inset; font: 700 .85rem/1 var(--font-body); font-variant-numeric: tabular-nums; white-space: nowrap; transition: background var(--dur); }
.wallet-chip:hover { background: var(--tint-gold); }
.wallet-chip .icon { width: 18px; height: 18px; color: var(--color-brand); }
.wallet-chip small { font-weight: 600; color: var(--color-text-3); }
.acct { position: relative; }
.acct__btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 4px; border-radius: var(--r-pill); font: 600 .88rem/1 var(--font-body); }
.acct__ava { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--color-brand); color: var(--color-brand-ink); font: 800 .85rem/1 var(--font-head); }
.acct__btn .icon { width: 16px; height: 16px; color: var(--color-text-3); transition: transform var(--dur); }
.acct__btn[aria-expanded="true"] .icon { transform: rotate(180deg); }
.acct__menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 240px; padding: 8px; border-radius: var(--r-md); background: var(--surface-3); box-shadow: var(--sh-3), 0 0 0 1px var(--hair-2) inset; list-style: none; margin: 0; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .25s var(--ease); }
.acct__menu.is-open { opacity: 1; visibility: visible; transform: none; }
.acct__menu a, .acct__menu button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: .9rem; color: var(--color-text-2); text-align: left; }
.acct__menu a:hover, .acct__menu button:hover { background: rgb(255 255 255 / .05); color: var(--color-text); }
.acct__menu .icon { width: 18px; height: 18px; }
.acct__menu hr { border: 0; height: 1px; background: var(--hair); margin: 6px 4px; }
.acct__who { padding: 8px 12px 10px; font-size: .78rem; color: var(--color-text-3); }
.acct__who b { display: block; font: 700 .95rem/1.3 var(--font-head); color: var(--color-text); }

.hdr .burger, .hdr__m-right { display: none; }

/* mobile menu overlay */
.menu { position: fixed; inset: 0; z-index: var(--z-menu); background: color-mix(in oklch, var(--surface-0) 96%, transparent); backdrop-filter: blur(10px); padding: calc(var(--hdr-h) + 24px) var(--gutter) 120px; overflow: auto; display: none; }
.menu.is-open { display: block; animation: menuIn .3s var(--ease) both; }
@keyframes menuIn { from { opacity: 0; } }
.menu__list { list-style: none; margin: 0; padding: 0 0 0 28px; position: relative; }
.menu__list::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 14px; width: 1px; background: linear-gradient(var(--color-brand), var(--hair-gold), transparent); }
.menu__list li { position: relative; }
.menu.is-open .menu__list li { animation: menuLi .4s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
@keyframes menuLi { from { transform: translateX(-12px); opacity: 0; } }
.menu__list li::before { content: ""; position: absolute; left: -28px; top: 50%; width: 11px; height: 11px; margin-top: -5.5px; border-radius: 50%; background: var(--color-bg); border: 2px solid var(--hair-gold); }
.menu__list li.is-here::before { border-color: var(--color-brand); background: var(--color-brand); }
.menu__list a { display: flex; align-items: center; justify-content: space-between; min-height: 56px; font: 700 1.5rem/1.1 var(--font-head); letter-spacing: -.02em; border-bottom: 1px solid var(--hair); }
.menu__list a small { font: 600 .7rem/1 var(--font-body); letter-spacing: .12em; color: var(--color-text-3); text-transform: uppercase; }
.menu__cta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.menu__note { margin-top: 22px; color: var(--color-text-3); font-size: var(--fs-sm); }

/* ================= SECTIONS ================= */
.sec { padding-block: var(--sec-y); position: relative; }
.sec--tight { padding-block: clamp(48px, 6vw, 80px); }
.sec--alt { background: linear-gradient(180deg, var(--color-bg), color-mix(in oklch, var(--surface-1) 60%, var(--color-bg)) 50%, var(--color-bg)); --notch-bg: color-mix(in oklch, var(--surface-1) 60%, var(--color-bg)); }
.sec--alt::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--hair-2), transparent); }
.sec__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.sec h2, .sec__title { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin-top: 18px; }
.sec__lead { margin-top: 16px; color: var(--color-text-2); max-width: 600px; }
.sec__foot { display: flex; align-items: center; gap: 16px; margin-top: 24px; flex-wrap: wrap; color: var(--color-text-3); font-size: .85rem; }
.zz { display: grid; gap: clamp(32px, 5vw, 72px); align-items: stretch; }
.zz--pl { grid-template-columns: minmax(0,5fr) minmax(0,7fr); }
.zz--pr { grid-template-columns: minmax(0,7fr) minmax(0,5fr); }
.zz--half { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; }

/* ================= INNER-PAGE HERO (photo band) ================= */
.phero { position: relative; margin-top: calc(var(--hdr-h) * -1); padding: calc(var(--hdr-h) + clamp(48px, 7vw, 96px)) 0 clamp(40px, 5vw, 64px); overflow: hidden; isolation: isolate; }
.phero__bg { position: absolute; inset: 0; z-index: -2; }
.phero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); animation: kb 18s linear both; }
.phero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, var(--color-bg) 0%, rgb(16 24 39 / .86) 30%, rgb(16 24 39 / .55) 70%, rgb(16 24 39 / .7) 100%), linear-gradient(90deg, rgb(16 24 39 / .9) 0%, rgb(16 24 39 / .3) 70%); }
.phero h1 { margin-top: 18px; font-size: var(--fs-page); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; max-width: 900px; }
.phero h1 em { font-style: normal; color: var(--color-brand); }
.phero__lead { margin-top: 16px; max-width: 640px; color: var(--color-text-2); font-size: clamp(1rem, .95rem + .3vw, 1.12rem); }
.phero__meta { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 600 .75rem/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--color-text-3); list-style: none; margin: 0; padding: 0; }
.crumbs a { display: inline-flex; align-items: center; min-height: 24px; }
.crumbs a:hover { color: var(--color-brand); }
.crumbs li + li::before { content: ""; display: inline-block; width: 18px; height: 1px; margin-right: 8px; vertical-align: middle; background: var(--hair-gold); }
.crumbs [aria-current] { color: var(--color-brand); }
@keyframes kb { from { transform: scale(1.02) translate3d(0,0,0); } to { transform: scale(1.14) translate3d(-1.5%,-1%,0); } }

/* in-page anchor navigator (long pages) */
.toc { position: sticky; top: calc(var(--hdr-h) + 24px); align-self: start; display: grid; gap: 2px; padding-left: 18px; border-left: 1px solid var(--hair-2); max-height: calc(100vh - var(--hdr-h) - 48px); overflow: auto; scrollbar-width: thin; }
.toc a { position: relative; display: block; padding: 6px 0; font-size: .84rem; line-height: 1.35; color: var(--color-text-3); transition: color var(--dur); }
.toc a::before { content: ""; position: absolute; left: -23px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--color-bg); border: 2px solid var(--hair-2); transition: all var(--dur); }
.toc a:hover { color: var(--color-text); }
.toc a:focus-visible { outline-offset: -2px; }
.toc a.is-on { color: var(--color-text); }
.toc a.is-on::before { border-color: var(--color-brand); background: var(--color-brand); }
.toc__title { font: 700 .7rem/1 var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--color-brand); margin-bottom: 10px; }
.with-toc { display: grid; grid-template-columns: 240px minmax(0,1fr); gap: clamp(32px, 5vw, 72px); }

/* ================= FOOTER ================= */
.foot { position: relative; border-top: 1px solid var(--hair); background: var(--surface-0); padding: clamp(48px, 6vw, 72px) 0 calc(28px + env(safe-area-inset-bottom)); }
.foot::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--hair-gold) 20%, var(--color-brand) 50%, var(--hair-gold) 80%, transparent); }
.foot__top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); gap: clamp(32px, 5vw, 72px); }
.foot__brand p { margin-top: 16px; color: var(--color-text-2); font-size: .9rem; max-width: 340px; }
.foot__brand .logo { font-size: 1.4rem; }
.foot__cols { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 24px; }
.foot__title { font: 700 .7rem/1 var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--color-brand); margin-bottom: 12px; }
.foot__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.foot__list a { display: inline-flex; align-items: center; min-height: 36px; font-size: .9rem; color: var(--color-text-2); transition: color var(--dur); }
.foot__list a:hover { color: var(--color-text); }
.foot__list button { min-height: 36px; font-size: .9rem; color: var(--color-text-2); text-align: left; }
.foot__list button:hover { color: var(--color-text); }
.foot__legal { margin-top: clamp(32px, 4vw, 48px); padding: 22px 24px; border-radius: var(--r-md); background: var(--surface-1); box-shadow: 0 0 0 1px var(--hair) inset; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 28px; }
.foot__legal dt { font: 700 .6875rem/1.2 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--color-text-3); }
.foot__legal dd { margin: 6px 0 0; font-size: .86rem; color: var(--color-text-2); line-height: 1.45; }
.foot__rg { margin-top: 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.rg { display: flex; align-items: center; gap: 12px; font-size: .85rem; color: var(--color-text-2); }
.rg__age { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 800 .82rem/1 var(--font-head); border: 1px solid var(--color-brand); color: var(--color-brand); }
.rg a { color: var(--color-brand); text-decoration: underline; text-underline-offset: 2px; }
.foot__copy { font-size: .8rem; color: var(--color-text-3); }

/* ================= TAB BAR (mobile) ================= */
.tabbar { display: none; }

/* ================= ROUTE RAIL (fixed, desktop ≥1380) ================= */
.rail { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: var(--z-rail); height: 300px; width: 14px; display: none; }
.rail::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: var(--hair-2); border-radius: 2px; }
.rail__fill { position: absolute; left: 6px; top: 0; width: 2px; height: var(--rp, 0%); background: linear-gradient(var(--color-brand), var(--color-accent)); border-radius: 2px; }
.rail__dot { position: absolute; left: 1px; top: var(--rp, 0%); width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--tint-gold), 0 0 12px rgb(245 184 65 / .7); }
.rail a { position: absolute; left: -5px; width: 24px; height: 24px; margin-top: -12px; display: grid; place-items: center; }
.rail a b { width: 10px; height: 10px; border-radius: 50%; background: var(--color-bg); border: 2px solid var(--hair-gold); transition: border-color .3s, background .3s; }
.rail a.is-on b { border-color: var(--color-brand); background: var(--color-brand); }
.rail a span { position: absolute; right: 28px; white-space: nowrap; font: 600 .72rem/1 var(--font-body); letter-spacing: .06em; padding: 6px 10px; border-radius: var(--r-pill); background: var(--surface-3); box-shadow: var(--sh-1); opacity: 0; transform: translateX(6px); transition: all .25s var(--ease); pointer-events: none; }
.rail a:hover span, .rail a:focus-visible span { opacity: 1; transform: none; }
@media (min-width: 1380px) { .rail { display: block; } }

.to-top { position: fixed; right: 22px; bottom: 24px; z-index: var(--z-rail); width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--color-brand); box-shadow: var(--sh-2), 0 0 0 1px var(--hair-gold) inset; transition: transform var(--dur) var(--ease); }
.to-top:hover { transform: translateY(-3px); }

/* ================= RESPONSIVE ================= */
@media (max-width: 1180px) {
  .nav__a { padding: 0 9px; font-size: .86rem; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .foot__top { grid-template-columns: minmax(0,1fr); }
  .track { grid-auto-columns: calc((100% - 18px) / 2.15); }
}
@media (max-width: 1040px) {
  .nav { display: none; }
  .hdr__in { grid-template-columns: 44px 1fr auto; gap: 12px; }
  .hdr .logo { justify-self: center; font-size: 1.3rem; }
  .hdr.is-scrolled .hdr__bar { height: var(--hdr-h); }
  .hdr.is-scrolled .logo { font-size: 1.3rem; }
  .hdr .burger { display: inline-grid; }
  .hdr__m-right { display: flex; align-items: center; gap: 6px; }
  .zz--pl, .zz--pr, .zz--half { grid-template-columns: minmax(0,1fr); }
  .frame { min-height: 0; aspect-ratio: 16/11; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .with-toc { grid-template-columns: minmax(0,1fr); }
  .toc { display: none; }
}
@media (max-width: 760px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .hdr__m-right .btn, .hdr__m-right .wallet-chip small { display: none; }
  .grid-3, .grid-4 { grid-template-columns: minmax(0,1fr); }
  .form__row { grid-template-columns: minmax(0,1fr); }
  .gcards { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .gc__play { height: 40px; }
  .track { grid-auto-columns: 86%; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  .car-arrows { display: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter); }
  .chips::-webkit-scrollbar { display: none; }
  .seg { display: flex; margin-right: calc(var(--gutter) * -1); border-radius: var(--r-pill) 0 0 var(--r-pill); }
  .frame__cap { left: 20px; right: 20px; bottom: 20px; }
  .frame__tag { left: 20px; top: 20px; }
  .frame { aspect-ratio: 4/3.4; }
  .frame__cap p { display: none; }
  .foot__cols { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .foot__cols > :last-child { grid-column: 1 / -1; }
  .overlay__bottom { grid-template-columns: 1fr; }
  .to-top { bottom: calc(84px + env(safe-area-inset-bottom)); right: 16px; }
  .tabbar { display: grid; grid-template-columns: repeat(5,1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-tabbar); height: calc(68px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgb(11 17 29 / .88); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); }
  .tabbar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--hair-gold), transparent); }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font: 600 .7rem/1 var(--font-body); color: var(--color-text-3); }
  .tabbar a .icon { width: 22px; height: 22px; }
  .tabbar a[aria-current] { color: var(--color-brand); }
  .tabbar a[aria-current]::before { content: ""; position: absolute; top: -1px; left: 30%; right: 30%; height: 2px; background: var(--color-brand); border-radius: 0 0 2px 2px; }
}
@media (max-width: 389px) {
  .hdr .logo { font-size: 1.12rem; gap: 6px; }
  .logo__mark { width: 28px; }
  .logo__mark i::after { left: 19px; }
  .gcards { grid-template-columns: minmax(0,1fr); }
}


/* section-title size must not leak into component headings inside a .sec */
.sec .prose h2 { font-size: clamp(1.35rem, 1.1rem + .8vw, 1.75rem); letter-spacing: -.025em; line-height: 1.2; margin-top: 0; }
.sec .panel__head h2 { font-size: 1.35rem; margin-top: 0; line-height: 1.2; }
.sec .panel__head h3 { margin-top: 0; }

/* ≤389: signed-in header — balance chip only, support moves to the menu */
@media (max-width: 389px) {
  .hdr__m-right .icon-btn { display: none; }
  .hdr__m-right .wallet-chip { padding: 0 10px 0 8px; font-size: .78rem; }
}
