/* Concourse Bench — landing page
   Design tokens measured from Figma file fkaAzrfv7eNYPsDDmxqlYH */

:root {
  --ink-900: #09090b;
  --ink-800: #18181b;
  --ink-700: #27272a;
  --ink-600: #3f3f46;
  --ink-400: #71717a;
  --ink-300: #a1a1aa;
  --line-200: #e4e4e7;
  --line-100: #ededee;
  --surface-50: #fafafa;
  --surface-100: #f4f4f5;
  --surface-warm: #faf9f9;
  --white: #ffffff;

  --accent-lime: #d6ff76;
  --accent-blue: #dbeafe;
  --accent-green: #dcfce7;
  --accent-red: #fee2e2;
  --accent-orange: #ffedd5;
  --shade-slate-300: #d1d5db;
  --shade-slate-200: #e2e8f0;

  --font-sans: "Nimbus Sans L", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --page: 1200px;
  --gutter: 24px;
  --nav-h: 64px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 150ms;
  --dur-base: 400ms;
  --dur-slow: 800ms;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html {
  scroll-padding-top: calc(var(--banner-h, 0px) + var(--nav-h) + 24px);
  scrollbar-gutter: stable;
}
html:has(dialog[open]) {
  overflow: hidden;
}
:focus-visible {
  outline: 2px solid var(--ink-700);
  outline-offset: 4px;
}
main {
  overflow-wrap: break-word;
}

body {
  --footer-curve: clamp(40px, 7vw, 100px);
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.01em;
  color: var(--ink-700);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: inherit;
}

/* ---------- layout primitives ---------- */

.wrap {
  width: 100%;
  max-width: calc(var(--page) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: 96px;
}
.section--tight {
  padding-block: 64px;
}
.section--alt {
  background: var(--surface-50);
}

.eyebrow {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0;
  color: var(--ink-400);
  margin: 0 0 12px;
}

.h1 {
  font-size: 50px;
  line-height: 54px;
  letter-spacing: -0.0432em;
  font-weight: 400;
  color: var(--ink-900);
  margin: 0 0 20px;
}

.h2 {
  font-size: 36px;
  line-height: 40px;
  letter-spacing: -0.02em;
  font-weight: 400;
  color: var(--ink-900);
  margin: 0 0 16px;
}

.h3 {
  font-size: 30px;
  line-height: 36px;
  letter-spacing: -0.02em;
  font-weight: 400;
  color: var(--ink-900);
  margin: 0 0 12px;
}

.h4 {
  font-size: 18px;
  line-height: 24px;
  letter-spacing: -0.02em;
  font-weight: 400;
  color: var(--ink-900);
  margin: 0 0 8px;
}

.lead {
  font-size: 16px;
  line-height: 25px;
  letter-spacing: -0.01em;
  color: var(--ink-400);
  margin: 0 0 24px;
  max-width: 68ch;
}

/* Section heading spans the recorded-buy image column. */
:is(.scrolly__head, .completion__head, .failures__head, #findings .wrap > .h2, #findings .wrap > .lead) {
  max-width: calc((100% - 40px) * 1.43 / 2.43);
}
:is(.scrolly__head, .completion__head, .failures__head) .lead { max-width: none; }
@media (max-width: 1024px) {
  :is(.scrolly__head, .completion__head, .failures__head, #findings .wrap > .h2, #findings .wrap > .lead) { max-width: none; }
}

.body {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-400);
  margin: 0 0 12px;
}
.meta {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0;
  color: var(--ink-400);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-block: 8px;
  padding-inline: 16px;
  border: 0;
  border-radius: 12px;
  background: var(--ink-700);
  color: var(--surface-50);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover {
  background: var(--ink-800);
}
.btn--ghost {
  background: transparent;
  color: var(--ink-900);
  box-shadow: inset 0 0 0 1px var(--line-200);
}
.btn--ghost:hover {
  background: var(--surface-100);
}

.card {
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: 12px;
  padding: 20px;
}

.shot {
  border: 1px solid var(--line-200);
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.04);
}

.grid {
  display: grid;
  gap: 24px;
}
.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: var(--banner-h, 0px);
  z-index: 50;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-200);
}
.nav__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  height: var(--nav-h);
}
.nav__brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-900);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav__links {
  display: flex;
  gap: 20px;
}
.nav__links a {
  font-size: 14px;
  color: var(--ink-700);
  text-decoration: none;
}
.nav__links a:hover {
  color: var(--ink-900);
}
.nav__actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

/* ---------- scrollytelling (shared by steps, recorded-buy, setup, commercial) ----------
   The whole section — title included — pins centred in the viewport while the page scrolls,
   and the stage advances one frame at a time. Track height scales with --frames. */

.scrolly {
  position: relative;
  padding-block: 64px;
}
.scrolly.is-pinned {
  height: calc(100svh + var(--frames, 4) * 55svh);
  padding-block: 0;
}

.scrolly__sticky {
  position: relative;
  top: 0;
  min-height: 0;
  display: grid;
  align-content: center;
  padding-block: 0;
}
.is-pinned .scrolly__sticky {
  position: sticky;
  height: 100svh;
  padding-block: calc(var(--banner-h, 0px) + var(--nav-h) + 16px) 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* Fits by construction: the body row takes whatever the heading leaves, so pinning never
   depends on measuring the panel mid-load (fonts, line masks, banner). Every track down to
   the image is minmax(0, 1fr) so percentages resolve and nothing grows past the viewport. */
.is-pinned .scrolly__sticky > .wrap {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: 100%;
}
.is-pinned .scrolly__body {
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
}

.scrolly__sticky > .wrap {
  position: relative;
}

.scrolly__head {
  margin-bottom: 32px;
}
.scrolly__head .lead {
  margin-bottom: 0;
}

.scrolly__body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.43fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}

.scrolly__frames {
  position: relative;
  min-width: 0;
}
.scrolly__body > * {
  min-width: 0;
}

/* Scroll indicator — 437:46079: 1px track with a 2px thumb marking progress. */
.scrolly__rail {
  position: absolute;
  top: 0;
  bottom: 0;
  right: -12px;
  width: 1px;
  background: var(--line-200);
}
.scrolly__thumb {
  position: absolute;
  left: -1px;
  top: 0;
  width: 3px;
  border-radius: 20px;
  background: var(--ink-700);
  transition: transform 500ms var(--ease-spring);
}

.scrolly__frame {
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 450ms var(--ease-out), transform 450ms var(--ease-out), filter 450ms var(--ease-out), visibility 450ms;
}
.is-pinned .scrolly__frames {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}
/* Frames already passed lift out; frames still ahead wait below, so direction flips when scrolling back. */
.is-pinned .scrolly__frame {
  grid-area: 1 / 1;
  min-width: 0;
  transform: translateY(-12px) scale(0.98);
  filter: blur(4px);
  will-change: transform, opacity, filter;
}
.is-pinned .scrolly__frame.is-active ~ .scrolly__frame:not(.is-active) {
  transform: translateY(16px) scale(0.98);
}
.scrolly__frame.is-active,
.is-pinned .scrolly__frame.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  filter: none;
}

/* Progressive enhancement: all steps remain readable without pinning or JavaScript. */
.scrolly:not(.is-pinned) .scrolly__body {
  grid-template-columns: minmax(0, 1fr);
}
.scrolly:not(.is-pinned) .scrolly__frames {
  display: grid;
  gap: 24px;
}
.scrolly:not(.is-pinned) .scrolly__frame {
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
}
.scrolly:not(.is-pinned) .scrolly__rail {
  display: none;
}
.scrolly:not(.is-pinned) .scrolly__legend {
  display: none;
}

.scrolly__legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.scrolly__legend li {
  padding: 10px 0 10px 16px;
  border-left: 2px solid var(--line-200);
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-300);
  transition: color 0.25s ease, border-color 0.25s ease;
}
.scrolly__legend li.is-active {
  color: var(--ink-900);
  border-left-color: var(--ink-900);
}

@media (max-width: 1024px) {
  .scrolly__body {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .scrolly__legend {
    display: none;
  }
  .scrolly__rail {
    display: none;
  }
}

/* No pinning without motion: everything stacks and every frame is shown. */
@media (prefers-reduced-motion: reduce) {
  .scrolly {
    height: auto;
  }
  .scrolly__sticky {
    position: static;
    min-height: 0;
    padding-top: 0;
  }
  .scrolly__body {
    grid-template-columns: minmax(0, 1fr);
  }
  .scrolly__frames {
    display: grid;
    gap: 24px;
  }
  .scrolly__frame {
    opacity: 1;
    transform: none;
  }
  .scrolly__frame:not(:first-child) {
    position: static;
  }
  .scrolly__legend {
    display: flex;
    margin-top: 24px;
  }
  .scrolly__legend li {
    color: var(--ink-700);
  }
  .scrolly__rail {
    display: none;
  }
}

/* ---------- enter animations ----------
   [data-reveal] fades one element up; [data-reveal-stagger] staggers its direct children.
   Only active with JS (html.js) so content stays visible without it. --d is the stagger index. */

.js [data-reveal],
.js [data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s ease, transform 1s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js [data-reveal="scale"],
.js [data-reveal-stagger="scale"] > * {
  transform: translateY(22px) scale(0.975);
}
[data-count] { font-variant-numeric: tabular-nums; }

/* Title line masks: each .line clips its inner span, which rises into place. */
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}
.line > span { display: inline-block; }
.js [data-reveal="lines"] {
  opacity: 1;
  transform: none;
}
.js [data-reveal="lines"] .line > span {
  transform: translateY(110%);
  transition: transform 700ms var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms + var(--l, 0) * 80ms);
}
.js [data-reveal="lines"].is-in .line > span { transform: none; }

.js [data-reveal].is-in,
.js [data-reveal-stagger].is-in > * {
  opacity: 1;
  transform: none;
}

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nav__links {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --gutter: 20px;
  }
  .section {
    padding-block: 56px;
  }
  .section--tight {
    padding-block: 40px;
  }
  .h1 {
    font-size: 34px;
    line-height: 38px;
  }
  .h2 {
    font-size: 28px;
    line-height: 32px;
  }
  .h3 {
    font-size: 24px;
    line-height: 30px;
  }
  .lead {
    font-size: 15px;
    line-height: 23px;
  }
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: minmax(0, 1fr);
  }
  .nav__links {
    display: none;
  }
  .nav__inner {
    gap: 12px;
  }
  .scrolly {
    padding-block: 56px;
  }
}

/* Big card shapes: the image lives on ::before (set via --shape-bg) so it can drift
   without moving the card content. The 12px bleed + content-box origin keeps the
   original background-position/size exact while hiding the edges during motion. */
.shape-drift {
  position: relative;
  isolation: isolate;
}
.shape-drift::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  padding: 12px;
  background: var(--shape-bg);
  background-origin: content-box;
  animation: shape-drift 14s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shape-drift {
  0%, 100% { transform: translate(0, 0) rotate(0) scale(1); }
  25% { transform: translate(3px, -2px) rotate(0.004rad) scale(1.006); }
  50% { transform: translate(-2px, 2px) rotate(-0.003rad) scale(0.997); }
  75% { transform: translate(2px, 1px) rotate(0.002rad) scale(1.004); }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .shape-drift::before { animation: none; }
  .js [data-reveal],
  .js [data-reveal-stagger] > * {
    opacity: 1;
    transform: none;
  }
  .js [data-reveal="lines"] .line > span { transform: none; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ===== nav ===== */
/* nav — shared rules (.nav, .nav__inner, .nav__brand, .nav__links, .nav__actions) live in styles.css. */
@property --banner-h { syntax: "<length>"; inherits: true; initial-value: 0px; }
:root:has(#banner) { --banner-h: 36px; }
/* Transition only on close: on load it would animate 0 -> 36px under layout that is measured at startup (pinned scrolly). */
:root:has(#banner.is-closing) { --banner-h: 0px; transition: --banner-h 300ms var(--ease-out); }
.banner { height: var(--banner-h); overflow: hidden; position: sticky; top: 0; z-index: 51; background: var(--accent-lime); color: var(--ink-900); border-bottom: 1px solid var(--line-200); }
.banner__inner { position: relative; display: flex; align-items: center; justify-content: center; height: 35px; }
@media (max-width: 499px) {
  .banner__lead { display: none; }
  .banner .banner__text { font-size: 13px; }
}
@media (max-width: 359px) {
  :root:has(#banner) { --banner-h: 56px; }
  .banner__inner { height: 55px; }
}
.banner__text { margin: 0; padding-inline: 32px; font-size: 14px; line-height: 20px; text-align: center; text-wrap: balance; }
.banner__text { display: grid; place-items: center; }
.banner__text > * { grid-area: 1 / 1; }
.banner__msg--a { animation: banner-a 10s ease-in-out infinite; }
.banner__msg--b { animation: banner-b 10s ease-in-out infinite; opacity: 0; }
@keyframes banner-a {
  0%, 45% { opacity: 1; transform: none; filter: none; }
  50% { opacity: 0; transform: translateY(-8px); filter: blur(3px); }
  95% { opacity: 0; transform: translateY(8px); filter: blur(3px); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes banner-b {
  0%, 45% { opacity: 0; transform: translateY(8px); filter: blur(3px); }
  50%, 95% { opacity: 1; transform: none; filter: none; }
  100% { opacity: 0; transform: translateY(-8px); filter: blur(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .banner__msg--a { animation: none; }
  .banner__msg--b { display: none; }
}
.banner__close { position: absolute; right: var(--gutter); display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink-900); cursor: pointer; }
.banner__close:hover { background: rgba(0, 0, 0, 0.06); }
.nav__links { position: relative; }
.nav__links a.is-active { color: var(--ink-900); }
.nav__ind { position: absolute; left: 0; top: calc(50% + var(--nav-h) / 2 - 2px); width: var(--w, 0px); height: 2px; background: var(--ink-900); transform: translateX(var(--x, 0px)); opacity: 0; transition: transform 400ms var(--ease-out), width 400ms var(--ease-out), opacity 200ms; pointer-events: none; }
.nav__links.has-active .nav__ind { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .nav__ind { transition: opacity 200ms; } }
.nav__menu { display: none; }
@media (max-width: 1024px) {
  .nav__inner { grid-template-columns: 1fr auto; gap: 8px; }
  .nav__inner > .nav__actions { display: none; }
  .nav__menu { display: block; grid-column: 2; }
  .nav__menu summary { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; color: var(--ink-900); cursor: pointer; list-style: none; }
  .nav__menu summary::-webkit-details-marker { display: none; }
  .nav__menu-icon path { transform-box: fill-box; transform-origin: center; }
  @media (prefers-reduced-motion: no-preference) { .nav__menu-icon path { transition: transform 250ms var(--ease-out); } }
  .nav__menu[open] .nav__menu-icon path:first-child { transform: translateY(3px) rotate(45deg); }
  .nav__menu[open] .nav__menu-icon path:last-child { transform: translateY(-3px) rotate(-45deg); }
  .nav__menu summary:hover, .nav__menu[open] summary { background: var(--surface-100); }
  .nav__menu-panel { position: absolute; top: 100%; left: 0; right: 0; display: flex; flex-direction: column; padding: 8px var(--gutter) 16px; background: var(--white); border-bottom: 1px solid var(--line-200); }
  .nav__menu-panel .nav__actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }
  .nav__menu-panel .btn { justify-content: center; padding-block: 12px; }
  .nav__menu-panel > a { padding-block: 12px; font-size: 15px; color: var(--ink-700); text-decoration: none; }
  .nav__menu-panel > a:hover { color: var(--ink-900); }
}

/* Page load sequence (motion plan 3.4): nav fades in first, once fonts are ready. */
.js .nav { opacity: 0; transition: opacity 300ms var(--ease-out); }
.js.is-ready .nav { opacity: 1; }

/* ===== hero ===== */
#hero .hero__intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  max-width: 736px;
}
#hero .hero__intro .eyebrow,
#hero .hero__intro .lead {
  margin-bottom: 0;
}
#hero .hero__intro .h1 { margin-bottom: 0; }
#hero .hero__intro .lead { max-width: 600px; color: var(--ink-600); }
#hero .hero__ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

/* 462:53692 "Simplified" — 1200×596. */
#hero .hero__stage {
  position: relative;
  height: 596px;
  margin-top: 42px;
  --shape-bg: url("assets/shapes/hero-shape.webp") 45% 42% / 110% auto no-repeat;
  background: var(--surface-warm);
  box-shadow: inset 0 0 0 1px var(--line-200);
  border-radius: 18px;
  overflow: hidden;
}
/* 462:53825 trace-card — 516×468 at 342,64 inside the stage. */
#hero .trace {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 64px;
  width: 516px;
}

/* Intro entrance matches alkimi.org-v2: whole blocks fade, rise and settle; no line split, so no flash. */
.js #hero .hero__intro > * {
  transform: translateY(18px) scale(0.99);
  transition: opacity 480ms ease-out, transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--d, 0) * 100ms);
}
.js #hero .hero__intro.is-in > * { transform: none; }

/* Page load sequence (motion plan 3.4). Hand-timed delays only while html.is-intro is set,
   so a hero revealed later by scrolling uses the normal stagger. */
.is-intro #hero .hero__intro .eyebrow { transition-delay: 150ms; }
.is-intro #hero .hero__intro .h1 { transition-delay: 250ms; }
.is-intro #hero .hero__intro .lead { transition-delay: 550ms; }
.is-intro #hero .hero__ctas { transition-delay: 650ms; }
.is-intro #hero .hero__stage { transition-delay: 700ms; }
.is-intro #hero .hero__answer > * { transition-delay: calc(1200ms + var(--d, 0) * 90ms); }

#hero .hero__answer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 40px;
}
#hero .hero__answer .h2,
#hero .hero__answer .lead { margin: 0; }
#hero .hero__answer .lead { color: var(--ink-600); }
#hero .br-mobile { display: none; }

@media (max-width: 768px) {
  #hero .hero__intro { gap: 16px; }
  #hero .hero__intro .h1 { font-size: 30px; line-height: 30px; letter-spacing: -0.02em; }
  #hero .br-mobile { display: inline; }
  #hero .hero__intro .lead { font-size: 14px; line-height: 20px; color: var(--ink-800); }
  #hero .hero__stage { height: auto; margin-top: 32px; padding: 20px; }
  #hero .hero__stage::before { background-size: 150% auto; }
  #hero .trace { position: static; width: 100%; transform: none; }
  #hero .trace__row:not(:nth-last-of-type(-n+2)) { display: none; }
  #hero .hero__answer { grid-template-columns: 1fr; gap: 12px; margin-top: 32px; }
  #hero .hero__answer .h2 { font-size: 30px; line-height: 36px; }
}


/* ---- trace-card (462:53825). Shared shape; reused by other stages. ---- */

.trace {
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line-200), 0 28px 56px -13px rgba(0, 0, 0, 0.25);
  border-radius: 18px;
  overflow: hidden;
}

.trace__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 13.5px 18px;
  box-shadow: inset 0 -1px 0 var(--line-100);
}
.trace__badge {
  padding: 3px 6px;
  border-radius: 8px;
  background: #fef9c3;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0;
  color: var(--ink-700);
}
.trace__sub {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0;
  color: var(--ink-400);
}

.trace__row {
  display: flex;
  align-items: flex-start;
  gap: 13.5px;
  padding: 13.5px 18px;
  box-shadow: inset 0 -1px 0 var(--line-100);
}
.trace__row--last { background: #f6f6f5; box-shadow: none; }

.trace__avatar {
  flex: none;
  width: 27px;
  height: 27px;
  background: center / contain no-repeat;
}
.trace__avatar--buyer { background-image: url("assets/shapes/avatar-buyer.webp"); }
.trace__avatar--seller { background-image: url("assets/shapes/avatar-seller.webp"); }

.trace__text { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 3.365px; }
.trace__who { margin: 0; font-size: 12px; line-height: 16px; letter-spacing: 0; color: var(--ink-400); }
.trace__what { margin: 0; font-size: 14px; line-height: 20px; letter-spacing: -0.01em; color: var(--ink-600); }

.trace__amt { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2.243px; }
.trace__value { margin: 0; font-size: 16px; line-height: 20px; letter-spacing: -0.01em; color: var(--ink-900); white-space: nowrap; }
.trace__kind { margin: 0; font-size: 12px; line-height: 16px; letter-spacing: 0; color: var(--ink-300); }

.trace__foot {
  display: flex;
  flex-direction: column;
  gap: 6.73px;
  padding: 13.5px 18px 15.7px;
  box-shadow: inset 0 1px 0 var(--line-100);
}
.trace__kv { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.trace__kv span { font-size: 12px; line-height: 16px; letter-spacing: 0; }
.trace__kv span:first-child { color: var(--ink-400); }
.trace__kv span:last-child { color: var(--ink-900); }

/* Hero negotiation sequence. .is-staged is set by the hero script, so no-JS and reduced motion stay static. */
.trace__value { font-variant-numeric: tabular-nums; text-align: right; }
.trace.is-staged .trace__amt { perspective: 400px; }
.trace.is-staged .trace__row {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}
.trace.is-staged .trace__kind {
  opacity: 0;
  transform: rotateX(-90deg);
  transform-origin: 50% 0;
  transition: opacity 300ms var(--ease-out), transform 500ms var(--ease-out);
}
.trace.is-staged .trace__kv span:last-child { opacity: 0; transition: opacity var(--dur-slow) var(--ease-out); }
.trace.is-staged .trace__row.is-on { opacity: 1; transform: none; }
.trace.is-staged .is-on .trace__kind { opacity: 1; transform: none; transition-delay: 500ms; }
.trace.is-staged .trace__row--last.is-on .trace__kind { animation: lime-pulse 900ms 700ms var(--ease-out); }
.trace.is-done .trace__kv span:last-child { opacity: 1; }
.trace.is-done .trace__kv + .trace__kv span:last-child { transition-delay: 150ms; }

@keyframes lime-pulse {
  30% { background: var(--accent-lime); box-shadow: 0 0 0 4px var(--accent-lime); color: var(--ink-900); border-radius: 2px; }
}

@media (max-width: 480px) {
  .trace__row { display: grid; grid-template-columns: 27px minmax(0, 1fr); gap: 8px; padding: 12px; }
  .trace__amt { grid-column: 2; flex-direction: row; align-items: baseline; gap: 8px; }
  .trace__head, .trace__foot { padding: 12px; }
  .trace__kv { align-items: flex-start; }
  .trace__kv span:last-child { text-align: right; }
}

/* ===== recorded-buy ===== */
#recorded-buy .rb {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
#recorded-buy .rb__head .h2 { margin: 0; max-width: 460px; }
#recorded-buy .rb__intro { margin: 0 0 20px; font-size: 14px; line-height: 20px; color: var(--ink-600); }

#recorded-buy .rb__stage {
  display: grid;
  place-items: center;
  padding: 56px 40px;
  border-radius: 18px;
  --shape-bg: url("assets/shapes/recorded-buy-shape.webp") center top -20px / 118% auto no-repeat;
  background: var(--surface-warm);
  box-shadow: inset 0 0 0 1px var(--line-200);
  overflow: hidden;
}

#recorded-buy .rb__card {
  width: 100%;
  max-width: 460px;
  margin: 0;
  padding: 24px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line-200), 0 28px 56px -13px rgba(0, 0, 0, 0.25);
}
#recorded-buy .rb__shape { width: 72px; height: 72px; margin: -4px 0 20px -4px; }
#recorded-buy .rb__label { margin: 0 0 8px; font-size: 12px; line-height: 16px; letter-spacing: 0; color: var(--ink-400); }

#recorded-buy .rb__table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 18px; }
#recorded-buy .rb__table :is(th, td) { padding: 7px 0; font-weight: 400; text-align: left; color: var(--ink-400); }
#recorded-buy .rb__table td { padding-left: 12px; text-align: right; }
#recorded-buy .rb__strong :is(th, td) { color: var(--ink-900); }

#recorded-buy .rb__tiles {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-900);
}
#recorded-buy .rb__tile { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 10px; background: var(--surface-100); }
#recorded-buy .rb__tile-label { font-size: 11px; line-height: 14px; letter-spacing: 0; color: var(--ink-300); }
#recorded-buy .rb__muted { color: var(--ink-400); }
#recorded-buy .rb__note { margin: 16px 0 0; font-size: 11px; line-height: 16px; letter-spacing: 0; color: var(--ink-300); }

#recorded-buy .rb__terms {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 40px;
}
#recorded-buy .rb__term img { width: 56px; height: 56px; margin-bottom: 16px; }
#recorded-buy .rb__term-title { margin: 0 0 12px; font-size: 20px; line-height: 26px; letter-spacing: -0.02em; font-weight: 400; color: var(--ink-900); }
#recorded-buy .rb__term p { margin: 0; color: var(--ink-600); }

@media (max-width: 1024px) {
  #recorded-buy .rb { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 480px) {
  #recorded-buy .rb__stage { padding: 20px; }
  #recorded-buy .rb__card { padding: 16px; }
  #recorded-buy .rb__terms { grid-template-columns: 1fr; gap: 28px; }
}

/* ===== benchmark ===== */
#benchmark .benchmark {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
#benchmark .h2 { margin: 0; max-width: 320px; }
#benchmark .benchmark__body { display: flex; flex-direction: column; gap: 20px; color: var(--ink-600); }
#benchmark .benchmark__body p { margin: 0; }

@media (max-width: 1024px) {
  #benchmark .benchmark { grid-template-columns: 1fr; gap: 16px; }
}

/* ===== completion ===== */
#completion .completion {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
#completion .completion > .completion__head { max-width: none; }
#completion .completion__head .h2 { margin: 0; max-width: 400px; }
#completion .completion__copy { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; color: var(--ink-600); }
#completion .completion__copy p { margin: 0; }

#completion .completion__stage {
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px 46px;
  border-radius: 18px;
  --shape-bg: url("assets/shapes/completion-shape.webp") left -180px top -30px / 1000px auto no-repeat;
  background: var(--surface-warm);
  box-shadow: inset 0 0 0 1px var(--line-200);
  overflow: hidden;
}

#completion .completion__card {
  width: 100%;
  max-width: 440px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line-200), 0 28px 56px -13px rgba(0, 0, 0, 0.25);
  letter-spacing: 0;
  color: var(--ink-900);
}

#completion .completion__matrix {
  border-collapse: separate;
  border-spacing: 6px 8px;
  margin: -8px -6px 0;
  width: calc(100% + 12px);
  table-layout: fixed;
  font-size: 11px;
  line-height: 16px;
}
#completion .completion__matrix caption { padding: 0 6px 4px; font-size: 11px; line-height: 16px; color: var(--ink-400); text-align: left; }
#completion .completion__matrix th { font-weight: 400; text-align: left; }
#completion .completion__matrix thead th { vertical-align: bottom; color: var(--ink-400); }
#completion .completion__matrix thead th:first-child { width: 96px; vertical-align: top; }
#completion .completion__matrix thead th + th { text-align: center; color: var(--ink-600); }
#completion .completion__sub { display: block; font-size: 8px; line-height: 10px; color: var(--ink-400); white-space: nowrap; }

#completion .completion__matrix tbody th { font-size: 13px; line-height: 20px; white-space: nowrap; }
#completion .completion__matrix tbody th img {
  display: inline-block;
  vertical-align: middle;
  margin-right: 12px;
  box-sizing: content-box;
  padding: 5px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line-200);
}
#completion .completion__matrix tbody + tbody tr:first-child > * { padding-top: 4px; }

#completion .completion__matrix td { height: 28px; border-radius: 6px; text-align: center; font-variant-numeric: tabular-nums; }
#completion .completion__matrix td[data-n="3"] { background: var(--ink-700); color: var(--white); }
#completion .completion__matrix td[data-n="2"] { background: var(--shade-slate-300); }
#completion .completion__matrix td[data-n="1"] { background: var(--shade-slate-200); }

#completion .completion__note { margin: 4px 0 0; font-size: 10px; line-height: 14px; color: var(--ink-400); }

@media (max-width: 1024px) {
  #completion .completion { grid-template-columns: 1fr; gap: 24px; }
}

/* Findings' mobile table: logos drop, sublabels wrap, zero cells get an outline. */
@media (max-width: 480px) {
  #completion .completion__stage { padding: 20px; }
  #completion .completion__card { padding: 16px; }
  #completion .completion__matrix { border-spacing: 4px 6px; margin: -6px -4px 0; width: calc(100% + 8px); }
  #completion .completion__matrix caption { padding-inline: 4px; }
  #completion .completion__matrix thead th:first-child { width: 25%; }
  #completion .completion__sub { white-space: normal; }
  #completion .completion__matrix tbody th img { display: none; }
  #completion .completion__matrix td[data-n="0"] { box-shadow: inset 0 0 0 1px var(--line-200); }
}

/* ===== protection ===== */
#protection .protection {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
#protection .protection > .protection__head { max-width: none; }
#protection .protection__head .h2 { margin: 0; max-width: 440px; }
#protection .protection__copy { margin-bottom: 20px; color: var(--ink-600); }
#protection .protection__copy p { margin: 0; }

#protection .protection__stage {
  display: grid;
  place-items: center;
  margin: 0;
  padding: 26px 70px;
  border-radius: 18px;
  --shape-bg: url("assets/shapes/protection-shape.webp") center top 40px / 1100px auto no-repeat;
  background: var(--surface-warm);
  box-shadow: inset 0 0 0 1px var(--line-200);
  overflow: hidden;
}

#protection .protection__card {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 30px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line-200), 0 28px 56px -13px rgba(0, 0, 0, 0.25);
  letter-spacing: 0;
  color: var(--ink-900);
}

#protection .protection__title { font-size: 14px; line-height: 20px; }

#protection .protection__donut { display: block; width: 230px; max-width: 100%; margin: auto; padding-block: 12px; box-sizing: content-box; }
#protection .protection__ring { fill: none; stroke-width: 7; }
#protection .protection__ring--high { stroke: var(--line-200); }
#protection .protection__ring--low {
  stroke: var(--ink-700);
  transition: stroke-dashoffset 900ms var(--ease-out) 300ms;
}
.js #protection .protection__stage:not(.is-in) .protection__ring--low { stroke-dashoffset: 95; }

#protection .protection__legend { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 20px; }
#protection .protection__legend li { display: flex; align-items: center; gap: 12px; }
#protection .protection__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
#protection .protection__dot--high { background: var(--line-200); }
#protection .protection__dot--low { background: var(--ink-700); }

#protection .protection__note { margin: 14px 0 0; font-size: 13px; line-height: 18px; color: var(--ink-400); }

@media (max-width: 1024px) {
  #protection .protection { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

@media (max-width: 480px) {
  #protection .protection__stage { padding: 20px; }
  #protection .protection__stage::before { background-size: 700px auto; }
  #protection .protection__card { padding: 20px; aspect-ratio: auto; }
}

/* ===== pricing ===== */
#pricing .pricing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
#pricing .pricing > .pricing__head { max-width: none; }
#pricing .pricing__head .h2 { margin: 0; max-width: 400px; }
#pricing .pricing__copy { margin: 0 0 48px; color: var(--ink-600); }
#pricing .pricing__limit-text {
  margin: 0;
  font-size: 24px;
  line-height: 34px;
  letter-spacing: -0.01em;
  color: var(--ink-700);
}

@media (max-width: 1024px) {
  #pricing .pricing { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 480px) {
  #pricing .pricing__copy { margin-bottom: 32px; }
  #pricing .pricing__limit-text { font-size: 20px; line-height: 28px; }
}

/* ===== shortfall ===== */
#shortfall .shortfall {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
#shortfall .h2 { margin: 0; max-width: 400px; }
#shortfall .shortfall__body { display: flex; flex-direction: column; gap: 48px; color: var(--ink-600); }
#shortfall .shortfall__body p { margin: 0; }
#shortfall .shortfall__example { margin: 0; }
#shortfall .shortfall__example p { font-size: 24px; line-height: 32px; letter-spacing: -0.02em; }

@media (max-width: 1024px) {
  #shortfall .shortfall { grid-template-columns: 1fr; gap: 16px; }
  #shortfall .shortfall__body { gap: 32px; }
}

@media (max-width: 480px) {
  #shortfall .shortfall__example p { font-size: 20px; line-height: 28px; }
}

/* ===== cost ===== */
#cost .cost {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
#cost .cost > .cost__head { max-width: none; }
#cost .cost__head .h2 { margin: 0; max-width: 400px; }
#cost .cost__copy { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; color: var(--ink-600); }
#cost .cost__copy p { margin: 0; }

#cost .cost__tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  box-shadow: inset 0 -1px 0 var(--line-200);
}
#cost .cost__tabs button {
  padding: 4px 4px 6px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--ink-400);
  cursor: pointer;
  transition: color var(--dur-fast), box-shadow var(--dur-fast);
}
#cost .cost__tabs button:hover { color: var(--ink-900); }
#cost .cost__tabs [aria-selected="true"] { color: var(--ink-900); box-shadow: inset 0 -2px 0 var(--ink-900); }
#cost .cost__tabs button:focus-visible { outline: 2px solid var(--ink-900); outline-offset: 2px; border-radius: 4px; }

#cost .cost__stage {
  display: grid;
  place-items: center;
  padding: 24px 54px;
  border-radius: 18px;
  --shape-bg: url("assets/shapes/cost-shape.webp") center top 90px / 900px auto no-repeat;
  background: var(--surface-warm);
  box-shadow: inset 0 0 0 1px var(--line-200);
  overflow: hidden;
}

#cost .cost__card {
  width: 100%;
  max-width: 452px;
  margin: 0;
  padding: 18px 18px 8px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line-200), 0 28px 56px -13px rgba(0, 0, 0, 0.25);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0;
  color: var(--ink-400);
}
#cost .cost__bars { width: 100%; border-collapse: collapse; }
#cost .cost__bars caption { text-align: left; }
#cost .cost__card :is(th, td) {
  height: 48px;
  padding: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#cost .cost__card th {
  width: 100px;
  font-size: 12px;
  font-weight: 400;
  text-align: left;
  color: var(--ink-900);
}
#cost .cost__card th img {
  display: inline-block;
  vertical-align: middle;
  margin-right: 12px;
  box-sizing: content-box;
  padding: 5px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line-200);
}
#cost .cost__card td:last-child { width: 7ch; padding-left: 10px; }

#cost .cost__track span {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--line-100);
}
#cost .cost__track :is(i, svg) {
  display: block;
  width: calc(var(--v) * 100%);
  height: 100%;
  border-radius: inherit;
  background: var(--ink-900);
  transform-origin: left;
  transition: transform 900ms var(--ease-out);
  transition-delay: calc(var(--i) * 60ms + 300ms);
}
#cost .cost__track svg { min-width: 6px; overflow: visible; background: none; }
#cost .cost__track rect {
  fill: var(--white);
  stroke: var(--ink-900);
  stroke-dasharray: 1;
  transition: stroke-dashoffset 900ms var(--ease-out);
  transition-delay: inherit;
}
#cost .is-reset .cost__track :is(i, rect) { transition: none; }
.js #cost .cost__stage:not(.is-in) .cost__track i,
#cost .is-reset .cost__track i { transform: scaleX(0); }
.js #cost .cost__stage:not(.is-in) .cost__track rect,
#cost .is-reset .cost__track rect { stroke-dashoffset: 1; }

@media (max-width: 1024px) {
  #cost .cost { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 480px) {
  #cost .cost__stage { padding: 20px; }
  #cost .cost__stage::before { background-size: 640px auto; }
  #cost .cost__card { padding: 16px 14px 6px; }
  #cost .cost__card th { width: 84px; }
  #cost .cost__card th img { margin-right: 8px; }
  #cost .cost__card :is(th, td) { height: 42px; }
}

/* ===== next ===== */
#next .next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
#next .h2 { margin: 0; max-width: 320px; }
#next .next__body { display: flex; flex-direction: column; gap: 20px; color: var(--ink-600); }
#next .next__body p { margin: 0; }
#next .next__subhead { margin: 0; font: inherit; color: var(--ink-900); }
#next .next__list { display: flex; flex-direction: column; gap: 40px; margin: 20px 0 0; padding: 0; list-style: none; }
#next .next__list img { display: block; width: 64px; height: 64px; margin-bottom: 16px; }
#next .next__list .eyebrow { margin-bottom: 12px; }

@media (max-width: 1024px) {
  #next .next { grid-template-columns: 1fr; gap: 16px; }
}

/* ===== faq ===== */
/* Line sits where the section would end; the gap below is the next section's top padding. */
#faq { padding-bottom: 0; }
#faq .faq {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  padding-bottom: 96px;
  border-bottom: 1px solid var(--line-100);
}
#faq .h2 { margin: 0; max-width: 320px; }

#faq .faq__item { padding-block: 20px; }
#faq .faq__item + .faq__item { border-top: 1px solid var(--line-100); }
#faq .faq__item:first-child { padding-top: 0; }

#faq summary { cursor: pointer; list-style: none; }
#faq summary::-webkit-details-marker { display: none; }
#faq summary:focus-visible { outline: 2px solid var(--ink-900); outline-offset: 4px; }

#faq .faq__question {
  font-size: 22px;
  line-height: 28px;
  letter-spacing: -0.02em;
  font-weight: 400;
  color: var(--ink-900);
  margin: 0;
}

#faq .faq__answer {
  font-size: 14px;
  line-height: 24px;
  letter-spacing: -0.01em;
  color: var(--ink-600);
  margin: 0;
  padding-top: 12px;
}

/* interpolate-size lets height animate to auto; unsupported browsers open instantly. */
#faq .faq__item { interpolate-size: allow-keywords; }
#faq .faq__item::details-content {
  height: 0;
  overflow: clip;
  transition: height 350ms var(--ease-out), content-visibility 350ms allow-discrete;
}
#faq .faq__item[open]::details-content { height: auto; }

@media (prefers-reduced-motion: reduce) {
  #faq .faq__item::details-content { transition: none; }
}

@media (max-width: 1024px) {
  #faq .faq { grid-template-columns: 1fr; gap: 16px; }
  #faq .faq__question { font-size: 18px; line-height: 24px; }
}

@media (max-width: 768px) {
  #faq .faq { padding-bottom: 56px; }
}

/* ===== campaign-preview ===== */
#campaign-preview .campaign-preview__grid {
  display: flex;
  align-items: center;
  gap: 40px;
}

#campaign-preview .campaign-preview__intro {
  flex: 1 1 42%;
  max-width: 476px;
}

#campaign-preview .campaign-preview__intro .h2 { margin-bottom: 20px; }

#campaign-preview .campaign-preview__shot {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  place-items: center;
  padding-block: 100px;
  --shape-bg: url("assets/shapes/findings-shape.webp") center / 640px auto no-repeat;
}

#campaign-preview .campaign-preview__form {
  width: 100%;
  max-width: 452px;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px var(--line-200),
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#campaign-preview .campaign-preview__form .cm__submit { width: auto; align-self: flex-start; }

@media (max-width: 1024px) {
  #campaign-preview .campaign-preview__grid { flex-direction: column; align-items: stretch; }
  #campaign-preview .campaign-preview__intro { flex-basis: auto; max-width: none; }
}

@media (max-width: 768px) {
  #campaign-preview .campaign-preview__shot {
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    overflow-x: clip;
  }
  #campaign-preview .campaign-preview__shot::before { background-position: center 20px; background-size: 115% auto; }
  #campaign-preview .campaign-preview__form { width: 88%; }
  #campaign-preview .campaign-preview__form .cm__submit { width: 100%; align-self: stretch; }
}

#campaign-preview {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: 0 0 var(--arch) var(--arch);
}

/* Corners round as the footer is uncovered, with a back-ease that overshoots and settles.
   ponytail: 0.7 is where the rounding finishes, tuned by eye; retune if the footer height changes a lot. */
body {
  --arch-t: min(1, var(--reveal, 1) / 0.7);
  --arch-o: calc(var(--arch-t) - 1);
  --arch: calc((1 + 3.5 * var(--arch-o) * var(--arch-o) * var(--arch-o) + 2.5 * var(--arch-o) * var(--arch-o)) * var(--footer-curve));
}

/* ===== footer ===== */
#footer {
  margin-top: calc(-1 * var(--footer-curve));
  padding-top: calc(64px + var(--footer-curve));
  padding-bottom: 40px;
  background: var(--accent-lime);
  color: var(--ink-900);
}

#footer .footer__top { margin-bottom: 32px; }

#footer .footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#footer .footer__cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px;
  padding-bottom: 40px;
}

#footer .footer__intro {
  margin: 0;
  max-width: 280px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-900);
}

#footer .footer__col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#footer .footer__label {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: var(--ink-900);
}

#footer .footer__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#footer .footer__link {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-900);
  opacity: 0.6;
  text-decoration: none;
  text-underline-offset: 4px;
}

#footer a.footer__link[href]:hover {
  opacity: 1;
  text-decoration: underline;
}

#footer .footer__bottom { padding-top: 24px; }

#footer .footer__copyright {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--ink-700);
}

@media (max-width: 1024px) {
  #footer .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  #footer .footer__intro { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  #footer .footer__cols { grid-template-columns: minmax(0, 1fr); }
}

/* Curtain reveal: page content lifts off a footer pinned to the viewport bottom.
   JS adds .is-curtain only when the footer fits the viewport and motion is allowed. */
:where(main > section:not(#footer)) {
  position: relative;
  z-index: 1;
  background: var(--white);
}

#footer.is-curtain {
  position: sticky;
  bottom: 0;
  z-index: 0;
  overflow: clip;
}
/* Parallax: the content drifts up into place as it is uncovered. */
#footer.is-curtain > .wrap {
  transform: translate3d(0, calc((1 - var(--reveal, 1)) * 30%), 0);
  will-change: transform;
}
/* Off on mobile: the JS-driven drift lags behind native touch scrolling there. */
@media (max-width: 768px) {
  #footer.is-curtain > .wrap { transform: none; will-change: auto; }
}
/* A near-viewport-tall footer peeks under the translucent header at scroll 0; back that strip with white. */
body:has(#footer.is-curtain)::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: calc(var(--banner-h, 0px) + var(--nav-h));
  z-index: 1;
  background: var(--white);
}

/* Staggered entrance. .is-staged hides items until .is-in lands. */
#footer.is-staged :is(.footer__top, .footer__intro, .footer__col, .footer__bottom) {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}

#footer.is-staged.is-in :is(.footer__top, .footer__intro, .footer__col, .footer__bottom) {
  opacity: 1;
  transform: none;
}

#footer .footer__cols > :nth-child(1) { --i: 1; }
#footer .footer__cols > :nth-child(2) { --i: 2; }
#footer .footer__cols > :nth-child(3) { --i: 3; }
#footer .footer__cols > :nth-child(4) { --i: 4; }
#footer .footer__bottom { --i: 6; }

/* ===== contact-modal ===== */
/* Contact modal — Figma 584:78381 (desktop 737×510), 584:79848 (mobile 350 wide). */

.cm {
  width: 737px;
  max-width: calc(100vw - 40px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--ink-700);
}
/* [open] so the UA's dialog:not([open]){display:none} still wins when closed. */
.cm[open] { display: flex; align-items: stretch; }
.cm::backdrop { background: rgba(9, 9, 11, 0.4); }

/* Enter/exit: fade + lift. allow-discrete keeps display/overlay until the exit transition ends. */
.cm,
.cm::backdrop {
  transition: opacity 0.2s ease, translate 0.2s ease, scale 0.2s ease,
    display 0.2s allow-discrete, overlay 0.2s allow-discrete;
}
.cm:not([open]) { opacity: 0; translate: 0 12px; scale: 0.98; }
.cm:not([open])::backdrop { opacity: 0; }
@starting-style {
  .cm[open] { opacity: 0; translate: 0 12px; scale: 0.98; }
  .cm[open]::backdrop { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cm, .cm::backdrop { transition: none; }
}

/* 584:78335 — left image card. */
.cm__visual {
  display: grid;
  place-items: center;
  width: 369px;
  flex: none;
  margin-right: -1px;
  --shape-bg: url("assets/shapes/modal-shape.webp") -92px 90px / 170% auto no-repeat;
  background: var(--surface-warm);
  box-shadow: inset 0 0 0 1px var(--line-200);
  border-radius: 18px 0 0 18px;
  overflow: hidden;
}

/* 584:78213 — form card. */
.cm__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 369px;
  flex: none;
  margin: 0;
  padding: 20px;
  font: inherit;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line-200);
  border-radius: 0 18px 18px 0;
  overflow: hidden;
}

.cm__title {
  padding-right: 40px;
  margin: 0;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: -0.02em;
  font-weight: 400;
  color: var(--ink-700);
}

/* 584:78242 — 36×36 icon button, inset 19px. */
.cm__close {
  position: absolute;
  top: 19px;
  right: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line-200);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink-700);
  cursor: pointer;
}
.cm__close:hover { background: var(--surface-100); }

.cm__fields { display: flex; flex-direction: column; gap: 10px; }
.cm__field { display: flex; flex-direction: column; gap: 10px; }

.cm__label {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.01em;
  color: var(--ink-700);
}
.cm__req { color: var(--ink-400); }

.cm__input {
  width: 100%;
  height: 36px;
  padding: 4px 12px;
  border: 1px solid var(--line-200);
  border-radius: 12px;
  background: var(--white);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.01em;
  color: var(--ink-900);
}
.cm__input--area { height: 96px; padding-block: 8px; resize: none; }
.cm__input::placeholder { color: var(--ink-400); }
.cm__input:focus-visible { outline: 2px solid var(--ink-700); outline-offset: -1px; }

.cm__actions { display: flex; flex-direction: column; gap: 8px; }
.cm__submit { width: 100%; justify-content: center; }
.cm__submit:disabled { opacity: 0.55; cursor: progress; }

.cm__hp { position: absolute; left: -10000px; }

.cm__status {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.01em;
  color: var(--ink-400);
}
.cm__status:empty { display: none; }
.cm__status.is-error { color: var(--ink-700); }

/* Success covers the form in place, so the card keeps its size. */
.cm__card.is-success > :not(.cm__success, .cm__close) { visibility: hidden; }
.cm__success {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px;
  text-align: center;
  color: var(--ink-700);
}
.cm__success[hidden] { display: none; }
.cm__success svg { margin-bottom: 10px; }
.cm__success-title {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.cm__success-title:focus { outline: none; }
.cm__success-text {
  max-width: 270px;
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.01em;
  color: var(--ink-400);
}

/* 584:79848 — mobile: single card, no image, tighter gap, smaller title, shadow. */
@media (max-width: 768px) {
  .cm {
    width: 350px;
    max-width: calc(100vw - 40px);
    border-radius: 16px;
  }
  .cm__visual { display: none; }
  .cm__card {
    gap: 16px;
    width: 100%;
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px var(--line-200),
      0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  }
  .cm__title { font-size: 20px; line-height: 26px; }
  .cm__input { font-size: 16px; }
  .cm__close { top: 9px; right: 9px; }
}

/* ===== not-found ===== */
/* 404 page, after alkimi.org-v2 src/pages/404.astro: torus with a "thinking" bubble, heading, copy. */
#not-found {
  display: grid;
  place-items: center;
  min-height: calc(100svh - var(--nav-h));
  padding-block: 160px 172px;
}
#not-found .not-found__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 477px;
  text-align: center;
}
#not-found .h1,
#not-found .lead,
#not-found .body { margin: 0; }
#not-found .not-found__links a { color: var(--ink-900); text-decoration: underline; text-underline-offset: 2px; }

#not-found .not-found__art { position: relative; width: 173px; height: 173px; }
#not-found .not-found__art img { width: 100%; height: 100%; object-fit: contain; }

/* radius 16px on every corner but the one pointing at the torus */
#not-found .not-found__bubble {
  position: absolute;
  top: 5px;
  left: 2px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line-200);
  border-radius: 16px 16px 0 16px;
  background: var(--white);
  box-shadow: 0 10px 10px -5px rgb(0 0 0 / 0.04), 0 20px 25px -5px rgb(0 0 0 / 0.1);
}
#not-found .not-found__dots { display: flex; gap: 2px; }
#not-found .not-found__dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-900);
  animation: not-found-think 1.4s ease-in-out infinite;
}
#not-found .not-found__dots i:nth-child(2) { animation-delay: 0.16s; }
#not-found .not-found__dots i:nth-child(3) { animation-delay: 0.32s; }
@keyframes not-found-think {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

@media (max-width: 760px) {
  #not-found { padding-block: 96px 112px; }
}
@media (prefers-reduced-motion: reduce) {
  #not-found .not-found__dots i { opacity: 1; animation: none; }
}
