/* Haze palette */
:root {
  color-scheme: light;
  --ground: #eef1ec;
  --ground-rgb: 238, 241, 236;
  --paper: #fbfcfa;
  --ink: #18241e;
  --ink-soft: #435149;
  --ink-faint: #55625a;
  --accent: #2b6249;
  --accent-hover: #204d39;
  --on-accent: #ffffff;
  --glow: #7fae93;
  --line: rgba(24, 36, 30, 0.14);
  --sky-fill: #e6ece6;
  --r-far: #d3ddd5;
  --r-far-low: #e6ece7;
  --r-mid: #b4c4b8;
  --r-mid-low: #d6dfd8;
  --r-near: #8ea193;
  --r-near-low: #c1cdc4;
  --r-front: #627869;
  --r-front-low: #a7b7ab;
  --mist: rgba(251, 252, 250, 0.92);
  --fog: rgb(240, 243, 238);
  --sun-core: rgba(251, 252, 246, 0.95);
  --sun-halo: rgba(240, 246, 232, 0.6);
  --mark-shadow: rgba(24, 36, 30, 0.16);
  --band-1: #e5ebe4;
  --band-2: #dce4db;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --d-weight: 600;
  --d-weight-strong: 700;
  --d-stretch: 100%;
  --d-track: -0.035em;
}

/* ---------- mist2 shared content system ----------
   Reads only the palette tokens and font variables set on :root. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
img, video, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--ink); color: var(--paper); }
html { scrollbar-color: color-mix(in srgb, var(--ink) 26%, transparent) var(--ground); }
input, textarea { caret-color: var(--accent); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 0.75rem 1.25rem;
}
.skip-link:focus { left: 1rem; top: calc(1rem + env(safe-area-inset-top, 0px)); }

.wrap {
  max-width: 74rem;
  margin: 0 auto;
  padding-left: clamp(1.25rem, 4vw, 3rem);
  padding-right: clamp(1.25rem, 4vw, 3rem);
}
.hero > .wrap { width: 100%; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--d-weight-strong);
  font-stretch: var(--d-stretch);
  letter-spacing: calc(var(--d-track) * 0.6);
  margin: 0; color: var(--ink); text-wrap: balance;
}
h3 { font-stretch: 100%; letter-spacing: -0.01em; }
p { margin: 0; color: var(--ink-soft); text-wrap: pretty; }
em {
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: var(--glow);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.15em;
  text-decoration-skip-ink: none;
}
.label {
  font: 600 0.72rem/1.3 var(--font-body);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border: 1px solid transparent; border-radius: 3px;
  font: 600 0.95rem/1.2 var(--font-body);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn--solid { background: var(--accent); color: var(--on-accent); }
.btn--solid:hover { background: var(--accent-hover); }
.btn--solid:active { transform: translateY(1px); }
.btn--quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--quiet:hover { border-color: color-mix(in srgb, var(--ink) 45%, transparent); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
.btn:hover svg { transform: translateX(3px); }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  background: linear-gradient(to bottom, rgba(var(--ground-rgb), 0.75), rgba(var(--ground-rgb), 0));
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.nav--scrolled {
  background: rgba(var(--ground-rgb), 0.88);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.nav__bar { display: flex; align-items: center; gap: 1.75rem; padding-top: 1rem; padding-bottom: 1rem; }
.nav__mark {
  display: flex; align-items: center; gap: 0.55rem; margin-right: auto;
  font: var(--d-weight-strong) 1.06rem var(--font-display); font-stretch: var(--d-stretch); letter-spacing: -0.01em; color: var(--ink);
}
.nav__mark img { width: 30px; height: 30px; object-fit: contain; }
.nav__links { display: flex; gap: 1.75rem; }
.nav__links a { color: var(--ink-soft); font-size: 0.92rem; transition: color 0.15s ease; }
.nav__links a:hover { color: var(--ink); }
.nav__cta { padding: 0.6rem 1.1rem; font-size: 0.88rem; }
@media (max-width: 760px) { .nav__links { display: none; } }

/* ---------- sections ---------- */
.section { padding-top: clamp(4.5rem, 9vw, 7.5rem); padding-bottom: clamp(4rem, 8vw, 6.5rem); }

/* case study + its demonstration */
.case__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 5.5rem); align-items: center; }
.case--flip .demo { order: -1; }
.case--stack .case__grid { grid-template-columns: 1fr; max-width: 46rem; margin-inline: auto; }
.case--stack .case__card { text-align: center; }
.case--stack .case__card p:not(.case__status) { margin-inline: auto; }
.case--stack .case__status { justify-content: center; }
@media (max-width: 860px) { .case__grid { grid-template-columns: 1fr; } .case--flip .demo { order: 0; } }
.case__card h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); line-height: 1.12; margin-bottom: 0.75rem; }
.case__status { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; font-weight: 500; color: var(--ink); margin: 0 0 1.1rem; }
.case__card p:not(.case__status) { max-width: 60ch; font-size: 1.04rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.pal-sulphur .dot { background: var(--hl); }
.dot--run { animation: dotPulse 2.8s ease-in-out infinite; }
@keyframes dotPulse { 50% { opacity: 0.35; } }

.mini-builds {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: clamp(2.25rem, 4.5vw, 3rem);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.75rem, 3.5vw, 3rem);
}
.mini-build h3 { font-size: 1.05rem; margin-bottom: 0.45rem; }
.mini-build p { font-size: 0.94rem; max-width: 34ch; }
@media (max-width: 780px) { .mini-builds { grid-template-columns: 1fr; gap: 1.9rem; } }

/* chaos, sorted (video) */
.sorted__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(2rem, 6vw, 5rem); }
.sorted__copy h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 1.1; margin-bottom: 1.1rem; }
.sorted__copy p { max-width: 40ch; font-size: 1.04rem; }
.sorted__visual { position: relative; width: 100%; max-width: 30rem; aspect-ratio: 1; margin-inline: auto; }
.sorted__video {
  width: 100%; height: 100%; object-fit: cover;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
}
@media (max-width: 780px) { .sorted__inner { grid-template-columns: 1fr; } }

/* footer */
.footer { padding-top: 2.5rem; padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.footer__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: 0.86rem; color: var(--ink-faint); }
.footer__bar a { transition: color 0.15s ease; }
.footer__bar a:hover { color: var(--ink); }

/* every animated thing has a resting state reduced motion lands on */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .btn svg { transition: none; }
  .dot--run { animation: none; }
}

/* ---------- mist + parallax hero ----------
   Layered scene (sky plate, sun, four procedural ridgelines, three mist
   banks, optional mark) drifting by depth with the pointer and on scroll.
   On load the fog burns off, the mark resolves and the headline condenses
   out of the haze letter by letter. */
:root { --ease-out: cubic-bezier(0.16, 1, 0.3, 1); }

.hero {
  position: relative; isolation: isolate;
  min-height: max(100svh, 40rem);
  display: flex; flex-direction: column;
  padding-top: calc(clamp(8rem, 20vh, 12rem) + env(safe-area-inset-top, 0px));
  padding-bottom: clamp(3rem, 8vh, 5rem);
  overflow: hidden;
}
.scene { position: absolute; inset: 0; z-index: -1; background: var(--sky-fill); }
.layer { position: absolute; inset: -4% -6%; will-change: transform; }
.layer--sky img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%;
  -webkit-mask-image: linear-gradient(#000 48%, transparent 72%); mask-image: linear-gradient(#000 48%, transparent 72%);
}
.layer--sun { background: radial-gradient(circle at var(--sun-x, 64%) var(--sun-y, 50%), var(--sun-core) 0, var(--sun-halo) 9%, transparent 30%); }
.layer--ridge {
  top: auto;
  -webkit-mask: var(--ridge) bottom / 100% 100% no-repeat;
  mask: var(--ridge) bottom / 100% 100% no-repeat;
}
.layer--far   { --ridge: url(assets/ridge-far.png);   height: var(--h-far, 62%);  background: linear-gradient(to bottom, var(--r-far), var(--r-far-low) 70%); }
.layer--mid   { --ridge: url(assets/ridge-mid.png);   height: var(--h-mid, 50%);  background: linear-gradient(to bottom, var(--r-mid), var(--r-mid-low) 75%); }
.layer--near  { --ridge: url(assets/ridge-near.png);  height: var(--h-near, 40%); background: linear-gradient(to bottom, var(--r-near), var(--r-near-low) 80%); }
.layer--front { --ridge: url(assets/ridge-front.png); height: var(--h-front, 36%); bottom: -4%; background: linear-gradient(to bottom, var(--r-front) 45%, var(--r-front-low) 70%, var(--ground) 94%); }

.layer--mark { inset: auto; left: var(--mark-x, 60%); top: var(--mark-y, 15%); width: var(--mark-w, clamp(200px, 24vw, 380px)); }
.layer--mark img { width: 100%; height: auto; filter: drop-shadow(0 26px 34px var(--mark-shadow)); }

.layer--mist i {
  position: absolute; inset: 0; display: block;
  background:
    radial-gradient(ellipse 22% 40% at 18% 50%, var(--mist), transparent 70%),
    radial-gradient(ellipse 28% 46% at 52% 56%, var(--mist), transparent 70%),
    radial-gradient(ellipse 22% 38% at 86% 48%, var(--mist), transparent 70%);
  filter: blur(10px);
  animation: drift 46s ease-in-out infinite alternate;
}
.layer--mist-a { inset: auto -20%; top: 46%; height: 22%; opacity: 0.8; }
.layer--mist-b { inset: auto -20%; top: 60%; height: 20%; opacity: 0.85; }
.layer--mist-b i { animation-duration: 36s; animation-direction: alternate-reverse; }
.layer--mist-c { inset: auto -20%; top: 74%; height: 18%; opacity: 0.7; }
.layer--mist-c i { animation-duration: 28s; }
@keyframes drift { to { transform: translateX(8%); } }
.scene__fog { position: absolute; inset: 0; background: var(--fog); opacity: 0; pointer-events: none; }

/* pointer mist-wipe: a low veil over the ridges that clears where you look */
.scene__wipe {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(var(--ground-rgb), 0.9) 0%, rgba(var(--ground-rgb), 0.62) 40%, rgba(var(--ground-rgb), 0) 72%);
  -webkit-mask-image: radial-gradient(circle var(--wr, 0px) at var(--mx, 50%) var(--my, 120%), transparent 0, transparent 30%, #000 100%);
  mask-image: radial-gradient(circle var(--wr, 0px) at var(--mx, 50%) var(--my, 120%), transparent 0, transparent 30%, #000 100%);
}
@media (hover: none), (max-width: 760px), (prefers-reduced-motion: reduce) { .scene__wipe { display: none; } }   /* nothing to clear it with */

.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16%; z-index: -1; pointer-events: none; background: linear-gradient(to bottom, rgba(var(--ground-rgb), 0), var(--ground)); }
.hero__content { position: relative; }
.hero__headline {
  display: flex; flex-direction: column;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6.4vw, 5.5rem);
  font-weight: var(--d-weight); font-stretch: var(--d-stretch);
  line-height: 0.98; letter-spacing: var(--d-track);
  margin-bottom: clamp(1.4rem, 3.5vh, 2.25rem);
}
.hero__line:last-child { font-weight: var(--d-weight-strong); }
.hero__foot { display: flex; flex-direction: column; align-items: flex-start; gap: 1.6rem; }
.hero__lede { font-size: 1.08rem; max-width: 31rem; color: var(--ink-soft); text-shadow: 0 1px 14px rgba(var(--ground-rgb), 0.9); }

/* Sulphur marks its emphasis with a highlighter stroke rather than colour */
.pal-sulphur .hero__headline { display: block; }
.pal-sulphur .hero__line:first-child { display: block; }
.pal-sulphur .hero__line:last-child {
  display: inline; color: var(--ink);
  background: linear-gradient(var(--hl), var(--hl)) 0 88% / 100% 0.3em no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  padding-inline: 0.04em;
}
@media (min-width: 761px) { .pal-sulphur .hero--veil .scene { --mark-x: 68%; --mark-w: clamp(180px, 19vw, 300px); } }
.pal-sulphur.is-condensing .hero__line:last-child { animation: hlSwipe 1s var(--ease-out) 1.55s both; }
@keyframes hlSwipe { from { background-size: 0% 0.3em; } }

/* ---------- the condensing sequence (once JS has split the letters) ---------- */
.hero__headline .w { display: inline-block; white-space: nowrap; }
.hero__headline .ch { display: inline-block; }
.is-condensing .scene__fog { animation: fogBurn 2.4s var(--ease-out) both; }
@keyframes fogBurn { from { opacity: 1; } }
.is-condensing .layer--mark img { animation: markResolve 1.7s var(--ease-out) 0.25s both; }
@keyframes markResolve { from { opacity: 0; filter: blur(18px) drop-shadow(0 26px 34px var(--mark-shadow)); transform: translateY(18px) scale(0.96); } }
.is-condensing .hero__headline .ch { animation: condense 1.25s var(--ease-out) both; animation-delay: calc(0.6s + var(--i) * 34ms); }
@keyframes condense {
  from { opacity: 0; filter: blur(16px); transform: translate(var(--dx), 0.1em) scale(1.12); }
  45% { opacity: 0.6; }
  to { opacity: 1; filter: blur(0); transform: none; }
}
.is-condensing .hero__foot { animation: footIn 0.9s var(--ease-out) 1.6s both; }
@keyframes footIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- compositions ---------- */
/* centre: headline high in the sky, the mark rising out of the mist below */
.hero--centre { text-align: center; padding-top: calc(clamp(7.5rem, 17vh, 10rem) + env(safe-area-inset-top, 0px)); }
.hero--centre .hero__headline { align-items: center; }
.hero--centre .hero__foot { align-items: center; }
.hero--centre .hero__lede { margin-inline: auto; }
.hero--centre .scene { --mark-x: 50%; --mark-y: 58%; --mark-w: clamp(170px, 16vw, 260px); --sun-x: 50%; --sun-y: 66%; }
.hero--centre .layer--mark { translate: -50% 0; z-index: 5; }
.hero--centre .layer--sky { z-index: 0; } .hero--centre .layer--sun { z-index: 1; } .hero--centre .layer--far { z-index: 2; }
.hero--centre .layer--mist-a { z-index: 3; } .hero--centre .layer--mid { z-index: 4; } .hero--centre .layer--mist-b { z-index: 6; }
.hero--centre .layer--near { z-index: 7; } .hero--centre .layer--mist-c { z-index: 8; } .hero--centre .layer--front { z-index: 9; }
.hero--centre .scene__fog { z-index: 10; }

/* drift: ridges rise out of a ground fog bank, headline low in it, mark high right */
.hero--drift { justify-content: flex-end; padding-top: 7rem; }
.hero--drift .scene { --mark-x: 64%; --mark-y: 9%; --mark-w: clamp(190px, 21vw, 330px); --sun-x: 72%; --sun-y: 30%; --h-far: 70%; --h-mid: 60%; --h-near: 52%; --h-front: 46%; }
.hero--drift .scene::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, var(--ground) 0%, rgba(var(--ground-rgb), 0.9) 22%, rgba(var(--ground-rgb), 0.4) 36%, rgba(var(--ground-rgb), 0) 50%);
}
.hero--drift .hero__headline { font-size: clamp(2.8rem, 7.4vw, 6rem); }
.hero--drift .hero__foot { flex-direction: row; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }

/* horizon: no mark, an oversized headline standing on the bare ridgeline */
.hero--horizon { text-align: center; padding-top: calc(clamp(9rem, 24vh, 13rem) + env(safe-area-inset-top, 0px)); }
.hero--horizon .hero__headline { align-items: center; font-size: clamp(3rem, 8.6vw, 6rem); line-height: 0.95; }
.hero--horizon .hero__foot { align-items: center; }
.hero--horizon .hero__lede { margin-inline: auto; }
.hero--horizon .scene { --sun-x: 50%; --sun-y: 64%; --h-far: 56%; --h-mid: 44%; --h-near: 34%; --h-front: 28%; }

/* sun: no mark; the low sun disc is the focal object, headline holds the left */
.hero--sun { justify-content: center; padding-top: 7rem; }
.hero--sun .scene { --sun-x: 200%; }
.hero--sun .hero__headline { font-size: clamp(2.8rem, 7vw, 5.8rem); }
.sun-disc {
  position: absolute; right: clamp(4%, 10vw, 14%); top: 30%;
  width: clamp(200px, 26vw, 380px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle closest-side, color-mix(in srgb, var(--sun-core) 70%, white) 0, var(--sun-core) 62%, color-mix(in srgb, var(--sun-halo) 90%, transparent) 63.5%, color-mix(in srgb, var(--sun-halo) 55%, transparent) 76%, transparent 100%);
}
.is-condensing .sun-disc { animation: sunRise 2.6s var(--ease-out) both; }
@keyframes sunRise { from { transform: translateY(70px); opacity: 0; } }

@media (max-width: 760px) {
  .hero { min-height: 100svh; padding-top: 6.5rem; }
  .hero--drift { justify-content: flex-start; }
  .hero--drift .scene::after { display: none; }
  .hero--drift .hero__foot { flex-direction: column; align-items: flex-start; }
  .hero .scene { --h-far: 40%; --h-mid: 32%; --h-near: 25%; --h-front: 24%; --mark-x: 50%; --mark-y: 55%; --mark-w: clamp(130px, 34vw, 170px); }
  .layer--mark { translate: -50% 0; }
  .hero .layer--sky { z-index: 0; } .hero .layer--sun { z-index: 1; } .hero .layer--far { z-index: 2; } .hero .layer--mist-a { z-index: 3; } .hero .layer--mid { z-index: 4; }
  .hero .layer--mist-b { z-index: 6; } .hero .layer--near { z-index: 7; } .hero .layer--mark { z-index: 8; } .hero .layer--mist-c { z-index: 8; } .hero .layer--front { z-index: 9; }
  .scene__wipe, .scene__fog { z-index: 10; }
  .layer--mist-a { top: 62%; } .layer--mist-b { top: 72%; } .layer--mist-c { top: 82%; }
  .layer--sky img { object-position: 35% 0%; }
  .hero--horizon { padding-top: 8rem; }
  .hero--horizon .scene { --h-far: 46%; --h-mid: 38%; --h-near: 30%; --h-front: 26%; }
  .sun-disc { right: 3%; top: 4.4rem; width: 124px; z-index: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .layer--mist i { animation: none; }
  .is-condensing .scene__fog, .is-condensing .layer--mark img, .is-condensing .sun-disc,
  .pal-sulphur.is-condensing .hero__line:last-child { animation: none; }
  .is-condensing .hero__headline .ch { animation: fadeOnly 0.6s ease both; animation-delay: 0.1s; }
  .is-condensing .hero__foot { animation: fadeOnly 0.6s ease 0.2s both; }
  @keyframes fadeOnly { from { opacity: 0; } }
}

/* ---------- demonstrations ---------- */
.demo { margin: 0; }
.demo__frame {
  position: relative;
  padding: clamp(1.25rem, 2.6vw, 1.75rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 30px 64px -48px color-mix(in srgb, var(--ink) 60%, transparent);
}
.demo figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-top: 0.85rem; font-size: 0.82rem; color: var(--ink-faint); }
.demo__replay {
  flex-shrink: 0; background: none; border: 0; padding: 0.2rem 0; cursor: pointer;
  font: 500 0.82rem var(--font-body); color: var(--ink-soft); text-decoration: underline; text-underline-offset: 0.2em;
}
.demo__replay:hover { color: var(--ink); }
.wd { display: inline-block; }
.demo__state { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.84rem; font-weight: 500; color: var(--ink-soft); }
.demo__state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 30%, transparent); transition: background-color 0.4s ease; }

/* 1. shorthand -> finding */
.doc__meta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-bottom: 0.8rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.doc__clause {
  font-size: 0.8rem; font-weight: 600; color: var(--ink-faint); padding: 0.2rem 0.5rem; border-radius: 3px;
  border: 1px solid var(--line); transition: color 0.4s ease, border-color 0.4s ease, background-color 0.4s ease;
}
.doc.is-read .doc__clause { color: var(--ink); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.pal-sulphur .doc.is-read .doc__clause { border-color: var(--ink); background: color-mix(in srgb, var(--hl) 30%, transparent); }
.doc__note {
  position: relative; margin: 0; padding: 0.6rem 0.75rem; border-radius: 3px;
  color: var(--ink); font-size: 0.95rem; font-style: italic;
  background: linear-gradient(color-mix(in srgb, var(--glow) 28%, transparent), color-mix(in srgb, var(--glow) 28%, transparent)) 0 0 / 0% 100% no-repeat, var(--ground);
  transition: background-size 0.9s var(--ease-out), opacity 0.6s ease;
}
.doc.is-read .doc__note { background-size: 100% 100%, auto; }
.doc.is-open .doc__note { opacity: 0.55; }
.doc__finding { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.8s var(--ease-out); }
.doc__finding > p { overflow: hidden; margin: 0; color: var(--ink); font-size: 0.97rem; line-height: 1.65; }
.doc.is-open .doc__finding { grid-template-rows: 1fr; }
.doc__finding .wd { opacity: 0; transform: translateY(4px); filter: blur(3px); transition: opacity 0.5s ease, transform 0.6s var(--ease-out), filter 0.5s ease; transition-delay: calc(0.25s + var(--i) * 22ms); }
.doc.is-open .doc__finding .wd { opacity: 1; transform: none; filter: none; }
.doc.is-open .doc__finding > p { padding-top: 1rem; }
.doc__foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.1rem; padding-top: 0.85rem; border-top: 1px solid var(--line); }
.doc.is-drafted .demo__state::before { background: var(--glow); }
.doc.is-signed .demo__state { color: var(--ink); }
.doc.is-signed .demo__state::before { background: var(--accent); }
.pal-sulphur .doc.is-signed .demo__state::before { background: var(--hl); }
.doc__sign { width: 26px; height: 26px; color: var(--accent); }
.pal-sulphur .doc__sign { color: var(--ink); }
.doc__sign path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.7s var(--ease-out) 0.15s; }
.doc.is-signed .doc__sign path { stroke-dashoffset: 0; }

/* 2. review -> reply -> approval */
.rv__review { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.rv__who { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.6rem; }
.rv__avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--band-2, var(--ground)); color: var(--ink); font-weight: 600; font-size: 0.9rem; }
.rv__who b { display: block; font-size: 0.92rem; color: var(--ink); }
.rv__stars { display: flex; gap: 2px; margin-top: 2px; }
.rv__stars svg { width: 13px; height: 13px; }
.rv__stars .on { fill: var(--ink); } .rv__stars .off { fill: none; stroke: color-mix(in srgb, var(--ink) 40%, transparent); }
.rv__review p { color: var(--ink); font-size: 0.96rem; }
.rv__draft .label { display: block; margin-bottom: 0.5rem; }
.rv__text { min-height: 6.6em; color: var(--ink); font-size: 0.96rem; line-height: 1.6; }
.rv__text .wd { opacity: 0; transition: opacity 0.35s ease; }
.rv__text .wd.on { opacity: 1; }
.rv.is-writing:not(.is-written) .rv__text::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: var(--accent); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.rv__gate { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.rv.is-written .demo__state::before { background: var(--glow); animation: dotPulse 1.6s ease-in-out infinite; }
.rv.is-approved .demo__state { color: var(--ink); }
.rv.is-approved .demo__state::before { background: var(--accent); animation: none; }
.pal-sulphur .rv.is-approved .demo__state::before { background: var(--hl); }
.rv__approve { padding: 0.6rem 1rem; font-size: 0.86rem; }
.rv.is-approved .rv__approve { background: transparent; color: var(--ink); border-color: var(--line); opacity: 1; }

/* 3. three sources -> one report */
.pipe { position: relative; aspect-ratio: 520 / 300; }
.pipe svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pipe__path { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 3 5; }
.pipe.is-live .pipe__path { stroke: color-mix(in srgb, var(--ink) 22%, transparent); }
.pipe__dot { fill: var(--accent); opacity: 0; }
.pal-sulphur .pipe__dot { fill: var(--hl); stroke: var(--ink); stroke-width: 1; }
.pipe.is-live .pipe__dot { opacity: 1; }
.pipe__src { position: absolute; left: 0; top: 0; bottom: 0; width: 23%; list-style: none; margin: 0; padding: 0; }
.pipe__src li {
  position: absolute; left: 0; width: 100%; transform: translateY(-50%);
  padding: 0.45rem 0.55rem; border: 1px solid var(--line); border-radius: 4px; background: var(--ground);
  font-size: clamp(0.66rem, 1.3vw, 0.8rem); font-weight: 600; color: var(--ink); line-height: 1.25;
}
.pipe__src li:nth-child(1) { top: 20%; } .pipe__src li:nth-child(2) { top: 50%; } .pipe__src li:nth-child(3) { top: 80%; }
.pipe__out {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 37%;
  padding: 0.8rem; border: 1px solid var(--line); border-radius: 4px; background: var(--ground);
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}
.pipe.is-done .pipe__out { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.pal-sulphur .pipe.is-done .pipe__out { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hl) 40%, transparent); }
.pipe__out b { display: block; font-size: clamp(0.7rem, 1.35vw, 0.84rem); margin-bottom: 0.5rem; color: var(--ink); }
.pipe__row { display: grid; grid-template-columns: 1fr; gap: 0.2rem; margin-top: 0.45rem; font-size: clamp(0.62rem, 1.2vw, 0.74rem); color: var(--ink-soft); }
.pipe__row i { display: block; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pipe__row i::after { content: ""; display: block; height: 100%; width: var(--w); background: var(--ink); border-radius: inherit; transform-origin: left; transform: scaleX(0); transition: transform 0.9s var(--ease-out); }
.pipe__row.is-in i::after { transform: scaleX(1); }
.pipe.is-done .demo__state::before { background: var(--accent); }
.pipe__foot { margin-top: 1rem; padding-top: 0.85rem; border-top: 1px solid var(--line); }

/* where the demo sits */
.builds-feature { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; margin-top: clamp(3rem, 6vw, 4.5rem); padding-top: clamp(2.25rem, 4.5vw, 3rem); border-top: 1px solid var(--line); }
.builds-feature .mini-builds { margin: 0; padding: 0; border: 0; grid-template-columns: 1fr; gap: 0; }
.builds-feature .mini-build { padding: 1.1rem 0 1.1rem 1.1rem; border-left: 1px solid var(--line); }
.builds-feature .mini-build.is-featured { border-left-color: var(--accent); }
.pal-sulphur .builds-feature .mini-build.is-featured { border-left-color: var(--hl); }
.builds-feature .mini-build p { max-width: 40ch; }
.case--flip .builds-feature .demo { order: 2; }
.case--stack .builds-feature { grid-template-columns: 1fr; }
.case--stack .builds-feature .mini-builds { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 2.5rem); }
.case--stack .builds-feature .demo { max-width: 36rem; margin-inline: auto; width: 100%; }
@media (max-width: 860px) { .builds-feature, .case--stack .builds-feature .mini-builds { grid-template-columns: 1fr; } .case--flip .builds-feature .demo { order: 0; } }

@media (prefers-reduced-motion: reduce) {
  .doc__note, .doc__finding, .doc__finding .wd, .rv__text .wd, .pipe__row i::after, .doc__sign path { transition: none !important; }
  .rv.is-writing .rv__text::after, .rv.is-written .demo__state::before { animation: none; }
}

/* ---------- body devices ---------- */
/* ridges: each band rises into the one above as a ridgeline of its own colour */
.has-ridges :is(.sorted, .sortlab, .quiz-section) { position: relative; }
.has-ridges :is(.sorted, .sortlab) { background: var(--band-1); }
.has-ridges .quiz-section, .has-ridges .footer { background: var(--band-2); }
.has-ridges :is(.sorted, .sortlab, .quiz-section)::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: clamp(70px, 11vw, 170px);
  background: inherit; pointer-events: none;
  -webkit-mask: var(--divider) bottom / 100% 100% no-repeat; mask: var(--divider) bottom / 100% 100% no-repeat;
}
.has-ridges :is(.sorted, .sortlab) { --divider: url(assets/ridge-mid.png); }
.has-ridges .quiz-section { --divider: url(assets/ridge-near.png); }

/* mist banks: a slow bank of fog rolls across each section boundary */
.has-mistbanks :is(.sorted, .sortlab, .quiz-section) { position: relative; overflow-x: clip; }
.has-mistbanks :is(.sorted, .sortlab, .quiz-section)::before {
  content: ""; position: absolute; left: -10%; right: -10%; top: -5rem; height: 10rem; pointer-events: none;
  background:
    radial-gradient(ellipse 28% 50% at 18% 50%, var(--mist), transparent 70%),
    radial-gradient(ellipse 30% 55% at 58% 45%, var(--mist), transparent 70%),
    radial-gradient(ellipse 24% 50% at 90% 55%, var(--mist), transparent 70%);
  filter: blur(6px);
}

/* contours: survey lines between sections, drawn in as they arrive */
.contour { height: clamp(56px, 8vw, 110px); overflow: hidden; }
.contour svg { width: 100%; height: 100%; }
/* revealed with a clip, so the lines run edge to edge at any width */
.contour svg { clip-path: inset(0 100% 0 0); transition: clip-path 2.2s var(--ease-out); }
.contour.is-drawn svg { clip-path: inset(0); }
.contour path { fill: none; stroke: color-mix(in srgb, var(--ink) 20%, transparent); stroke-width: 1; }
.contour path:nth-child(2) { stroke: color-mix(in srgb, var(--ink) 28%, transparent); }
.pal-sulphur .contour path:nth-child(2) { stroke: var(--glow); stroke-width: 1.5; }
@media (prefers-reduced-motion: reduce) { .contour svg { transition: none; clip-path: none; } }

/* wayfinding rail: where you are on the page, and a way to jump */
.waypoints { position: fixed; right: clamp(0.9rem, 2vw, 1.75rem); top: 50%; z-index: 90; transform: translateY(-50%); transition: opacity 0.35s ease; }
.is-at-brief .waypoints { opacity: 0; pointer-events: none; }
.waypoints ol { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.35rem; }
.waypoints ol::before { content: ""; position: absolute; right: 4px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.waypoints a { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 0.7rem; font-size: 0.78rem; color: var(--ink-faint); }
.waypoints a span { opacity: 0; transform: translateX(6px); transition: opacity 0.3s ease, transform 0.4s var(--ease-out); white-space: nowrap; background: rgba(var(--ground-rgb), 0.85); padding: 0.1rem 0.35rem; border-radius: 3px; }
.waypoints a::after { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ink) 40%, transparent); background: var(--ground); transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.4s var(--ease-out); }
.waypoints a:hover span, .waypoints a:focus-visible span, .waypoints a[aria-current] span { opacity: 1; transform: none; }
.waypoints a[aria-current] { color: var(--ink); }
.waypoints a[aria-current]::after { background: var(--accent); border-color: var(--accent); transform: scale(1.25); }
.pal-sulphur .waypoints a[aria-current]::after { background: var(--hl); border-color: var(--ink); }
@media (max-width: 1100px) { .waypoints { display: none; } }

/* ---------- questionnaire (replaces the contact form) ----------
   Plain stacked form without JS; .is-live turns it into one of three skins:
   deck (cards stacked, answered ones fly off into a row of chips), rail
   (a slide deck with named steps), composer (questions on the left, the
   email writing itself on the right). */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.quiz-section { overflow-x: clip; }
.quiz-section__intro h2 { font-size: clamp(2rem, 3.8vw, 2.9rem); line-height: 1.1; margin-bottom: 1rem; }
.quiz-section__intro p { max-width: 46ch; }
.quiz-section__terms { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; list-style: none; padding: 0; margin: 1.4rem 0 0; font-size: 0.86rem; color: var(--ink-faint); }
.quiz-section__terms li { display: flex; align-items: center; gap: 0.5rem; }
.quiz-section__terms li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--glow); }

.quiz { position: relative; margin: 0; }
.quiz__stage { display: flex; flex-direction: column; gap: 1.25rem; }
.quiz__step {
  margin: 0; min-width: 0;
  padding: clamp(1.4rem, 3vw, 2.1rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 28px 60px -42px color-mix(in srgb, var(--ink) 55%, transparent), 0 2px 6px -3px color-mix(in srgb, var(--ink) 14%, transparent);
}
.quiz__step legend {
  float: left; width: 100%; padding: 0; margin-bottom: 0.5rem;
  font: var(--d-weight-strong) clamp(1.3rem, 2.3vw, 1.7rem)/1.2 var(--font-display);
  font-stretch: var(--d-stretch); letter-spacing: calc(var(--d-track) * 0.5); color: var(--ink);
}
.quiz__step legend + * { clear: both; }
.quiz__hint { font-size: 0.94rem; margin-bottom: 1.1rem; }
.quiz__honest {
  margin-top: 1rem; padding: 0.75rem 0.9rem; border-radius: 4px;
  background: color-mix(in srgb, var(--glow) 16%, transparent); color: var(--ink); font-size: 0.92rem;
}
.quiz__field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.quiz__field label { font-size: 0.86rem; font-weight: 600; color: var(--ink); }
.quiz__field .opt { font-weight: 400; color: var(--ink-faint); }
.quiz input[type=text], .quiz input[type=email], .quiz textarea {
  width: 100%; padding: 0.8rem 0.9rem;
  background: var(--ground); border: 1px solid var(--line); border-radius: 4px;
  color: var(--ink); font: 1rem/1.5 var(--font-body);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.quiz textarea { resize: vertical; min-height: 7rem; }
.quiz input::placeholder, .quiz textarea::placeholder { color: var(--ink-faint); }
.quiz input:hover, .quiz textarea:hover { border-color: color-mix(in srgb, var(--ink) 34%, transparent); }
.quiz input:focus, .quiz textarea:focus { outline: none; background: var(--paper); border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.quiz [aria-invalid=true] { border-color: var(--accent); border-style: dashed; }
.pal-sulphur .quiz [aria-invalid=true] { border-color: #8a6d00; }
.quiz__error { min-height: 0; font-size: 0.86rem; color: var(--ink); }
.quiz__error:not(:empty) { margin-top: 0.15rem; padding-left: 0.9rem; position: relative; }
.quiz__error:not(:empty)::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.pal-sulphur .quiz__error:not(:empty)::before { background: var(--hl); }

/* answer cards */
.quiz__opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.quiz__opt {
  position: relative; display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.85rem 0.95rem; border: 1px solid var(--line); border-radius: 4px;
  background: var(--ground); cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.25s var(--ease-out);
}
.quiz__opt:hover { border-color: color-mix(in srgb, var(--ink) 38%, transparent); }
.quiz__opt:active { transform: scale(0.985); }
.quiz__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.quiz__tick {
  flex-shrink: 0; width: 18px; height: 18px; margin-top: 0.12rem;
  border: 1.5px solid color-mix(in srgb, var(--ink) 45%, transparent); border-radius: 50%;
  display: grid; place-items: center; transition: border-color 0.18s ease, background-color 0.18s ease;
}
.quiz__opt input[type=checkbox] + .quiz__tick { border-radius: 3px; }
.quiz__tick::after { content: ""; width: 8px; height: 8px; border-radius: inherit; background: var(--on-accent); transform: scale(0); transition: transform 0.3s var(--ease-out); }
.quiz__opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--paper)); }
.quiz__opt:has(input:checked) .quiz__tick { background: var(--accent); border-color: var(--accent); }
.quiz__opt:has(input:checked) .quiz__tick::after { transform: scale(1); }
.pal-sulphur .quiz__opt:has(input:checked) { border-color: var(--ink); background: color-mix(in srgb, var(--hl) 14%, var(--paper)); }
.pal-sulphur .quiz__opt:has(input:checked) .quiz__tick { background: var(--hl); border-color: var(--ink); }
.pal-sulphur .quiz__tick::after { background: var(--ink); }
.quiz__opt:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.quiz__opt b { display: block; font-weight: 600; color: var(--ink); font-size: 0.97rem; }
.quiz__opt small { display: block; font-size: 0.84rem; color: var(--ink-faint); line-height: 1.4; }
@media (max-width: 560px) { .quiz__opts { grid-template-columns: 1fr; } }

/* review */
.quiz__review { margin: 0.4rem 0 0; }
.quiz__row { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: 0.75rem; align-items: baseline; padding: 0.7rem 0; border-top: 1px solid var(--line); }
.quiz__row dt { font-size: 0.84rem; color: var(--ink-faint); }
.quiz__row dd { margin: 0; color: var(--ink); font-size: 0.95rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.quiz__edit { background: none; border: 0; padding: 0.2rem 0; font: 500 0.84rem var(--font-body); color: var(--ink-soft); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.quiz__edit:hover { color: var(--ink); }
.quiz__send-note { font-size: 0.92rem; margin-bottom: 0.4rem; }
.quiz__send-note:focus { outline: none; }
@media (max-width: 520px) { .quiz__row { grid-template-columns: 1fr auto; } .quiz__row dt { grid-column: 1 / -1; } }

/* controls */
.quiz__controls { display: none; }
.quiz.is-live .quiz__controls { display: flex; align-items: center; gap: 1rem; margin-top: 1.25rem; }
.quiz__count { margin-inline: auto; font-size: 0.86rem; color: var(--ink-faint); }
.quiz [data-quiz-back][hidden] + .quiz__count { margin-left: 0; }
.quiz [data-quiz-next] { margin-left: auto; }
.quiz__sent { margin-top: 1rem; font-size: 0.92rem; color: var(--ink); }
.quiz__nojs { margin-top: 1.25rem; }
.quiz.is-live .quiz__nojs { display: none; }
.quiz:not(.is-live) .quiz__step--review { display: none; }

/* every live card takes the height of the question in front */
.quiz.is-live .quiz__step { height: var(--qh, auto); overflow: hidden; }
.quiz.is-live .quiz__stage { align-items: start; }
.quiz--composer .quiz__row dd { display: none; }
.quiz--composer .quiz__row { grid-template-columns: 1fr auto; padding: 0.55rem 0; }

/* ======== skin: deck ======== */
.quiz-section--deck .quiz-section__inner { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(2.5rem, 6vw, 5.5rem); align-items: start; }
.quiz-section--deck .quiz-section__intro { position: sticky; top: 6rem; }
@media (max-width: 900px) { .quiz-section--deck .quiz-section__inner { grid-template-columns: 1fr; } .quiz-section--deck .quiz-section__intro { position: static; } }
.quiz--deck.is-live .quiz__stage { display: grid; padding-bottom: 34px; }
.quiz--deck.is-live .quiz__step {
  grid-area: 1 / 1; align-self: start;
  transform-origin: 50% 100%;
  transition: transform 0.7s var(--ease-out), opacity 0.45s ease, box-shadow 0.4s ease;
}
.quiz--deck .quiz__step[data-pos="0"] { z-index: 6; }
.quiz--deck .quiz__step[data-pos="1"] { z-index: 5; transform: translateY(16px) scale(0.965); }
.quiz--deck .quiz__step[data-pos="2"] { z-index: 4; transform: translateY(32px) scale(0.93); opacity: 0.7; }
.quiz--deck .quiz__step:is([data-pos="3"], [data-pos="4"], [data-pos="5"]) { z-index: 3; transform: translateY(40px) scale(0.91); opacity: 0; }
.quiz--deck .quiz__step[data-pos^="-"] { z-index: 7; transform: translate(-34%, -30px) rotate(-6deg) scale(0.92); opacity: 0; pointer-events: none; transition-duration: 0.55s, 0.35s, 0.4s; }
.quiz--deck .quiz__step:not([data-pos="0"]) > * { visibility: hidden; transition: visibility 0s 0.2s; }
.quiz--deck .quiz__step[data-pos="0"] > * { visibility: visible; }
.quiz__answered { display: flex; flex-wrap: wrap; gap: 0.45rem; min-height: 2.1rem; margin-bottom: 1rem; }
.quiz__chip {
  max-width: 100%; padding: 0.38rem 0.7rem; border-radius: 3px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink-soft); font: 500 0.82rem var(--font-body); cursor: pointer;
  animation: chipIn 0.55s var(--ease-out) both; transition: color 0.15s ease, border-color 0.15s ease;
}
.quiz__chip:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 40%, transparent); }
@keyframes chipIn { from { opacity: 0; transform: translate(-10px, 14px) rotate(-3deg); } }

/* ======== skin: rail ======== */
.quiz-section--rail .quiz-section__intro { text-align: center; margin: 0 auto clamp(2.25rem, 5vw, 3.25rem); }
.quiz-section--rail .quiz-section__intro p { margin-inline: auto; }
.quiz-section--rail .quiz-section__terms { justify-content: center; }
.quiz--rail { max-width: 44rem; margin-inline: auto; }
.quiz__crumbs { display: none; }
.quiz--rail.is-live .quiz__crumbs {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); list-style: none; padding: 0; margin: 0 0 1.5rem;
  border-top: 2px solid var(--line); position: relative;
}
.quiz__crumbs::before {
  content: ""; position: absolute; left: 0; top: -2px; height: 2px; width: 100%;
  background: var(--accent); transform-origin: left; transform: scaleX(calc((var(--at, 0) + 1) / 6));
  transition: transform 0.7s var(--ease-out);
}
.pal-sulphur .quiz__crumbs::before { background: var(--hl); }
.quiz__crumbs button {
  width: 100%; padding: 0.65rem 0 0; background: none; border: 0; text-align: left;
  font: 500 0.82rem var(--font-body); color: var(--ink-faint); cursor: pointer;
}
.quiz__crumbs button:disabled { cursor: default; opacity: 0.55; }
.quiz__crumbs button.is-done { color: var(--ink-soft); }
.quiz__crumbs button.is-current { color: var(--ink); font-weight: 650; }
@media (max-width: 600px) { .quiz__crumbs button { font-size: 0; } .quiz__crumbs button.is-current { font-size: 0.8rem; } }
.quiz--rail.is-live .quiz__stage { display: grid; }
.quiz--rail.is-live .quiz__step {
  grid-area: 1 / 1; align-self: start;
  transform: translateX(calc(var(--pos, 0) * (100% + 1.5rem)));
  transition: transform 0.75s var(--ease-out), opacity 0.5s ease;
}
.quiz--rail .quiz__step:not([data-pos="0"]) { opacity: 0.32; }
.quiz--rail .quiz__step:not([data-pos="0"], [data-pos="1"], [data-pos="-1"]) { opacity: 0; }
.quiz--rail .quiz__step:not([data-pos="0"]) > * { visibility: hidden; transition: visibility 0s 0.25s; }
.quiz--rail .quiz__step[data-pos="0"] > * { visibility: visible; }
@media (max-width: 760px) { .quiz--rail .quiz__step:not([data-pos="0"]) { opacity: 0; } }

/* ======== skin: composer ======== */
.quiz-section--composer .quiz-section__intro { margin-bottom: clamp(2.25rem, 5vw, 3.25rem); }
.quiz-composer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 900px) { .quiz-composer { grid-template-columns: 1fr; } .quiz__preview { order: -1; } }
.quiz--composer.is-live .quiz__stage { display: grid; }
.quiz--composer.is-live .quiz__step { grid-area: 1 / 1; align-self: start; transition: opacity 0.45s ease, transform 0.6s var(--ease-out); }
.quiz--composer .quiz__step[data-pos^="-"] { opacity: 0; transform: translateY(-14px); }
.quiz--composer .quiz__step:not([data-pos="0"]):not([data-pos^="-"]) { opacity: 0; transform: translateY(14px); }
.quiz--composer .quiz__step:not([data-pos="0"]) > * { visibility: hidden; transition: visibility 0s 0.25s; }
.quiz__bar { display: none; }
.quiz--composer.is-live .quiz__bar { display: block; position: absolute; left: 0; right: 0; top: -14px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.quiz__bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform 0.7s var(--ease-out); }
.pal-sulphur .quiz__bar i { background: var(--hl); }

.quiz__preview { display: none; }
.quiz-composer:has(.quiz.is-live) .quiz__preview { display: block; position: sticky; top: 6rem; }
.mail {
  padding: clamp(1.25rem, 2.6vw, 1.8rem);
  background: var(--paper); border-radius: 4px;
  border: 1px solid var(--line);
  box-shadow: 0 28px 60px -46px color-mix(in srgb, var(--ink) 55%, transparent);
  font-size: 0.95rem; line-height: 1.6; color: var(--ink);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.mail__head { display: grid; grid-template-columns: 4.5rem 1fr; row-gap: 0.35rem; padding-bottom: 0.9rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.mail__head .label { align-self: center; }
.mail__body p { color: var(--ink); margin: 0 0 0.85rem; white-space: pre-wrap; }
.mail [data-slot]:not(.is-filled) { color: var(--ink-faint); }
.mail [data-slot].is-new { animation: inkIn 0.7s var(--ease-out); }
@keyframes inkIn { from { opacity: 0; filter: blur(5px); } }
.quiz-composer:has(.quiz.is-ready) .mail { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent), 0 28px 60px -46px color-mix(in srgb, var(--ink) 55%, transparent); }
.mail__status { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; font-size: 0.84rem; color: var(--ink-faint); }
.quiz-composer:has(.quiz.is-ready) .mail__status { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .quiz.is-live .quiz__step, .quiz__chip, .quiz__bar i, .quiz__crumbs::before { transition: opacity 0.2s ease !important; animation: none !important; }
  .quiz--deck .quiz__step[data-pos^="-"], .quiz--rail .quiz__step, .quiz--composer .quiz__step { transform: none !important; }
  .quiz--rail .quiz__step:not([data-pos="0"]) { opacity: 0; }
  .mail [data-slot].is-new { animation: none; }
}


.sorted--lead .sorted__visual { order: -1; }
@media (max-width: 780px) { .sorted--lead .sorted__visual { order: 0; } }

/* ---------- chaos, sorted: autoplay sort ----------
   Plays once when the section is in view (and again after it has been
   scrolled back above). Cards move on the compositor only: one transform
   animation each, a lifted arc, a long exponential settle. */
.sortlab__body { padding-block: clamp(4.5rem, 9vw, 7rem); }
.sortlab__inner { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; gap: clamp(2rem, 6vw, 5rem); }
.sortlab__copy h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 1.1; margin-bottom: 1.1rem; }
.sortlab__copy p { max-width: 40ch; font-size: 1.04rem; }
.sortlab__state { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.75rem; font-size: 0.9rem; color: var(--ink); font-weight: 500; }
.sortlab__state .dot { background: var(--ink-faint); animation: none; transition: background-color 0.4s ease; }
.sortlab.is-sorted .sortlab__state .dot { background: var(--accent); }
.sortlab { overflow-x: clip; }
.sortlab__stage { position: relative; width: 100%; max-width: 34rem; aspect-ratio: 1 / 1.08; justify-self: center; }
.sortlab__group {
  position: absolute; translate: -50% 0;
  font: 600 0.72rem var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint);
  opacity: 0; transition: opacity 0.9s var(--ease-out);
}
.sortlab.is-sorted .sortlab__group { opacity: 1; }
.sortlab__group[data-group="0"] { left: 25.5%; top: 1%; }
.sortlab__group[data-group="1"] { left: 74.5%; top: 1%; }
.sortlab__group[data-group="2"] { left: 25.5%; top: 52.5%; }
.sortlab__group[data-group="3"] { left: 74.5%; top: 52.5%; }
.task {
  position: absolute; left: 0; top: 0; width: 46%;
  display: flex; flex-direction: column; gap: 0.1rem;
  padding: 0.6rem 0.8rem 0.65rem;
  background: var(--paper);
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 3px;
  box-shadow: 0 14px 28px -16px color-mix(in srgb, var(--ink) 45%, transparent);
  backface-visibility: hidden;
}
.task b { font: 600 clamp(0.74rem, 1.5vw, 0.95rem)/1.25 var(--font-display); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task small { font-size: clamp(0.68rem, 1.2vw, 0.8rem); color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task::after {
  content: ""; position: absolute; right: 0.7rem; top: 0.8rem; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); opacity: 0; transform: scale(0.4);
  transition: opacity 0.3s ease, transform 0.5s var(--ease-out);
}
.task.is-filed::after { opacity: 1; transform: none; }
@media (max-width: 860px) { .sortlab__inner { grid-template-columns: 1fr; } .task b { font-size: 0.8rem; } .task small { font-size: 0.75rem; } }

/* ---------- final page ---------- */
/* the first screen leaves the top of "What we've built" in view */
.hero { min-height: max(calc(100svh - clamp(9rem, 19vh, 11rem)), 34rem); padding-bottom: clamp(2.5rem, 5vh, 3.5rem); }
@media (min-width: 761px) {
  .hero--centre .scene { --mark-y: 71%; --mark-w: clamp(140px, 12vw, 200px); --sun-y: 74%; }
}
@media (min-width: 761px) and (max-height: 820px) {
  .hero--centre { padding-top: calc(6.25rem + env(safe-area-inset-top, 0px)); }
  .hero--centre .hero__headline { font-size: clamp(2.4rem, 5.6vw, 4.6rem); }
  .hero--centre .scene { --mark-y: 75%; --mark-w: clamp(110px, 10vw, 150px); }
}
@media (max-width: 760px) {
  .hero { min-height: 0; padding-bottom: 15rem; }
  .hero .scene { --mark-y: auto; }
  .hero .layer--mark { top: auto; bottom: 4.5rem; }
}

/* contour rails: grey survey lines with one haze-green line, between every section */
.contour { position: relative; z-index: 1; }
.contour path:nth-child(2) { stroke: color-mix(in srgb, var(--accent) 78%, transparent); stroke-width: 1.5; }
.contour--first { margin-top: calc(-1 * clamp(28px, 4vw, 56px)); }

/* what we've built */
.built { padding-top: clamp(1rem, 2.5vw, 2rem); }
.built__title { font-size: clamp(2rem, 3.8vw, 3rem); line-height: 1.08; margin-bottom: clamp(2.25rem, 5vw, 3.75rem); }
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2.5rem, 6vw, 5.5rem); align-items: center; }
.product + .product { margin-top: clamp(4rem, 9vw, 7rem); }
.product--flip .demo { order: -1; }
.product__copy h3 { font-size: clamp(1.5rem, 2.6vw, 2.05rem); line-height: 1.15; letter-spacing: calc(var(--d-track) * 0.5); margin-bottom: 0.7rem; }
.product__copy p:not(.case__status) { max-width: 58ch; font-size: 1.03rem; }
.product__copy p + p:not(.case__status) { margin-top: 0.9rem; }
.dot--pilot { background: transparent; border: 1.5px solid var(--accent); }
@media (max-width: 860px) { .product { grid-template-columns: 1fr; } .product--flip .demo { order: 0; } }
.also { margin-top: clamp(4rem, 8vw, 6rem); padding-top: clamp(2rem, 4vw, 2.75rem); border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 2.2fr); gap: clamp(1.5rem, 4vw, 3rem); }
.also__title { font-size: 1.05rem; color: var(--ink-soft); padding-top: 0.1rem; }
.also .mini-builds { margin: 0; padding: 0; border: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 780px) { .also, .also .mini-builds { grid-template-columns: 1fr; } }

/* the review-request flow */
.rq { display: flex; flex-direction: column; gap: 1.1rem; }
.rq__track { list-style: none; margin: 0; padding: 0 0 1rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; border-bottom: 1px solid var(--line); position: relative; }
.rq__track::before, .rq__track::after { content: ""; position: absolute; left: 6px; right: 33%; top: 6px; height: 1px; background: var(--line); }
.rq__track::after { background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform 1.4s var(--ease-out); }
.rq.is-waiting .rq__track::after { transform: scaleX(0.5); }
.rq.is-sent .rq__track::after { transform: scaleX(1); }
.rq__track li { position: relative; padding-top: 1.35rem; font-size: 0.82rem; line-height: 1.35; color: var(--ink-faint); transition: color 0.4s ease; }
.rq__track li::before { content: ""; position: absolute; left: 0; top: 0; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--ink) 30%, transparent); background: var(--paper); transition: background-color 0.4s ease, border-color 0.4s ease; }
.rq__track b { display: block; color: inherit; font-weight: 600; font-size: 0.86rem; }
.rq.is-done .rq__track li:nth-child(1), .rq.is-waiting .rq__track li:nth-child(2), .rq.is-sent .rq__track li:nth-child(3) { color: var(--ink); }
.rq.is-done .rq__track li:nth-child(1)::before, .rq.is-waiting .rq__track li:nth-child(2)::before, .rq.is-sent .rq__track li:nth-child(3)::before { background: var(--accent); border-color: var(--accent); }
.rq__msg {
  max-width: 86%; padding: 0.85rem 1rem; border-radius: 4px 14px 14px 14px;
  background: var(--ground); border: 1px solid var(--line); font-size: 0.93rem; line-height: 1.5; color: var(--ink);
  opacity: 0; transform: translateY(10px); transition: opacity 0.5s ease, transform 0.7s var(--ease-out);
}
.rq__from { display: block; font-size: 0.76rem; font-weight: 600; color: var(--ink-faint); margin-bottom: 0.3rem; }
.rq__link { color: var(--accent); text-decoration: underline; text-underline-offset: 0.18em; position: relative; border-radius: 3px; transition: background-color 0.3s ease; }
.rq__optout { display: block; margin-top: 0.35rem; font-size: 0.8rem; color: var(--ink-faint); }
.rq.is-sent .rq__msg { opacity: 1; transform: none; }
.rq.is-tapped .rq__link { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.rq__form {
  align-self: flex-end; width: min(100%, 22rem); padding: 1rem 1.1rem;
  background: color-mix(in srgb, var(--accent) 6%, var(--ground)); border-radius: 4px;
  opacity: 0; transform: translateY(16px) scale(0.98); transition: opacity 0.5s ease, transform 0.8s var(--ease-out);
}
.rq.is-open .rq__form { opacity: 1; transform: none; }
.rq__form .label { display: block; margin-bottom: 0.45rem; }
.rq__form b { display: block; font-size: 0.95rem; color: var(--ink); margin-bottom: 0.5rem; }
.rq__stars { display: flex; gap: 6px; margin-bottom: 0.7rem; }
.rq__stars svg { width: 22px; height: 22px; fill: none; stroke: color-mix(in srgb, var(--ink) 45%, transparent); stroke-width: 1.3; }
.rq__box { height: 2.4rem; border-bottom: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); font-size: 0.8rem; color: var(--ink-faint); padding: 0.5rem 0.6rem; }
.rq__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.6rem 1rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.rq__fair { font-size: 0.8rem; color: var(--ink-soft); }
.demo__frame:has(.rq.is-open) .demo__state::before { background: var(--accent); }
.demo__frame:has(.rq.is-open) .demo__state { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .rq__msg, .rq__form, .rq__track::after { transition: none; } }
