/* Home page only. Tokens (colour, type, motion) come from site.css. */
body.home main { padding: 0; }
body.home section h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.4rem); font-stretch: 82%; line-height: 1.1;
  letter-spacing: -0.008em; margin: 0 0 32px; max-width: 24ch;
}

/* ---------- Hero: the blue field ---------- */
.hero { background: var(--field); color: var(--field-text); padding: 48px 0 96px; }
.hero :focus-visible, .closing :focus-visible { outline-color: var(--field-text); }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 940px) { .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 64px; } }
.hero h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.1rem); font-stretch: 78%; font-weight: 650;
  line-height: 1.03; letter-spacing: -0.008em; margin: 0 0 22px; max-width: 15ch;
}
.hero-sub { font-size: 1.2rem; line-height: 1.5; color: var(--field-muted); max-width: 33em; margin: 0; }
.hero .actions { margin: 30px 0 18px; }
.hero-note { color: var(--field-muted); font-size: .95rem; margin: 0; }
.hero-note strong { color: var(--field-text); }

.btn-invert { background: var(--field-text); border-color: var(--field-text); color: oklch(0.27 0.13 266); font-weight: 650; }
.btn-ghost { background: transparent; border-color: var(--field-line); color: var(--field-text); }
@media (hover: hover) and (pointer: fine) {
  .btn-invert:hover { background: oklch(0.93 0.025 260); border-color: oklch(0.93 0.025 260); }
  .btn-ghost:hover { border-color: var(--field-text); }
}

/* Hero entrance: one orchestrated sequence on load. */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
.hero-copy > *, .hero-panel { animation: rise var(--dur-enter) var(--ease-out) both; }
.hero-copy > :nth-child(2) { animation-delay: calc(var(--stagger) * 1); }
.hero-copy > :nth-child(3) { animation-delay: calc(var(--stagger) * 2); }
.hero-copy > :nth-child(4) { animation-delay: calc(var(--stagger) * 3); }
.hero-panel { animation-duration: 640ms; animation-delay: 160ms; }
.hero-panel .seq { animation: rise 420ms var(--ease-out) both; }
.hero-panel .bp-body > .seq:first-child { animation-delay: 460ms; }
.hero-panel .bp-speeds .seq:nth-child(1) { animation-delay: 520ms; }
.hero-panel .bp-speeds .seq:nth-child(2) { animation-delay: 570ms; }
.hero-panel .bp-speeds .seq:nth-child(3) { animation-delay: 620ms; }
.hero-panel .bp-speeds .seq:nth-child(4) { animation-delay: 670ms; }
.hero-panel .bp-foot.seq { animation-delay: 760ms; }

/* ---------- The panel: a drawn example of the add-on, not a screenshot ---------- */
.panel-fig { margin: 0; min-width: 0; }
.panel-fig figcaption { font-size: .88rem; color: var(--muted); margin-top: 12px; }
.hero .panel-fig figcaption { color: var(--field-muted); }
.bpanel {
  --p-bg: oklch(0.25 0.012 264); --p-row: oklch(0.31 0.013 264); --p-text: oklch(0.92 0.008 260);
  --p-dim: oklch(0.75 0.012 260); --p-blue: oklch(0.52 0.19 264); --p-ok: oklch(0.74 0.15 155);
  background: var(--p-bg); color: var(--p-text); border: 1px solid oklch(0.37 0.02 264); border-radius: 12px;
  box-shadow: 0 28px 60px -28px oklch(0.14 0.08 266 / 0.65); overflow: hidden;
  font-size: .92rem; line-height: 1.45; font-variant-numeric: tabular-nums;
}
.bpanel { container: panel / inline-size; }
.bp-head { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--p-row); font-weight: 600; }
.bp-caret { width: 7px; height: 7px; border-right: 1.5px solid var(--p-dim); border-bottom: 1.5px solid var(--p-dim); transform: translateY(-2px) rotate(45deg); }
.bp-body, .bp-screen { padding: 14px; display: grid; gap: 10px; align-content: start; }
.bp-line { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.bp-dim { color: var(--p-dim); }
.bp-row { padding: 7px 10px; background: var(--p-row); border-radius: 6px; }
.bp-speeds, .bp-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bp-speeds li { display: grid; grid-template-columns: 14px 5.4em minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 7px 10px; border-radius: 6px; background: var(--p-row); }
/* Narrow panels: the finish time moves under the speed's name so the price in credits always fits. */
@container panel (max-width: 400px) {
  .bp-speeds li { grid-template-columns: 14px minmax(0, 1fr) auto; }
  .bp-speeds .bp-eta { grid-column: 2 / -1; grid-row: 2; white-space: normal; }
}
.bp-speeds .bp-eta { color: var(--p-dim); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-speeds .bp-price { font-weight: 650; }
.bp-speeds .is-sel { background: oklch(0.45 0.17 264); color: oklch(0.99 0.005 258); }
.bp-speeds .is-sel .bp-eta { color: oklch(0.93 0.025 260); }
.bp-radio { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--p-dim); }
.is-sel .bp-radio { border-color: currentColor; background: currentColor; box-shadow: inset 0 0 0 2.5px oklch(0.45 0.17 264); }
.bp-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-top: 4px; }
.bp-btn { background: var(--p-blue); color: oklch(0.99 0.005 258); padding: 7px 14px; border-radius: 6px; font-weight: 650; }
.bp-btn-quiet { background: oklch(0.36 0.014 264); color: var(--p-text); }
.bp-checks { gap: 8px; }
.bp-checks li { display: grid; grid-template-columns: 14px 1fr; gap: 9px; align-items: start; }
.bp-tick, .bp-info { width: 14px; height: 14px; border-radius: 50%; margin-top: 3px; flex: none; position: relative; }
.bp-tick { background: var(--p-ok); }
.bp-tick::after { content: ""; position: absolute; left: 4.5px; top: 2.5px; width: 3.5px; height: 6.5px; border: solid var(--p-bg); border-width: 0 1.8px 1.8px 0; transform: rotate(42deg); }
.bp-line > .bp-tick { align-self: center; margin-top: 0; }
.bp-info { border: 1.5px solid var(--p-dim); }
.bp-bar, .bp-cap-track { height: 6px; border-radius: 3px; background: oklch(0.34 0.013 264); overflow: hidden; }
.bp-cap-track { height: 8px; border-radius: 4px; }
.bp-bar-fill, .bp-cap-fill { display: block; height: 100%; transform-origin: left center; transform: scaleX(var(--to)); }
.bp-bar-fill { background: oklch(0.66 0.16 262); }
.bp-cap-fill { background: var(--amber); }
.bp-cap { display: grid; gap: 6px; }
.bp-cap-legend { display: flex; justify-content: space-between; gap: 12px; font-size: .86rem; }
.bp-frames { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; }
.cell { aspect-ratio: 16 / 10; border-radius: 1px; background: oklch(0.34 0.013 264); position: relative; }
.cell.is-done::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--amber); }

/* Screens share one grid cell, so swapping them never changes the layout. */
.bp-screens { display: grid; }
.bp-screen {
  grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity var(--dur-state) var(--ease-out), transform var(--dur-state) var(--ease-out), visibility 0s linear var(--dur-state);
}
.bp-screen.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
/* What plays inside a screen when it becomes the current one. */
.bp-screen .bp-speeds li { opacity: 0; transform: translateY(5px); transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out); }
.bp-screen.is-active .bp-speeds li { opacity: 1; transform: none; }
.bp-screen.is-active .bp-speeds li:nth-child(1) { transition-delay: 90ms; }
.bp-screen.is-active .bp-speeds li:nth-child(2) { transition-delay: 140ms; }
.bp-screen.is-active .bp-speeds li:nth-child(3) { transition-delay: 180ms; }
.bp-screen.is-active .bp-speeds li:nth-child(4) { transition-delay: 210ms; }
.bp-screen .bp-bar-fill, .bp-screen .bp-cap-fill { transform: scaleX(0); transition: transform 1100ms var(--ease-out) 200ms; }
.bp-screen.is-active .bp-bar-fill, .bp-screen.is-active .bp-cap-fill { transform: scaleX(var(--to)); }
.bp-screen .cell.is-done::after { opacity: 0; transition: opacity 160ms ease-out; }
.bp-screen.is-active .cell.is-done::after { opacity: 1; transition-delay: calc(var(--n, 0) * 7ms + 150ms); }

/* ---------- Problem ---------- */
.stakes { padding: 96px 0 72px; }
.stakes-grid { display: grid; gap: 28px 44px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stakes-grid > div { border-top: 1px solid var(--text); padding-top: 18px; }
.stakes-grid h3 { font-size: 1.2rem; font-stretch: 90%; line-height: 1.25; margin-bottom: 8px; }
.stakes-grid p { color: var(--muted); margin: 0; max-width: 40ch; }

/* ---------- How it works ---------- */
.how { background: var(--surface-2); padding: 88px 0; }
.how-grid { display: grid; gap: 40px; align-items: start; }
.how .stage { order: -1; }
@media (min-width: 940px) {
  .how-grid { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 64px; }
  .how .stage { order: 0; position: sticky; top: 24px; }
}
.flow { list-style: none; margin: 0; padding: 0; }
.flow li { position: relative; padding: 0 0 28px 54px; }
.flow li:last-child { padding-bottom: 0; }
/* The rail between two steps: a grey track with a blue fill that draws downward. */
.flow li:not(:last-child)::before, .flow li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 40px; bottom: 2px; width: 2px; border-radius: 1px; }
.flow li::before { background: var(--line); }
.flow li::after { background: var(--accent); transform: scaleY(0); transform-origin: center top; transition: transform 420ms var(--ease-in-out); }
.flow li.is-done::after { transform: scaleY(1); }
.flow-btn {
  font: inherit; font-size: 1.2rem; font-stretch: 90%; font-weight: 650; color: var(--text); background: none; border: 0;
  padding: 3px 0; min-height: 34px; text-align: left; cursor: pointer; touch-action: manipulation;
}
.flow-num {
  position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-size: .95rem; font-variant-numeric: tabular-nums; background: var(--surface-2); color: var(--muted); border: 1.5px solid var(--line);
  transition: background-color var(--dur-state) ease, border-color var(--dur-state) ease, color var(--dur-state) ease, transform var(--dur-micro) var(--ease-out);
}
.flow li.is-done .flow-num { border-color: var(--accent); color: var(--accent); }
.flow li.is-active .flow-num { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.flow-btn:active .flow-num { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .flow li:not(.is-active) .flow-btn:hover .flow-num { border-color: var(--accent); color: var(--accent); } }
.flow li p { margin: 4px 0 0; color: var(--muted); max-width: 46ch; }
.flow li.is-active p { color: var(--text); }

/* ---------- Benefits ---------- */
.benefits { padding: 96px 0 40px; }
.benefit { display: grid; gap: 10px 56px; padding: 28px 0; border-top: 1px solid var(--line); }
@media (min-width: 820px) { .benefit { grid-template-columns: 19rem minmax(0, 1fr); } }
.benefit h3 { font-size: 1.3rem; font-stretch: 88%; line-height: 1.2; margin: 0; }
.benefit p { max-width: 62ch; }
.benefit p:last-child { margin-bottom: 0; }
.pairs { display: grid; gap: 20px 44px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 18px 0 16px; }
.pair { margin: 0; }
.pair > div { display: grid; grid-template-columns: 5.6em minmax(0, 1fr); gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); }
.pair dt { font-weight: 650; }
.pair dd { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- Proof: the receipt ---------- */
.proof { padding: 56px 0 104px; }
.proof-grid { display: grid; gap: 36px 64px; align-items: center; }
@media (min-width: 880px) { .proof-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
body.home .proof h2 { margin-bottom: 20px; max-width: 18ch; }
.proof p { max-width: 50ch; }
.receipt { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px 24px; }
.receipt table { margin: 0; }
.receipt caption { text-align: left; color: var(--muted); font-size: .9rem; padding-bottom: 6px; }
.receipt th, .receipt td { padding-left: 0; padding-right: 0; }
.receipt tbody th { font-weight: 400; }
.receipt .receipt-total th, .receipt .receipt-total td { font-weight: 650; border-bottom: 0; }
.cap { margin-top: 14px; display: grid; gap: 8px; }
.cap-track { height: 10px; border-radius: 5px; background: var(--accent-soft); overflow: hidden; }
.cap-fill { display: block; height: 100%; background: var(--accent); border-radius: 5px; transform-origin: left center; transform: scaleX(0.892); transition: transform 900ms var(--ease-out) 300ms; }
[data-reveal-armed]:not([data-visible]) .cap-fill { transform: scaleX(0); }
.cap-legend { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Trust ---------- */
.trust { background: var(--surface-2); padding: 88px 0; }
.trust-list { margin: 0; display: grid; gap: 0 64px; }
@media (min-width: 760px) { .trust-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.trust-list > div { padding: 20px 0; border-top: 1px solid var(--line); }
.trust-list dt { font-weight: 650; font-size: 1.08rem; }
.trust-list dd { margin: 6px 0 0; color: var(--muted); max-width: 52ch; }
.limits { margin-top: 44px; padding: 24px 28px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.limits h3 { margin-bottom: 10px; }
.limits ul { margin: 0; padding-left: 1.1em; color: var(--muted); }
.limits li { margin: 6px 0; max-width: 70ch; }

/* ---------- Questions and closing ---------- */
.faq { padding: 88px 0 96px; }
.faq details { max-width: 760px; }
.closing { background: var(--field); color: var(--field-text); padding: 104px 0; text-align: center; }
body.home .closing h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); font-stretch: 78%; max-width: 19ch; margin: 0 auto 16px; }
.closing p { color: var(--field-muted); max-width: 44ch; margin: 0 auto 30px; font-size: 1.1rem; }
body.home footer.site { border-top: 0; }

/* ---------- Scroll reveal: armed by home.js only for content below the fold ---------- */
[data-reveal-armed] {
  opacity: 0; transform: translateY(14px);
  transition: opacity var(--dur-enter) var(--ease-out) var(--rd, 0ms), transform var(--dur-enter) var(--ease-out) var(--rd, 0ms);
}
[data-reveal-armed][data-visible] { opacity: 1; transform: none; }

/* ---------- Reduced motion: keep the fades, drop the movement ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-copy > *, .hero-panel, .hero-panel .seq { animation-name: fade; animation-duration: 200ms; animation-delay: 0ms; }
  [data-reveal-armed] { transform: none; transition: opacity 200ms ease-out; }
  .bp-screen, .bp-screen .bp-speeds li { transform: none; transition: opacity 160ms ease-out, visibility 0s linear 160ms; }
  .bp-screen.is-active, .bp-screen.is-active .bp-speeds li { transition-delay: 0s; }
  .bp-screen .bp-bar-fill, .bp-screen .bp-cap-fill, .cap-fill, .flow li::after { transition: none; }
  .bp-screen.is-active .cell.is-done::after { transition-delay: 0s; }
  .flow-btn:active .flow-num { transform: none; }
}
