/* ===========================================================================
   Justin Creasy — styles.css
   Direction: Apple-restrained, builder's notebook.
   Neutral and typographic. No shadows. One accent, used sparingly.
   Order: tokens -> themes -> reset -> elements -> layout -> components -> motion
   ======================================================================== */

/* --------------------------------------------------------------- tokens */

:root {
  color-scheme: light;

  /* surfaces + ink */
  --canvas: #FBFBFD;
  --surface: #F2F2F4;
  --ink: #1D1D1F;
  --ink-2: #6E6E73;
  --rule: #D9D9DE;

  /* the single accent: signal vermilion.
     --signal is for graphic and large use only (3.6:1 on canvas).
     --signal-text is the text-safe variant (5.0:1 on canvas). */
  --signal: #E8502A;
  --signal-text: #C2410C;

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

  /* layout */
  --max: 1120px;
  --read: 680px;
  --gutter: 24px;

  /* spacing scale */
  --s1: 4px;   --s2: 8px;    --s3: 12px;  --s4: 16px;  --s5: 24px;
  --s6: 32px;  --s7: 48px;   --s8: 72px;  --s9: 112px; --s10: 160px;

  /* radius: two steps, nothing else */
  --r-media: 20px;
  --r-small: 12px;

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-exit: cubic-bezier(0.55, 0, 1, 0.45);
  /* spring, response 0.28 damping 0.88 — bezier fallback, linear() below */
  --spring-settle: cubic-bezier(0.22, 1, 0.30, 1);

  --t-press: 140ms;
  --t-hover: 200ms;
  --t-reveal: 600ms;
  --t-draw: 900ms;
  --stagger: 70ms;
}

/* The real spring: a sampled solution of a second-order system at
   response 0.28s, damping ratio 0.88. Settles in 245ms, no overshoot. */
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring-settle: linear(
      0, 0.0229, 0.0803, 0.1581, 0.2464, 0.3377, 0.4272, 0.5117, 0.5891,
      0.6585, 0.7196, 0.7724, 0.8175, 0.8555, 0.8871, 0.9131, 0.9342,
      0.9511, 0.9645, 0.975, 0.9831, 0.9892, 0.9938, 0.9971, 1
    );
  }
}

/* --------------------------------------------------------------- themes */

/* Dark is composed, not inverted: the surface step stays one tone from the
   canvas, and the accent lightens so it keeps its weight against black. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #0B0B0C;
    --surface: #161618;
    --ink: #F5F5F7;
    --ink-2: #A1A1A6;
    --rule: #2C2C2E;
    --signal: #FF6A3D;
    --signal-text: #FF7A50;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0B0B0C;
  --surface: #161618;
  --ink: #F5F5F7;
  --ink-2: #A1A1A6;
  --rule: #2C2C2E;
  --signal: #FF6A3D;
  --signal-text: #FF7A50;
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--rule) transparent;
  overflow-x: clip;
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  caret-color: var(--signal-text);
}

::selection { background: var(--signal); color: #FFFFFF; }

:focus-visible {
  outline: 2px solid var(--signal-text);
  outline-offset: 3px;
  border-radius: 2px;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

button { font: inherit; color: inherit; background: none; border: 0; }

/* ------------------------------------------------------------- elements */

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.1;
  text-wrap: balance;
}

p { text-wrap: pretty; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover { color: var(--signal-text); }

code, kbd, pre { font-family: var(--mono); }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

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

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

.read { max-width: var(--read); }

.section { padding-block: var(--s9); }
.section--tight { padding-block: var(--s8); }
.section + .section { padding-top: 0; }

.section-head > :first-child { flex: 0 0 auto; max-width: 100%; }
.section-head {
  display: flex;
  flex-wrap: wrap;               /* a long note drops under the heading on a phone */
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3) var(--s5);
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--s8);
}

.skip-link {
  position: absolute;
  left: var(--s4);
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: var(--canvas);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-small);
  text-decoration: none;
  transition: top var(--t-hover) var(--ease-out);
}
.skip-link:focus { top: var(--s4); }

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

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

.display {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.h3 {
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lede {
  font-size: 1.3125rem;
  line-height: 1.45;
  color: var(--ink-2);
  letter-spacing: -0.011em;
  max-width: 34ch;
}

.body { max-width: 62ch; }
.body + .body { margin-top: var(--s5); }

.meta {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-2);
  letter-spacing: 0;
}

.dim { color: var(--ink-2); }

.link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color var(--t-hover) var(--ease-out),
              border-color var(--t-hover) var(--ease-out);
}
.link:hover { color: var(--signal-text); border-bottom-color: var(--signal-text); }

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

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: transparent;
  border-bottom: 1px solid transparent;
}

.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--canvas);
  border-bottom: 1px solid var(--rule);
  opacity: 0;
  transition: opacity var(--t-hover) var(--ease-out);
  pointer-events: none;
}
.nav.is-stuck::before { opacity: 1; }

.nav__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  text-decoration: none;
  color: var(--ink);
  flex: 0 0 auto;
}
.brand:hover { color: var(--ink); }

.mark {
  width: 16px;
  height: 31px;
  overflow: visible;
  flex: 0 0 auto;
}
.mark path {
  fill: none;
  stroke: var(--signal);
  stroke-width: 19.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand__name {
  font-weight: 600;
  letter-spacing: -0.017em;
  font-size: 1rem;
  white-space: nowrap;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(var(--s4), 3vw, var(--s6));
  list-style: none;
  padding: 0;
}

.nav__links a {
  position: relative;
  display: block;
  padding-block: var(--s3);
  text-decoration: none;
  font-size: 0.9375rem;
  color: var(--ink-2);
  transition: color var(--t-hover) var(--ease-out);
}
.nav__links a:hover { color: var(--ink); }

.nav__links a[aria-current="page"] { color: var(--ink); }
.nav__links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 6px;
  height: 1px;
  background: currentColor;
}

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

.hero {
  padding-top: clamp(var(--s7), 9vh, 120px);
  padding-bottom: var(--s8);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s6);
  align-items: center;
}

@media (min-width: 860px) {
  .hero__grid {
    grid-template-columns: auto 1fr;
    gap: clamp(var(--s7), 6vw, 104px);
  }
}

/* The hero mark is the signature object. It is laid out in flow, then
   transformed into the nav logo position by the scrubber in site.js. */
.hero__mark {
  height: clamp(124px, 21vh, 176px);
  width: auto;
}

@media (min-width: 860px) {
  .hero__mark { height: clamp(252px, 40vh, 400px); }
}

.mark-lg { height: 100%; width: auto; overflow: visible; }
.mark-lg path {
  fill: none;
  stroke: var(--signal);
  stroke-width: 19.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero__title { max-width: 14ch; }

.hero__lede {
  margin-top: var(--s6);
  max-width: 44ch;
}

/* The one drawn line: a nod to a speaking line, and the only place the
   accent is used as a shape on this page. */
.hero__line {
  margin-top: var(--s7);
  height: 2px;
  width: min(100%, 420px);
  background: var(--signal);
  transform-origin: left center;
  border-radius: 2px;
}

/* ------------------------------------------------- masked title rises */
/* The inner span is created by site.js, so without it a heading is just a
   heading. The padding/negative-margin pair keeps descenders off the mask. */

.rise {
  display: block;
  overflow: hidden;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}
.rise__i { display: block; }

.js .rise .rise__i {
  transform: translateY(105%);
  transition: transform var(--t-draw) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js .rise.is-in .rise__i { transform: none; }
.js .hero .rise .rise__i { transition-delay: calc(320ms + var(--i, 0) * 90ms); }

/* ------------------------------------------------------- pointer tilt */

[data-tilt] {
  transform:
    perspective(1000px)
    translate3d(var(--tx, 0px), var(--ty, 0px), 0)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    scale(var(--sc, 1));
}
[data-tilt].is-settling { transition: transform 420ms var(--spring-settle); }

/* -------------------------------------------------------- media + tiles */

.media {
  background: var(--surface);
  border-radius: var(--r-media);
  overflow: hidden;
  position: relative;
}

.media img {
  width: 100%;
  height: auto;
  transform-origin: center;
}

.media--tall img { aspect-ratio: 1 / 1.25; object-fit: cover; }

@media (hover: hover) and (pointer: fine) {
  a.media img,
  a:hover .media img { transition: transform var(--t-reveal) var(--ease-out); }
  a:hover .media img { transform: scale(1.025); }
}

.media__caption {
  margin-top: var(--s3);
}

/* ---------------------------------------------------------- demo tiles */
/* The screenshot is the real content and defines the box. JS overlays a
   same-origin iframe on top of it at exactly the same aspect ratio, so the
   upgrade cannot shift the layout. Without JS the screenshot simply stays. */

.demo-tile { position: relative; }

.demo-tile__frame {
  position: absolute;
  inset: 0;
  width: 1600px;
  height: 1000px;
  border: 0;
  display: block;
  transform-origin: 0 0;
  transform: scale(var(--k, 1));
  opacity: 0;
  transition: opacity var(--t-hover) var(--ease-out);
  /* the controls inside are a recording, not a UI */
  pointer-events: none;
}
.demo-tile.is-live .demo-tile__frame { opacity: 1; }

.stage__fig { display: block; }
.stage__fig figcaption { margin-top: var(--s3); }

/* ------------------------------------------------------- running blocks */

.run {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s6);
  align-items: center;
}

.run + .run { margin-top: var(--s9); }

@media (min-width: 860px) {
  .run {
    grid-template-columns: 1.45fr 1fr;
    gap: var(--s7);
  }
  /* Flipped: mirror the tracks too, so the media keeps the wide column. */
  .run--flip { grid-template-columns: 1fr 1.45fr; }
  .run--flip .run__media { order: 2; }
  .run--flip .run__text { order: 1; }
}

.run__text > * + * { margin-top: var(--s4); }
.run__text .body { margin-top: var(--s5); }

.run__facts {
  list-style: none;
  padding: 0;
  margin-top: var(--s5);
  border-top: 1px solid var(--rule);
}
.run__facts li {
  display: flex;
  gap: var(--s5);
  padding-block: var(--s3);
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.run__facts dt, .run__facts .k {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
  flex: 0 0 5.5rem;
  padding-top: 0.2em;
}
.run__facts .v { flex: 1 1 auto; }

/* --------------------------------------------------------------- stage */
/* Default is two stacked blocks, exactly like .run. On a large screen with
   motion allowed, site.js adds .has-stage and the same markup pins for three
   screens while one shot wipes over the other. */

.stage__panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s6);
  align-items: center;
}
.stage__panel + .stage__panel { margin-top: var(--s9); }

@media (min-width: 860px) {
  /* 7 of 12 columns to the media, 5 to the copy: the embedded product UI
     needs the width more than the prose does. */
  .stage__panel { grid-template-columns: 7fr 5fr; gap: var(--s6); }
  .stage__panel--b { grid-template-columns: 5fr 7fr; }
  .stage__panel--b .stage__fig,
  .stage__panel--b > .stage__media { order: 2; }
  .stage__panel--b .stage__copy { order: 1; }
}

.stage__copy > * + * { margin-top: var(--s4); }
.stage__copy .body { margin-top: var(--s5); }
.stage__copy .run__facts { margin-top: var(--s5); }

/* pinned mode */
.has-stage .stage-track { height: 300vh; }

.has-stage .stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  align-content: center;
}

.has-stage .stage__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  translate: 0 -50%;
  margin: 0;
  grid-template-columns: 7fr 5fr;
  gap: var(--s6);
}
.has-stage .stage__panel--b { grid-template-columns: 7fr 5fr; z-index: 2; }
.has-stage .stage__panel--b .stage__fig,
.has-stage .stage__panel--b > .stage__media { order: 0; }
.has-stage .stage__panel--b .stage__copy  { order: 0; }

/* the first shot settles in */
.has-stage .stage__panel--a .stage__media {
  --sc: calc(0.86 + 0.14 * var(--a, 0));
  border-radius: calc(28px - 8px * var(--a, 0));
}
/* The two copy blocks hand over rather than cross-dissolve: one is gone
   before the other starts, so the stacked text is never readable twice. */
.has-stage .stage__panel--a .stage__copy {
  opacity: min(var(--a, 0), max(0, calc(1 - var(--w, 0) / 0.45)));
  translate: 0 calc(24px * (1 - var(--a, 0)));
}

/* then the second wipes in from the right */
.has-stage .stage__panel--b .stage__media {
  clip-path: inset(0 0 0 calc(100% - 100% * var(--w, 0)));
}
.has-stage .stage__panel--b .stage__copy {
  --b: max(0, calc((var(--w, 0) - 0.45) / 0.55));
  opacity: var(--b);
  translate: 0 calc(16px * (1 - var(--b)));
}

/* Captions sit outside the wiped tile, so they follow their panel's copy
   through the same hand-off instead of stacking on top of each other. */
.has-stage .stage__panel--a figcaption {
  opacity: min(var(--a, 0), max(0, calc(1 - var(--w, 0) / 0.45)));
}
.has-stage .stage__panel--b figcaption {
  opacity: max(0, calc((var(--w, 0) - 0.45) / 0.55));
}

/* only the visible half takes the pointer */
.has-stage .stage__panel--b .stage__copy { pointer-events: none; }
.has-stage .stage.is-b .stage__panel--b .stage__copy { pointer-events: auto; }
.has-stage .stage.is-b .stage__panel--a .stage__copy { pointer-events: none; }

/* ------------------------------------------------- working on: products */
/* Shoptimal and Sayforth, feature by feature, above the menu-bar app below.
   Same hairline language as .results and .run__facts elsewhere on the site:
   no cards, no shadows, grouping by a rule and by proximity. */

.wk-products > .wk-product + .wk-product {
  margin-top: var(--s9);
  padding-top: var(--s8);
  border-top: 1px solid var(--rule);
}

.wk-product__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s2) var(--s5);
}
.wk-product__head .h3 { margin: 0; }

.wk-product .body { margin-top: var(--s5); }

.wk-features {
  list-style: none;
  padding: 0;
  margin-top: var(--s6);
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 0 var(--s7);
}
.wk-features li {
  padding-block: var(--s4);
  border-bottom: 1px solid var(--rule);
  max-width: 54ch;
}
.wk-features b { font-weight: 600; }

@media (min-width: 900px) {
  .wk-features { grid-template-columns: 1fr 1fr; }
}

.wk-now { margin-top: var(--s6); }
.wk-now__list {
  list-style: none;
  padding: 0;
  margin-top: var(--s2);
  max-width: 62ch;
}
.wk-now__list li {
  position: relative;
  padding-left: var(--s4);
  color: var(--ink-2);
  font-size: 0.9375rem;
}
.wk-now__list li + li { margin-top: var(--s2); }
.wk-now__list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.6em;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ink-2);
}

/* ------------------------------------------------------ the menu-bar app */
/* "What I'm working on". Three blocks in ordinary document flow. The first two
   put copy on one side and the live thing on the other, sides alternating;
   the third puts its copy above a full width screen for the bar. No pinning, no
   wipe, no media tile: what sits beside the copy is the app's own interface,
   ported from the SwiftUI source and running here.

   Those surfaces keep the app's palette, which is Shoptimal's:
     navy   #0A2836   navy deep #061A23   ink 700 #1F323B
     ink500 #4A5B66   ink 300   #7D8B94   ink 200 #A8B4BC
     line   #E3E8EE   sheet     #FFFFFF   mist    #F5F6FA
     teal   #14B8A6   teal dim  #0F766E   success #10B981
     gold   #D8A94A   danger    #EF4444   amber   #F59E0B
   The app sets all of it in Gotham Rounded, which is not a web font here, so
   the system face stands in. Sizes, spacing and radii are the app's own. */

.av__block { display: grid; gap: var(--s6); }

.av__block + .av__block {
  margin-top: var(--s9);
  padding-top: var(--s8);
  border-top: 1px solid var(--rule);
}

@media (min-width: 900px) {
  .av__block {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--s8);
    align-items: start;
  }
  /* The side the live thing sits on alternates down the section. */
  .av__block--flip .av__text { order: 2; }
  .av__block--flip .av__vis { order: 1; }
}

.av__text .h3 + .body { margin-top: var(--s4); }
.av__vis { margin: 0; }
.av__vis figcaption { margin-top: var(--s4); max-width: 46ch; }

.av__status {
  margin-top: var(--s7);
  font-size: 0.9375rem;
  color: var(--ink-2);
  min-height: 1.6em;
  max-width: 62ch;
}

/* --------------------------------------------------------- 1. the day */

.av__day {
  list-style: none;
  padding: 0;
  margin-top: var(--s6);
  border-top: 1px solid var(--rule);
}
.av__day-row { border-bottom: 1px solid var(--rule); }

.js .av__day-row {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--t-reveal) var(--ease-out),
              transform var(--t-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
.js .av__day.is-in .av__day-row { opacity: 1; transform: none; }

.av__day-l {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s3) var(--s4);
  /* Body-size labels on an 18px control, padded out to a 44px row. */
  padding-block: var(--s3);
  min-height: 44px;
  cursor: pointer;
  font-size: 1.0625rem;
}
.av__day-l input {
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
  cursor: pointer;
  flex: 0 0 auto;
}
.av__day-l input:focus-visible { outline: 2px solid var(--signal-text); outline-offset: 4px; }
.av__day-m { white-space: nowrap; }
.av__day-l input:checked ~ .av__day-t {
  color: var(--ink-2);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

/* The glass has room of its own to be moved around in. It rests in the middle
   of it; on my screen it rests bottom right and clear of the Dock. */
.av__stage {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 300px;
  touch-action: none;
}

.av__glass {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--gsize, 300px);
  height: var(--gsize, 300px);
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
  translate: var(--gx, 0px) var(--gy, 0px);
  /* The app's own states: 1.06 lifted, 0.93 pressed, on its spring. */
  transition: scale 280ms var(--spring-settle);
}
.av__glass.is-lifted { scale: 1.06; }
.av__glass.is-held { cursor: grabbing; scale: 0.93; }
.av__glass:focus-visible {
  outline: 2px solid var(--signal-text);
  outline-offset: 2px;
  border-radius: 50%;
}
@media (hover: hover) and (pointer: fine) {
  .av__glass:hover { scale: 1.06; }
  .av__glass.is-held:hover { scale: 0.93; }
}
.av__svg { display: block; width: 100%; height: auto; }

/* ------------------------------------------------------------ 2. voice */

.av__hold {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3) var(--s5);
  margin-top: var(--s6);
}

.av__key {
  display: inline-flex;
  align-items: center;
  gap: var(--s4);
  font-size: 1rem;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--r-small);
  padding: var(--s3) var(--s5) var(--s3) var(--s3);
  min-height: 56px;
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transition: border-color var(--t-hover) var(--ease-out),
              transform var(--t-press) var(--ease-out);
}
.av__key-cap {
  font-family: var(--mono);
  font-size: 1.125rem;
  min-width: 3.2em;
  text-align: center;
  border: 1px solid var(--rule);
  border-bottom-width: 3px;
  border-radius: 10px;
  padding: var(--s2) var(--s3);
  background: var(--surface);
  transition: border-bottom-width var(--t-press) var(--ease-out),
              background-color var(--t-hover) var(--ease-out);
}
.av__key-label { color: var(--ink-2); font-size: 0.9375rem; }
.av__key:hover { border-color: var(--ink-2); }
.av__key.is-down { transform: translateY(1px); }
.av__key.is-down .av__key-cap { border-bottom-width: 1px; background: var(--rule); }
.av__key:focus-visible { outline: 2px solid var(--signal-text); outline-offset: 2px; }

/* The screen the pill flies up into. The ground and the marked screen edge
   are the app's own preview colours: #E9EDF1 with a 2px #9AA7AF edge. */
.app-screen {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 64px;
  min-height: 280px;
  background: #E9EDF1;
  border-radius: var(--r-small);
  font-family: var(--sans);
  line-height: 1.45;
}
.app-screen::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: #9AA7AF;
}

/* The app that happens to be in front. */
.app-win {
  background: #FFFFFF;
  border: 1px solid #E3E8EE;
  border-radius: 10px;
  overflow: hidden;
}
.app-win__bar {
  display: flex;
  gap: 5px;
  padding: 8px 10px;
  border-bottom: 1px solid #E3E8EE;
}
.app-win__bar i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #E3E8EE;
}
.app-win__text {
  padding: 10px;
  font-size: 15px;
  color: #0A2836;
  min-height: 5.2em;
}
.app-win__caret {
  display: inline-block;
  width: 1.5px;
  height: 1em;
  margin-left: 1px;
  vertical-align: -0.14em;
  background: #0F766E;
  opacity: 0;
}
.app-screen.is-listening .app-win__caret {
  opacity: 1;
  animation: av-blink 1s steps(1, end) infinite;
}
@keyframes av-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* The listening pill: 44 high, a 7px state dot, nine 3px bars in a 78 by 26
   group, 16 either side, white on a hairline. It rises from below the screen
   edge while the key is held and falls straight back out when it comes up.
   The app gives it a shadow; this site has none anywhere, so it has none. */
.app-pill {
  position: absolute;
  left: 50%;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  background: #FFFFFF;
  border: 1px solid #E3E8EE;
  border-radius: 22px;
  opacity: 0;
  transform: translate(-50%, 56px) scale(0.92, 1.08);
  transform-origin: 50% 100%;
  transition: opacity 120ms var(--ease-out), transform 240ms var(--ease-exit);
}
.app-screen.is-listening .app-pill {
  opacity: 1;
  transform: translate(-50%, 0) scale(1, 1);
  transition: opacity 120ms var(--ease-out), transform 245ms var(--spring-settle);
}
.app-pill__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #10B981;
  flex: 0 0 auto;
}
.app-pill__bars {
  display: flex;
  align-items: center;
  gap: 3px;
  width: 78px;
  height: 26px;
}
.app-pill__bars i {
  display: block;
  width: 3px;
  height: 3px;                    /* three points tall is silence */
  border-radius: 1.5px;
  background: rgba(10, 40, 54, 0.85);
  transition: height 60ms linear;
}

/* ------------------------------------------------- 3. the Chief of Staff */
/* One surface, from the app: a plain white panel
   with a #E3E8EE hairline that comes up out of the bottom edge of the screen,
   centred, 28 above it, min(760, screen - 80) wide. Compact it is 76 high and
   a true stadium; taller, its corner eases to 24. The app gives it a window
   shadow; this site has none anywhere, so it has none.

   The shape is a clip over content that always sits at its full size, pinned
   to the foot, which is how the app does it too: nothing inside is redrawn,
   it is revealed. The hairline is the outer box showing one pixel around the
   inner one, so it follows the clip. */

.av__block--wide { grid-template-columns: minmax(0, 1fr); }
.av__block--wide .av__text { max-width: 62ch; }
.av__block--wide .av__vis figcaption { max-width: 62ch; }

.app-desk {
  container-type: inline-size;
  padding: 0;
  min-height: 580px;
}

/* The glass rests bottom right on the desktop, clear of the bar. */
.app-desk__glass {
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: 84px;
  height: 84px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: scale 280ms var(--spring-settle);
}
.app-desk__glass:active { scale: 0.93; }
.app-desk__glass:focus-visible { outline: 2px solid #0F766E; outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .app-desk__glass:hover { scale: 1.06; }
  .app-desk__glass:active:hover { scale: 0.93; }
}

.app-bar {
  --clip: 0px;
  --rad: 24px;
  --rise: 0px;
  --morph: 0s;
  --curve: cubic-bezier(0.16, 1, 0.30, 1);
  position: absolute;
  left: 40px;
  right: 40px;
  bottom: 28px;
  max-width: 760px;
  margin-inline: auto;
  padding: 1px;
  background: #E3E8EE;
  color: #0A2836;
  font-family: var(--sans);
  line-height: 1.3;
  transform: translateY(var(--rise));
  clip-path: inset(var(--clip) 0 0 0 round var(--rad));
  transition: clip-path var(--morph) var(--curve),
              transform var(--morph) var(--curve),
              opacity var(--morph) var(--curve);
}
.app-bar__in {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: #FFFFFF;
  clip-path: inset(var(--clip) 0 0 0 round calc(var(--rad) - 1px));
  transition: clip-path var(--morph) var(--curve);
}
.app-bar__in > * { flex: 0 0 auto; }
.app-bar [hidden] { display: none !important; }

.js .app-bar:not(.is-up) { visibility: hidden; }
/* The content acknowledges the arrival a beat after the shape has landed. */
.app-bar__in > * { transition: opacity 260ms var(--ease-out); }
.app-bar.is-arriving .app-bar__in > * { opacity: 0; transition: none; }

.app-bar__rule { height: 1px; background: #E3E8EE; }
.app-bar__gap { flex: 1 1 auto; }

.app-bar button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.app-bar button:focus-visible { outline: 2px solid #0F766E; outline-offset: 2px; }

/* Header: only once there is a conversation. */
.app-bar__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.app-bar__dot {
  position: relative;
  width: 7px; height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #10B981;
  transition: scale 200ms var(--spring-settle);
}
.app-bar__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #F59E0B;
  opacity: 0;
  transition: opacity 160ms var(--ease-out);
}
.app-bar.is-busy .app-bar__dot::after { opacity: 1; }
.app-bar__dot.is-beat { scale: 1.16; }
.app-bar__who { font-weight: 500; }
.app-bar__clock { font-family: var(--mono); font-size: 11px; color: #7D8B94; }
.app-bar__hist,
.app-bar .app-bar__new { color: #7D8B94; }
.app-bar .app-bar__new { position: relative; }
.app-bar .app-bar__new:hover { color: #0A2836; }
.app-bar .app-bar__x {
  position: relative;
  width: 22px; height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #F5F6FA;
  color: #7D8B94;
}
.app-bar__x svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
/* The app's controls are small. The hit areas here are not. */
.app-bar__new::after,
.app-bar__x::after,
.app-day__refresh::after,
.app-day__disc::after {
  content: "";
  position: absolute;
  left: -4px; right: -4px;
  top: 50%;
  height: 40px;
  transform: translateY(-50%);
}

/* Transcript. */
.app-bar__log {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  max-height: 330px;
  overflow-y: auto;
  padding: 8px 20px;
  scrollbar-width: thin;
}
.app-bar__log > * { flex: 0 0 auto; }
/* With the day asked back mid-conversation, the transcript gives it the room. */
.app-bar.is-pinned .app-bar__log { max-height: 88px; }
.app-msg { max-width: 100%; font-size: 14px; }
.app-msg--me {
  align-self: flex-end;
  padding: 9px 14px;
  border-radius: 18px;
  background: #0A2836;
  color: #FFFFFF;
}
.app-msg--chief { line-height: 1.45; }
.app-msg--receipt {
  margin-top: -8px;
  font-family: var(--mono);
  font-size: 11px;
  color: #7D8B94;
}
.app-msg--note {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: #4A5B66;
}
.app-msg--note i {
  width: 6px; height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #F59E0B;
  translate: 0 -1px;
}

.app-steps {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  border-radius: 14px;
  background: #F5F6FA;
}
.app-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #0A2836;
  min-width: 0;
}
.app-step.is-in { padding-left: 18px; }
.app-step.is-done { color: #7D8B94; }
.app-step__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-step__i {
  width: 10px; height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1.5px solid #A8B4BC;
  border-top-color: transparent;
  animation: av-spin 0.8s linear infinite;
}
.app-step.is-done .app-step__i {
  border: 0;
  border-radius: 0;
  animation: none;
  background: none;
  position: relative;
}
.app-step.is-done .app-step__i::after {
  content: "";
  position: absolute;
  left: 3px; top: 0;
  width: 3px; height: 7px;
  border: solid #10B981;
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg);
}
@keyframes av-spin { to { transform: rotate(360deg); } }

/* Something that needs me arrives with more weight than a message, states its
   border once, and goes quiet. */
.app-ask {
  position: relative;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px;
  border-radius: 14px;
  background: #FFFFFF;
  border: 1px solid rgba(245, 158, 11, 0.55);
}
.app-ask.is-answered { border-color: #E3E8EE; }
.app-ask::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 14px;
  border: 1.8px solid rgba(245, 158, 11, 0.95);
  opacity: 0;
  pointer-events: none;
}
.app-ask.is-new::after { animation: av-mark 460ms 220ms var(--ease-out) 1 both; }
@keyframes av-mark { 0% { opacity: 0; } 39% { opacity: 1; } 100% { opacity: 0; } }
.app-ask__top { display: flex; align-items: center; gap: 7px; }
.app-ask__top svg { width: 11px; height: 13px; flex: 0 0 auto; fill: #B45309; }
.app-ask__title { font-size: 12px; font-weight: 600; }
.app-ask__src { font-size: 10.5px; color: #7D8B94; }
.app-ask__why { font-size: 12.5px; color: #4A5B66; }
.app-ask__what {
  padding: 8px 10px;
  border-radius: 10px;
  background: #F5F6FA;
  font-family: var(--mono);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}
.app-ask__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.app-bar .app-ask__yes,
.app-bar .app-ask__no {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  transition: transform var(--t-press) var(--ease-out);
}
.app-bar .app-ask__yes { font-weight: 600; color: #FFFFFF; background: #0F766E; }
.app-bar .app-ask__no { font-weight: 500; background: #F5F6FA; }
.app-ask__yes:active, .app-ask__no:active { transform: scale(0.97); }
.app-ask__hint, .app-ask__done { font-size: 10.5px; color: #7D8B94; }
.app-ask__done { font-size: 11.5px; }

.app-bar__log > .is-new { animation: av-msg 170ms var(--ease-out) both; }
.app-bar__log > .app-ask.is-new { animation: av-ask 220ms cubic-bezier(0.16, 1, 0.30, 1) both; }
@keyframes av-msg { from { opacity: 0; transform: translateY(5px); } }
@keyframes av-ask { from { opacity: 0; transform: translateY(12px) scale(0.985); } }
@keyframes av-fade { from { opacity: 0; } }

/* The day at a glance. */
.app-day {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 20px 4px;
}
.app-day__top { display: flex; align-items: flex-start; gap: 16px; }
.app-day__today { flex: 1 1 0; min-width: 0; }
.app-day__label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #7D8B94;
}
.app-day__tasks { list-style: none; margin: 7px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.app-bar .app-day__task {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  text-align: left;
}
.app-bar .app-day__task.is-auto { cursor: default; }
.app-day__circle {
  position: relative;
  width: 13px; height: 13px;
  margin-top: 1.5px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1.3px solid #7D8B94;
}
.app-day__task.is-auto .app-day__circle { border-color: #A8B4BC; }
.app-day__task[aria-checked="true"] .app-day__circle { border-color: #10B981; background: #10B981; }
.app-day__task[aria-checked="true"] .app-day__circle::after {
  content: "";
  position: absolute;
  left: 3.4px; top: 1.2px;
  width: 3px; height: 6px;
  border: solid #FFFFFF;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.app-day__words { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.app-day__title,
.app-day__evi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-day__title { font-size: 12.5px; font-weight: 500; color: #1F323B; }
.app-day__evi { font-size: 10.5px; color: #7D8B94; }
.app-day__task[aria-checked="true"] .app-day__title {
  font-weight: 400;
  color: #7D8B94;
  text-decoration: line-through;
}

.app-star {
  flex: 0 0 250px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px;
  border: 1px solid #E3E8EE;
  border-radius: 11px;
  background: #FFFFFF;
}
.app-star__row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.app-star__pace { font-size: 10px; font-weight: 600; color: #10B981; }
.app-star__num { font-size: 12px; color: #7D8B94; }
.app-star__num b { margin-right: 2px; font-size: 24px; font-weight: 700; color: #1F323B; }
.app-star__track { display: block; height: 5px; border-radius: 999px; background: #E3E8EE; overflow: hidden; }
.app-star__track i { display: block; height: 100%; border-radius: 999px; background: #10B981; }
.app-star__foot { font-size: 10.5px; color: #7D8B94; }

.app-day__attn,
.app-day__rest { display: flex; flex-direction: column; gap: 5px; }
.app-day__rest { gap: 10px; }
.app-day__bullet {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 12px;
  color: #4A5B66;
}
.app-day__bullet i {
  width: 5px; height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #D8A94A;
  translate: 0 -2px;
}
.app-day__bullet.is-critical i { background: #EF4444; }
.app-day__bullet.is-ok i { background: #10B981; }
.app-day__bullet.is-quiet i { background: #7D8B94; }
.app-day__streak { font-size: 10.5px; color: #7D8B94; }

.app-day__more { display: flex; align-items: center; gap: 10px; min-height: 18px; white-space: nowrap; }
.app-bar .app-day__disc {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 11.5px;
  font-weight: 500;
  color: #7D8B94;
}
.app-day__disc span { overflow: hidden; text-overflow: ellipsis; }
.app-day__disc svg {
  width: 8px; height: 8px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 170ms var(--ease-out);
}
.app-day__disc[aria-expanded="true"] svg { transform: rotate(90deg); }
.app-day__updated { font-size: 10.5px; color: #7D8B94; }
.app-bar .app-day__refresh { position: relative; font-size: 11px; color: #0F766E; }

/* Folded to a line while I am typing or mid-conversation. */
.app-bar .app-dayline {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 9px 20px;
  font-size: 11.5px;
  color: #4A5B66;
  text-align: left;
  white-space: nowrap;
}
.app-bar .app-dayline:focus-visible { outline-offset: -3px; }
.app-dayline > span:first-child { font-weight: 500; }
.app-dayline__attn { color: #D8A94A; }
.app-dayline svg {
  width: 10px; height: 6px;
  flex: 0 0 auto;
  fill: none;
  stroke: #7D8B94;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The input row. */
.app-bar__row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 0 18px;
}
.app-bar__circle,
.app-bar .app-bar__circle,
.app-bar__send {
  width: 40px; height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.app-bar__circle,
.app-bar .app-bar__circle { background: #F5F6FA; color: #0A2836; }
.app-bar__send { background: #A8B4BC; color: #FFFFFF; transition: opacity var(--t-hover) var(--ease-out); }
.app-bar__row.is-ready .app-bar__send { background: #0F766E; }
.app-bar__circle svg,
.app-bar__send svg {
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-bar__team svg { width: 18px; height: 14px; fill: currentColor; stroke: none; }
.app-bar__stop svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.app-bar__team, .app-bar__stop { transition: transform var(--t-press) var(--ease-out); }
.app-bar__team:active, .app-bar__stop:active { transform: scale(0.93); }
.app-bar .app-bar__field {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-size: 15px;
  color: #7D8B94;
}
.app-bar .app-bar__field.is-asked { color: #0A2836; }
.app-bar.is-busy .app-bar__field { cursor: default; }

/* Narrower than the app ever is: the north star goes under TODAY, and the
   glass moves up out of the bar's way. */
@container (max-width: 980px) {
  .app-desk__glass { bottom: auto; top: 14px; right: 14px; width: 72px; height: 72px; }
}
@container (max-width: 700px) {
  .app-bar { left: 12px; right: 12px; bottom: 20px; }
  .app-day__top { flex-direction: column; align-items: stretch; gap: 12px; }
  .app-star { flex: 0 0 auto; }
  .app-bar__hist { display: none; }
  .app-bar__log { max-height: 300px; }
  .app-bar.is-pinned .app-bar__log { max-height: 48px; }
}
@container (max-width: 460px) {
  .app-bar { left: 8px; right: 8px; bottom: 14px; }
  .app-bar__head, .app-bar__log, .app-day, .app-bar .app-dayline { padding-left: 14px; padding-right: 14px; }
  .app-bar__row { padding: 0 12px; gap: 8px; }
  .app-bar .app-bar__circle--shot { display: none; }
  .app-bar__new span { display: none; }
  .app-day__updated { display: none; }
  .app-ask__hint { flex-basis: 100%; }
}

/* ------------------------------------------------------ shared controls */

.av__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3) var(--s4);
  margin-top: var(--s5);
}

.av__btn {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-small);
  padding: var(--s3) var(--s4);
  min-height: 44px;
  cursor: pointer;
  transition: color var(--t-hover) var(--ease-out),
              border-color var(--t-hover) var(--ease-out),
              transform var(--t-press) var(--ease-out);
}
.av__btn:hover { color: var(--ink); border-color: var(--ink-2); }
.av__btn:active { transform: scale(0.97); }
.av__btn:focus-visible { outline: 2px solid var(--signal-text); outline-offset: 2px; }

/* Without JavaScript nothing here can run, so nothing that needs it is
   offered. The three blocks and the app's surfaces stay, because they are
   the point. */
html:not(.js) .av__controls,
html:not(.js) .av__hold,
html:not(.js) .av__status,
html:not(.js) .av__day-l input { display: none; }
html:not(.js) .app-bar button,
html:not(.js) .app-desk__glass { pointer-events: none; cursor: default; }
html:not(.js) .av__day-l { cursor: default; }
html:not(.js) .av__glass { cursor: default; }
html:not(.js) .app-win__text [data-av-heard]::after {
  content: "Add a task: check the order confirmation email";
}

@media (prefers-reduced-motion: reduce) {
  .js .av__day-row { opacity: 1; transform: none; }
  .app-step__i { animation: none; }
  .app-bar__log > .is-new,
  .app-bar__log > .app-ask.is-new { animation: av-fade 140ms var(--ease-out) both; }
  .app-ask.is-new::after { animation: none; }
  .app-pill__bars i { transition: none; }
  .app-win__caret { animation: none; }
}

@media (max-width: 900px) {
  .av__stage { max-width: 420px; }
}

@media (max-width: 700px) {
  :root { --gsize: 220px; }
  .av__stage { min-height: 240px; }
  .app-screen { padding: 14px 14px 62px; min-height: 250px; }
  .app-desk { padding: 0; min-height: 660px; }
}

/* --------------------------------------------------------- lead project */

.lead__media { margin-bottom: var(--s7); }

.lead__grid {
  display: grid;
  gap: var(--s6);
}

@media (min-width: 860px) {
  .lead__grid { grid-template-columns: 1fr 1.1fr; gap: var(--s8); }
}

/* Numbers as sentences on hairlines, not tiles. */
.results {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.results li {
  padding-block: var(--s4);
  border-bottom: 1px solid var(--rule);
  max-width: 54ch;
}
.results b { font-weight: 600; }

/* --------------------------------------------------------- pair of shots */

.pair {
  display: grid;
  gap: var(--s5);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .pair { grid-template-columns: 1fr 1fr; gap: var(--s6); }
  .pair--lean { grid-template-columns: 1.8fr 1fr; align-items: start; }
}

/* The phone shot is cropped to sit close to the height of its neighbour. */
.media--phone img { aspect-ratio: 480 / 760; object-fit: cover; object-position: 50% 0; }

/* -------------------------------------------------------------- rows */

.rows { border-top: 1px solid var(--rule); }

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--s5);
  padding-block: var(--s5);
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
}

.row--media {
  grid-template-columns: 96px 1fr auto;
}

.row__thumb {
  width: 96px;
  border-radius: var(--r-small);
  overflow: hidden;
  background: var(--surface);
}
.row__thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.row__title {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  transition: color var(--t-hover) var(--ease-out);
}
.row__note { color: var(--ink-2); font-size: 0.9375rem; }

.row__chev {
  width: 7px; height: 12px;
  color: var(--ink-2);
  flex: 0 0 auto;
}
.row__chev path {
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

@media (hover: hover) and (pointer: fine) {
  .row__chev { transition: transform var(--t-hover) var(--ease-out), color var(--t-hover) var(--ease-out); }
  .rows:hover .row { transition: opacity var(--t-hover) var(--ease-out); }
  .rows:hover .row:not(:hover) { opacity: 0.55; }
  .row:hover .row__chev {
    transform: translateX(4px);
    transition-timing-function: var(--spring-settle);
    color: var(--signal-text);
  }
  .row:hover .row__title { color: var(--signal-text); }
}

/* ------------------------------------------------------------- writing */

.posts { border-top: 1px solid var(--rule); }

.post-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--s5);
  padding-block: var(--s5);
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.post-row .row__title { max-width: 40ch; }
.post-row time { flex: 0 0 auto; }

@media (hover: hover) and (pointer: fine) {
  .posts:hover .post-row { transition: opacity var(--t-hover) var(--ease-out); }
  .posts:hover .post-row:not(:hover) { opacity: 0.55; }
  .post-row:hover .row__title { color: var(--signal-text); }
}

/* ----------------------------------------------------------------- post */

.post { padding-block: var(--s8) var(--s9); }
.post__head { margin-bottom: var(--s8); padding-bottom: var(--s6); border-bottom: 1px solid var(--rule); }
.post__title { margin-top: var(--s4); max-width: 22ch; }

.post__body { font-size: 1.0625rem; }
.post__body > * + * { margin-top: var(--s5); }
.post__body h2 {
  font-size: 1.375rem;
  letter-spacing: -0.018em;
  margin-top: var(--s8);
}
.post__body ul, .post__body ol { padding-left: 1.25em; }
.post__body li + li { margin-top: var(--s2); }
.post__body strong { font-weight: 600; }

.post__body pre {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-small);
  padding: var(--s4) var(--s5);
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.65;
  tab-size: 4;
}
.post__body pre code { color: var(--ink); white-space: pre; }

/* Code runs a little wider than the prose measure so real lines fit. */
@media (min-width: 780px) {
  .post__body pre { margin-inline: calc(var(--s5) * -1); }
}
.post__body :not(pre) > code {
  background: var(--surface);
  border-radius: 4px;
  padding: 0.12em 0.34em;
  font-size: 0.875em;
}

.post__body blockquote {
  border-left: 2px solid var(--signal);
  padding-left: var(--s5);
  color: var(--ink-2);
}

.post__body h3 {
  font-size: 1.1875rem;
  letter-spacing: -0.014em;
  margin-top: var(--s7);
}
.post__body h4 {
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  margin-top: var(--s6);
}

.post__body a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color var(--t-hover) var(--ease-out),
              border-color var(--t-hover) var(--ease-out);
}
.post__body a:hover { color: var(--signal-text); border-bottom-color: var(--signal-text); }

.post__body ul ul, .post__body ol ul, .post__body ul ol, .post__body ol ol {
  margin-top: var(--s2);
}

.post__body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.post__body th, .post__body td {
  text-align: left;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--rule);
}
.post__body th { font-weight: 600; }
@media (max-width: 640px) {
  .post__body table { display: block; overflow-x: auto; }
}

/* Featured image on a migrated blog post: real size, never upscaled past its
   native pixel width, centered in the reading column. No surface fill - the
   photo carries its own edges, per BRAND.md's "hairlines, not cards". */
.post__media {
  text-align: center;
  margin-bottom: var(--s6);
}
.post__media img {
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: var(--r-media);
  display: inline-block;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: var(--s5);
  margin-top: var(--s9);
  padding-top: var(--s5);
  border-top: 1px solid var(--rule);
}
.pager a { text-decoration: none; max-width: 22ch; }
.pager .meta { display: block; margin-bottom: var(--s1); }
.pager__next { text-align: right; margin-left: auto; }

/* ---------------------------------------------------------------- about */

.about-teaser {
  display: grid;
  gap: var(--s6);
  align-items: start;
}
@media (min-width: 720px) {
  .about-teaser { grid-template-columns: 260px 1fr; gap: var(--s8); }
}

.portrait {
  border-radius: var(--r-media);
  overflow: hidden;
  background: var(--surface);
}
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 22%; }

.cv { border-top: 1px solid var(--rule); }
.cv li {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s1);
  padding-block: var(--s4);
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 640px) {
  .cv li { grid-template-columns: 9.5rem 1fr; gap: var(--s5); align-items: baseline; }
}
.cv ul, .cv { list-style: none; padding: 0; }
.cv .role { font-weight: 600; letter-spacing: -0.012em; }
.cv .where { color: var(--ink-2); font-size: 0.9375rem; }

/* --------------------------------------------------------------- button */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  background: var(--ink);
  color: var(--canvas);
  border-radius: var(--r-small);
  padding: var(--s3) var(--s5);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--t-press) var(--ease-out),
              opacity var(--t-hover) var(--ease-out);
}
.btn:hover { color: var(--canvas); opacity: 0.86; }
.btn:active { transform: scale(0.97); }

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

.footer {
  border-top: 1px solid var(--rule);
  padding-block: var(--s8);
  margin-top: var(--s7);
}

.footer__grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s5) var(--s8);
  justify-content: space-between;
  align-items: flex-start;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s5);
  list-style: none;
  padding: 0;
}
.footer__links a { font-size: 0.9375rem; text-decoration: none; color: var(--ink-2); transition: color var(--t-hover) var(--ease-out); }
.footer__links a:hover { color: var(--signal-text); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: 0.8125rem;
  font-family: var(--mono);
  color: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-small);
  padding: var(--s2) var(--s3);
  cursor: pointer;
  transition: transform var(--t-press) var(--ease-out),
              color var(--t-hover) var(--ease-out),
              border-color var(--t-hover) var(--ease-out);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-2); }
.theme-toggle:active { transform: scale(0.97); }
html:not(.js) .theme-toggle { display: none; }

/* ------------------------------------------------------- brand page bits */

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--s5);
  list-style: none;
  padding: 0;
}
.swatch__chip {
  height: 78px;
  border-radius: var(--r-small);
  border: 1px solid var(--rule);
}
.swatch__name { margin-top: var(--s3); font-weight: 600; font-size: 0.9375rem; }

.specimen { border-top: 1px solid var(--rule); }
.specimen > li {
  display: grid;
  gap: var(--s3);
  padding-block: var(--s5);
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 720px) {
  .specimen > li { grid-template-columns: 11rem 1fr; gap: var(--s6); align-items: baseline; }
}
.specimen { list-style: none; padding: 0; }

.demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s5);
  padding: var(--s5);
  background: var(--surface);
  border-radius: var(--r-media);
}

.demo__box {
  width: 56px; height: 56px;
  border-radius: var(--r-small);
  background: var(--ink);
}

.demo__track {
  flex: 1 1 200px;
  min-width: 160px;
  height: 56px;
  position: relative;
  border-radius: var(--r-small);
  border: 1px dashed var(--rule);
}
.demo__track .demo__box {
  position: absolute;
  top: 50%;
  left: var(--s2);
  margin-top: -28px;
  transition-property: transform;
  transition-duration: var(--t-reveal);
}
.demo__track:hover .demo__box { transform: translateX(calc(100% + var(--s5))); }

.demo--eo .demo__box { transition-timing-function: var(--ease-out); }
.demo--eio .demo__box { transition-timing-function: var(--ease-in-out); }
.demo--exit .demo__box { transition-timing-function: var(--ease-exit); }
.demo--spring .demo__box { transition-timing-function: var(--spring-settle); transition-duration: 400ms; }

.radius-demo { display: flex; gap: var(--s5); flex-wrap: wrap; }
.radius-demo div {
  width: 110px; height: 78px;
  background: var(--surface);
  border: 1px solid var(--rule);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 0.75rem; color: var(--ink-2);
}

.token-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.token-table th, .token-table td {
  text-align: left;
  padding: var(--s3) var(--s5) var(--s3) 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.token-table th { font-weight: 600; }
.token-table code { font-size: 0.8125rem; color: var(--ink-2); }
.table-scroll { overflow-x: auto; }

/* ------------------------------------------------------------------ 404 */

.notfound {
  min-height: 62vh;
  display: grid;
  align-content: center;
  padding-block: var(--s9);
}

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

/* 1. Signature moment. The mark draws itself once on the home page: the
      upper chevron on a curve, the lower one 180ms later, settling on the
      spring. Pure CSS, so it still runs with JS switched off. */
@keyframes draw {
  from { stroke-dashoffset: 96; }
  to   { stroke-dashoffset: 0; }
}

/* The second chevron lands and swings itself out, the way the avatar's
   completion beat does: a decaying oscillation, not a bounce. */
@keyframes swing {
  0%   { rotate: 0deg; }
  12%  { rotate: -5.5deg; }
  26%  { rotate: 3.3deg; }
  40%  { rotate: -1.9deg; }
  54%  { rotate: 1.1deg; }
  68%  { rotate: -0.6deg; }
  82%  { rotate: 0.25deg; }
  100% { rotate: 0deg; }
}

.mark-lg path { stroke-dasharray: 96; }
.mark-lg .a { animation: draw var(--t-draw) var(--ease-out) both; }
.mark-lg .b {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation:
    draw var(--t-draw) var(--spring-settle) 180ms both,
    swing 900ms linear 1040ms both;
}

/* Nav mark: the two chevrons ease apart and settle back. */
@media (hover: hover) and (pointer: fine) {
  .brand .mark path { transition: translate var(--t-hover) var(--spring-settle); }
  .brand:hover .mark .a { translate: -13px -13px; }
  .brand:hover .mark .b { translate: 13px 13px; }
}

/* Footer: a very large outlined mark that draws once, behind the links. */
.footer { position: relative; overflow: hidden; }
.footer .wrap { position: relative; z-index: 1; }

.footer__mark {
  position: absolute;
  right: clamp(-48px, -2vw, 0px);
  bottom: -52px;
  height: clamp(190px, 26vw, 300px);
  width: auto;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}
.footer__mark path {
  fill: none;
  stroke: var(--rule);
  stroke-width: 19.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 96;
  stroke-dashoffset: 96;
}
.footer__mark.is-in .a { animation: draw var(--t-draw) var(--ease-out) both; }
.footer__mark.is-in .b { animation: draw var(--t-draw) var(--ease-out) 180ms both; }
html:not(.js) .footer__mark path { stroke-dashoffset: 0; }

@keyframes draw-line {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.hero__line { animation: draw-line var(--t-draw) var(--ease-out) 560ms both; }

/* 2. Scroll arrival. Gated on .js so nothing is ever hidden without it. */
.js [data-arrive] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--t-reveal) var(--ease-out),
              transform var(--t-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
.js [data-arrive].is-in { opacity: 1; transform: none; }

/* 5. Cross-page: a short crossfade where the browser supports it. */
@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: var(--t-hover);
  animation-timing-function: var(--ease-out);
}

/* One reduced-motion block. Everything collapses to a 200ms opacity fade. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: var(--t-hover) !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: var(--t-hover) !important;
    transition-delay: 0ms !important;
    transition-property: opacity !important;
    transition-timing-function: linear !important;
  }
  .mark-lg path,
  .footer__mark path {
    animation-name: none !important;
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
  }
  .hero__line { animation-name: none; }
  .js [data-arrive] { transform: none; }
  .js .rise .rise__i { transform: none !important; }
  .brand:hover .mark .a, .brand:hover .mark .b { translate: 0 0; }
  [data-tilt] { transform: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-name: fade; }
  html { scroll-behavior: auto; }
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* -------------------------------------------------------------- narrow */

@media (max-width: 700px) {
  :root {
    --gutter: 16px;
    --s9: 72px;
    --s10: 112px;
  }
  .section { padding-block: var(--s8); }
  .lede { font-size: 1.1875rem; }
  .section-head { margin-bottom: var(--s6); }
  .run + .run { margin-top: var(--s8); }
}

@media (max-width: 420px) {
  .brand__name { display: none; }
  .row--media { grid-template-columns: 64px 1fr auto; }
  .row__thumb { width: 64px; }
}
