/* Embedded as the site opener: host page drives progress; hide standalone chrome
   and the internal scrollbar (the frame stays exactly one screen tall). */
body.embed { overflow: hidden; height: 100vh; }
body.embed .masthead,
body.embed .cta { display: none !important; }

/* ============================================================
   Worldflight — nocturne scroll-flight over the tracker data
   Built on Scrollcraft doctrine: one fixed stage, a spacer
   track, scroll drives the camera + copy windows, one peak,
   an ending that resolves. Theme = six roles, one accent.
   Glow is allowed here only because the world is a nocturne.
   ============================================================ */

:root {
  --fl-canvas:    #032C30;
  --fl-surface:   #06383C;
  --fl-ink:       #FFFFFF;
  --fl-ink-soft:  #BEE7E7;
  --fl-accent:    #68E0D1;   /* green capital = the one accent */
  --fl-accent-ink:#032C30;
  --fl-origin:    #FFFFFF;   /* the Gulf, where the money lives */

  --fl-land:      #0B4B50;
  --fl-land-line: #2A9AA1;
  --fl-grat:      #0A4549;

  --fl-font-display: "DM Serif Display", Georgia, serif;
  --fl-font-data:    "Manrope", ui-sans-serif, system-ui, sans-serif;

  --fl-ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --fl-gutter: clamp(20px, 5vw, 72px);
  --fl-measure: 34ch;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fl-canvas);
  color: var(--fl-ink);
  font-family: var(--fl-font-data);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--fl-accent); color: var(--fl-accent-ink); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--fl-canvas); }
::-webkit-scrollbar-thumb { background: #1c3149; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #274661; }

/* ---------- The single fixed stage ---------- */

.flight { position: relative; }

.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 90% at 50% 8%, #0D595D 0%, var(--fl-canvas) 62%);
}

#globe { display: block; width: 100%; height: 100%; }

/* film grain: a flat dark ground bands on real panels */
.stage::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* faint vignette so the limb of the globe falls into the room */
.stage__vignette {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(130% 100% at 50% 46%, transparent 52%, rgba(1,28,31,0.76) 100%);
}

/* ---------- The copy layer (fixed, above the stage) ---------- */

.copy-layer {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.copy {
  position: absolute;
  padding: 0 var(--fl-gutter);
  max-width: min(var(--fl-measure), calc(100% - 2 * var(--fl-gutter)));
  opacity: 0;
  will-change: opacity, transform;
}

/* anchors — copy is never centred every act (taste.md) */
.copy--lead   { left: 0;  top: 22vh; text-align: left; }
.copy--trail  { right: 0; bottom: 16vh; left: auto; text-align: right; }
.copy--center { left: 50%; top: 50%; transform: translate(-50%,-50%);
                text-align: center; max-width: 40ch; }

.eyebrow {
  font-family: var(--fl-font-data);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fl-accent);
  margin: 0 0 0.9rem;
  font-weight: 500;
}

.copy h1, .copy h2 {
  font-family: var(--fl-font-display);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
  color: var(--fl-ink);
}
.copy h1 { font-size: clamp(2.6rem, 6.4vw, 5.2rem); }
.copy h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); }

.copy p {
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.55;
  color: var(--fl-ink-soft);
  margin: 1.1rem 0 0;
  text-wrap: pretty;
}

.copy .big {
  color: var(--fl-ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- The scale moment (count-up) ---------- */

.tally {
  font-family: var(--fl-font-data);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: clamp(3.4rem, 11vw, 9rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--fl-ink);
  display: block;
}
.tally .unit { color: var(--fl-accent); }
.tally-sub {
  margin-top: 0.6rem;
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  letter-spacing: 0.02em;
  color: var(--fl-ink-soft);
}

/* ---------- The flagship panel (the peak lands here) ---------- */

.flagship {
  right: var(--fl-gutter);
  bottom: 12vh;
  left: auto;
  max-width: min(30rem, calc(100% - 2 * var(--fl-gutter)));
  text-align: left;
}
.flagship .kicker {
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--fl-origin); margin: 0 0 0.7rem; font-weight: 500;
}
.flagship .name {
  font-family: var(--fl-font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  line-height: 1.02; letter-spacing: -0.015em; margin: 0;
  text-wrap: balance;
}
.flagship .value {
  font-family: var(--fl-font-data);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 500; letter-spacing: -0.02em;
  color: var(--fl-accent);
  margin: 1.1rem 0 0.2rem;
  display: block;
}
.flagship .meta {
  margin: 0.9rem 0 0;
  display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1.2rem;
  font-size: 0.95rem;
}
.flagship .meta dt { color: var(--fl-ink-soft); }
.flagship .meta dd { margin: 0; color: var(--fl-ink); }

/* ---------- The close (resolves, holds) ---------- */

.cta {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-top: 1.6rem;
  padding: 0.85rem 1.4rem;
  background: var(--fl-accent); color: var(--fl-accent-ink);
  font-family: var(--fl-font-data); font-weight: 500; font-size: 0.98rem;
  letter-spacing: 0.01em;
  border: 0; border-radius: 4px; text-decoration: none;
  transition: transform 140ms var(--fl-ease-out), filter 140ms var(--fl-ease-out);
}
.cta:hover { filter: brightness(1.08); }
.cta:active { transform: translateY(1px); }
.cta:focus-visible { outline: 2px solid var(--fl-ink); outline-offset: 3px; }
.cta__arrow { transition: transform 160ms var(--fl-ease-out); }
.cta:hover .cta__arrow { transform: translateX(3px); }

/* ---------- The route rail (built in the page, not the engine) ---------- */

.rail {
  position: fixed;
  right: clamp(14px, 2.4vw, 30px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  display: flex; flex-direction: column; gap: 0.85rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 500ms var(--fl-ease-out);
}
.rail.is-live { opacity: 1; }
.rail__leg {
  display: flex; align-items: center; gap: 0.7rem;
  justify-content: flex-end;
  font-family: var(--fl-font-data);
  font-size: 0.74rem; letter-spacing: 0.02em;
  color: var(--fl-ink-soft);
  transition: color 300ms var(--fl-ease-out);
}
.rail__label {
  opacity: 0; transform: translateX(6px);
  transition: opacity 280ms var(--fl-ease-out), transform 280ms var(--fl-ease-out);
  white-space: nowrap;
}
.rail__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #0f646a; flex: none;
  transition: background 300ms var(--fl-ease-out), box-shadow 300ms var(--fl-ease-out), transform 300ms var(--fl-ease-out);
}
.rail__leg[aria-current="true"] { color: var(--fl-ink); }
.rail__leg[aria-current="true"] .rail__label { opacity: 1; transform: none; }
.rail__leg[aria-current="true"] .rail__dot {
  background: var(--fl-accent);
  box-shadow: 0 0 0 4px rgba(104,224,209,0.14);
  transform: scale(1.15);
}

/* ---------- Masthead (quiet, holds top-left) ---------- */

.masthead {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(16px, 2.4vw, 26px) var(--fl-gutter);
  pointer-events: none;
}
.masthead a { pointer-events: auto; }
.wordmark {
  font-family: var(--fl-font-display);
  font-size: 1.02rem; letter-spacing: 0.01em; color: var(--fl-ink);
  text-decoration: none; display: inline-flex; align-items: center; gap: 0.55rem;
}
.wordmark::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--fl-accent); box-shadow: 0 0 12px rgba(104,224,209,0.55);
}
.masthead__meta {
  font-family: var(--fl-font-data); font-size: 0.74rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--fl-ink-soft);
}

/* ---------- The scroll track ---------- */

.spacer { position: relative; z-index: -1; }

/* ---------- Reduced motion: the globe is the film, held still ---------- */

@media (prefers-reduced-motion: reduce) {
  .copy { transition: none !important; }
  .rail { transition: none; }
}

@media (max-width: 760px) {
  :root { --fl-measure: 22ch; }
  .copy--lead { top: 16vh; }
  .copy--trail { bottom: 12vh; }
  .flagship { left: 0; right: 0; bottom: 10vh; max-width: none; }
  .flagship .meta { grid-template-columns: 1fr; gap: 0.15rem; }
  .flagship .meta dt { margin-top: 0.5rem; }
  .rail { display: none; }
  .masthead__meta { display: none; }
}
