/* ---------------------------------------------------------------------------
   FROM IRON — site styles.

   The palette is lifted from the app's own src/theme/tokens.ts so the site and
   the product are visibly one thing. The app deliberately has no light mode
   ("One theme. Daylight is gone, along with the Jarvis-coded HUD language it
   came from"), and the site keeps that commitment: a single dark world, with
   every colour painted explicitly so nothing depends on a host theme.
   ------------------------------------------------------------------------- */

:root {
  --bg:       #0F1218;
  --bg2:      #141821;
  --panel:    #181D27;
  --panel2:   #1E2430;
  --line:     rgba(255, 255, 255, 0.07);
  --line2:    rgba(255, 255, 255, 0.14);
  --tx:       #F2F5F9;
  --tx2:      #AEB7C4;
  --tx3:      #7A8496;
  --tx4:      #525C6D;
  --acc:      #E3B961;   /* Gold tier — the molten accent */
  --acc-deep: #8A6A2F;
  --ok:       #6FCF97;
  --warn:     #E0A860;
  --bad:      #E27C74;

  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --cond: "IBM Plex Sans Condensed", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 66ch;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--tx2);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.narrow { max-width: 760px; }

/* The ambient ember field sits behind everything and is never interactive. */
#embers {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
main, footer, .nav { position: relative; z-index: 1; }

img { max-width: 100%; height: auto; }

a { color: var(--acc); text-decoration-color: rgba(227, 185, 97, 0.38); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--acc); }

:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--acc); color: #12151A; font-weight: 600;
  padding: 10px 16px; border-radius: 0 0 10px 0; z-index: 100;
}
.skip:focus { left: 0; }

/* ── site chrome ─────────────────────────────────────────────────────── */

.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.brand {
  font-family: var(--cond);
  font-weight: 700; font-size: 20px; letter-spacing: 0.01em;
  color: var(--tx); text-decoration: none; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 10px;
}
.brand::before {
  content: ""; width: 9px; height: 9px; border-radius: 2px;
  background: var(--acc); transform: rotate(45deg); flex: none;
}

.nav-links { display: flex; gap: 22px; flex-wrap: wrap; }
.nav-links a {
  font-size: 15px; font-weight: 500; color: var(--tx3); text-decoration: none;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--tx); }

/* ── type ────────────────────────────────────────────────────────────── */

h1 {
  font-family: var(--cond); font-weight: 700;
  font-size: clamp(40px, 7.5vw, 68px); line-height: 1.02; letter-spacing: -0.022em;
  color: var(--tx); margin: 0 0 20px; text-wrap: balance;
}

h2 {
  font-family: var(--cond); font-weight: 700;
  font-size: clamp(26px, 4vw, 34px); line-height: 1.12; letter-spacing: -0.015em;
  color: var(--tx); margin: 0 0 14px; text-wrap: balance;
}

h3 {
  font-weight: 600; font-size: 19px; letter-spacing: -0.01em;
  color: var(--tx); margin: 0 0 8px;
}

p { margin: 0 0 16px; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }
strong { color: var(--tx); font-weight: 600; }

ul, ol { padding-left: 22px; max-width: var(--measure); margin: 0 0 16px; }
li { margin-bottom: 9px; }

.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--acc); margin: 0 0 18px;
}

.lede { font-size: 20px; line-height: 1.55; color: var(--tx2); max-width: 60ch; }

code {
  font-family: var(--mono); font-size: 0.88em;
  background: var(--bg2); color: var(--acc);
  padding: 2px 6px; border-radius: 5px;
}

/* ── hero ────────────────────────────────────────────────────────────── */

.hero {
  position: relative; overflow: hidden;
  padding: clamp(64px, 11vw, 116px) 0 clamp(56px, 9vw, 96px);
  border-bottom: 1px solid var(--line);
}

/* The app draws an ambient forge glow behind every screen; this is the same
   idea in CSS. A radial gradient falling to zero, never a flat translucent
   shape — a low-alpha fill reads as a hard-edged disc at any opacity. */
.hero::before {
  content: ""; position: absolute; inset: -40% 0 auto; height: 150%;
  background: radial-gradient(ellipse 60% 50% at 50% 0%,
              rgba(227, 185, 97, 0.13) 0%,
              rgba(227, 185, 97, 0.04) 42%,
              rgba(227, 185, 97, 0) 72%);
  pointer-events: none;
}
.hero > * { position: relative; }

.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--acc); color: #12151A;
  font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
  padding: 15px 26px; border-radius: 999px; text-decoration: none;
  transition: filter 140ms ease, transform 140ms ease;
}
.btn:hover { filter: brightness(1.07); transform: translateY(-1px); }

.btn-ghost {
  background: transparent; color: var(--tx);
  border: 1px solid var(--line2);
}
.btn-ghost:hover { background: var(--panel2); filter: none; }

.note { font-size: 14px; color: var(--tx4); margin-top: 16px; }

/* ── hero layout ─────────────────────────────────────────────────────── */

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
}

.hero-crest { position: relative; display: grid; place-items: center; }
.hero-crest img {
  position: relative;
  width: min(100%, 420px);
  height: auto;
  filter: drop-shadow(0 20px 52px rgba(0, 0, 0, 0.45));
}

/* A gradient falling to zero — never a translucent disc, which reads as a
   hard edge at any opacity. Same rule the app's <Aura> follows. */
.crest-aura {
  position: absolute;
  width: 128%; aspect-ratio: 1;
  background: radial-gradient(circle at 50% 46%,
              color-mix(in srgb, var(--tier) 17.0%, transparent) 0%,
              color-mix(in srgb, var(--tier) 14.8%, transparent) 9%,
              color-mix(in srgb, var(--tier) 11.4%, transparent) 18%,
              color-mix(in srgb, var(--tier) 8.0%, transparent) 26%,
              color-mix(in srgb, var(--tier) 5.1%, transparent) 34%,
              color-mix(in srgb, var(--tier) 2.9%, transparent) 43%,
              color-mix(in srgb, var(--tier) 1.5%, transparent) 52%,
              color-mix(in srgb, var(--tier) 0.5%, transparent) 62%,
              transparent 74%);
}

@media (max-width: 780px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-crest { order: -1; }
  .hero-crest img { width: min(62%, 260px); }
}

/* ── sections ────────────────────────────────────────────────────────── */

section { padding: clamp(58px, 8vw, 96px) 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: 0; }

.section-lede { font-size: 18px; color: var(--tx2); max-width: 58ch; margin-bottom: 0; }

/* ── the loop — a sequence, not a card grid ──────────────────────────── */

.steps { margin-top: 40px; display: flex; flex-direction: column; }
.step {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.step:last-child { border-bottom: 1px solid var(--line); }
.step h3 { font-size: 21px; font-family: var(--cond); font-weight: 700; letter-spacing: -0.01em; }
.step p { color: var(--tx2); margin-bottom: 0; }

/* ── inside — flowing bands ──────────────────────────────────────────── */

.band {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(28px, 4vw, 48px) clamp(32px, 5vw, 64px);
}
.band-copy h3 {
  font-family: var(--cond); font-weight: 700; font-size: 21px;
  letter-spacing: -0.01em; margin-bottom: 8px;
}
.band-copy p { color: var(--tx2); max-width: 46ch; margin-bottom: 0; }

/* ── lists ───────────────────────────────────────────────────────────── */

.plain { margin-top: 30px; padding-left: 20px; }
.plain li { color: var(--tx2); }
.after-list { margin-top: 22px; }

/* ── close ───────────────────────────────────────────────────────────── */

.close-inner { text-align: center; display: grid; justify-items: center; gap: 14px; }
.close-inner .section-lede { margin-bottom: 10px; }

/* A quiet emphasis block — used for the data promise, not stamped everywhere. */
.pledge {
  border-left: 2px solid var(--acc-deep);
  background: var(--panel);
  border-radius: 0 16px 16px 0;
  padding: 24px 26px;
  margin-top: 30px;
}
.pledge h3 { color: var(--acc); }

/* ── legal / doc pages ───────────────────────────────────────────────── */

.doc { padding: 52px 0 80px; }
.doc h2 { margin-top: 44px; font-size: 24px; }
.doc h2:first-of-type { margin-top: 32px; }
.doc .updated {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.05em;
  color: var(--tx3); margin: 0 0 4px;
}

/* Australian Privacy Principle 1.4 expects the policy to name the entity
   behind it; the ABN sits with it rather than buried in the footer. */
.doc .entity {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.05em;
  color: var(--tx4); margin: 0 0 8px;
}

.summary {
  background: var(--panel2); border-radius: 16px;
  padding: 22px 24px; margin: 28px 0 8px;
}
.summary h3 { margin-bottom: 8px; }
.summary p { font-size: 16px; }

.scroll { overflow-x: auto; margin: 18px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; min-width: 520px; }
th {
  text-align: left; font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--tx4);
  padding: 0 16px 10px 0; border-bottom: 1px solid var(--line2); white-space: nowrap;
}
td {
  padding: 13px 16px 13px 0; border-bottom: 1px solid var(--line);
  vertical-align: top; color: var(--tx2);
}
td:first-child { color: var(--tx); font-weight: 500; }

.fill {
  background: rgba(224, 168, 96, 0.09);
  border-left: 2px solid var(--warn);
  border-radius: 0 12px 12px 0;
  padding: 16px 18px; margin: 20px 0;
  font-size: 15px; color: var(--tx2);
}
.fill strong { color: var(--warn); }

/* ── footer ──────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 56px;
  font-size: 14.5px; color: var(--tx4);
}
.foot-top {
  display: flex; justify-content: space-between; gap: 24px;
  flex-wrap: wrap; margin-bottom: 26px;
}
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-links a { color: var(--tx3); text-decoration: none; }
.foot-links a:hover { color: var(--tx); }
.legal { max-width: 74ch; }
.legal p { font-size: 13.5px; line-height: 1.6; color: var(--tx4); margin-bottom: 10px; max-width: none; }

@media (max-width: 620px) {
  body { font-size: 16px; }
  .lede { font-size: 18px; }
  .nav { padding: 18px 0; }
}

/* ── the wheel ────────────────────────────────────────────────────────────
   Ten helms on a slowly turning ring. Hovering or focusing one stops the
   wheel, lifts that helm into the core, and repaints the page in its tier
   colour by rewriting --acc on :root — the same "the app wears your rank"
   rule the product follows, applied to the site.

   The ring rotates; each spoke counter-rotates by the same angle so the
   helms stay upright instead of tumbling. JS sets --a (the spoke's angle)
   and --spin (the ring's current angle).
   ------------------------------------------------------------------------ */

.wheel-stage {
  position: relative;
  width: min(100%, 660px);
  margin: 52px auto 0;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.wheel {
  position: absolute;
  inset: 0;
  transform: rotate(var(--spin, 0deg));
  /* No CSS transition here: JS drives --spin every frame, and a transition
     would fight it. The easing on stop is done in JS instead. */
}

.spoke {
  position: absolute;
  top: 50%; left: 50%;
  width: 16%;
  aspect-ratio: 1;
  margin: 0; padding: 0;
  border: 0; background: none;
  cursor: pointer;
  /* Push out along the spoke's angle, then undo the ring's rotation so the
     helm sits upright at every point of the turn. */
  transform:
    translate(-50%, -50%)
    rotate(var(--a))
    translateY(calc(var(--r, 180px) * -1))
    rotate(calc(var(--a) * -1))
    rotate(calc(var(--spin, 0deg) * -1));
  transition: filter 220ms ease;
}

.spoke::before {
  content: "";
  position: absolute;
  inset: -48%;
  background: radial-gradient(circle at 50% 50%,
              color-mix(in srgb, var(--acc) 30.0%, transparent) 0%,
              color-mix(in srgb, var(--acc) 26.1%, transparent) 9%,
              color-mix(in srgb, var(--acc) 20.1%, transparent) 18%,
              color-mix(in srgb, var(--acc) 14.1%, transparent) 26%,
              color-mix(in srgb, var(--acc) 9.0%, transparent) 34%,
              color-mix(in srgb, var(--acc) 5.1%, transparent) 43%,
              color-mix(in srgb, var(--acc) 2.7%, transparent) 52%,
              color-mix(in srgb, var(--acc) 0.9%, transparent) 62%,
              transparent 74%);
  opacity: 0;
  transition: opacity 280ms ease;
  pointer-events: none;
}
.spoke:hover::before,
.spoke:focus-visible::before,
.spoke.is-on::before { opacity: 1; }

.spoke img {
  position: relative;           /* above the glow */
  width: 100%; height: 100%;
  display: block;
  filter: drop-shadow(0 8px 26px rgba(0, 0, 0, 0.42));
  transition: transform 260ms cubic-bezier(.2,.7,.3,1), opacity 260ms ease;
}

.spoke:hover img,
.spoke:focus-visible img { transform: scale(1.16); }

/* When one is picked, the rest recede so the core reads as the subject. */
.wheel-stage.is-picked .spoke img { opacity: 0.38; }
.wheel-stage.is-picked .spoke.is-on img { opacity: 1; }

/* ── the core ─────────────────────────────────────────────────────────── */

.wheel-core {
  position: relative;
  width: 44%;
  max-width: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  pointer-events: none;
}

/* Every tier's panel is stacked in the same cell; only one is shown. Using
   visibility (not display) keeps the grid from resizing as they swap. */
.detail {
  grid-area: 1 / 1;
  width: 100%;
  min-width: 0;
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.94);
  transition: opacity 240ms ease, transform 240ms cubic-bezier(.2,.7,.3,1);
}
.detail.is-on { opacity: 1; visibility: visible; transform: scale(1); }

.wheel-core::before {
  content: "";
  position: absolute;
  inset: -60%;
  background: radial-gradient(circle at 50% 42%,
              color-mix(in srgb, var(--acc) 17.0%, transparent) 0%,
              color-mix(in srgb, var(--acc) 14.8%, transparent) 9%,
              color-mix(in srgb, var(--acc) 11.4%, transparent) 18%,
              color-mix(in srgb, var(--acc) 8.0%, transparent) 26%,
              color-mix(in srgb, var(--acc) 5.1%, transparent) 34%,
              color-mix(in srgb, var(--acc) 2.9%, transparent) 43%,
              color-mix(in srgb, var(--acc) 1.5%, transparent) 52%,
              color-mix(in srgb, var(--acc) 0.5%, transparent) 62%,
              transparent 74%);
  pointer-events: none;
  transition: background 300ms ease;
}

.detail img {
  position: relative;
  width: min(100%, 200px);
  height: auto;
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.5));
}

.detail figcaption { display: grid; gap: 3px; }

.detail-name {
  font-family: var(--cond);
  font-weight: 700;
  font-size: clamp(24px, 4vw, 32px);
  letter-spacing: -0.015em;
  line-height: 1.05;
}
.detail-rp, .detail-name, .detail-note { overflow-wrap: anywhere; }
.detail-rp {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--tx3);
  font-variant-numeric: tabular-nums;
}
.detail-note { font-size: 14px; color: var(--tx3); max-width: 100%; }

.ladder-foot { margin-top: 44px; color: var(--tx3); font-size: 16px; text-align: center; }

/* Accent-driven chrome eases between tiers rather than snapping. */
.btn, .brand::before, .eyebrow, .skip { transition: background-color 300ms ease, color 300ms ease; }

@media (max-width: 640px) {
  .wheel-stage { width: min(100%, 400px); margin-top: 36px; }
  .spoke { width: 19%; }
  .wheel-core { width: 46%; max-width: 190px; }
  .detail img { width: min(100%, 120px); }
  .detail-name { font-size: 22px; }
  .detail-rp { font-size: 12px; }
  .detail-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .spoke img, .detail { transition: none; }
}


/* ── live board ───────────────────────────────────────────────────────── */

.live-board { list-style: none; padding: 0; margin: 32px 0 0; max-width: none; display: flex; flex-direction: column; gap: 4px; }
.live-note { color: var(--tx3); text-align: center; padding: 28px 0; margin: 0; }
.live-row {
  display: grid;
  grid-template-columns: 30px 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  margin: 0;
  border-radius: 16px;
}
.live-row:nth-child(-n+3) { background: color-mix(in srgb, var(--tier) 7%, transparent); }
.live-pos { font-family: var(--mono); font-size: 14px; color: var(--tx3); text-align: right; font-variant-numeric: tabular-nums; }
.live-crest { width: 44px; height: 44px; }
.live-who { display: flex; flex-direction: column; min-width: 0; }
.live-name { color: var(--tx); font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-tier { color: var(--tier); font-size: 13px; }
.live-rp { font-family: var(--mono); font-size: 14px; color: var(--tx2); font-variant-numeric: tabular-nums; }
.live-foot { color: var(--tx4); font-size: 13px; text-align: center; margin-top: 16px; }
