/* ==========================================================================
   David Sunnock

   DIRECTION: quiet, bright, Apple-native. White ground, near-black type,
   one blue for links, soft grey cards. The site follows the visitor's
   system appearance: light is the primary design, dark is the same design
   on black. No web fonts: the system UI face (SF on Apple devices) carries
   everything, with the system monospace for dates and labels.

   COLOR: six --brand-* tokens, registered as Slingshot color regions.
     paper    the ground
     ink      the type
     accent   links and the one live indicator
     muted    secondary type
     line     hairlines
     surface  cards
   Dark values follow prefers-color-scheme and stay in the same family.

   SHAPE: cards and framed media use --r-lg (20px). Chips, the nav and
   buttons are pills. Nothing else is rounded.

   MOTION: small and physical. Cards lift 2px on hover. Content fades up
   14px as it enters. Everything on --ease. Reduced motion turns it off.
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* Slingshot color tokens - editable */
  --brand-paper:   #ffffff;
  --brand-ink:     #1d1d1f;
  --brand-accent:  #0066cc;
  --brand-muted:   #6e6e73;
  --brand-line:    #d2d2d7;
  --brand-surface: #f5f5f7;

  --surface-hover: #ebebef;
  --ink-soft: #424245;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-lg: 20px;
  --r-md: 12px;

  /* Type scale: golden ratio (1.618) from the 17px body.
     17 → 27.5 → 44.5 → 72. Half-steps (√φ = 1.272) for lede and small. */
  --t-xs:   .8125rem;   /* 13   body ÷ 1.272 */
  --t-sm:   .9375rem;   /* 15 */
  --t-base: 1.0625rem;  /* 17 */
  --t-md:   1.35rem;    /* 21.6 body × 1.272 */
  --t-lg:   1.72rem;    /* 27.5 body × φ      subheaders, card titles */
  --t-xl:   2.78rem;    /* 44.5 body × φ²     h2 */
  --t-2xl:  4.5rem;     /* 72   body × φ³     h1 */
  --h1: clamp(2.78rem, 5.2vw, 4.5rem);
  --h2: clamp(1.72rem, 3.2vw, 2.78rem);
  --h3: clamp(1.35rem, 1.95vw, 1.72rem);

  /* Space scale: the same ratio. */
  --sp-1: 1rem;
  --sp-2: 1.618rem;
  --sp-3: 2.618rem;
  --sp-4: 4.236rem;
  --sp-5: 6.854rem;

  --wrap: 1120px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --chapter-gap: clamp(var(--sp-4), 8vw, var(--sp-5));

  --ease: cubic-bezier(.32, .72, 0, 1);
  --dur: .35s;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-paper:   #000000;
    --brand-ink:     #f5f5f7;
    --brand-accent:  #2997ff;
    --brand-muted:   #a1a1a6;
    --brand-line:    #424245;
    --brand-surface: #1d1d1f;

    --surface-hover: #272729;
    --ink-soft: #d2d2d7;
  }
}

/* ---------- reset ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
  background: var(--brand-paper);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--brand-paper);
  color: var(--brand-ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.47;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: 7rem; /* room for the floating nav */
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.1;
  text-wrap: balance;
}

::selection { background: var(--brand-accent); color: #fff; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand-ink); color: var(--brand-paper);
  padding: .75rem 1.25rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

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

/* ---------- type roles ---------- */

.mono {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .02em;
  color: var(--brand-muted);
  font-variant-numeric: tabular-nums;
}

.sub { color: var(--brand-muted); }

.link {
  color: var(--brand-accent);
  display: inline-flex; align-items: center; gap: .3em;
}
.link svg { width: .8em; height: .8em; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur) var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .link:hover { text-decoration: underline; text-underline-offset: .18em; }
  .link:hover svg { transform: translateX(3px); }
}

.live {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #34c759; vertical-align: 1px; margin-right: .45em;
}

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

.nav {
  position: fixed;
  left: 50%; bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 50;
  display: flex; align-items: center; gap: .125rem;
  padding: .3rem;
  border-radius: 999px;
  /* Glass: a translucent body, a specular line along the top edge, a soft
     shadow underneath, and heavy blur and saturation of what sits behind. */
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand-paper) 70%, transparent), color-mix(in srgb, var(--brand-paper) 40%, transparent));
  border: 1px solid color-mix(in srgb, var(--brand-ink) 8%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 70%, transparent),
    inset 0 -1px 0 color-mix(in srgb, var(--brand-ink) 4%, transparent),
    0 1px 2px rgba(0, 0, 0, .05),
    0 20px 48px -20px rgba(0, 0, 0, .25);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
@media (prefers-color-scheme: dark) {
  .nav {
    background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .05));
    border-color: rgba(255, 255, 255, .12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(0, 0, 0, .4), 0 20px 48px -20px rgba(0, 0, 0, .8);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--brand-paper); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
.nav__link {
  position: relative;
  display: inline-flex; align-items: center;
  padding: .55rem 1.05rem;
  border-radius: 999px;
  font-size: .875rem; font-weight: 500;
  color: var(--brand-muted);
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
/* The filled state is its own named element for the View Transition, so it
   glides from one label to the other when the page changes. */
.nav__link[aria-current="page"] {
  color: var(--brand-paper);
  background: var(--brand-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 2px 8px -2px rgba(0, 0, 0, .3);
  view-transition-name: nav-active;
}
.nav__link:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) {
  .nav__link:not([aria-current="page"]):hover { color: var(--brand-ink); background: color-mix(in srgb, var(--brand-ink) 6%, transparent); }
}

/* ---------- hero ---------- */

.hero { padding-top: clamp(var(--sp-4), 11vw, var(--sp-5)); padding-bottom: clamp(var(--sp-3), 5vw, var(--sp-4)); }
.hero__eyebrow { margin-bottom: var(--sp-2); font-size: var(--t-sm); color: var(--brand-muted); display: flex; flex-wrap: wrap; gap: .35rem .75rem; }
.hero__eyebrow strong { font-weight: 600; color: var(--brand-ink); }
.hero__title {
  font-size: var(--h1);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  max-width: 17ch;
}
.hero__sub {
  margin-top: var(--sp-2);
  font-size: var(--t-md);
  color: var(--brand-muted);
  max-width: 44ch;
  line-height: 1.4;
}
.hero__meta { margin-top: var(--sp-2); display: flex; flex-wrap: wrap; gap: .5rem var(--sp-2); }

/* ---------- chapters ---------- */

.chapter { padding-top: var(--chapter-gap); }
.chapter--first { padding-top: clamp(1.5rem, 3vw, 2.5rem); }
.chapter__head { max-width: 62ch; margin-bottom: var(--sp-3); }
.chapter__q { font-size: var(--t-sm); font-weight: 500; color: var(--brand-muted); margin-bottom: var(--sp-1); }
.chapter__title {
  font-size: var(--h2);
  letter-spacing: -0.028em;
  line-height: 1.05;
  max-width: 22ch;
}
.chapter__text { margin-top: var(--sp-2); font-size: var(--t-base); color: var(--ink-soft); max-width: 58ch; }
.chapter__text a { color: var(--brand-accent); }
@media (hover: hover) and (pointer: fine) { .chapter__text a:hover { text-decoration: underline; text-underline-offset: .18em; } }

/* ---------- project cards ---------- */

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

.card {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 300px;
  padding: clamp(1.5rem, 2.4vw, 2rem);
  border-radius: var(--r-lg);
  background: var(--brand-surface);
  color: inherit;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
@media (min-width: 720px) {
  .card { min-height: 360px; }
  .card--wide { grid-column: 1 / -1; min-height: 400px; }
}
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-2px); background: var(--surface-hover); box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .25); }
  .card:hover .card__arrow { opacity: 1; transform: none; }
}
.card:active { transform: scale(.995); }

.card__body { display: flex; flex-direction: column; flex: 1; }
.card__title, .card__desc, .card__date, .card__metric, .card__metric-label, .card__foot > span:first-child { display: block; }
.card__title { font-size: var(--h3); letter-spacing: -0.024em; font-weight: 600; line-height: 1.1; }
.card__desc { margin-top: .625rem; font-size: var(--t-sm); line-height: 1.45; color: var(--brand-muted); max-width: 34ch; }
.card__date { margin-top: .875rem; }
.card__foot { margin-top: auto; padding-top: 2rem; display: flex !important; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.card__metric {
  font-size: var(--h2);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.card__metric-label { margin-top: .5rem; font-size: .8125rem; color: var(--brand-muted); max-width: 26ch; }
.card__arrow {
  flex: none;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-paper);
  color: var(--brand-ink);
  opacity: 0; transform: translate(-4px, 4px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card__arrow svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: none) { .card__arrow { opacity: 1; transform: none; } }

/* Wide card with a product shot: text on top, image bleeding off the bottom. */
.card--wide .card__body { max-width: 44ch; }
.card__media {
  margin: 2rem calc(-1 * clamp(1.5rem, 2.4vw, 2rem)) calc(-1 * clamp(1.5rem, 2.4vw, 2rem));
  padding-left: clamp(1.5rem, 2.4vw, 2rem);
  overflow: hidden;
  flex: 1;
  display: flex; align-items: flex-start;
}
.card__media img {
  width: 100%;
  border-radius: var(--r-md) 0 0 0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 24px 48px -24px rgba(0, 0, 0, .35);
  transition: transform .8s var(--ease);
}
@media (min-width: 720px) {
  .card--wide { flex-direction: row; align-items: stretch; gap: 2rem; }
  .card--wide .card__body { flex: 0 0 40%; display: flex; flex-direction: column; }
  .card--wide .card__foot { margin-top: auto; padding-top: 2rem; }
  .card__media { flex: 1; margin: calc(-1 * clamp(1.5rem, 2.4vw, 2rem)) calc(-1 * clamp(1.5rem, 2.4vw, 2rem)) calc(-1 * clamp(1.5rem, 2.4vw, 2rem)) 0; padding: 3.5rem 0 0 0; align-items: flex-end; }
  .card__media img { width: 118%; max-width: none; border-radius: var(--r-md) 0 0 0; }
}
@media (hover: hover) and (pointer: fine) { .card:hover .card__media img { transform: translate(-6px, -6px); } }

/* ---------- inline proof strip ---------- */

.proof { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: clamp(1.5rem, 3vw, 2.25rem); }
@media (min-width: 720px) { .proof { grid-template-columns: repeat(4, 1fr); } }
.proof__cell { padding: 1.25rem 0 0; border-top: 1px solid var(--brand-line); }
.proof__value { font-size: var(--h3); font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.proof__label { margin-top: .5rem; font-size: .875rem; color: var(--brand-muted); }

/* ---------- how I work ---------- */

.rules { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 720px) { .rules { grid-template-columns: repeat(3, 1fr); } }
.rule {
  padding: clamp(1.5rem, 2.4vw, 2rem);
  border-radius: var(--r-lg);
  background: var(--brand-surface);
}
.rule__num { margin-bottom: 2.5rem; }
.rule__title { font-size: var(--h3); letter-spacing: -0.022em; line-height: 1.1; }
.rule__text { margin-top: .625rem; font-size: .9375rem; color: var(--brand-muted); line-height: 1.5; }

/* ---------- skills ---------- */

.skills { display: grid; grid-template-columns: 1fr; gap: 2rem 1.5rem; }
@media (min-width: 720px) { .skills { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .skills { grid-template-columns: repeat(4, 1fr); } }
.skills__group h3 { font-size: var(--t-md); margin-bottom: var(--sp-1); }
.skills__group li { font-size: .9375rem; color: var(--brand-muted); padding: .3rem 0; border-top: 1px solid var(--brand-line); }
.skills__group li:last-child { border-bottom: 1px solid var(--brand-line); }

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

.footer { margin-top: var(--chapter-gap); padding-top: 2rem; border-top: 1px solid var(--brand-line); }
.footer__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.footer__links { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.footer__links a { font-size: .875rem; color: var(--brand-muted); transition: color var(--dur) var(--ease); }
@media (hover: hover) and (pointer: fine) { .footer__links a:hover { color: var(--brand-ink); } }

/* ---------- project pages ---------- */

.back { display: inline-flex; align-items: center; gap: .4em; font-size: .875rem; color: var(--brand-muted); margin-top: clamp(2rem, 5vw, 3.5rem); transition: color var(--dur) var(--ease); }
.back svg { width: .8em; height: .8em; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { .back:hover { color: var(--brand-ink); } }

.proj-hero { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(2rem, 4vw, 3rem); }
.proj-hero__title { font-size: var(--h1); letter-spacing: -0.03em; line-height: 1; }
.proj-hero__sub { margin-top: var(--sp-2); font-size: var(--t-md); color: var(--brand-muted); max-width: 46ch; line-height: 1.4; }

.meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem 1.5rem; margin-top: clamp(2rem, 4vw, 3rem); padding-top: 1.5rem; border-top: 1px solid var(--brand-line); }
@media (min-width: 720px) { .meta { grid-template-columns: repeat(4, 1fr); } }
.meta dt { font-size: .8125rem; color: var(--brand-muted); }
.meta dd { margin-top: .25rem; font-size: .9375rem; font-weight: 500; }
.meta dd a { color: var(--brand-accent); }

.shot { margin-top: clamp(2rem, 4vw, 3rem); border-radius: var(--r-lg); overflow: hidden; background: var(--brand-surface); padding: clamp(1rem, 2.5vw, 2.5rem) clamp(1rem, 2.5vw, 2.5rem) 0; }
.shot img { border-radius: var(--r-md) var(--r-md) 0 0; box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .35); }
.shot__caption { margin-top: .875rem; }

.results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: clamp(2.5rem, 5vw, 4rem); }
@media (min-width: 720px) { .results { grid-template-columns: repeat(var(--cols, 3), 1fr); } }
.results__cell { padding: clamp(1.25rem, 2vw, 1.75rem); border-radius: var(--r-lg); background: var(--brand-surface); display: flex; flex-direction: column; gap: .625rem; }
.results__value { font-size: var(--h2); font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.results__label { font-size: .875rem; color: var(--brand-muted); line-height: 1.45; }
.results__src { margin-top: auto; }

.prose { margin-top: var(--sp-4); }
.prose > * { max-width: 66ch; }
.prose > * + * { margin-top: var(--sp-1); }
.prose h2 { font-size: var(--h3); letter-spacing: -0.022em; margin-top: var(--sp-4); line-height: 1.15; }
.prose > h2:first-child { margin-top: 0; }
.prose p { color: var(--ink-soft); }
.prose strong { color: var(--brand-ink); font-weight: 600; }
.prose a { color: var(--brand-accent); }
@media (hover: hover) and (pointer: fine) { .prose a:hover { text-decoration: underline; text-underline-offset: .18em; } }
.prose blockquote {
  margin: 2.5rem 0; padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--brand-ink);
  font-size: clamp(1.125rem, 1.6vw, 1.375rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.35;
}
.prose blockquote cite { display: block; margin-top: .75rem; font-size: .8125rem; font-style: normal; font-weight: 400; color: var(--brand-muted); }

.steps { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: clamp(2.5rem, 5vw, 4rem); }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps--two { grid-template-columns: 1fr; }
@media (min-width: 720px) { .steps--two { grid-template-columns: repeat(2, 1fr); } }
.step { padding: clamp(1.25rem, 2vw, 1.75rem); border-radius: var(--r-lg); background: var(--brand-surface); }
.step__num { margin-bottom: 1.25rem; }
.step__title { font-size: var(--t-md); letter-spacing: -0.02em; line-height: 1.2; }
.step__text { margin-top: .5rem; font-size: .9375rem; color: var(--brand-muted); line-height: 1.5; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.chips li { font-size: .8125rem; padding: .375rem .75rem; border-radius: 999px; border: 1px solid var(--brand-line); color: var(--ink-soft); }

.next { margin-top: clamp(3.5rem, 7vw, 5.5rem); padding: clamp(1.5rem, 2.4vw, 2rem); border-radius: var(--r-lg); background: var(--brand-surface); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.next__label { display: block; margin-bottom: .375rem; font-size: .8125rem; color: var(--brand-muted); }
.next__name { font-size: var(--h2); font-weight: 600; letter-spacing: -0.028em; line-height: 1.05; }
.next .card__arrow { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) { .next:hover { background: var(--surface-hover); transform: translateY(-2px); } }

/* ---------- career page ---------- */

.career { margin-top: clamp(2rem, 4vw, 3rem); }
.role { display: grid; grid-template-columns: 1fr; gap: .75rem 2rem; padding-block: clamp(1.75rem, 3vw, 2.5rem); border-top: 1px solid var(--brand-line); }
@media (min-width: 720px) { .role { grid-template-columns: 11rem 1fr; } }
.role__when { color: var(--brand-muted); padding-top: .2rem; }
.role__title { font-size: var(--h3); letter-spacing: -0.022em; line-height: 1.15; }
.role__org { margin-top: .25rem; font-size: 1rem; color: var(--brand-muted); }
.role__context { margin-top: .875rem; color: var(--ink-soft); max-width: 62ch; }
.role__list { margin-top: 1rem; display: grid; gap: .5rem; max-width: 66ch; }
.role__list li { position: relative; padding-left: 1.125rem; color: var(--ink-soft); font-size: .9875rem; }
.role__list li::before { content: ""; position: absolute; left: 0; top: .66em; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-line); }
.role__list a { color: var(--brand-accent); }
@media (hover: hover) and (pointer: fine) { .role__list a:hover { text-decoration: underline; text-underline-offset: .18em; } }

.section-title { font-size: var(--h2); letter-spacing: -0.028em; margin-top: var(--chapter-gap); margin-bottom: var(--sp-2); line-height: 1.05; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0; transform: translateY(14px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
    transition-delay: calc(var(--i, 0) * 60ms);
  }
  .js .reveal.is-in { opacity: 1; transform: none; }

  .hero__title, .hero__sub, .hero__meta, .proj-hero__title, .proj-hero__sub, .meta, .back, .shot {
    animation: settle .8s var(--ease) both;
  }
  .hero__sub, .proj-hero__sub { animation-delay: .08s; }
  .hero__meta, .meta { animation-delay: .16s; }
  .shot { animation-delay: .24s; }
  @keyframes settle { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

  /* Cross-document transitions. The old page dissolves and drifts up a
     little, the new one settles in underneath it. The nav is pinned as its
     own group so it never fades, and the filled label morphs between pages. */
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-out .28s var(--ease) both; }
  ::view-transition-new(root) { animation: vt-in .55s var(--ease) both; }
  @keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }
  .nav { view-transition-name: nav; }
  ::view-transition-old(nav), ::view-transition-new(nav) { animation: none; mix-blend-mode: normal; }
  ::view-transition-group(nav-active) { animation-duration: .55s; animation-timing-function: cubic-bezier(.3, .7, 0, 1); }
  ::view-transition-old(nav-active), ::view-transition-new(nav-active) { animation: none; height: 100%; }
  ::view-transition-image-pair(nav-active) { isolation: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- diagrams: show, don't tell ---------- */

.viz { margin-top: var(--sp-4); padding: var(--sp-2); border-radius: var(--r-lg); background: var(--brand-surface); }
.viz__grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-2); }
@media (min-width: 900px) { .viz__grid { grid-template-columns: 1fr 1fr; } .viz__grid--stack { grid-template-columns: 1fr; } }
.viz__label { display: block; margin-bottom: var(--sp-1); }
.viz__caption { margin-top: var(--sp-2); font-size: var(--t-sm); color: var(--brand-muted); max-width: 70ch; }
.viz + .viz { margin-top: var(--sp-2); }

.flow { display: flex; align-items: stretch; gap: .625rem; flex-wrap: wrap; }
.flow--col { flex-direction: column; }
.flow__arrow { flex: none; align-self: center; width: 1.25rem; height: 1.25rem; color: var(--brand-muted); }
.flow__arrow svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.flow--col .flow__arrow { transform: rotate(90deg); margin-left: var(--sp-1); }
@media (max-width: 719px) { .flow:not(.flow--keep) { flex-direction: column; } .flow:not(.flow--keep) .flow__arrow { transform: rotate(90deg); margin-left: var(--sp-1); } }

.node {
  flex: 1 1 9rem; min-width: 0;
  padding: var(--sp-1) 1.125rem;
  border-radius: var(--r-md);
  background: var(--brand-paper);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 8px 20px -14px rgba(0, 0, 0, .3);
}
.node__k { display: block; margin-bottom: .35rem; }
.node__v { display: block; font-size: var(--t-md); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.node__d { display: block; margin-top: .4rem; font-size: var(--t-xs); color: var(--brand-muted); line-height: 1.45; }
.node--ink { background: var(--brand-ink); color: var(--brand-paper); }
.node--ink .node__k, .node--ink .node__d { color: color-mix(in srgb, var(--brand-paper) 70%, transparent); }
.node--out { background: transparent; box-shadow: none; border: 1px dashed var(--brand-line); }
.node--out .node__v { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--brand-muted); }
.node--accent { box-shadow: inset 0 0 0 1.5px var(--brand-accent), 0 8px 20px -14px rgba(0, 0, 0, .3); }
.node-group { flex: 2 1 12rem; display: grid; gap: .625rem; }
.node--sm { padding: .75rem .9rem; }
.node--sm .node__v { font-size: var(--t-base); }

.bars { display: grid; gap: var(--sp-1); }
.bar { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr auto; align-items: center; gap: var(--sp-1); }
@media (max-width: 560px) { .bar { grid-template-columns: 1fr auto; } .bar__track { grid-column: 1 / -1; } }
.bar__label { font-size: var(--t-sm); color: var(--ink-soft); }
.bar__track { height: 12px; border-radius: 999px; background: var(--brand-paper); overflow: hidden; }
.bar__fill { height: 100%; width: var(--w, 50%); min-width: 6px; border-radius: 999px; background: var(--brand-ink); transform-origin: left; }
.bar--accent .bar__fill { background: var(--brand-accent); }
.bar--muted .bar__fill { background: var(--brand-line); }
.bar__value { font-size: var(--t-sm); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.js .reveal .bar__fill { transform: scaleX(0); transition: transform 1.1s var(--ease) .15s; }
.js .reveal.is-in .bar__fill { transform: none; }

.timeline { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; padding-top: 1.75rem; }
@media (max-width: 719px) { .timeline { grid-template-columns: repeat(2, 1fr); } }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: .45rem; height: 2px; background: var(--brand-line); border-radius: 1px; }
.timeline__pt { position: relative; }
.timeline__pt::before { content: ""; position: absolute; top: -1.75rem; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--brand-ink); box-shadow: 0 0 0 3px var(--brand-surface); }
.timeline__pt--accent::before { background: var(--brand-accent); }
.lanes { display: grid; gap: .5rem; margin-top: var(--sp-2); }
.lane { display: grid; grid-template-columns: minmax(8rem, 11rem) 1fr; align-items: center; gap: var(--sp-1); font-size: var(--t-sm); }
.lane__track { height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--brand-paper), var(--brand-ink) var(--from, 0%), var(--brand-ink) var(--to, 100%), var(--brand-paper) var(--to, 100%)); }

.phone { max-width: 320px; margin: 0 auto; padding: 1rem .875rem; border-radius: 28px; background: var(--brand-paper); box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 24px 48px -28px rgba(0,0,0,.35); display: grid; gap: .5rem; }
.phone__hdr { text-align: center; padding-bottom: .5rem; border-bottom: 1px solid var(--brand-line); margin-bottom: .25rem; }
.msg { max-width: 86%; padding: .6rem .8rem; border-radius: 18px; background: var(--brand-surface); font-size: var(--t-sm); line-height: 1.4; }
.msg--in { border-bottom-left-radius: 6px; }
.msg__cta { display: block; margin-top: .3rem; color: var(--brand-accent); font-weight: 600; }
.msg__when { display: block; text-align: center; margin: .25rem 0; }

.mock { background: var(--brand-paper); border-radius: var(--r-md); padding: .5rem 1rem; font-size: var(--t-sm); box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 8px 20px -14px rgba(0,0,0,.3); }
.mock__row { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: center; padding: .7rem 0; border-top: 1px solid var(--brand-line); }
.mock__row:first-child { border-top: 0; }
.mock__row--head { color: var(--brand-muted); }
.mock__row > span:last-child { text-align: right; }
.tag { display: inline-block; padding: .15rem .55rem; border-radius: 999px; background: var(--brand-surface); font-size: var(--t-xs); color: var(--ink-soft); white-space: nowrap; }
.tag--accent { background: color-mix(in srgb, var(--brand-accent) 14%, transparent); color: var(--brand-accent); }
.tag--ink { background: var(--brand-ink); color: var(--brand-paper); }

.search { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: 999px; background: var(--brand-paper); box-shadow: inset 0 0 0 1px var(--brand-line); color: var(--brand-muted); font-size: var(--t-sm); }
.search svg { width: 1rem; height: 1rem; stroke: currentColor; fill: none; stroke-width: 1.75; }
.results-list { margin-top: .75rem; display: grid; gap: .4rem; }
.results-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem .9rem; border-radius: var(--r-md); background: var(--brand-paper); font-size: var(--t-sm); }
.results-list li span:last-child { color: var(--brand-muted); }

.code { margin: 0; padding: var(--sp-1) 1.125rem; border-radius: var(--r-md); background: var(--brand-paper); font-family: var(--font-mono); font-size: var(--t-xs); line-height: 1.6; color: var(--ink-soft); overflow-x: auto; white-space: pre; box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 8px 20px -14px rgba(0,0,0,.3); }
.code b { font-weight: 500; color: var(--brand-accent); }
.code i { font-style: normal; color: var(--brand-muted); }

.states { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.state { padding: .55rem .9rem; border-radius: 999px; background: var(--brand-paper); font-size: var(--t-sm); font-weight: 500; box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 6px 16px -12px rgba(0,0,0,.3); }
.state--ink { background: var(--brand-ink); color: var(--brand-paper); }
.states__note { flex-basis: 100%; margin-top: .25rem; }

.tiers { display: grid; grid-template-columns: 1fr; gap: .75rem; }
@media (min-width: 720px) { .tiers { grid-template-columns: repeat(3, 1fr); } }
.tier { padding: var(--sp-1) 1.125rem; border-radius: var(--r-md); background: var(--brand-paper); box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 8px 20px -14px rgba(0,0,0,.3); }
.tier__price { display: block; margin-top: .25rem; font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.024em; }
.tier__price small { font-size: var(--t-xs); font-weight: 400; color: var(--brand-muted); letter-spacing: 0; }
.tier ul { margin-top: .75rem; display: grid; gap: .3rem; }
.tier li { font-size: var(--t-xs); color: var(--ink-soft); padding-left: 1rem; position: relative; }
.tier li::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-line); }
