/* Stepwave Walk — landing site
   Sibling to step-wave.master-tempo.com. Palette and faces are brand-pinned;
   the badge system is this surface's own. */

:root {
  --ground: #08090a;
  --panel: #101317;
  --line: #1f242a;
  --line-bright: #2c333a;
  /* Badge geometry carries meaning, so it must clear WCAG 1.4.11's 3:1 for
     non-text content. The old --line-bright measured 1.3-1.6:1 here. */
  --badge-line: #5a6470;
  --text: #eef0ec;
  --muted: #9aa19b;
  --accent: #b8f23b;
  --accent-ink: #0a0d05;
  --accent-soft: rgba(184, 242, 59, 0.14);
  --accent-line: rgba(184, 242, 59, 0.38);

  --display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;

  --gap: clamp(4.5rem, 9vw, 8.5rem);
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --max: 1180px;
  --r: 14px;
}

*, *::before, *::after { box-sizing: border-box; }

/* figure defaults to margin: 1em 40px, which added 80px of phantom width to
   every badge column and blew the grid past the viewport on phones. */
figure, dl, dd, blockquote { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 clamp(1rem, 0.96rem + 0.2vw, 1.0625rem)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grain: brand-pinned from the sibling site. Kept faint enough to read as
   paper tooth rather than noise. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%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");
}

h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 1.6rem + 4.4vw, 5.4rem); letter-spacing: -0.038em; }
h2 { font-size: clamp(2rem, 1.35rem + 2.8vw, 3.5rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem); letter-spacing: -0.02em; }
p { margin: 0; }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }

.lede { max-width: 62ch; color: var(--muted); font-size: clamp(1.05rem, 1rem + 0.35vw, 1.3rem); line-height: 1.55; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: blur(14px);
}
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 66px; }
.mark { display: inline-flex; align-items: center; gap: 0.65rem; font-family: var(--display); font-weight: 800; font-size: 1.0625rem; letter-spacing: -0.025em; }
.mark svg { display: block; }
.masthead nav { display: flex; align-items: center; gap: clamp(0.9rem, 2.5vw, 1.75rem); font-size: 0.9375rem; }
.masthead nav a { color: var(--muted); }
.masthead nav a:hover { color: var(--text); }
@media (max-width: 33rem) {
  .masthead .wrap { height: auto; padding-block: 0.75rem; flex-wrap: wrap; }
  .masthead nav { gap: 0.9rem; font-size: 0.875rem; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0 1.6rem;
  border-radius: 999px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), background-color 200ms ease, color 200ms ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #c8fa54; transform: translateY(-2px); }
.btn-ghost { border-color: var(--line-bright); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent-line); color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.note { font-size: 0.875rem; color: var(--muted); }

/* ---------- the wall (first viewport) ---------- */

.wall { position: relative; padding-block: clamp(2.5rem, 5vw, 4rem) var(--gap); }
.wall-grid { display: grid; gap: clamp(2.5rem, 5vw, 3.5rem); align-items: center; }
@media (min-width: 62rem) { .wall-grid { grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); gap: clamp(3rem, 5vw, 4.5rem); } }

.wall h1 span { color: var(--accent); }
.wall .lede { margin-top: 1.5rem; }
.wall .actions { margin-top: 2.25rem; }

/* A packed constellation, not a grid. Diameter tracks rarity and alternating
   vertical offsets break the rows, so nine objects read as one collection.
   Deliberately uncaptioned: the ladder names every badge a screen later, and
   captions here staggered against nine different diameters. Each figure keeps
   an aria-label so the names survive for screen readers. */
/* Three fixed columns rather than greedy flex wrapping, which packed a
   different number per row at every width and pushed the last badge off the
   fold. Rarity still sets diameter; offset and alignment break the grid read. */
.constellation {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: clamp(0.5rem, 1.2vw, 0.9rem);
  max-width: 30rem;
  margin-inline: auto;
}
.constellation .badge { justify-self: center; transform: translateY(var(--off, 0px)); }
.constellation .b1 { width: 84px; justify-self: end; --off: 26px; }
.constellation .b2 { width: 96px; --off: -22px; }
.constellation .b3 { width: 106px; justify-self: start; --off: 10px; }
.constellation .b4 { width: 92px; justify-self: start; --off: 14px; }
.constellation .b5 { width: 104px; --off: -6px; }
.constellation .b6 { width: 116px; justify-self: end; --off: 2px; }
.constellation .b7 { width: 130px; justify-self: end; --off: 26px; }
.constellation .b8 { width: 116px; --off: -22px; }
.constellation .b9 { width: 158px; justify-self: start; --off: 18px; }
@media (prefers-reduced-motion: no-preference) {
  .constellation .badge { transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1); }
}
@media (max-width: 38rem) {
  .constellation { max-width: none; gap: 0.7rem; }
  .constellation .badge { --off: 0px; justify-self: center; }
  .constellation .b1 { width: 70px; } .constellation .b2 { width: 80px; }
  .constellation .b3 { width: 88px; } .constellation .b4 { width: 76px; }
  .constellation .b5 { width: 86px; } .constellation .b6 { width: 96px; }
  .constellation .b7 { width: 104px; } .constellation .b8 { width: 96px; }
  .constellation .b9 { width: 128px; }
}

/* Below ~400px three fixed columns cannot fit without shrinking the badges past
   legibility, so the wall drops to two columns and grows taller instead. */
@media (max-width: 25rem) {
  .constellation { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .constellation .b1 { width: 78px; } .constellation .b2 { width: 88px; }
  .constellation .b3 { width: 96px; } .constellation .b4 { width: 84px; }
  .constellation .b5 { width: 92px; } .constellation .b6 { width: 102px; }
  .constellation .b7 { width: 112px; } .constellation .b8 { width: 104px; }
  .constellation .b9 { width: 124px; }
}

/* ---------- badge object ---------- */

.badge { display: block; position: relative; }
.badge svg { display: block; width: 100%; height: auto; overflow: visible; }
.disc { fill: var(--panel); stroke: var(--badge-line); stroke-width: 1.5; }
/* A continuous track, overriding the dasharray in the markup: matching the live
   arc's dashes exactly hid the etch behind them, so the streak badges read as
   loose marks floating on a disc instead of ticks struck on a ring. */
.etch { fill: none; stroke: var(--badge-line); stroke-width: 4; stroke-dasharray: none; }
.live { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: butt; }
/* transform-box/origin so the level-up wipe (anime.js) scales each bar from
   its own left edge rather than the svg's origin. Inert without the script. */
.live-fill { fill: var(--accent); transform-box: fill-box; transform-origin: left center; }
.dim-fill { fill: none; stroke: var(--badge-line); stroke-width: 1.5; }
.badge figcaption { margin-top: 0.85rem; text-align: center; }
.badge .t { display: block; font-family: var(--display); font-weight: 700; font-size: 0.9375rem; letter-spacing: -0.015em; }
.badge .d { display: block; margin-top: 0.2rem; font-size: 0.8125rem; line-height: 1.4; color: var(--muted); }

/* One authored moment: badges strike in as the wall arrives — the arc sweeps,
   then the disc settles. Content is visible by default; this only animates. */
.strike { animation: strike 900ms cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: var(--d, 0ms); }
@keyframes strike {
  from { opacity: 0; transform: translateY(calc(var(--off, 0px) + 14px)) scale(0.92); }
  to { opacity: 1; transform: translateY(var(--off, 0px)); }
}
.sweep { stroke-dashoffset: 0; }
.js .sweep { animation: sweep 1100ms cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: var(--d, 0ms); }
@keyframes sweep { from { stroke-dashoffset: var(--len, 300); } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .strike, .js .sweep { animation: none; }
}

/* The looping ambience (discs breathing, ticks revolving, bars pulsing,
   dashes crawling, rings rippling) lives in the anime.js module script in
   index.html, so every period, phase and amplitude is re-rolled per visit.
   Without JavaScript the page is simply still — content never depends on it. */

/* ---------- generic section ---------- */

.band { padding-block: var(--gap); border-top: 1px solid var(--line); }
.band > .wrap > h2 { max-width: 18ch; }
.band .lede { margin-top: 1.25rem; }

.tier { display: grid; gap: clamp(1.75rem, 4vw, 3rem); margin-top: clamp(2.5rem, 5vw, 4rem); }
@media (min-width: 48rem) { .tier { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); align-items: start; } }
.tier + .tier { margin-top: clamp(3rem, 6vw, 5rem); padding-top: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--line); }
.tier h3 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); font-weight: 800; }
.tier .lede { font-size: 1.0625rem; margin-top: 0.9rem; }
.tier-badges { display: flex; flex-wrap: wrap; gap: clamp(1.25rem, 3vw, 2rem); }
.tier-badges .badge { flex: 0 1 118px; min-width: 104px; }
.tier-badges .badge.wide { flex: 0 1 148px; }

/* run of day marks — a badge descends from the days that earned it */
.run { display: flex; gap: 3px; margin-top: 1.5rem; flex-wrap: wrap; }
.run i { width: 10px; height: 22px; border-radius: 2px; background: var(--line); display: block; }
.run i.hit { background: var(--accent); }
.run i.miss { background: var(--badge-line); }

/* ---------- mechanic ---------- */

.facts { display: grid; gap: 1px; margin-top: clamp(2.5rem, 5vw, 3.5rem); background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
@media (min-width: 40rem) { .facts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .facts { grid-template-columns: repeat(4, 1fr); } }
.fact { background: var(--ground); padding: clamp(1.5rem, 3vw, 2rem); }
.fact dt { font-family: var(--display); font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.02em; }
.fact dd { margin: 0.55rem 0 0; color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }

/* Ledger rows — a deliberately different rhythm from the .facts grid, so two
   consecutive sections don't read as the same template twice. */
.rows { margin-top: clamp(2.5rem, 5vw, 3.5rem); border-top: 1px solid var(--line); }
.rows > div { display: grid; gap: 0.4rem 2.5rem; padding-block: clamp(1.25rem, 2.5vw, 1.75rem); border-bottom: 1px solid var(--line); }
@media (min-width: 44rem) { .rows > div { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); align-items: baseline; } }
.rows dt { font-family: var(--display); font-weight: 700; font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); letter-spacing: -0.02em; }
.rows dd { margin: 0; color: var(--muted); max-width: 62ch; }

/* screenshot slots — PLACEHOLDER until real captures exist */
.shots { display: grid; gap: clamp(1rem, 3vw, 2rem); margin-top: clamp(2.5rem, 5vw, 3.5rem); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.shot {
  aspect-ratio: 1206 / 2622;
  border: 1px dashed var(--line-bright);
  border-radius: 26px;
  display: grid;
  place-content: center;
  gap: 0.4rem;
  text-align: center;
  padding: 1rem;
  background: var(--panel);
}
.shot span { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.02em; }
.shot strong { font-family: var(--display); font-size: 0.9375rem; font-weight: 700; }

/* ---------- plans ---------- */

.plans { display: grid; gap: clamp(1rem, 2.5vw, 1.5rem); margin-top: clamp(2.5rem, 5vw, 3.5rem); }
@media (min-width: 48rem) { .plans { grid-template-columns: repeat(2, 1fr); } }
.plan { border: 1px solid var(--line); border-radius: var(--r); padding: clamp(1.75rem, 3.5vw, 2.5rem); background: var(--panel); }
.plan.pro { border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-soft), transparent 55%), var(--panel); }
.plan h3 { font-size: 1.5rem; }
.plan .price { margin-top: 1rem; font-family: var(--mono); font-size: 1.75rem; letter-spacing: -0.02em; }
.plan .price small { font-family: var(--body); font-size: 0.9375rem; color: var(--muted); letter-spacing: 0; }
.plan ul { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.7rem; }
.plan li { display: grid; grid-template-columns: 20px 1fr; gap: 0.7rem; align-items: start; font-size: 0.9688rem; color: var(--muted); }
.plan li svg { margin-top: 3px; }
.plan li b { color: var(--text); font-weight: 600; }

/* ---------- close ---------- */

.close { padding-block: var(--gap); border-top: 1px solid var(--line); text-align: center; }
.close h2 { max-width: 20ch; margin-inline: auto; }
.close .actions { justify-content: center; margin-top: 2rem; }
.close .lede { margin-inline: auto; margin-top: 1.25rem; }

/* ---------- footer ---------- */

footer { border-top: 1px solid var(--line); padding-block: 3rem 4rem; font-size: 0.9375rem; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; }
footer a:hover { color: var(--text); }

/* ---------- legal / support pages ---------- */

.doc { padding-block: clamp(3rem, 7vw, 5rem) var(--gap); }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem); }
.doc .updated { margin-top: 1rem; font-family: var(--mono); font-size: 0.8125rem; color: var(--muted); }
.doc h2 { font-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.85rem); margin-top: 3rem; }
.doc h3 { margin-top: 2rem; }
.doc p, .doc li { color: var(--muted); max-width: 70ch; }
.doc p { margin-top: 1rem; }
.doc ul { margin-top: 1rem; padding-left: 1.1rem; display: grid; gap: 0.6rem; }
.doc strong { color: var(--text); font-weight: 600; }
.doc a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.doc .callout { margin-top: 1.5rem; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--r); padding: 1.25rem 1.5rem; }
.doc .callout p { color: var(--text); margin-top: 0; }
