/* a1a2 — the category canon, played straight.
   Craft bar: Stripe, Ramp, Vercel, Render. One accent, spent only on margin gained. */

/* Self-hosted so the 60px headline never flashes a fallback face. SIL OFL. */
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("./fonts/schibsted-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("./fonts/schibsted-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --surface:      #FFFFFF;
  --surface-2:    #F6F8FB;
  --track:        #EDF1F7;

  --ink:          #0B1220;
  --ink-2:        #414B5F;
  --ink-3:        #616B7D;

  --line:         #E4E9F0;
  --line-2:       #D2DAE5;

  /* Two data colours, and only inside the figure: orange is the margin you
     already keep, green is the margin we add. iOS system orange paired with a
     cooler emerald. Validated as a categorical pair — protanope ΔE 10.5,
     normal-vision ΔE 25.9. Both sit under 3:1 against white, which is legal
     here only because every segment carries a direct label and a legend; the
     ink labels themselves clear 8.5:1 and 8.0:1. Buttons stay ink. */
  --today:        #FF9500;
  --accent:       #00C08B;
  --accent-deep:  #007A5A;

  --dark:         #0B1220;
  --dark-2:       #151E30;
  --on-dark:      #F2F5F9;
  --on-dark-2:    #98A4B8;
  --on-dark-line: rgba(242, 245, 249, 0.16);
  --accent-dark:  #2FE0AC;

  --max:    1180px;
  --pad:    clamp(20px, 5vw, 32px);
  --sec-y:  clamp(72px, 9vw, 128px);

  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;

  --ease:   cubic-bezier(0.22, 0.7, 0.25, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --font: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

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

html {
  /* Bottom overscroll was rubber-banding open a band of white canvas under the
     dark footer. Nothing can paint that region, so stop the bounce instead. */
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---- browser surfaces: the parts we did not draw still carry the design ---- */
::selection { background: var(--ink); color: var(--surface); }
:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 3px;
  border-radius: 3px;
}
* { scrollbar-width: thin; scrollbar-color: var(--line-2) var(--surface-2); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--line-2); border: 3px solid var(--surface-2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

a { color: inherit; }
img, svg { display: block; max-width: 100%; }

/* Autofill is the loudest thing a browser paints over a design: Chrome and
   Safari flood the field pale blue and override the text colour. Repaint it in
   the field's own colours. The absurd transition delay is the standard trick —
   the UA colour is applied as a background, and only an unreachable transition
   keeps it from winning. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  box-shadow: 0 0 0 1000px var(--surface) inset;
  caret-color: var(--ink);
  transition: background-color 9999s ease-out 0s;
}
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus,
.field textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--on-dark);
  -webkit-box-shadow: 0 0 0 1000px var(--dark-2) inset;
  box-shadow: 0 0 0 1000px var(--dark-2) inset;
  caret-color: var(--accent-dark);
}

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

p { margin: 0; }

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

.vh {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: top 160ms var(--ease);
}
.skip:focus-visible { top: 16px; }

/* ============================ buttons ============================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--surface);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 160ms var(--ease), transform 160ms var(--ease);
}
.btn:hover { background: var(--dark-2); }
.btn:active { transform: translateY(1px); }
.btn-sm { height: 40px; padding: 0 18px; font-size: 15px; }
.btn-block { width: 100%; height: 54px; }

/* ============================ nav ============================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line); }

/* The nav CTA exists for a visitor who has scrolled past the form. While the
   hero capture is on screen it is a second button pointing at a field already
   in view, so it stays out of the way. Default is visible: a page whose JS
   never runs still offers the action. */
.nav .btn-sm {
  transition: opacity 220ms var(--ease), transform 220ms var(--ease), visibility 220ms;
}
.nav[data-cta="hidden"] .btn-sm {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
}

.nav-in {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}

.brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
  margin-right: auto;
}

.nav-links {
  display: flex;
  gap: 28px;
  margin-right: 8px;
}
.nav-links a {
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 160ms var(--ease);
}
.nav-links a:hover { color: var(--ink); }

/* ============================ hero ============================ */

.hero { padding: clamp(44px, 5.6vw, 72px) 0 clamp(56px, 6.4vw, 84px); }

.hero-in {
  display: grid;
  gap: clamp(44px, 5vw, 64px);
  align-items: center;
}

h1 {
  font-size: clamp(37px, 4.3vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  max-width: 17ch;
}

.lede {
  margin-top: 24px;
  max-width: 54ch;
  font-size: 18.5px;
  line-height: 1.58;
  color: var(--ink-2);
}

.capture {
  display: flex;
  gap: 10px;
  margin-top: 32px;
  max-width: 490px;
}
.capture input {
  flex: 1 1 auto;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  caret-color: var(--accent-deep);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.capture input::placeholder { color: var(--ink-3); }
.capture input:hover { border-color: var(--ink-3); }
.capture input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11, 18, 32, 0.09); }
.capture input[aria-invalid="true"] { border-color: #B4231C; }

.msg {
  min-height: 0;
  margin-top: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--accent-deep);
}
.msg:empty { margin-top: 0; }
.msg[data-state="error"] { color: #B4231C; }

.fineprint {
  margin-top: 14px;
  max-width: 48ch;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

/* ---------------------- the margin figure ---------------------- */

/* Unboxed on purpose. A 1px border round a white panel on a white ground is the
   card idiom this world refuses, and it buys no separation when the fill matches
   the page — space does the separating. */
.fig {
  margin: 0;
  padding: 0;
  background: none;
}

.fig-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 22px;
}
.fig-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.fig-tag {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
}

.plot { position: relative; }

/* Only the payoff sits above the bar; the baseline rides inside its own segment,
   so the two can never collide however narrow the figure gets. */
.marks { position: relative; height: 58px; }
.mark {
  position: absolute;
  bottom: 0;
  left: 100%;
  transform: translateX(-100%);
  padding-right: 11px;
  text-align: right;
  white-space: nowrap;
  line-height: 1.15;
}
.mark::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -6px;
  width: 1px;
  height: 22px;
  background: var(--ink-3);
}
/* Proportional figures, not tabular: at 36px a tabular decimal point takes a
   full digit width and prints "15 . 0%". The mark is pinned to the track's right
   edge, so the counter's anchor never moves while it runs. Tabular stays where it
   belongs — the axis and the money column. */
.mark-val {
  display: block;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.mark-lab { display: block; font-size: 13px; color: var(--ink-3); }

.track {
  position: relative;
  height: 64px;
  border-radius: 10px;
  background: var(--track);
  overflow: hidden;
}
.fill { display: flex; gap: 2px; height: 100%; }
.seg { display: flex; align-items: center; height: 100%; overflow: hidden; }
.seg-today {
  flex: 0 0 80%;
  background: var(--today);
  border-radius: 10px 0 0 10px;
  padding-left: 18px;
}
.seg-found {
  flex: 0 0 20%;
  background: var(--accent);
  border-radius: 0 10px 10px 0;
  justify-content: center;
}
/* Label colour is picked by the fill's luminance, not by brand habit: ink reads
   8.5:1 on the orange and 8.0:1 on the green, so one label colour clears both.
   These fills are light, so white would be unreadable on either. */
.seg-lab {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
  color: var(--ink);
}

.axis {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

.keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14.5px;
  color: var(--ink-2);
}
.keys li { display: flex; align-items: center; gap: 9px; }
.keys strong { color: var(--ink); font-weight: 600; }
.key { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.key-today { background: var(--today); }
.key-found { background: var(--accent); }

.fig-note {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-3);
  max-width: 62ch;
}

/* ============================ sections ============================ */

section > .wrap > h2 {
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.1;
  max-width: 18ch;
}

.how, .hides, .faq { padding: var(--sec-y) 0; }
/* Two white sections meeting doubles the gap. Halve the seam. */
.hides + .faq { padding-top: clamp(38px, 4.6vw, 64px); }
.band { padding: var(--sec-y) 0; background: var(--surface-2); border-block: 1px solid var(--line); }

/* ---------------------- steps ---------------------- */

.steps {
  margin: clamp(36px, 4vw, 52px) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.steps li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0 24px;
  padding: clamp(24px, 2.6vw, 32px) 0;
  border-bottom: 1px solid var(--line);
}
.step-n {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  padding-top: 2px;
}
.step-body h3 { font-size: 20px; letter-spacing: -0.02em; }
.step-body p {
  margin-top: 8px;
  max-width: 68ch;
  color: var(--ink-2);
  font-size: 16.5px;
}

/* ---------------------- terms table ---------------------- */

.terms {
  width: 100%;
  max-width: 820px;
  margin-top: clamp(32px, 4vw, 48px);
  border-collapse: collapse;
  font-size: 17px;
}
.terms tr { border-top: 1px solid var(--line-2); }
.terms tr:last-child { border-bottom: 1px solid var(--line-2); }
.terms th, .terms td { padding: 18px 0; text-align: left; vertical-align: baseline; }
.terms th { font-weight: 500; color: var(--ink-2); width: 46%; padding-right: 24px; }
/* No tabular figures here: these values are sentences, not an aligned numeric
   column, and tabular gives the full stops and commas a digit's width. */
.terms td { font-weight: 600; letter-spacing: -0.015em; }
.terms .hi th { color: var(--ink); font-weight: 600; }
/* Accent means margin gained. It is spent on the gain the client keeps, and
   never on our fee — the one row where green would mean the opposite. */
.terms .hi-gain td { color: var(--accent-deep); }

/* ---------------------- ledger ---------------------- */

/* Deliberately not another ruled row-list: three of those already run above it,
   and four identical textures in a row is one texture. */
.ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(30px, 3.6vw, 46px) clamp(40px, 5vw, 80px);
  margin: clamp(34px, 4vw, 50px) 0 0;
  max-width: 940px;
}
.ledger-row { display: block; }
.ledger dt {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 7px;
}
.ledger dd { margin: 0; color: var(--ink-2); font-size: 16.5px; max-width: 44ch; }

/* ---------------------- faq ---------------------- */

.faq-list {
  margin-top: clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--line);
}
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
  font-size: 18.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
  list-style: none;
  transition: color 160ms var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--ink-2); }

.ico { width: 20px; height: 20px; flex: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-linecap: round; fill: none; }
.ico-v { transition: transform 240ms var(--ease); transform-origin: 10px 10px; }
details[open] .ico-v { transform: scaleY(0); }

.ans {
  padding: 0 0 26px;
  max-width: 72ch;
}
.ans p { color: var(--ink-2); font-size: 16.5px; }
details[open] .ans { animation: ansIn 260ms var(--ease) both; }
@keyframes ansIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

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

.close {
  padding: var(--sec-y) 0;
  background: var(--dark);
  color: var(--on-dark);
}
.close-in {
  display: grid;
  gap: clamp(40px, 5vw, 72px);
  align-items: start;
}
.close-copy h2 {
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.1;
  max-width: 16ch;
}
.close-copy p {
  margin-top: 18px;
  max-width: 44ch;
  font-size: 17.5px;
  color: var(--on-dark-2);
}

.book-form { max-width: 520px; }
/* One field per line: name and company side by side made the form read as a
   grid of boxes rather than a short list of questions. */
.row { display: block; }
.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-dark-2);
}
.field input, .field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--on-dark-line);
  border-radius: var(--r-sm);
  background: var(--dark-2);
  color: var(--on-dark);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  caret-color: var(--accent-dark);
  resize: vertical;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--on-dark-2); }
.field input:hover, .field textarea:hover { border-color: rgba(242, 245, 249, 0.3); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(47, 224, 172, 0.18);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #FF8177; }

.close .btn { background: var(--on-dark); color: var(--ink); }
.close .btn:hover { background: #FFFFFF; }
.close :focus-visible { outline-color: var(--accent-dark); }

.msg-dark { color: var(--accent-dark); }
.msg-dark[data-state="error"] { color: #FF8177; }
.fineprint-dark { color: var(--on-dark-2); max-width: none; }
.fineprint-dark a { color: var(--on-dark); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

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

.foot { background: var(--dark); color: var(--on-dark-2); border-top: 1px solid var(--on-dark-line); }
.foot-in {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  justify-content: space-between;
  padding-block: 30px;
  font-size: 14.5px;
}
.foot-brand { color: var(--on-dark); font-weight: 600; letter-spacing: -0.015em; }
.foot a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.foot a:hover { color: var(--on-dark); }

/* ============================ the one authored moment ============================ */
/* The finished figure is the default. Script opts into the collapsed "ready" state
   only when it is actually going to animate, so a page without JS — or with JS that
   fails — still shows the accent and the correct numbers. */

.fig[data-anim="ready"] .seg-found { flex-basis: 0; }
.fig[data-anim="ready"] .seg-found .seg-lab { opacity: 0; }

.fig[data-anim="run"] .seg-found {
  flex-basis: 20%;
  transition: flex-basis 1100ms var(--ease-out) 120ms;
}
.fig[data-anim="run"] .seg-found .seg-lab {
  opacity: 1;
  transition: opacity 360ms var(--ease) 920ms;
}

/* ============================ responsive ============================ */

@media (min-width: 1040px) {
  .hero-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
  .close-in { grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr); }
}

@media (max-width: 1039px) {
  .hero-copy { max-width: 720px; }
  h1 { max-width: 17ch; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .ledger { grid-template-columns: 1fr; }
  .ledger dd { max-width: none; }
  .steps li { grid-template-columns: 34px 1fr; gap: 0 14px; }
  .terms th { width: 48%; }
}

@media (max-width: 620px) {
  body { font-size: 16.5px; }
  .capture { flex-direction: column; }
  .capture input, .capture .btn { width: 100%; }
  /* The 12 -> 15 arithmetic is the proof, so both numbers survive on a phone:
     the baseline rides inside the ink segment, the payoff stays above. */
  .track { height: 58px; }
  .marks { height: 48px; }
  .mark-val { font-size: 28px; }
  .seg-today { padding-left: 13px; }
  .seg-lab { font-size: 13px; }
  .keys { gap: 8px 20px; }
  .terms { font-size: 16px; }
  .terms th, .terms td { padding: 15px 0; }
  .foot-in { flex-direction: column; }
}

@media (max-width: 360px) {
  /* Below this the accent segment is ~56px and "+3.0 pts" would be clipped by
     the segment's own overflow. Measured, not guessed: the unit survives at
     390px, where the segment is 70px and the label ~48px. */
  .seg-found .unit { display: none; }
}

@media (max-width: 420px) {
  .terms tr { display: grid; grid-template-columns: 1fr; padding: 14px 0; }
  .terms th, .terms td { width: auto; padding: 0; }
  .terms th { margin-bottom: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fig[data-anim="ready"] .seg-found { flex-basis: 20%; }
  .fig[data-anim="ready"] .seg-found .seg-lab { opacity: 1; }
}
