/* ==========================================================================
   Obi launch site. Tokens are the app's own (docs/site/BRIEF.md), so the
   page and the app read as one product. Only transform and opacity animate.
   ========================================================================== */

:root {
  color-scheme: light dark;

  --canvas: #f3eee5;
  --surface: #fcfaf5;
  --raised: #ffffff;
  --sunken: #ebe5d8;
  --border: #e1dacc;
  --border-strong: #c7bdab;
  --text: #1f1b16;
  --muted: #6a6356;
  --faint: #9c9385;
  --accent: #b23a2b;
  --accent-hover: #972f22;
  --accent-text: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 11%, transparent);
  --success: #2a7142;
  --success-soft: color-mix(in srgb, var(--success) 13%, transparent);
  --warning: #946012;
  --warning-soft: color-mix(in srgb, var(--warning) 14%, transparent);
  --ink-on-belt: color-mix(in srgb, var(--text) 22%, transparent);

  --shadow-sm: 0 1px 2px rgb(31 27 22 / 0.06), 0 0 0 1px rgb(31 27 22 / 0.02);
  --shadow-md: 0 4px 14px rgb(31 27 22 / 0.08), 0 1px 3px rgb(31 27 22 / 0.06);
  --shadow-lg:
    0 24px 48px rgb(31 27 22 / 0.18), 0 8px 16px rgb(31 27 22 / 0.08);
  --shadow-accent: 0 2px 8px rgb(178 58 43 / 0.28);

  /* The seeded ladder. Never used as text. */
  --belt-white: #f4f1ea;
  --belt-yellow: #f5d547;
  --belt-orange: #f28c28;
  --belt-green: #3c9d4e;
  --belt-blue: #2f6fdb;
  --belt-purple: #7a4bb8;
  --belt-brown: #7b4a2d;
  --belt-black: #1a1a1a;

  --font-display:
    "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body:
    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-headline: clamp(2.5rem, 1.6rem + 4.2vw, 4.75rem);
  --text-section: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);
  --nav-height: 4rem;

  /* Scroll-driven state, written by main.js, read only here. */
  --ladder-progress: 0;
  --hero-progress: 0;
  --meter-1: 0;
  --meter-2: 0;
  --meter-3: 0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #15130e;
    --surface: #1f1c16;
    --raised: #29251e;
    --sunken: #0f0e0a;
    --border: #38332a;
    --border-strong: #58513f;
    --text: #f1ece2;
    --muted: #aaa191;
    --faint: #7d7566;
    --accent: #e2614f;
    --accent-hover: #ec7867;
    --accent-text: #15130e;
    --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
    --success: #5cc07a;
    --success-soft: color-mix(in srgb, var(--success) 16%, transparent);
    --warning: #e5a93f;
    --warning-soft: color-mix(in srgb, var(--warning) 16%, transparent);
    --ink-on-belt: color-mix(in srgb, var(--text) 30%, transparent);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(0 0 0 / 0.2);
    --shadow-md: 0 6px 18px rgb(0 0 0 / 0.5), 0 1px 3px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 24px 48px rgb(0 0 0 / 0.6), 0 8px 16px rgb(0 0 0 / 0.4);
    --shadow-accent: 0 2px 8px rgb(226 97 79 / 0.3);
  }
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent);
}

svg {
  display: block;
}

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

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* Room for the margin ladder on the left, mirrored on the right to stay centred. */
@media (min-width: 960px) {
  .wrap {
    padding-inline: 3.5rem;
  }
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

/* Type */

.headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-headline);
  font-variation-settings:
    "opsz" 144,
    "SOFT" 40;
  letter-spacing: -0.03em;
  line-height: 1.02;
  text-wrap: balance;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-section);
  font-variation-settings:
    "opsz" 144,
    "SOFT" 40;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
}

.label,
.eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* Buttons: visible hover, focus-visible and active states */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 120ms var(--ease),
    background-color 120ms var(--ease),
    border-color 120ms var(--ease),
    box-shadow 120ms var(--ease);
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--shadow-accent);
}

.button-primary:hover {
  background: var(--accent-hover);
}

.button-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.button-secondary:hover {
  background: var(--raised);
  border-color: var(--faint);
}

.button-lg {
  min-height: 3rem;
  padding-inline: 1.5rem;
  font-size: var(--text-lg);
}

.button-inverted {
  background: var(--accent-text);
  color: var(--accent);
  min-height: 3rem;
  padding-inline: 1.75rem;
  font-size: var(--text-lg);
  box-shadow: var(--shadow-md);
}

.button-inverted:hover {
  background: color-mix(in srgb, var(--text) 8%, var(--accent-text));
}

.start .button-inverted:focus-visible {
  outline-color: var(--accent-text);
}

/* Badges, pills and belt chips, as in the app */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--raised);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: currentColor;
}

.badge-success {
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
  background: var(--success-soft);
  color: var(--success);
}

.badge-warning {
  border-color: color-mix(in srgb, var(--warning) 35%, transparent);
  background: var(--warning-soft);
  color: var(--warning);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.25rem 0.875rem;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pill-success {
  background: var(--success-soft);
  color: var(--success);
}

.pill-count {
  font-variant-numeric: tabular-nums;
}

.belt-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  white-space: nowrap;
}

.belt-swatch {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--belt);
  border: 1px solid var(--ink-on-belt);
  box-shadow: inset 0 1px 1px rgb(255 255 255 / 0.25);
}

.belt-chip-lg .belt-swatch {
  width: 1.5rem;
  height: 1.5rem;
}

/* ==========================================================================
   Signature move: the margin ladder
   ========================================================================== */

.ladder {
  position: fixed;
  z-index: 20;
  display: grid;
  gap: 2px;
  pointer-events: none;
}

.ladder-band {
  display: block;
  background: var(--belt);
  border-radius: 5px;
  /* A steep clamp turns the band full as soon as the scroll fraction passes its slot. */
  opacity: clamp(0.28, 0.28 + (var(--ladder-progress) * 8 - var(--i)) * 200, 1);
  /* The outline appears only at the very bottom of the page. */
  --outline-on: clamp(0, (var(--ladder-progress) - 0.995) * 1000, 1);
}

/* The white rung would vanish on light canvas and the black rung on dark canvas:
   a permanent 1px inset ring keeps both legible in either scheme. */
.ladder-band[style*="belt-white"] {
  box-shadow: inset 0 0 0 1px var(--ink-on-belt);
}

.ladder-band-black {
  box-shadow:
    inset 0 0 0 1px var(--ink-on-belt),
    0 0 0 calc(var(--outline-on) * 1px) var(--ink-on-belt);
}

@media (min-width: 960px) {
  .ladder {
    top: calc(var(--nav-height) + 1.5rem);
    bottom: 1.5rem;
    left: 1.5rem;
    width: 10px;
    grid-auto-rows: 1fr;
  }
}

@media (max-width: 959.98px) {
  .ladder {
    top: var(--nav-height);
    left: 0;
    right: 0;
    height: 3px;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
  }

  .ladder-band {
    border-radius: 0;
  }
}

/* ==========================================================================
   0. Nav
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--nav-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
}

.logo {
  flex: none;
  box-shadow: var(--shadow-accent);
  border-radius: 8px;
  transition: transform 220ms var(--ease-spring);
}

.brand:hover .logo {
  transform: rotate(-6deg);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-sm .wordmark {
  font-size: var(--text-md);
}

.brand-sm .logo {
  border-radius: 6px;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
  transition: color 120ms var(--ease);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a[aria-current="true"] {
  color: var(--text);
  text-decoration: underline;
}

.nav-cta {
  min-height: 2.5rem;
}

.nav-cta-short {
  display: none;
}

@media (max-width: 719.98px) {
  .site-header {
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav-links {
    display: none;
  }

  .nav-cta {
    min-height: 2.75rem;
  }

  .nav-cta-long {
    display: none;
  }

  .nav-cta-short {
    display: inline;
  }
}

/* ==========================================================================
   1. Hero
   ========================================================================== */

.hero {
  padding: 3.5rem 0 4rem;
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}

.sub-line {
  max-width: 34rem;
  font-size: var(--text-xl);
  color: var(--muted);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.hero-note {
  font-size: var(--text-sm);
  color: var(--muted);
}

@media (max-width: 479.98px) {
  .hero-actions {
    flex-direction: column;
    align-self: stretch;
  }

  .hero-actions .button {
    width: 100%;
  }
}

@media (min-width: 960px) {
  .hero {
    padding: 6rem 0 5rem;
  }

  .hero-grid {
    grid-template-columns: 7fr 5fr;
    gap: 4rem;
  }
}

/* The roster card scene: three planes */

.scene {
  position: relative;
  overflow: clip;
  padding: 1rem 0 2.5rem;
}

.scene-bands {
  display: grid;
  gap: 10px;
}

.band {
  display: block;
  height: 14px;
  border-radius: 7px;
  background: var(--belt);
  opacity: 0.55;
}

.band-white {
  --belt: var(--belt-white);
  border: 1px solid var(--ink-on-belt);
}

/* The black band gets the same border so it survives dark mode. */
.band-black {
  border: 1px solid var(--ink-on-belt);
}

.scene-stack {
  position: relative;
  width: min(26rem, 100%);
  margin-inline: auto;
}

.roster-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 1.25rem;
}

.roster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
}

.roster-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
}

.roster-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "name badge"
    "belt badge"
    "gap gap";
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.15rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  animation: row-in 360ms var(--ease) both;
  animation-delay: calc(var(--i) * 60ms);
}

.roster-row:last-child {
  border-bottom: 0;
  padding-bottom: 0.25rem;
}

.roster-name {
  grid-area: name;
  font-weight: 600;
}

.roster-row .belt-chip {
  grid-area: belt;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
}

.roster-row .badge {
  grid-area: badge;
}

.roster-gap {
  grid-area: gap;
  font-size: var(--text-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cert-corner {
  position: absolute;
  z-index: 2;
  width: 11rem;
  padding: 0.875rem 1rem 1rem;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 0.35rem;
  transform: rotate(4deg);
  transform-origin: center;
}

.cert-corner-band {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--belt-green);
  margin-bottom: 0.25rem;
}

.cert-corner-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.cert-corner-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-md);
  letter-spacing: -0.01em;
}

/* Phones: a single band row above the card, nothing overflows */
@media (max-width: 959.98px) {
  .scene-bands {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 6px;
    margin-bottom: 1.25rem;
  }

  .cert-corner {
    right: 0.5rem;
    bottom: -1.75rem;
  }
}

@media (min-width: 960px) {
  .scene {
    padding: 3rem 3rem 4rem;
  }

  .scene-bands {
    position: absolute;
    left: -10%;
    right: -10%;
    top: 50%;
    transform: translateY(calc(-50% - var(--hero-progress) * 24px))
      rotate(-8deg);
  }

  .cert-corner {
    right: -2.5rem;
    bottom: -1.5rem;
    transform: translateY(calc(var(--hero-progress) * 10px)) rotate(4deg);
  }
}

/* ==========================================================================
   2. The old way
   ========================================================================== */

.before {
  padding: 4rem 1.5rem;
}

.before-inner {
  max-width: 44rem;
  margin-inline: auto;
  text-align: center;
  display: grid;
  gap: 1.25rem;
}

.before-copy {
  font-size: var(--text-lg);
  color: var(--muted);
  text-wrap: pretty;
}

.before-copy .ink {
  color: var(--text);
}

/* Reveals: opacity and a 12px translate, once */

[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 400ms var(--ease),
    transform 400ms var(--ease);
  transition-delay: calc(var(--i, 0) * var(--stagger, 0ms));
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   3. How it works
   ========================================================================== */

.how {
  padding: 5rem 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.steps {
  display: grid;
  gap: 2.5rem;
  margin-top: 3rem;
}

.step {
  --stagger: 120ms;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.step-numeral {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 3rem;
  font-variation-settings:
    "opsz" 144,
    "SOFT" 40;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.step-title {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.3;
}

.step-copy {
  color: var(--muted);
  text-wrap: pretty;
}

.illus {
  margin-top: 1rem;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  font-size: var(--text-sm);
}

/* Step 1: a belt card */

.illus-belt {
  border-left: 6px solid var(--belt-green);
  padding: 1rem 1.125rem;
  display: grid;
  gap: 0.875rem;
}

.illus-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.illus-field {
  display: grid;
  gap: 0.35rem;
}

.illus-input {
  display: block;
  padding: 0.4rem 0.6rem;
  background: var(--raised);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.illus-techniques {
  display: grid;
  gap: 0.35rem;
  font-weight: 500;
}

.illus-techniques li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.illus-rank {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--faint);
  min-width: 1ch;
}

/* Step 2: a register */

.illus-register {
  padding: 1rem 1.125rem;
  display: grid;
  gap: 0.75rem;
}

.illus-register-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.illus-date {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-md);
  letter-spacing: -0.01em;
}

.illus-count {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.illus-rows {
  display: grid;
  gap: 0.4rem;
}

.illus-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 500;
}

.illus-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--raised);
  color: var(--success);
}

.illus-check svg {
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity 180ms var(--ease),
    transform 220ms var(--ease-spring);
}

.illus-row.is-ticked {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
}

.illus-row.is-ticked .illus-check {
  border-color: var(--success);
  background: var(--success);
  color: var(--accent-text);
}

.illus-row.is-ticked .illus-check svg {
  opacity: 1;
  transform: none;
}

/* Step 3: a landscape certificate */

.illus-cert {
  padding: 0.6rem;
}

.illus-cert-inner {
  aspect-ratio: 1.414 / 1;
  border: 3px double var(--belt-green);
  border-radius: 6px;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.4rem;
}

.illus-cert-school {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.illus-cert-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-lg);
  color: var(--accent);
  letter-spacing: -0.01em;
}

.illus-cert-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.illus-cert-line {
  font-size: var(--text-xs);
  color: var(--muted);
}

@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   4. The peak: three requirements, one answer
   ========================================================================== */

.ready {
  padding: 6rem 0;
}

.ready-grid {
  display: grid;
  gap: 3rem;
  align-items: start;
}

.ready-copy-inner {
  display: grid;
  gap: 1.25rem;
}

.ready-lead {
  font-size: var(--text-lg);
  text-wrap: pretty;
}

.ready-note {
  font-size: var(--text-sm);
  color: var(--muted);
}

.req-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 2rem;
  display: grid;
  gap: 1.5rem;
  transition: border-color 220ms var(--ease);
}

.req-card[data-state="ready"] {
  border-color: color-mix(in srgb, var(--success) 40%, var(--border));
}

.req-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.req-title .belt-chip {
  font-family: var(--font-body);
  font-size: var(--text-lg);
}

.requirements {
  display: grid;
  gap: 1.25rem;
}

.req {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.req-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--muted);
  transition:
    background-color 220ms var(--ease),
    color 220ms var(--ease);
}

.req-mark svg {
  position: absolute;
  transition:
    opacity 180ms var(--ease),
    transform 220ms var(--ease-spring);
}

.req-check {
  opacity: 0;
  transform: scale(0.5);
}

.req[data-met="true"] .req-mark {
  background: var(--success-soft);
  color: var(--success);
}

.req[data-met="true"] {
  color: var(--success);
}

.req[data-met="true"] .req-cross {
  opacity: 0;
  transform: scale(0.5);
}

.req[data-met="true"] .req-check {
  opacity: 1;
  transform: none;
}

.req-label {
  font-variant-numeric: tabular-nums;
  font-size: var(--text-lg);
}

.req-count {
  font-variant-numeric: tabular-nums;
}

.req-bar {
  grid-column: 2;
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--sunken);
  overflow: hidden;
}

.req-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: var(--warning);
  transform-origin: left center;
  transform: scaleX(var(--meter));
}

.req[data-met="true"] .req-fill {
  background: var(--success);
}

.req-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
}

.req-gap {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.req-done {
  color: var(--success);
  font-weight: 600;
}

.req-badge-ready,
.req-done {
  display: none;
}

.req-card[data-state="ready"] .req-badge-progress,
.req-card[data-state="ready"] .req-gap {
  display: none;
}

.req-card[data-state="ready"] .req-badge-ready {
  display: inline-flex;
  animation: pop 220ms var(--ease-spring) both;
}

.req-card[data-state="ready"] .req-done {
  display: inline;
}

@keyframes pop {
  from {
    transform: scale(0.8);
  }
  to {
    transform: none;
  }
}

@media (min-width: 960px) {
  .ready-grid {
    grid-template-columns: 5fr 7fr;
    gap: 4rem;
    /* The copy column is tall so the card stays pinned while the meters fill. */
    min-height: 180vh;
  }

  .ready-copy {
    align-self: stretch;
  }

  .ready-copy-inner {
    position: sticky;
    top: 8rem;
  }

  .ready-demo {
    position: sticky;
    top: 6rem;
  }
}

/* ==========================================================================
   5. Features
   ========================================================================== */

.features {
  padding: 5rem 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.feature-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 3rem;
}

/* The list item only reveals (fade-up, 60ms stagger); the chrome and the
   hover lift live on the inner card so the two transitions never collide. */
.feature {
  --stagger: 60ms;
}

.feature-card {
  height: 100%;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 0.75rem;
  align-content: start;
  transition:
    transform 120ms var(--ease),
    box-shadow 120ms var(--ease);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-title {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
}

.feature-copy {
  color: var(--muted);
  text-wrap: pretty;
}

.features-note {
  margin-top: 2.5rem;
  text-align: center;
  color: var(--muted);
}

@media (min-width: 720px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   6. See it live
   ========================================================================== */

.live {
  padding: 6rem 0;
}

.live-title {
  text-align: center;
}

.live-sub {
  max-width: 36rem;
  margin: 1rem auto 0;
  text-align: center;
  color: var(--muted);
  text-wrap: pretty;
}

.device {
  margin-top: 3rem;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 10px;
}

.device-strip {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.5rem 0.5rem;
}

.device-dots {
  display: flex;
  gap: 6px;
}

.device-dots span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--border-strong);
}

.device-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
}

.device-frame {
  display: block;
  width: 100%;
  height: 720px;
  border: 0;
  border-radius: 12px;
  background: var(--canvas);
}

.live-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.good-to-know {
  display: grid;
  gap: 1.5rem;
  margin-top: 3rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.good-to-know strong {
  display: block;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 719.98px) {
  .device-frame {
    height: 640px;
  }
}

@media (min-width: 720px) {
  .good-to-know {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

/* ==========================================================================
   7. Closing call to action
   ========================================================================== */

.start {
  position: relative;
  overflow: clip;
  padding: 6rem 1.5rem;
  background: var(--accent);
  color: var(--accent-text);
  text-align: center;
}

.start-stripes {
  position: absolute;
  inset: 0;
  display: grid;
  grid-auto-rows: 1fr;
  opacity: 0.12;
  pointer-events: none;
}

.start-stripes span {
  display: block;
  background: var(--belt);
}

.start-inner {
  position: relative;
  max-width: 44rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.start-copy {
  font-size: var(--text-lg);
  opacity: 0.9;
  text-wrap: pretty;
}

.start-note {
  font-size: var(--text-sm);
  opacity: 0.8;
}

/* ==========================================================================
   8. Footer
   ========================================================================== */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}

.footer-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-line {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--text);
  font-weight: 500;
  font-size: var(--text-sm);
  text-decoration: none;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-credit {
  margin-top: 1.5rem;
  font-size: var(--text-sm);
  color: var(--muted);
}

@media (max-width: 719.98px) {
  .footer-row {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
  }

  .footer-credit {
    text-align: center;
  }
}

/* ==========================================================================
   Reduced motion: every animated element in its final state, zero duration
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  :root {
    --ladder-progress: 1;
    --hero-progress: 0;
    --meter-1: 1;
    --meter-2: 1;
    --meter-3: 1;
  }

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }

  .roster-row {
    animation: none;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
