/* components.css — reusable UI primitives
   Migrated from inline during Step 3. Section-specific styles live in sections.css. */

/* ─── LOADER ─── */
.loader {
  position: fixed; inset: 0;
  z-index: 999;
  background: var(--navy);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px;
  transition: opacity .8s, visibility .8s;
}
.loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader img { height: 80px; animation: fadeUp .5s both; }
.loader-board { display: flex; gap: 3px; animation: fadeUp .5s .2s both; }
.loader-char {
  width: 16px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(234,194,73,.06);
  border: 1px solid rgba(234,194,73,.12);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 12px; color: var(--gold);
  opacity: 0; transform: translateY(-12px);
  animation: flipIn .3s forwards;
}
@keyframes flipIn { to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.loader-bar {
  width: 160px; height: 2px;
  background: rgba(255,255,255,.06);
  border-radius: 2px; overflow: hidden;
  animation: fadeUp .4s .3s both;
}
.loader-bar span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  border-radius: 2px;
  animation: fill 2.2s .5s ease-out forwards;
}
@keyframes fill { to { width: 100%; } }
.loader-strip { display: flex; gap: 8px; animation: fadeUp .4s .5s both; }
.loader-strip span {
  font-family: var(--font-mono);
  font-size: 8px; letter-spacing: .2em;
  color: rgba(197,198,207,.35);
}

/* ─── NAV ─── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: all .4s;
}
.nav.stuck {
  background: rgba(0,17,53,.95);
  backdrop-filter: blur(16px);
  padding: 12px 0;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: flex; align-items: center; gap: 8px; }
.nav-brand img { height: 28px; }
.nav-brand span {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 500;
  color: var(--gold);
  letter-spacing: 3px;
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  font-size: 13px;
  color: rgba(218,226,255,.65);
  transition: color .2s;
  font-weight: 400;
}
.nav-links a:hover { color: var(--ink-100); }
.nav-stores { display: flex; gap: 8px; }
.nav-store {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 5px 12px 5px 8px;
  transition: border-color .3s;
}
.nav-store:hover { border-color: rgba(234,194,73,.3); }
.nav-store small {
  font-size: 7px; letter-spacing: .06em;
  color: rgba(197,198,207,.55);
  text-transform: uppercase;
  display: block; line-height: 1;
}
.nav-store strong {
  font-size: 11px; color: var(--ink-100);
  font-weight: 500;
  display: block; line-height: 1.2;
}
.hamburger {
  display: none;
  background: none; border: none;
  cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--ink-100);
  margin: 4px 0;
  border-radius: 2px;
}

/* ─── Mobile menu ─── */
.mob-menu {
  position: fixed; inset: 0;
  z-index: 200;
  background: var(--navy);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 32px;
  opacity: 0; visibility: hidden;
  transition: all .3s;
}
.mob-menu.open { opacity: 1; visibility: visible; }
.mob-menu a {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--ink-100);
  font-weight: 500;
}
.mob-close {
  position: absolute;
  top: 24px; right: 24px;
  background: none; border: none;
  font-size: 28px; color: var(--ink-100);
  cursor: pointer;
}

/* ─── Store buttons (shared between nav + stats + hero CTAs) ─── */
.store-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  padding: 12px 24px 12px 16px;
  transition: all .3s;
  position: relative;
}
.store-btn:hover {
  border-color: rgba(234,194,73,.3);
  background: rgba(255,255,255,.08);
}
.store-btn small {
  font-size: 8px; letter-spacing: .06em;
  color: rgba(197,198,207,.55);
  text-transform: uppercase;
  display: block; line-height: 1;
}
.store-btn strong {
  font-size: 14px; color: var(--ink-100);
  font-weight: 500; display: block;
}
.store-soon {
  position: absolute;
  top: -6px; right: -6px;
  font-family: var(--font-mono);
  font-size: 7px;
  background: var(--gold);
  color: var(--navy);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: .1em;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════
   Step 4 — Two-row header: flight-strip + main nav (brief Section 6).
   These rules override the legacy .nav block above where classes collide.
   ═══════════════════════════════════════════════════════════════════ */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--ink-900);
}

/* Row 1 — flight strip */
.flight-strip {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--gutter);
  background: var(--ink-900);
  border-bottom: 0.5px solid var(--ink-700);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-300);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}
.flight-strip-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.flight-strip .live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--terminal-green);
  animation: liveDotPulse 2s infinite;
  flex-shrink: 0;
}
@keyframes liveDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.85); }
}
[data-utc], [data-hub-cycle] { font-variant-numeric: tabular-nums; }

/* Row 2 — main nav */
.nav {
  position: static; /* override legacy fixed positioning; wrapper is fixed */
  padding: 0;
  background: transparent;
  border-bottom: 0.5px solid var(--ink-700);
  transition: background 220ms var(--ease-in-out), backdrop-filter 220ms var(--ease-in-out);
}
.nav.is-scrolled {
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-brand {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--amber-signal);
  text-decoration: none;
  line-height: 1;
  font-variation-settings: "opsz" 144;
  transition: filter 220ms var(--ease-out-expo);
}
.nav-brand:hover {
  filter: brightness(1.12);
}
.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-left: auto;
}
.nav-links a {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 14px;
  color: var(--ink-300);
  text-decoration: none;
  transition: color 180ms;
}
.nav-links a:hover,
.nav-links a:focus-visible { color: var(--ink-100); }

.nav-ctas { display: flex; gap: 10px; align-items: center; }
.nav-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 0.5px solid var(--ink-100);
  border-radius: var(--radius-sm);
  color: var(--ink-100);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
  transition: border-color 180ms, color 180ms;
  overflow: hidden;
}
.nav-cta .mono {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-300);
}
.nav-cta::before {
  content: '→';
  color: var(--amber-signal);
  opacity: 0;
  margin-right: -12px;
  transition: opacity 180ms, margin-right 180ms;
}
.nav-cta:hover,
.nav-cta:focus-visible {
  border-color: var(--amber-signal);
  color: var(--ink-100);
}
.nav-cta:hover::before,
.nav-cta:focus-visible::before {
  opacity: 1;
  margin-right: 0;
}

/* Hamburger (appears <1024px) */
.hamburger {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--ink-100);
}
.hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: currentColor;
  margin: 4px 0;
  border-radius: 2px;
}

/* Mobile menu — restyle with new tokens */
.mob-menu {
  position: fixed; inset: 0;
  z-index: 200;
  background: rgba(10, 14, 26, 0.98);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0; visibility: hidden;
  transition: opacity 300ms, visibility 300ms;
}
.mob-menu.open { opacity: 1; visibility: visible; }
.mob-menu a {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 32px;
  color: var(--ink-100);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.mob-close {
  position: absolute;
  top: 20px; right: 20px;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--ink-100);
  cursor: pointer;
}

/* Body offset so fixed header does not cover hero content */
body { padding-top: calc(28px + 64px); }

/* Responsive — brief 14.2 */
@media (max-width: 1023px) {
  .nav-links,
  .nav-ctas { display: none; }
  .hamburger { display: block; }
}
@media (max-width: 767px) {
  .flight-strip { display: none; }
  body { padding-top: 64px; }
  .nav-inner { height: 56px; }
}

/* ─── Split-flap character animation (brief 6.2, 13.4) ─── */
.flap-char {
  display: inline-block;
  transform-origin: center;
  backface-visibility: hidden;
  min-width: 0.6ch;
  text-align: center;
}
@keyframes splitFlap {
  0%    { transform: rotateX(0deg); }
  50%   { transform: rotateX(-90deg); }
  50.1% { transform: rotateX(90deg); }
  100%  { transform: rotateX(0deg); }
}
.flap-run {
  animation: splitFlap var(--duration-med, 420ms) var(--ease-in-out);
}

/* ─── Ambient ornament animations ─── */

/* Live dot — dual-ring pulse (replaces the simple opacity pulse) */
.flight-strip .live-dot {
  position: relative;
}
.flight-strip .live-dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1px solid var(--terminal-green);
  opacity: 0;
  animation: liveRingExpand 2s ease-out infinite;
}
@keyframes liveRingExpand {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Boarding-pass perforation — travelling shimmer */
.perforation::before {
  animation: perforationShimmer 3.2s linear infinite;
  background-size: 16px 4px, 16px 4px;
  background-image:
    radial-gradient(circle, rgba(234,194,73,0.95) 1.1px, transparent 1.6px),
    radial-gradient(circle, rgba(234,194,73,0.35) 1.1px, transparent 1.6px);
}
@keyframes perforationShimmer {
  0%   { background-position: 0 center, -200px center; }
  100% { background-position: 200px center, 0 center; }
}

/* Destination-board OPEN — subtle presence pulse */
.status-open {
  position: relative;
  display: inline-block;
  padding-left: 14px;
}
.status-open::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 6px; height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--terminal-green);
  box-shadow: 0 0 0 0 rgba(105,218,184,0.6);
  animation: openPulse 2.4s ease-out infinite;
}
@keyframes openPulse {
  0%   { box-shadow: 0 0 0 0 rgba(105,218,184,0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(105,218,184,0); }
  100% { box-shadow: 0 0 0 0 rgba(105,218,184,0); }
}
.board-table tbody tr:nth-child(2) .status-open::before { animation-delay: 0.3s; }
.board-table tbody tr:nth-child(3) .status-open::before { animation-delay: 0.6s; }
.board-table tbody tr:nth-child(4) .status-open::before { animation-delay: 0.9s; }
.board-table tbody tr:nth-child(5) .status-open::before { animation-delay: 1.2s; }
.board-table tbody tr:nth-child(6) .status-open::before { animation-delay: 1.5s; }
.board-table tbody tr:nth-child(7) .status-open::before { animation-delay: 1.8s; }
.board-table tbody tr:nth-child(8) .status-open::before { animation-delay: 2.1s; }

/* Footer perforation — slow drift (echoes hero strip) */
.footer-perforation {
  animation: footerPerfDrift 18s linear infinite;
}
@keyframes footerPerfDrift {
  0%   { background-position: 0 center; }
  100% { background-position: 18px center; }
}

/* Chapter numeral — breathe on hover, subtle lift on scroll-in */
.chapter.in-view .chapter-numeral,
.chapter .reveal.in-view .chapter-numeral {
  animation: chapterLift 900ms var(--ease-out-expo) both;
}
@keyframes chapterLift {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Step numeral — amber-warm fade on scroll-in */
.how-step.in-view .step-numeral {
  animation: stepNumeralGlow 1.4s var(--ease-out-expo) both;
}
@keyframes stepNumeralGlow {
  0%   { opacity: 0; filter: brightness(1.8) blur(2px); letter-spacing: 0.08em; }
  60%  { opacity: 1; filter: brightness(1.15) blur(0); }
  100% { opacity: 1; filter: brightness(1) blur(0); }
}

/* Flight-path dashed line — draws in from the top when how section enters view */
.how::before {
  transform-origin: top center;
  animation: howPathDraw 2.4s var(--ease-out-expo) 0.2s both;
}
@keyframes howPathDraw {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}

/* Hero boarding strip — amber rule wipes in from left */
.hero-boarding-strip {
  position: relative;
}
.hero-boarding-strip::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--amber-signal);
  transform-origin: left center;
  animation: wipeIn 1.2s var(--ease-out-expo) 0.6s both;
}
.hero-boarding-strip { border-top: none !important; }
@keyframes wipeIn {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* Hero copy — staggered entry */
.hero-copy .eyebrow,
.hero-copy h1,
.hero-copy .hero-sub,
.hero-copy .hero-ctas,
.hero-copy .hero-footnote {
  animation: heroFadeUp 900ms var(--ease-out-expo) both;
}
.hero-copy .eyebrow        { animation-delay: 0.05s; }
.hero-copy h1              { animation-delay: 0.15s; }
.hero-copy .hero-sub       { animation-delay: 0.30s; }
.hero-copy .hero-ctas      { animation-delay: 0.45s; }
.hero-copy .hero-footnote  { animation-delay: 0.60s; }
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Feature card icon frame — subtle sheen on hover */
.feat-card:hover .icon-frame {
  border-color: var(--amber-signal);
  transition: border-color 280ms;
}
.feat-card .icon-frame { transition: border-color 280ms; }

/* CTA button idle — barely-visible border breathing draws the eye */
.cta-outline {
  animation: ctaIdle 5s ease-in-out infinite;
}
@keyframes ctaIdle {
  0%, 100% { border-color: var(--ink-100); }
  50%      { border-color: rgba(234,194,73,0.5); }
}
.cta-outline:hover,
.cta-outline:focus-visible { animation: none; }

/* Story lounge — slow ken-burns drift */
.story-lounge img {
  animation: loungeDrift 24s ease-in-out infinite alternate;
}
@keyframes loungeDrift {
  from { transform: scale(1.02) translateX(-0.4%); }
  to   { transform: scale(1.06) translateX(0.4%); }
}

@media (prefers-reduced-motion: reduce) {
  .flap-run,
  .flight-strip .live-dot::after,
  .perforation::before,
  .status-open::before,
  .footer-perforation,
  .chapter.in-view .chapter-numeral,
  .chapter .reveal.in-view .chapter-numeral,
  .how-step.in-view .step-numeral,
  .how::before,
  .hero-boarding-strip::before,
  .hero-copy .eyebrow,
  .hero-copy h1,
  .hero-copy .hero-sub,
  .hero-copy .hero-ctas,
  .hero-copy .hero-footnote,
  .cta-outline,
  .story-lounge img {
    animation: none !important;
  }
}

/* ─── Icon frame (brief Section 5 — used by Features in Step 10) ─── */
.icon-frame {
  width: 40px; height: 40px;
  padding: 8px;
  border: 0.5px solid var(--ink-700);
  border-radius: var(--radius-md);
  background: var(--ink-800);
  color: var(--ink-100);
  display: inline-flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.on-cream .icon-frame {
  background: var(--cream-100);
  border-color: var(--cream-200);
  color: var(--cream-900);
}

/* ─── Feature card (current .fc rules — migrated) ─── */
.fc {
  background: var(--s3);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 14px;
  padding: 28px 24px;
  transition: all .4s;
}
.fc:hover {
  border-color: rgba(234,194,73,.15);
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
  transform: translateY(-3px);
}
.fc-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(234,194,73,.08);
  border: 1px solid rgba(234,194,73,.12);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.fc-icon .material-symbols-outlined {
  font-size: 22px;
  color: var(--gold);
}
.fc h3 {
  font-size: 18px; font-weight: 500;
  color: var(--ink-100);
  margin-bottom: 8px;
}
.fc p {
  font-size: 13px;
  color: var(--tx2);
  line-height: 1.65;
  margin-bottom: 12px;
}
.fc-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--teal);
  letter-spacing: .05em;
}
