/* schwarz.sh: one stylesheet. Light and dark follow the system unless the switch sets data-theme.
   Each project's colors derive from its single --accent. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-opsz-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f7f8;
  --fg: #121417;
  --body: #2b3038;
  --muted: #5b6069;
  --dim: #868c94;
  --line: #e3e5e8;
  --ring: rgb(0 0 0 / 0.07);
  --wash: 30%;
  --panel: #ffffff;
  --inv-dim: #8b9099;
  --inv-line: #2a2e34;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 8px 20px -14px rgb(0 0 0 / 0.28);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --edge: max(20px, calc((100% - 1208px) / 2));
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1012;
  --fg: #eceef1;
  --body: #d3d7dd;
  --muted: #9aa1ab;
  --dim: #737a84;
  --line: #24282e;
  --ring: rgb(255 255 255 / 0.07);
  --wash: 58%;
  --panel: #14171b;
  --inv-dim: #5d636b;
  --inv-line: #cfd3d8;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1012;
    --fg: #eceef1;
    --body: #d3d7dd;
    --muted: #9aa1ab;
    --dim: #737a84;
    --line: #24282e;
    --ring: rgb(255 255 255 / 0.07);
    --wash: 58%;
    --panel: #14171b;
    --inv-dim: #5d636b;
    --inv-line: #cfd3d8;
    color-scheme: dark;
  }
}

/* Project colors. color-mix is the fallback; relative oklch where supported. */
.tint {
  --band: color-mix(in oklab, var(--accent) 14%, #fff);
  --ink: #121417;
  --tbody: color-mix(in oklab, var(--accent) 25%, #2b2b2b);
  --label: color-mix(in oklab, var(--accent) 40%, #565656);
  --acc: color-mix(in oklab, var(--accent) 70%, #000);
  --rule: color-mix(in oklab, var(--accent) 22%, #fff);
  --pill-bg: #121417;
  --pill-fg: #ffffff;
}
@supports (color: oklch(from red l c h)) {
  .tint {
    --band: oklch(from var(--accent) 0.935 calc(c * 0.24) h);
    --tbody: oklch(from var(--accent) 0.36 calc(c * 0.25) h);
    --label: oklch(from var(--accent) 0.46 calc(c * 0.35) h);
    --acc: oklch(from var(--accent) 0.45 calc(c * 0.9) h);
    --rule: oklch(from var(--accent) 0.86 calc(c * 0.35) h);
  }
}
:root[data-theme="dark"] .tint {
  --band: color-mix(in oklab, var(--accent) 18%, #0e1012);
  --ink: #eef0f3;
  --tbody: color-mix(in oklab, var(--accent) 15%, #d8dbe0);
  --label: color-mix(in oklab, var(--accent) 30%, #949aa3);
  --acc: color-mix(in oklab, var(--accent) 60%, #fff);
  --rule: color-mix(in oklab, var(--accent) 22%, #2a2e34);
  --pill-bg: var(--acc);
  --pill-fg: var(--band);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tint {
    --band: color-mix(in oklab, var(--accent) 18%, #0e1012);
    --ink: #eef0f3;
    --tbody: color-mix(in oklab, var(--accent) 15%, #d8dbe0);
    --label: color-mix(in oklab, var(--accent) 30%, #949aa3);
    --acc: color-mix(in oklab, var(--accent) 60%, #fff);
    --rule: color-mix(in oklab, var(--accent) 22%, #2a2e34);
    --pill-bg: var(--acc);
    --pill-fg: var(--band);
  }
}
@supports (color: oklch(from red l c h)) {
  :root[data-theme="dark"] .tint {
    --band: oklch(from var(--accent) 0.255 calc(c * 0.3) h);
    --ink: oklch(from var(--accent) 0.95 calc(c * 0.08) h);
    --tbody: oklch(from var(--accent) 0.87 calc(c * 0.15) h);
    --label: oklch(from var(--accent) 0.72 calc(c * 0.25) h);
    --acc: oklch(from var(--accent) 0.8 calc(c * 0.7) h);
    --rule: oklch(from var(--accent) 0.34 calc(c * 0.3) h);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .tint {
      --band: oklch(from var(--accent) 0.255 calc(c * 0.3) h);
      --ink: oklch(from var(--accent) 0.95 calc(c * 0.08) h);
      --tbody: oklch(from var(--accent) 0.87 calc(c * 0.15) h);
      --label: oklch(from var(--accent) 0.72 calc(c * 0.25) h);
      --acc: oklch(from var(--accent) 0.8 calc(c * 0.7) h);
      --rule: oklch(from var(--accent) 0.34 calc(c * 0.3) h);
    }
  }
}

/* A project can keep its band dark in both themes (Typer, to match its terminal). */
.tint.tint--dark {
  --band: color-mix(in oklab, var(--accent) 42%, #0e1012);
  --ink: #eef0f3;
  --tbody: color-mix(in oklab, var(--accent) 15%, #d8dbe0);
  --label: color-mix(in oklab, var(--accent) 30%, #a8aeb7);
  --acc: color-mix(in oklab, var(--accent) 60%, #fff);
  --rule: color-mix(in oklab, var(--accent) 45%, #2a2e34);
  --pill-bg: var(--acc);
  --pill-fg: var(--band);
}
@supports (color: oklch(from red l c h)) {
  .tint.tint--dark {
    --band: oklch(from var(--accent) 0.35 calc(c * 0.8) h);
    --ink: oklch(from var(--accent) 0.97 calc(c * 0.06) h);
    --tbody: oklch(from var(--accent) 0.9 calc(c * 0.14) h);
    --label: oklch(from var(--accent) 0.78 calc(c * 0.3) h);
    --acc: oklch(from var(--accent) 0.84 calc(c * 0.7) h);
    --rule: oklch(from var(--accent) 0.47 calc(c * 0.6) h);
  }
}

/* Screenshots with a dark counterpart swap with the theme. */
.swap { display: contents; }
.swap-d { display: none !important; }
:root[data-theme="dark"] .swap-l { display: none !important; }
:root[data-theme="dark"] .swap-d { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .swap-l { display: none !important; }
  :root:not([data-theme="light"]) .swap-d { display: block !important; }
}

/* Theme switch shows the theme it switches to. */
.theme-toggle .i-sun, .theme-toggle .when-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun, :root[data-theme="dark"] .theme-toggle .when-dark { display: inline; }
:root[data-theme="dark"] .theme-toggle .i-moon, :root[data-theme="dark"] .theme-toggle .when-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun, :root:not([data-theme="light"]) .theme-toggle .when-dark { display: inline; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon, :root:not([data-theme="light"]) .theme-toggle .when-light { display: none; }
}

/* --- Base ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
/* Nothing may push the page sideways: an animation's blur or a word that renders a hair wider just gets clipped. */
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  transition: background-color 320ms ease, color 320ms ease;
}
img { max-width: 100%; }
/* Screenshots come as <picture> (AVIF with a WebP fallback); it takes no box, so the img inside lays out as if alone. */
picture { display: contents; }
a { color: inherit; }
a:where(:not(:has(img))):hover { opacity: 0.75; }
.site-nav a, .back, .strong, .preview-links a, .footer-cta, .footer-col a, .footer-top {
  text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 5px;
  text-decoration-color: transparent; transition: text-decoration-color 220ms ease, opacity 160ms ease;
}
.site-nav a:hover, .back:hover, .strong:hover, .preview-links a:hover, .footer-cta:hover, .footer-col a:hover, .footer-top:hover { opacity: 1; text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.wrap { max-width: 1320px; margin-inline: auto; padding-inline: clamp(20px, 4%, 56px); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: 4px; z-index: 10; }
.skip:focus { left: 8px; }

.display, .display-m, .title, .wordmark, .index-name, .built-item h3 {
  font-weight: 600;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.display { font-size: clamp(48px, 8vw, 120px); line-height: 0.94; }
.display > span { display: block; }
/* Headline flipper: words slide up out of a blur, and each slot eases to its new width. */
.flip-line { white-space: nowrap; }
.flip { display: inline-block; position: relative; transition: width 440ms cubic-bezier(0.22, 1, 0.36, 1); }
.flip-word { display: inline-block; }
.flip-word.is-out { position: absolute; left: 0; top: 0; animation: flip-out 650ms var(--ease) forwards; }
/* The slot gets a head start on its new width, so a wider word never covers its neighbour. */
.flip-word.is-in { animation: flip-in 950ms cubic-bezier(0.3, 0.7, 0.2, 1) 90ms both; }
@keyframes flip-out { to { opacity: 0; transform: translateY(-0.32em); filter: blur(calc(var(--flip-blur, 14px) - 2px)); } }
@keyframes flip-in {
  from { opacity: 0; transform: translateY(0.42em); filter: blur(var(--flip-blur, 14px)); }
  65% { opacity: 0.9; filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}
.display-m { font-size: clamp(40px, 5.2vw, 76px); line-height: 0.96; letter-spacing: -0.05em; }
.title { font-size: clamp(28px, 2.6vw, 34px); line-height: 1.1; letter-spacing: -0.035em; }
.dim { color: var(--dim); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.strong { font-weight: 600; }
.lede .strong, .form-done .strong, .preview-links .strong { display: inline-block; padding-block: 4px; margin-block: -4px; }
.lede { font-size: 19px; line-height: 1.55; color: var(--muted); max-width: 560px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim);
}
.eyebrow.acc { color: var(--acc); }
.dot { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); flex: none; }
/* Project app icons sit beside names, sized to the text they sit with. */
.picon { display: inline-block; flex: none; width: 1em; height: 1em; border-radius: 23%; object-fit: cover; box-shadow: 0 0 0 1px var(--ring); }
.label { font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }

.button {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  background: var(--fg); color: var(--bg); border: 0; border-radius: 6px; padding: 13px 20px;
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease);
}
.button:hover { opacity: 1; transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgb(0 0 0 / 0.4); }
.button:active { transform: translateY(0); box-shadow: none; }
.button-tint { background: var(--pill-bg); color: var(--pill-fg); font-size: 14.5px; padding: 11px 18px; position: relative; overflow: hidden; }
.button-tint::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / 0.34) 50%, transparent 70%);
  transform: translateX(-120%);
}
.button-tint:hover::after { transform: translateX(120%); transition: transform 800ms var(--ease); }
.btn-arrow { display: inline-block; transition: transform 380ms var(--ease); }
.button:hover .btn-arrow, .strong:hover .btn-arrow { transform: translateX(5px); }
.button-inv { background: var(--bg); color: var(--fg); }

/* --- Header and footer ------------------------------------------------------- */

.site-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding-block: 24px; }
.wordmark { font-size: 20px; letter-spacing: -0.02em; text-decoration: none; }
.wordmark span { color: var(--dim); }
.site-nav { display: flex; align-items: center; gap: 24px; font-size: 15px; }
.site-nav a { padding-block: 5px; }
/* Contact stands out from the plain links: a solid button, in the project's colors on project pages. */
.site-nav .nav-cta {
  padding: 8px 14px; border-radius: 6px; background: var(--fg); color: var(--bg); font-weight: 600;
  text-decoration: none; transition: transform 260ms var(--ease), box-shadow 260ms var(--ease);
}
.site-nav .nav-cta:hover { opacity: 1; transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgb(0 0 0 / 0.45); }
.site-nav .nav-cta:hover .btn-arrow { transform: translateX(4px); }
.tint .site-nav .nav-cta { background: var(--pill-bg); color: var(--pill-fg); }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 500; color: inherit;
  background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 6px 11px;
}
.tint .theme-toggle { border-color: var(--rule); }
.theme-toggle svg { transition: transform 600ms var(--ease); }
.theme-toggle:hover svg { transform: rotate(-24deg); }
.site-footer { margin-top: 72px; font-size: 15px; color: var(--muted); }
.footer-inner {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.5fr) minmax(0, 0.55fr); gap: 40px 56px;
  padding-block: 56px 48px; border-top: 1px solid var(--line);
}
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.footer-mark { font-size: 26px; font-weight: 600; letter-spacing: -0.035em; color: var(--fg); }
.footer-line { max-width: 34ch; line-height: 1.55; }
.footer-cta { margin-top: 8px; font-weight: 600; color: var(--fg); }
.footer-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); margin-bottom: 16px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-work ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.footer-col a { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); }
.footer-col .dot { width: 6px; height: 6px; border-radius: 2px; transition: transform 320ms var(--ease); }
.footer-col a:hover .dot { transform: scale(1.5); }
.footer-base { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-block: 18px 36px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); }
.footer-top { color: var(--muted); }
.footer-base-end { display: flex; align-items: center; gap: 18px; }

/* --- Home: hero --------------------------------------------------------------------- */

.hero { padding-block: clamp(48px, 7vw, 88px) 40px; display: flex; flex-direction: column; gap: 28px; }
.hero-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px 48px; }


/* --- Home: selected work index ------------------------------------------------------ */

.work { padding-block: 120px; }
.hero + .work { padding-top: 56px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.index { display: flex; flex-wrap: wrap; gap: 48px 72px; align-items: flex-start; padding-top: 8px; }
.index-list { list-style: none; margin: 0; padding: 0; flex: 1 1 360px; min-width: 0; }
.index-item {
  display: flex; align-items: baseline; gap: 14px; padding-block: 18px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--muted); transition: color 200ms ease;
}
.index-item:hover, .index-item[aria-current="true"] { color: var(--fg); opacity: 1; }
.index-item .dot { transform: translateY(-4px); transition: transform 420ms var(--ease); }
.index-item .picon { width: 0.9em; height: 0.9em; align-self: center; font-size: clamp(24px, 2.6vw, 34px); transition: transform 420ms var(--ease); }
.index-item:hover .picon, .index-item[aria-current="true"] .picon { transform: scale(1.08); }
.index-item:hover .dot, .index-item[aria-current="true"] .dot { transform: translateY(-4px) scale(1.5); }
.index-name { flex: 1 1 auto; font-size: clamp(24px, 2.6vw, 34px); line-height: 1.1; letter-spacing: -0.035em; transition: transform 420ms var(--ease); }
.index-item:hover .index-name, .index-item[aria-current="true"] .index-name { transform: translateX(6px); }
.index-kind { font-family: var(--mono); font-size: 12px; color: var(--dim); white-space: nowrap; }
.index-previews { flex: 1.5 1 560px; min-width: 0; position: sticky; top: 32px; }
.preview { position: relative; display: flex; flex-direction: column; gap: 56px; animation: preview-in 560ms var(--ease); }
.preview::before {
  content: ""; position: absolute; inset: -110px -100px -90px -110px; z-index: -1; pointer-events: none;
  /* Sized to the box's nearest edges, so the glow always fades out before any edge: never clipped. */
  background: radial-gradient(
    closest-side at 54% 46%,
    color-mix(in oklab, var(--accent) 40%, transparent),
    color-mix(in oklab, var(--accent) 16%, transparent) 55%,
    transparent 100%
  );
  animation: glow-in 900ms var(--ease) both;
}
@keyframes glow-in { from { opacity: 0; transform: scale(0.94); } }
.index-previews { isolation: isolate; }
@media (hover: hover) {
  .index-item { position: relative; isolation: isolate; }
  .index-item::before {
    content: ""; position: absolute; inset: 0 0 0 -20px; z-index: -1; pointer-events: none; border-radius: 6px;
    background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 16%, transparent), transparent 80%);
    opacity: 0; transition: opacity 320ms ease;
  }
  .index-item[aria-current="true"]::before { opacity: 1; }
}
.preview .layered-second { animation: slide-in 760ms var(--ease) 60ms both; }
.layered { position: relative; padding-bottom: 48px; }
.layered-main { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 0 0 1px var(--ring), var(--shadow); }
.layered-second {
  position: absolute; left: -28px; bottom: 0; width: 44%; height: auto; display: block;
  border-radius: 6px; box-shadow: 0 10px 24px -14px rgb(0 0 0 / 0.4); outline: 4px solid var(--bg);
}
.layered-second.is-tall { width: 20%; }
.preview-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; }
.preview-meta p { flex: 1 1 320px; font-size: 16.5px; line-height: 1.6; color: var(--body); }
.preview-links { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; color: var(--dim); }
.preview-links .strong { color: var(--fg); }

/* --- Home: chapters --------------------------------------------------------------- */

.chapter { background: var(--band); color: var(--ink); overflow: hidden; transition: background-color 320ms ease, color 320ms ease; }
.chapter-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 56px 72px;
  padding-block: clamp(72px, 9vw, 112px); padding-left: var(--edge);
}
.chapter--flip .chapter-inner { flex-direction: row-reverse; padding-left: 0; padding-right: var(--edge); }
.chapter-text { flex: 1 1 380px; max-width: 480px; display: flex; flex-direction: column; gap: 22px; }
.chapter-title { display: inline-flex; align-items: center; gap: 0.26em; color: inherit; text-decoration: none; transform-origin: left center; transition: transform 480ms var(--ease); }
.chapter-title .picon { width: 0.8em; height: 0.8em; }
.chapter-title:hover { opacity: 1; transform: scale(1.035); }
.chapter-summary { font-size: 18px; line-height: 1.6; color: var(--tbody); }
.dash-list { list-style: none; margin: 0; padding: 18px 0 0; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 10px; font-size: 15.5px; line-height: 1.5; }
.dash-list li { display: flex; gap: 12px; }
.dash-list li::before { content: "—"; color: var(--accent); }
.facts-inline { margin: 0; padding-top: 18px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 12px 32px; font-size: 14px; }
.facts-inline dt, .facts dt, .details dt {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--label); margin-bottom: 4px;
}
.facts-inline dd, .facts dd, .details dd { margin: 0; }
.chapter-media { flex: 1.8 1 560px; min-width: 0; position: relative; padding-bottom: 56px; }
.chapter-main { display: block; width: 100%; height: auto; border-radius: 6px 0 0 6px; box-shadow: 0 0 0 1px var(--ring), var(--shadow); }
.chapter--flip .chapter-main { border-radius: 0 6px 6px 0; }
.chapter-second {
  position: absolute; bottom: 0; left: 40px; width: 40%; height: auto; display: block;
  border-radius: 6px; box-shadow: 0 0 0 1px var(--ring), 0 10px 24px -14px rgb(0 0 0 / 0.4);
}
.chapter--flip .chapter-second { left: auto; right: 40px; }
.chapter-second.is-tall { width: 17%; }

/* --- Screenshot viewer ------------------------------------------------------------- */

.zoom { position: relative; display: block; cursor: zoom-in; color: inherit; border-radius: 6px; }
.zoom:has(.chapter-second) { position: static; }
.zoom img { transition: transform 600ms var(--ease), box-shadow 600ms var(--ease); }
.zoom:hover img { transform: translateY(-4px); }
.zoom:hover .figure-img, .zoom:hover .chapter-main { box-shadow: 0 0 0 1px var(--ring), 0 2px 4px rgb(0 0 0 / 0.05), 0 14px 28px -18px rgb(0 0 0 / 0.34); }
.zoom::after {
  content: ""; position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 6px; pointer-events: none;
  background: rgb(14 16 18 / 0.72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E") center / 16px no-repeat;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(2px) scale(0.94); transition: opacity 240ms ease, transform 420ms var(--ease);
}
.zoom:hover::after, .zoom:focus-visible::after { opacity: 1; transform: translateY(-4px); }
.zoom:has(.chapter-second)::after, .zoom:has(.figure--tall)::after { display: none; }
.chapter--flip .zoom:has(.chapter-main)::after { right: auto; left: 14px; }
.zoom:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.compare-zoom {
  position: absolute; right: 12px; bottom: 12px; z-index: 2; width: 40px; height: 40px;
  display: grid; place-items: center; border-radius: 6px; cursor: zoom-in;
  background: rgb(14 16 18 / 0.78); color: #fff; box-shadow: 0 6px 18px rgb(0 0 0 / 0.3);
}
.compare-zoom:hover { background: rgb(14 16 18 / 0.92); }

html:has(.lightbox[open]) { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: #0b0c0e; color: #eceef1;
}
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; animation: lb-in 180ms ease-out; }
@keyframes lb-in { from { opacity: 0; } }
.lb-stage { display: flex; min-height: 0; overflow: auto; padding: 64px 76px 4px; overscroll-behavior: contain; }
.lb-img {
  display: block; flex: none; margin: auto; width: auto; height: auto; max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 4px; cursor: zoom-in; box-shadow: 0 20px 50px -28px rgb(0 0 0 / 0.8);
}
.lb-img.is-zoomed { max-width: none; max-height: none; cursor: zoom-out; }
.lb-img.is-loading { opacity: 0; }
.lb-img.lb-enter { animation: lb-img 520ms var(--ease); }
@keyframes lb-img { from { opacity: 0; transform: translateX(calc(var(--dir, 0) * 32px)) scale(0.985); } }
.lb-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 76px 22px; }
.lb-caption { margin: 0; font-size: 15px; color: rgb(236 238 241 / 0.8); }
.lb-count { font-family: var(--mono); font-size: 12px; color: rgb(236 238 241 / 0.55); white-space: nowrap; }
.lb-btn {
  position: absolute; width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  border-radius: 6px; border: 1px solid rgb(255 255 255 / 0.14); background: rgb(20 22 25 / 0.7);
  color: inherit; cursor: pointer; z-index: 1;
}
.lb-btn:hover { background: rgb(255 255 255 / 0.14); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-btn[hidden] { display: none; }
.lb-close { top: 12px; right: 16px; }
.lb-prev, .lb-next { top: 50%; margin-top: -22px; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

/* --- Home: experiments ------------------------------------------------------------------ */

.experiments { padding-block: 112px 24px; }
.exp-list { list-style: none; margin: 0; padding: 0; }
/* kaej.dev and each experiment share one row style: icon, name, line, kind, arrow. */
.exp {
  display: grid; grid-template-columns: 44px minmax(150px, 210px) minmax(0, 1fr) auto 22px; align-items: center; gap: 22px;
  padding-block: 20px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none;
}
.exp-icon { width: 44px; height: 44px; border-radius: 10px; transition: transform 380ms var(--ease); }
.exp-name { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; }
.exp-line { font-size: 15.5px; color: var(--muted); }
.exp-kind { font-family: var(--mono); font-size: 11.5px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.exp-go { font-size: 20px; color: var(--dim); text-align: right; transition: transform 360ms var(--ease), color 200ms ease; }
a.exp:hover { opacity: 1; }
a.exp:hover .exp-icon { transform: scale(1.06); }
a.exp:hover .exp-go { color: var(--fg); transform: translateX(4px); }
a.exp--out:hover .exp-go { transform: translate(3px, -3px); }

/* --- Home: contact ---------------------------------------------------------------------- */

.contact-block {
  margin-block: 112px 40px; background: var(--fg); color: var(--bg); border-radius: 8px;
  padding: clamp(32px, 6%, 80px); display: flex; flex-direction: column; gap: 48px;
}
.contact-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px; }
.contact-top h2 { flex: 1 1 520px; }
.dim-inv { color: var(--inv-dim); }
.contact-notes { display: flex; flex-wrap: wrap; gap: 20px 48px; padding-top: 28px; border-top: 1px solid var(--inv-line); font-size: 15px; }
.contact-notes > div { flex: 1 1 220px; }
.label-inv { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--inv-dim); margin-bottom: 6px; }

/* --- Project page ---------------------------------------------------------------------- */

.band { background: var(--band); color: var(--ink); transition: background-color 320ms ease, color 320ms ease; }
.band .wordmark span { color: var(--label); }
.band-inner { padding-block: 56px 220px; display: flex; flex-direction: column; gap: 22px; }
.back { align-self: flex-start; font-size: 14px; color: var(--acc); padding-block: 5px; margin-block: -5px; }
.project-title { font-size: clamp(60px, 10vw, 150px); line-height: 0.88; letter-spacing: -0.06em; display: flex; align-items: center; gap: 0.16em; }
.project-title .picon { width: 0.7em; height: 0.7em; }
.badge-experimental {
  margin-left: 6px; padding: 3px 8px; border-radius: 4px; font-size: 11px; letter-spacing: 0.08em;
  color: var(--acc); border: 1px solid color-mix(in oklab, var(--acc) 45%, transparent);
  background: color-mix(in oklab, var(--acc) 10%, transparent);
}
.band-lede { max-width: 680px; font-size: clamp(19px, 1.8vw, 22px); line-height: 1.45; color: var(--tbody); }
.visit {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 16px; margin-top: 6px;
  padding: 11px 16px 12px 20px; border-radius: 6px; text-decoration: none;
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  background: var(--pill-bg); color: var(--pill-fg);
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease);
}
.visit-text { display: flex; flex-direction: column; gap: 3px; }
.visit-label { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.72; }
.visit-host { line-height: 1.2; }
.visit svg { flex: none; transition: transform 320ms var(--ease); }
.visit:hover { opacity: 1; transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgb(0 0 0 / 0.4); }
.visit:hover svg { transform: translate(2px, -2px); }
.facts { margin: 26px 0 0; display: flex; flex-wrap: wrap; border-top: 1px solid var(--rule); }
.facts > div { flex: 1 1 180px; padding: 16px 20px 0 0; }
.facts dd { font-size: 15.5px; }
.lift { margin-top: -170px; }

.figure { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.figure-img { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 0 0 1px var(--ring), var(--shadow); }
.figure figcaption, .compare figcaption { font-size: 14.5px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.figure--tall { align-items: center; }
.figure--tall .figure-img { max-width: 340px; }

.compare { margin: 0; display: flex; flex-direction: column; gap: 14px; --pos: 50; }
.compare-frame { position: relative; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px var(--ring), var(--shadow); user-select: none; }
.compare-frame img { display: block; width: 100%; height: auto; }
.compare-dark { position: absolute; inset: 0; clip-path: inset(0 0 0 calc(var(--pos) * 1%)); }
.compare-line, .compare-knob { position: absolute; left: calc(var(--pos) * 1%); pointer-events: none; }
.compare-line { top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.25); }
.compare-knob {
  top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  background: #fff; color: #121417; box-shadow: 0 6px 20px rgb(0 0 0 / 0.35);
  display: flex; align-items: center; justify-content: center;
}
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }

.split-section { display: flex; flex-wrap: wrap; gap: 32px 80px; padding-block: 104px 88px; }
.split-section .label { flex: 1 1 240px; }
.prose { flex: 3 1 560px; display: flex; flex-direction: column; gap: 20px; font-size: 18.5px; line-height: 1.7; color: var(--body); max-width: 68ch; }
.block { padding-block: 56px 32px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 20px; }
.built-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 40px; }
.built-item { padding-block: 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.built-item h3 { font-size: 18px; letter-spacing: -0.02em; }
.built-item p { font-size: 15px; line-height: 1.55; color: var(--muted); }
.screens { gap: 48px; padding-bottom: 96px; }
.pair { display: flex; flex-wrap: wrap; gap: 48px 28px; align-items: flex-start; }
.pair > .figure { flex: 1 1 420px; min-width: 0; }
.numbers { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.numbers > div { padding-top: 18px; border-top: 1px solid var(--line); }
.numbers dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); margin-bottom: 10px; }
.numbers dd { margin: 0; font-size: clamp(34px, 3.8vw, 52px); font-weight: 600; line-height: 1; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.langs { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.lang-bar { display: flex; gap: 2px; height: 10px; border-radius: 3px; overflow: hidden; transform-origin: left; }
.lang-bar span { background: var(--c); min-width: 3px; }
.lang-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--muted); }
.lang-legend li { display: inline-flex; align-items: center; gap: 8px; }
.lang-dot { width: 9px; height: 9px; border-radius: 2px; background: var(--c); }
.lang-pct { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.details { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding-bottom: 64px; }
.details dt { color: var(--dim); }
.details dd { font-size: 16px; line-height: 1.5; }

.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 40px; }
.pager-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; overflow: hidden; text-decoration: none;
  padding: 24px 28px 0; border-radius: 8px; background: var(--band); color: var(--ink);
  transition: transform 420ms var(--ease), box-shadow 420ms var(--ease);
}
.pager-card:only-child { grid-column: 2; }
.pager-card:hover { opacity: 1; transform: translateY(-3px); box-shadow: 0 14px 30px -20px rgb(0 0 0 / 0.35); }
.pager-card--next { text-align: right; }
.pager-dir { flex: none; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--label); }
.pager-arrow { display: inline-block; transition: transform 420ms var(--ease); }
.pager-card--prev:hover .pager-arrow { transform: translateX(-4px); }
.pager-card--next:hover .pager-arrow { transform: translateX(4px); }
/* One row on top: the direction label in its corner, and the project's icon, name and kind in the opposite one. */
.pager-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 20px; }
.pager-card--next .pager-head { flex-direction: row-reverse; }
.pager-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pager-card--prev .pager-brand { flex-direction: row-reverse; text-align: right; }
.pager-brand .picon { width: 46px; height: 46px; transition: transform 420ms var(--ease); }
.pager-card:hover .pager-brand .picon { transform: scale(1.06); }
.pager-brand-text { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.pager-card--prev .pager-brand-text { align-items: flex-end; }
.pager-card--next .pager-brand-text { align-items: flex-start; }
.pager-name { font-size: clamp(24px, 2.3vw, 32px); font-weight: 600; line-height: 1; letter-spacing: -0.04em; }
.pager-brand .eyebrow { max-width: 100%; gap: 7px; }
.pager-kind { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager-year { flex: none; }
.pager-line { max-width: 52ch; font-size: 15px; line-height: 1.5; color: var(--tbody); }
.pager-card--next .pager-line { margin-left: auto; }
/* A strip of the first screen rather than the whole of it, bleeding off the far edge. */
.pager-shot { display: block; margin-top: 4px; }
.pager-card--prev .pager-shot { margin-right: -28px; }
.pager-card--next .pager-shot { margin-left: -28px; }
.pager-img {
  display: block; width: 100%; height: 196px; margin-bottom: -6px; object-fit: cover; object-position: top left;
  border-radius: 6px 6px 0 0; box-shadow: 0 0 0 1px var(--ring), var(--shadow); transition: transform 600ms var(--ease);
}
.pager-card--prev .pager-img { border-top-left-radius: 6px; border-top-right-radius: 0; }
.pager-card--next .pager-img { border-top-right-radius: 6px; border-top-left-radius: 0; object-position: top right; }
.pager-card:hover .pager-img { transform: translateY(-6px); }
@media (max-width: 1100px) {
  .pager-dir-more, .pager-year { display: none; }
}

/* --- Contact page ------------------------------------------------------------------------ */

.contact-page { display: flex; flex-wrap: wrap; gap: 56px 88px; padding-block: 64px 40px; align-items: flex-start; }
.contact-intro { flex: 1 1 380px; display: flex; flex-direction: column; gap: 22px; }
.contact-dot { background: linear-gradient(135deg, #7c5cf6, #2a9a86 55%, #c49a52); }
.steps { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.steps li { position: relative; display: flex; gap: 18px; padding-bottom: 22px; }
.steps li:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 4px; width: 1px; background: var(--line); }
.step-n {
  flex: none; display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px;
  font-family: var(--mono); font-size: 11.5px; color: var(--fg); background: var(--panel); border: 1px solid var(--line);
}
.step-body { display: flex; flex-direction: column; gap: 3px; padding-top: 5px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.step-body strong { color: var(--fg); font-weight: 600; font-size: 16px; }
.contact-work { padding-top: 6px; }
.icon-strip { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.icon-strip a { display: block; border-radius: 10px; transition: transform 380ms var(--ease); }
.icon-strip a:hover { opacity: 1; transform: translateY(-3px) scale(1.06); }
.icon-strip .picon { width: 40px; height: 40px; border-radius: 10px; }
/* The form sits on a soft wash of a few project colors. */
.contact-card { flex: 1.3 1 480px; position: relative; isolation: isolate; }
.contact-card::before {
  content: ""; position: absolute; inset: -80px -60px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(30% 34% at 32% 36%, color-mix(in oklab, #7c5cf6 var(--wash), transparent), transparent 100%),
    radial-gradient(26% 32% at 72% 44%, color-mix(in oklab, #2a9a86 var(--wash), transparent), transparent 100%),
    radial-gradient(30% 20% at 52% 78%, color-mix(in oklab, #c49a52 var(--wash), transparent), transparent 100%);
}
.form-head { display: flex; flex-direction: column; gap: 4px; padding-bottom: 4px; }
.form-head .title { font-size: 26px; }
.button-send { position: relative; overflow: hidden; }
.button-send::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / 0.3) 50%, transparent 70%);
  transform: translateX(-120%);
}
.button-send:hover::after { transform: translateX(120%); transition: transform 800ms var(--ease); }
.form-done { align-items: flex-start; text-align: left; }
.done-check { color: #1f8a3c; }
/* Drawn by default; the animation only plays the drawing in, so reduced motion still shows it. */
.done-check circle { stroke-dasharray: 164; animation: draw-circle 700ms var(--ease) 100ms both; }
.done-check path { stroke-dasharray: 36; animation: draw-tick 500ms var(--ease) 650ms both; }
@keyframes draw-circle { from { stroke-dashoffset: 164; } to { stroke-dashoffset: 0; } }
@keyframes draw-tick { from { stroke-dashoffset: 36; } to { stroke-dashoffset: 0; } }
.form {
  background: var(--panel); box-shadow: 0 0 0 1px var(--ring), 0 24px 48px -32px rgb(0 0 0 / 0.35); border: 1px solid var(--line); border-radius: 8px;
  padding: clamp(24px, 3.5%, 40px); display: flex; flex-direction: column; gap: 20px;
}
.form-done { gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 500; }
.form-row { display: flex; flex-wrap: wrap; gap: 20px; }
.form-row label { flex: 1 1 220px; }
.form input, .form textarea {
  /* 16px or larger, or iPhones zoom in when a field is tapped. */
  font: inherit; font-size: 16px; font-weight: 400; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 11px 13px;
}
.form textarea { resize: vertical; line-height: 1.55; min-height: 220px; }
/* Examples, not content: small and faint, so they don't read as text already filled in. The field
   itself stays at 16px for iPhones. */
.form :is(input, textarea)::placeholder { font-size: 12.5px; color: color-mix(in oklab, var(--dim) 60%, var(--bg)); opacity: 1; }
.field-message { display: flex; flex-direction: column; gap: 8px; }
.field-message label { font-size: 14px; font-weight: 500; }
.field-hint { margin-top: -4px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.field-count { min-height: 1.4em; font-size: 12.5px; color: var(--dim); text-align: right; transition: color 200ms ease; }
.field-count.is-good { color: #1f8a3c; }

/* Quick message or guided brief. */
.mode-switch {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; margin-bottom: 14px;
  border-radius: 10px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 0 0 1px var(--ring);
}
.mode-tab { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 7px; text-decoration: none; color: var(--muted); transition: background-color 200ms ease; }
.mode-tab strong { font-size: 15px; font-weight: 600; color: var(--fg); }
.mode-tab span { font-size: 13px; }
.mode-tab:hover { opacity: 1; background: color-mix(in oklab, var(--fg) 6%, transparent); }
.mode-tab[aria-current] { background: var(--fg); }
.mode-tab[aria-current] strong, .mode-tab[aria-current] span { color: var(--bg); }
.mode-tab[aria-current] span { opacity: 0.7; }

/* Guided brief. */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 500; }
.options-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.options-field legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 500; }
.options-field .field-hint { margin: 0 0 10px; }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.form .option { position: relative; display: inline-flex; gap: 0; font-weight: 400; cursor: pointer; }
.option input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.option span {
  padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  font-size: 14.5px; transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.option:hover span { border-color: var(--dim); }
.option input:checked + span { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.option input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 2px; }
.brief-step { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.brief-legend { display: flex; align-items: center; gap: 12px; padding: 0; margin: 0 0 2px; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.brief:not(.is-wizard) .brief-step + .brief-step { border-top: 1px solid var(--line); padding-top: 26px; }
.is-wizard .brief-step:not([hidden]), .is-wizard .brief-review:not([hidden]) { animation: step-in 420ms var(--ease); }
@keyframes step-in { from { opacity: 0; transform: translateY(8px); } }
.brief-progress { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.brief-progress li { display: flex; align-items: center; gap: 7px; padding: 4px 9px 4px 4px; border-radius: 7px; font-size: 13px; color: var(--dim); }
.brief-progress .step-n { width: 22px; height: 22px; border-radius: 6px; font-size: 10.5px; }
.brief-progress li.is-done { color: var(--muted); cursor: pointer; }
.brief-progress li.is-done:hover { background: color-mix(in oklab, var(--fg) 6%, transparent); }
.brief-progress li.is-current { color: var(--fg); background: color-mix(in oklab, var(--fg) 6%, transparent); }
.brief-progress li.is-current .step-n { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.brief-review { display: flex; flex-direction: column; gap: 16px; }
.review-step + .review-step { border-top: 1px solid var(--line); padding-top: 16px; }
.review-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.review-head h4 { margin: 0; font-size: 15px; font-weight: 600; }
.review-edit { border: 0; background: none; padding: 4px 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--fg); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.brief-review dl { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.brief-review dt { font-size: 12.5px; color: var(--dim); }
.brief-review dd { margin: 0 0 8px; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; }
.brief-nav [data-brief-note] { flex: 1; }
/* Sending: the button holds still, with a small spinner in place of the arrow. */
.button:disabled { cursor: default; opacity: 0.45; transform: none; box-shadow: none; }
.button:disabled::after { display: none; }
form[aria-busy="true"] .button-send:disabled { cursor: progress; opacity: 1; }
.btn-spinner {
  width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.button-ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.button-ghost:hover { box-shadow: inset 0 0 0 1px var(--dim); }
.button:hover .btn-arrow--back { transform: translateX(-5px); }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px color-mix(in oklab, var(--fg) 14%, transparent); }
.form-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding-top: 4px; }
.form-errors { border: 1px solid #d6454f; border-radius: 6px; padding: 14px 16px; font-size: 14.5px; }
.form-errors ul { margin: 6px 0 0; padding-left: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- Motion and small screens ------------------------------------------------------------- */

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(0.4em); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes lift-in { from { opacity: 0; transform: translateY(40px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes preview-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sheen { from { transform: translateX(-120%); } to { transform: translateX(120%); } }

/* Headlines settle in on load, line by line. */
.hero .display > span, .band-inner > * { animation: rise-in 900ms var(--ease) both; }
.hero .display > span:nth-child(2) { animation-delay: 90ms; }
.hero-foot { animation: rise-in 900ms var(--ease) 200ms both; }
.band-inner > :nth-child(2) { animation-delay: 40ms; }
.band-inner > :nth-child(3) { animation-delay: 80ms; }
.band-inner > :nth-child(4) { animation-delay: 140ms; }
.band-inner > :nth-child(5) { animation-delay: 200ms; }
.band-inner > :nth-child(6) { animation-delay: 260ms; }
.lift { animation: lift-in 1100ms var(--ease) 180ms both; }

/* Tinted bands catch a soft glow of their accent, so they read as lit rather than flat. */
.chapter.tint, .band.tint, .pager-card.tint {
  --glow: color-mix(in oklab, var(--accent) 26%, transparent);
  --glow-2: color-mix(in oklab, var(--accent) 12%, transparent);
  background-image: radial-gradient(80% 70% at 100% 0%, var(--glow), transparent 70%), radial-gradient(60% 70% at 0% 100%, var(--glow-2), transparent 70%);
}
.chapter--flip.tint { background-image: radial-gradient(80% 70% at 0% 0%, var(--glow), transparent 70%), radial-gradient(60% 70% at 100% 100%, var(--glow-2), transparent 70%); }
.contact-block { background-image: radial-gradient(70% 120% at 100% 0%, color-mix(in oklab, var(--bg) 12%, transparent), transparent 65%); }

/* Section rules draw in from the left as they arrive. */
.section-head { border-bottom: 0; position: relative; }
.section-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); transform-origin: left; }

/* Things rise into place as they scroll into view, where the browser can tie motion to scroll. */
@supports (animation-timeline: view()) {
  .chapter-media { animation: lift-in linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
  .chapter-text > *, .screens .figure, .built-item, .details > div, .index-list li, .exp-list li, .split-section > *, .contact-block, .pager-card, .footer-inner > * {
    animation: rise linear both; animation-timeline: view(); animation-range: entry 5% entry 45%;
  }
  .section-head::after, .lang-bar { animation: draw linear both; animation-timeline: view(); animation-range: entry 30% cover 40%; }
  .button-tint::after { animation: sheen linear both; animation-timeline: view(); animation-range: entry 100% cover 45%; }
  .numbers > div { animation: rise linear both; animation-timeline: view(); animation-range: entry 5% entry 45%; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox[open] { animation: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* Tablets and phones: screenshots lead, full width; text follows. */
@media (max-width: 900px) {
  .index-previews, .work .section-head .eyebrow { display: none; }
  .index-item { color: var(--fg); }
  .index-item::after { content: "→"; color: var(--dim); font-size: 18px; }
  .chapter-inner, .chapter--flip .chapter-inner {
    flex-direction: column; align-items: stretch; gap: 32px;
    padding: 40px 0 56px;
  }
  /* Stacked, the media's width basis would become a 560px minimum height. */
  .chapter-media, .chapter-text { flex: none; }
  .chapter-media { order: -1; padding-bottom: 0; }
  .chapter-main, .chapter--flip .chapter-main { border-radius: 0; box-shadow: none; }
  .chapter-second { display: none; }
  .chapter-text { max-width: none; padding-inline: var(--edge); gap: 18px; }
  .built-grid { grid-template-columns: minmax(0, 1fr); }
  /* The form's color wash stays within the page width, so nothing scrolls sideways. */
  .contact-card::before { inset: -60px 0; }
  .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
  .details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work { padding-block: 72px; }
  .experiments { padding-top: 72px; }
  .contact-block { margin-block: 72px 32px; }
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

/* Tablets and phones: previous and next shrink to slim rows, icon and name on the left and the direction on
   the right. The summary and screenshot are a tap away on the project's own page. */
@media (max-width: 960px) {
  .pager { gap: 10px; margin-top: 28px; }
  .pager-card, .pager-card--next { padding: 14px 16px; text-align: left; }
  .pager-line, .pager-shot { display: none; }
  .pager-head, .pager-card--next .pager-head { flex-wrap: nowrap; flex-direction: row-reverse; align-items: center; gap: 12px; }
  .pager-brand, .pager-card--prev .pager-brand { flex-direction: row; text-align: left; gap: 12px; }
  .pager-card--prev .pager-brand-text { align-items: flex-start; }
  .pager-brand-text { gap: 5px; }
  .pager-brand .picon { width: 38px; height: 38px; }
  .pager-name { font-size: 19px; letter-spacing: -0.03em; }
  .pager-dir, .pager-brand .eyebrow { font-size: 10.5px; }
  .pager-brand .eyebrow { gap: 6px; }
  .pager-dir-more, .pager-year { display: none; }
}
/* The narrowest phones: the brand and both links share one row, so Contact drops its arrow. */
@media (max-width: 360px) {
  .site-nav .nav-cta { padding: 12px 14px; }
  .site-nav .nav-cta .btn-arrow { display: none; }
}
/* Phones: one column, next first. */
@media (max-width: 760px) {
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager-card:only-child { grid-column: auto; }
  .pager-card--next { order: -1; }
}

/* Under 640px the longer phrases wouldn't fit on one line, so the second word always takes its own line.
   With a word per line there's nothing beside a slot to make room for, so each slot just takes its
   word's own width (no measured widths), and the blur is softer so it stays inside the screen. */
@media (max-width: 639px) {
  .flip-tail { display: block; }
  .flip { width: auto !important; transition: none; }
  .flip-line { --flip-blur: 7px; }
}

/* Phones. */
@media (max-width: 600px) {
  .brief-progress .brief-progress-label { display: none; }
  .brief-progress li.is-current .brief-progress-label { display: inline; }
  .brief-nav { flex-wrap: wrap; }
  .brief-nav [data-brief-note] { order: 3; flex-basis: 100%; }
  .brief-nav .button { width: auto; flex: 1; }
  .exp { grid-template-columns: 44px minmax(0, 1fr) 22px; grid-template-areas: "icon name go" "icon line line"; column-gap: 16px; row-gap: 4px; align-items: start; }
  .exp-icon { grid-area: icon; } .exp-name { grid-area: name; } .exp-line { grid-area: line; } .exp-go { grid-area: go; }
  .exp-kind { display: none; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); padding-block: 44px 36px; }
  .site-footer { margin-top: 48px; }
  .lb-stage { padding: 60px 0 4px; }
  .lb-bar { padding: 12px 20px 20px; }
  .lb-close { top: 8px; right: 8px; }
  /* Swipe to move between screenshots on phones. */
  .lb-prev, .lb-next { display: none; }
  .site-header { padding-block: 12px; flex-wrap: nowrap; }
  .site-nav { gap: 6px; }
  .site-nav a { padding: 12px 8px; }
  .site-nav .nav-cta { padding: 12px 16px; white-space: nowrap; }
  .display { font-size: clamp(34px, calc((100vw - 40px) / 7.2), 60px); }
  .hero { padding-block: 40px 32px; gap: 24px; }
  .lede { font-size: 17px; }
  .index-name { font-size: 26px; }
  .index-kind { display: none; }
  .chapter-summary { font-size: 17px; }
  .dash-list { font-size: 15px; }
  .contact-block { padding: 32px 24px; gap: 32px; border-radius: 6px; }
  .contact-top .button { width: 100%; justify-content: center; }

  /* Project page: screenshots run edge to edge; captions keep the gutter. */
  .band-inner { padding-block: 32px 112px; gap: 18px; }
  .project-title { font-size: clamp(52px, 16vw, 72px); }
  .facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
  .facts > div { padding-right: 0; }
  .lift { margin-top: -80px; padding-inline: 0; }
  .compare-frame, .lift .figure-img { border-radius: 0; }
  .compare figcaption, .lift .figure figcaption { padding-inline: var(--edge); }
  .compare-knob { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
  .split-section { padding-block: 56px 40px; gap: 16px; }
  .prose { font-size: 17px; }
  .screens .figure:not(.figure--tall) .figure-img { width: calc(100% + 40px); max-width: none; margin-inline: -20px; border-radius: 0; box-shadow: none; }
  .screens, .pair { gap: 36px; }

  /* Contact page. */
  .contact-page { padding-block: 32px 72px; gap: 32px; }
  .form { padding: 20px; }
  .form-foot .button { width: 100%; justify-content: center; }
}
