/* =========================================================
   zaraselim.com: design tokens
   Breakpoints (used in media queries below; CSS vars can't be):
     sm 560px · md 820px · lg 1100px · xl 1360px
   ========================================================= */
:root {
  /* Colour */
  /* ~90% neutral; one copper accent used sparingly */
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #efefec;
  --surface-3: #e8e8e4;
  --ink: #121315;
  --ink-2: #45474c;
  --muted: #696c71;
  --line: rgba(18, 19, 21, 0.09);
  --line-strong: rgba(18, 19, 21, 0.18);

  --accent: #b0531b;
  --accent-tint: #f5e7dc;

  --dark: #111214;
  --dark-2: #1a1b1e;
  --dark-line: rgba(255, 255, 255, 0.09);
  --on-dark: #f3f3f1;
  --on-dark-2: #9fa2a8;
  --accent-on-dark: #e39a64;

  /* Status colours: only inside project visuals */
  --ok: #3d6b4a;
  --watch: #946812;
  --exc: #b13a2b;
  --ok-dark: #8fc29c;
  --watch-dark: #e0b45a;
  --exc-dark: #f08a74;

  /* Type */
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --fs-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  --fs-xl: clamp(1.5rem, 1.25rem + 1.1vw, 2.125rem);
  --fs-2xl: clamp(2rem, 1.5rem + 2.2vw, 3.25rem);
  --fs-hero: clamp(2.6rem, 1.4rem + 4.4vw, 5.5rem);

  /* Space */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: clamp(3.5rem, 2rem + 6vw, 7rem);
  --s-9: clamp(5rem, 3rem + 8vw, 10rem);
  --gutter: clamp(1rem, 0.4rem + 3vw, 3rem);
  --wrap: 1320px;
  --measure: 62ch;

  /* Shape */
  --r-sm: 4px;
  --r-md: 10px;
  --r-lg: 14px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 180ms;
  --dur-2: 420ms;
  --dur-3: 800ms;

  --header-h: 64px;
}

/* =========================================================
   Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
em { font-style: italic; }
strong { font-weight: 600; }
::selection { background: var(--ink); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.dark :focus-visible, .casefile :focus-visible { outline-color: var(--accent-on-dark); }

.mono {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

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

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-sm);
}
.skip-link:focus { top: var(--s-4); }

/* =========================================================
   Buttons & links
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--ink);
  font-weight: 500;
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.btn span { transition: transform var(--dur-1) var(--ease); }
.btn:hover span { transform: translateX(3px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #2b2d31; border-color: #2b2d31; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.btn-on-dark { background: var(--on-dark); border-color: var(--on-dark); color: var(--dark); }
.btn-on-dark:hover { background: #fff; border-color: #fff; color: var(--dark); }

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
}
.text-link:hover { color: var(--ink); text-decoration-color: currentColor; }

/* =========================================================
   Header + nav
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1;
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.wordmark-dot { color: var(--accent); }

.nav-list { display: flex; gap: var(--s-1); list-style: none; padding: 0; }
.nav-list a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.85rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-2);
  transition: color var(--dur-1) var(--ease);
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 10px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-2) var(--ease);
}
.nav-list a:hover, .nav-list a[aria-current="page"] { color: var(--ink); }
.nav-list a:hover::after, .nav-list a[aria-current="page"]::after { transform: scaleX(1); }
.nav-list .nav-contact {
  margin-left: var(--s-2);
  border: 1px solid var(--ink);
  border-radius: 999px;
  min-height: 40px;
  align-self: center;
  color: var(--ink);
}
.nav-list .nav-contact::after { display: none; }
.nav-list .nav-contact:hover { background: var(--ink); color: var(--bg); }

.menu-button {
  display: none;
  align-items: center;
  gap: var(--s-3);
  min-height: 44px;
  padding: 0 0.25rem 0 0.9rem;
  background: none;
  border: 0;
  font-size: var(--fs-sm);
  font-weight: 500;
}
.menu-icon { position: relative; width: 36px; height: 36px; border: 1px solid var(--ink); border-radius: 50%; }
.menu-icon span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1.5px;
  background: var(--ink);
  transition: transform var(--dur-2) var(--ease), top var(--dur-2) var(--ease);
}
.menu-icon span:first-child { top: 14px; }
.menu-icon span:last-child { top: 20px; }
.menu-button[aria-expanded="true"] .menu-icon span:first-child { top: 17px; transform: rotate(45deg); }
.menu-button[aria-expanded="true"] .menu-icon span:last-child { top: 17px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--header-h) + env(safe-area-inset-top, 0px) + var(--s-6)) var(--gutter) calc(var(--s-6) + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  overflow-y: auto;
}
.mobile-menu-list { list-style: none; padding: 0; }
.mobile-menu-list li { border-bottom: 1px solid var(--line); }
.mobile-menu-list a {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  font-weight: 600;
  font-size: clamp(2rem, 9vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-decoration: none;
}
.mobile-menu-list .mono { color: var(--muted); }
.mobile-menu-foot { display: grid; gap: var(--s-2); padding-top: var(--s-6); }
.mobile-menu-foot a { font-size: var(--fs-lg); min-height: 44px; display: inline-flex; align-items: center; }
.mobile-menu-foot .mono { color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .mobile-menu.is-open .mobile-menu-list li {
    animation: rise var(--dur-2) var(--ease) both;
    animation-delay: calc(var(--i, 0) * 50ms);
  }
}

@media (max-width: 819px) {
  .nav { display: none; }
  .menu-button { display: inline-flex; }
}

/* =========================================================
   Section scaffolding
   ========================================================= */
section { position: relative; }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-4);
  margin-bottom: var(--s-7);
}
.section-index { color: var(--muted); }
.section-title {
  font-weight: 600;
  font-size: var(--fs-2xl);
  line-height: 1.05;
  letter-spacing: -0.035em;
  max-width: 20ch;
  text-wrap: balance;
}
.section-title em { font-style: normal; color: var(--muted); }
.section-intro { max-width: 48ch; color: var(--ink-2); font-size: var(--fs-lg); line-height: 1.5; }
@media (min-width: 1100px) {
  .section-head {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
    align-items: end;
    column-gap: var(--s-7);
  }
  .section-head .section-index { grid-column: 1; grid-row: 1; }
  .section-head .section-title { grid-column: 1; grid-row: 2; }
  .section-head .section-intro { grid-column: 2; grid-row: 2; }
}

.dark {
  background: var(--dark);
  color: var(--on-dark);
}
.dark .section-index { color: var(--on-dark-2); }
.dark .section-title em { color: var(--on-dark-2); }

/* =========================================================
   Hero
   ========================================================= */
.hero { padding-top: clamp(2rem, 0.5rem + 4.5vw, 4.5rem); padding-bottom: var(--s-7); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-7);
  align-items: center;
}
@media (min-width: 1100px) {
  .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr); gap: var(--s-6); }
}
.kicker {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  margin-bottom: var(--s-5);
}
.kicker-rule { display: none; }
.hero-title {
  font-weight: 600;
  font-size: var(--fs-hero);
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.hero-title .line { display: block; }
.hero-title em { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; color: var(--accent); }
.hero-lede {
  margin-top: var(--s-6);
  max-width: 52ch;
  font-size: var(--fs-lg);
  line-height: 1.55;
  color: var(--ink-2);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-4);
  margin-top: var(--s-6);
}
@media (max-width: 559px) {
  .hero-actions .btn { width: 100%; }
}

.hero-figure { position: relative; margin: 0; }
.router { width: 100%; height: auto; overflow: visible; }
.router-tall { display: none; max-width: 420px; margin-inline: auto; }
@media (max-width: 559px) {
  .router-wide { display: none; }
  .router-tall { display: block; }
}
.router text { font-family: var(--sans); font-size: 13px; fill: var(--ink); }
.router .chip { fill: var(--surface); stroke: var(--line-strong); }
.router .chip-meta { display: none; }
.router-paths path { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.router-paths path.out { stroke-width: 1.25; }
.router-paths .ok { stroke: var(--ok); }
.router-paths .watch { stroke: var(--watch); }
.router-paths .exc { stroke: var(--exc); }
.router-core rect { fill: var(--ink); }
.router-core line { stroke: rgba(243, 236, 225, 0.25); }
.router .core-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; fill: var(--bg); }
.router .out-title { font-size: 14px; font-weight: 600; }
.router .out-sub { font-size: 14px; fill: var(--muted); }
.router .dot.ok { fill: var(--ok); }
.router .dot.watch { fill: var(--watch); }
.router .dot.exc { fill: var(--exc); }
.packets circle { fill: var(--muted); }
.packets .p-ok { fill: var(--ok); }
.packets .p-watch { fill: var(--watch); }
.packets .p-exc { fill: var(--exc); }
.router-tall text { font-size: 12.5px; }
.annotation {
  display: none;
  margin-top: var(--s-4);
  color: var(--muted);
  text-align: right;
}

/* Hero entrance + path drawing */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-title .line { animation: rise var(--dur-3) var(--ease) both; }
  .js .hero-title .line:nth-child(2) { animation-delay: 90ms; }
  .js .hero-title .line:nth-child(3) { animation-delay: 180ms; }
  .js .hero-lede, .js .hero-actions, .js .kicker { animation: rise var(--dur-3) var(--ease) both; animation-delay: 260ms; }
  .js .router-paths path { stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.4s var(--ease-in-out) forwards; animation-delay: 300ms; }
  .js .router-paths path.out { animation-delay: 900ms; }
  .js .router-outputs g, .js .router-core { animation: fade var(--dur-3) var(--ease) both; animation-delay: 700ms; }
  .js .router-outputs g:nth-child(2) { animation-delay: 1000ms; }
  .js .router-outputs g:nth-child(3) { animation-delay: 1200ms; }
  .js .packets { animation: fade 600ms ease both; animation-delay: 1.6s; }
}
@media (prefers-reduced-motion: reduce) {
  .packets { display: none; }
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: var(--s-8);
  border-top: 1px solid var(--line);
}
.hero-facts > div { padding: var(--s-4) var(--s-4) 0 0; }
.hero-facts > div + div { padding-left: var(--s-4); }
.hero-facts dt { color: var(--muted); margin-bottom: var(--s-1); font-size: 0.6875rem; }
.hero-facts dd { font-size: var(--fs-sm); line-height: 1.45; color: var(--ink-2); }
@media (max-width: 819px) {
  .hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-facts > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .hero-facts > div:nth-child(n + 3) { border-top: 1px solid var(--line); margin-top: var(--s-4); }
}
@media (max-width: 419px) {
  .hero-facts { grid-template-columns: minmax(0, 1fr); }
  .hero-facts > div, .hero-facts > div + div { padding-left: 0; border-left: 0; }
  .hero-facts > div + div { border-top: 1px solid var(--line); margin-top: var(--s-3); }
}

/* =========================================================
   Work / projects
   ========================================================= */
.work { padding-block: var(--s-8) var(--s-9); }
.projects { display: grid; gap: clamp(1.25rem, 0.5rem + 3vw, 3rem); }

.project {
  position: relative;
  display: grid;
  gap: var(--s-6);
  padding: clamp(1.25rem, 0.6rem + 2.4vw, 2.75rem);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
@media (hover: hover) {
  .project:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 20px 40px -30px rgba(18, 19, 21, 0.35); }
}
.project-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.project-meta { display: flex; align-items: baseline; gap: var(--s-3); color: var(--muted); }
.project-num {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  line-height: 1;
  color: var(--muted);
}
.project-title {
  margin-top: var(--s-3);
  font-weight: 600;
  font-size: var(--fs-xl);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.project-tagline { margin-top: var(--s-3); max-width: 42ch; font-size: var(--fs-base); line-height: 1.55; color: var(--ink-2); }
.project-note { margin-top: var(--s-3); font-size: var(--fs-sm); color: var(--ink-2); max-width: 44ch; }
.project-note strong { color: var(--ink); font-weight: 600; }

/* The whole card is clickable via the button's stretched hit area */
.project-open {
  margin-top: auto;
  padding-top: var(--s-5);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 44px;
  background: none;
  border: 0;
  padding-inline: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.35em;
}
.project:hover .project-open { text-decoration-color: var(--accent); }
.project-open::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.project-open span { display: inline-block; transition: transform var(--dur-1) var(--ease); }
.project:hover .project-open span { transform: translateX(4px); }
.project-open:focus-visible { outline: none; }
.project:has(.project-open:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; }
.project--dark:has(.project-open:focus-visible) { outline-color: var(--on-dark); }

.project-visual { position: relative; min-width: 0; }

/* --- 01 Waybill (feature) --- */
.project--feature { background: var(--surface); }
@media (min-width: 1100px) {
  .project--feature { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--s-7); align-items: stretch; }
}
.vis-waybill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-5);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 0;
}
.wb-sources, .wb-states { display: grid; gap: var(--s-3); }
.wb-src {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.wb-src .mono { display: block; color: var(--muted); font-size: 0.68rem; }
.wb-src b { font-weight: 500; font-size: var(--fs-sm); }
.wb-pipe {
  position: relative;
  display: grid;
  gap: var(--s-2);
  padding-inline: var(--s-4);
}
.wb-pipe::before, .wb-pipe::after {
  content: "";
  position: absolute;
  top: 50%;
  width: var(--s-4);
  height: 1px;
  background: var(--ink);
}
.wb-pipe::before { left: 0; }
.wb-pipe::after { right: 0; }
.wb-step {
  display: block;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}
.wb-state {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--s-2);
  align-items: center;
  padding: 0.55rem 0.8rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  opacity: 0.55;
  transition: opacity var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.wb-state b { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; font-weight: 600; }
.wb-state .mono { grid-column: 2; font-size: 0.64rem; color: var(--muted); text-transform: none; overflow-wrap: anywhere; }
.wb-dot { width: 8px; height: 8px; border-radius: 50%; grid-row: span 2; }
.wb-state.ok .wb-dot { background: var(--ok); } .wb-state.ok b { color: var(--ok); }
.wb-state.watch .wb-dot { background: var(--watch); } .wb-state.watch b { color: var(--watch); }
.wb-state.exc .wb-dot { background: var(--exc); } .wb-state.exc b { color: var(--exc); }
.wb-state.is-hit { opacity: 1; border-color: currentColor; color: var(--exc); transform: translateX(-4px); }
.wb-state.is-hit.ok { color: var(--ok); }
.wb-state.is-hit.watch { color: var(--watch); }
@media (max-width: 559px) {
  .vis-waybill { grid-template-columns: minmax(0, 1fr); padding: var(--s-4); }
  .wb-pipe { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: var(--s-4) 0; }
  .wb-pipe::before, .wb-pipe::after { left: 50%; width: 1px; height: var(--s-4); top: 0; }
  .wb-pipe::after { top: auto; bottom: 0; right: auto; }
  .wb-step { padding-inline: 0.3rem; font-size: 0.62rem; }
  .wb-state.is-hit { transform: none; }
}

/* --- 02 PaperGuard --- */
.projects { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) {
  .projects { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .project--feature, .reliability, .project--strip, .project--explainer, .family { grid-column: 1 / -1; }
  .project--paper { grid-column: 1 / span 7; }
  .project--north { grid-column: 8 / span 5; }
}
@media (min-width: 820px) and (max-width: 1099px) {
  .project--paper { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); align-items: center; }
  .project--north { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); align-items: center; }
}
@media (min-width: 1100px) {
  .project--paper { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr); align-items: center; }
}
.vis-paper {
  display: grid;
  place-items: center;
  padding: var(--s-5) var(--s-3);
  background: var(--surface-2);
  border-radius: var(--r-md);
  min-height: 300px;
}
.sheet {
  position: relative;
  width: min(100%, 300px);
  padding: 1.6rem 1.4rem 1.4rem;
  background: #fff;
  box-shadow: 0 1px 0 var(--line), 0 16px 30px -24px rgba(18, 19, 21, 0.4);
}
.sheet-file { color: var(--muted); font-size: 0.62rem; margin-bottom: var(--s-3); text-transform: none; }
.sheet-line {
  position: relative;
  height: 7px;
  margin-bottom: 0.85rem;
  border-radius: 2px;
  background: #e4e4e0;
}
.w90 { width: 90%; } .w85 { width: 85%; } .w80 { width: 80%; } .w75 { width: 75%; } .w70 { width: 70%; } .w60 { width: 60%; }
.mark-fail { background: color-mix(in srgb, var(--exc) 28%, #e4e4e0); }
.mark-pass { background: color-mix(in srgb, var(--ok) 28%, #e4e4e0); }
.sheet-figure {
  position: relative;
  height: 64px;
  margin-top: var(--s-4);
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
}
.stamp {
  position: absolute;
  right: -0.9rem;
  top: 50%;
  translate: 0 -50%;
  padding: 0.12rem 0.4rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  background: #fff;
}
.stamp.fail { color: var(--exc); }
.stamp.pass { color: var(--ok); }
.stamp.review { color: var(--watch); top: 0.6rem; translate: 0 0; }
.anno {
  position: absolute;
  left: 0;
  top: 9px;
  font-size: 0.72rem;
  line-height: 1;
  color: var(--exc);
  white-space: nowrap;
}
.mark-pass .anno { color: var(--ok); }
.sheet-figure .anno { top: auto; bottom: 0.5rem; left: 0.6rem; color: var(--watch); white-space: normal; }
.sheet-line.mark-fail, .sheet-line.mark-pass { margin-bottom: 1.6rem; }

/* --- 03 NorthStar --- */
.project--north { background: var(--surface); }
.gates { list-style: none; padding: 0; display: grid; gap: 0; counter-reset: gate; }
.gate {
  position: relative;
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  align-items: center;
  gap: var(--s-3);
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.gate + .gate { margin-top: 1.1rem; }
.gate + .gate::before {
  content: "";
  position: absolute;
  left: 1.5rem;
  top: calc(-1.1rem - 1px);
  height: 1.1rem;
  width: 1px;
  background: var(--line-strong);
}
.gate .mono { font-size: 0.66rem; }
.gate b { font-weight: 500; font-size: var(--fs-sm); }
.gate s { text-decoration-color: var(--exc); text-decoration-thickness: 2px; }
.gate.rule .mono { color: var(--ink-2); }
.gate.ai .mono { color: var(--watch); }
.gate.ai { border-style: dashed; }
.gate.human { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.gate.human .mono { color: var(--on-dark-2); }
.gate.human b { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; }

/* --- Reliability pair (dark band) --- */
.reliability {
  padding: clamp(1.25rem, 0.5rem + 3vw, 3rem);
  border-radius: var(--r-lg);
  background: var(--dark);
  color: var(--on-dark);
}
.reliability-kicker { color: var(--on-dark-2); }
.reliability-title {
  margin-top: var(--s-3);
  font-weight: 600;
  font-size: var(--fs-xl);
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 24ch;
}
.said-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: var(--s-6);
  border-top: 1px solid var(--dark-line);
  border-bottom: 1px solid var(--dark-line);
}
.said { padding: var(--s-4) var(--s-4) var(--s-4) 0; min-width: 0; }
.said + .said { padding-left: var(--s-4); border-left: 1px solid var(--dark-line); }
.said .mono { display: block; color: var(--on-dark-2); font-size: 0.68rem; margin-bottom: var(--s-2); }
.said q { font-size: var(--fs-base); quotes: none; color: var(--on-dark); }
.said--truth code { font-family: var(--mono); font-size: var(--fs-sm); color: var(--exc-dark); overflow-wrap: anywhere; }
@media (max-width: 819px) {
  .said-grid { grid-template-columns: minmax(0, 1fr); }
  .said, .said + .said { padding-left: 0; border-left: 0; }
  .said + .said { border-top: 1px solid var(--dark-line); }
}
.reliability-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
  margin-top: var(--s-6);
}
@media (min-width: 820px) { .reliability-pair { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--s-3); } }
.project--dark {
  background: var(--dark-2);
  border-color: var(--dark-line);
  color: var(--on-dark);
  align-content: start;
}
@media (hover: hover) {
  .project--dark:hover { border-color: var(--on-dark-2); box-shadow: none; }
}
.project--dark .project-meta, .project--dark .project-tagline { color: var(--on-dark-2); }
.project--dark .project-num { color: var(--on-dark-2); }
.project--dark .project-title { font-size: var(--fs-xl); }
.project--dark .project-open { color: var(--on-dark); text-decoration-color: var(--dark-line); }
.project--dark:hover .project-open { text-decoration-color: var(--accent-on-dark); }

.vis-qa {
  padding: var(--s-4);
  border: 1px solid var(--dark-line);
  border-radius: var(--r-md);
  min-height: 190px;
}
.wave { display: flex; align-items: center; gap: 2px; height: 56px; }
.wave i { flex: 1; min-width: 1px; background: var(--on-dark-2); opacity: 0.35; border-radius: 1px; }
.pins { position: relative; height: 82px; margin-top: var(--s-2); }
.pin {
  position: absolute;
  left: var(--x);
  top: 0;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding-top: 18px;
  font-size: 0.72rem;
  white-space: nowrap;
  color: var(--on-dark);
}
.pin::before {
  content: "";
  position: absolute;
  top: -60px;
  height: 74px;
  width: 1px;
  background: var(--on-dark-2);
}
.pin i { font-style: normal; color: var(--on-dark-2); font-size: 0.62rem; }
.pin--flag { color: var(--exc-dark); }
.pin--flag::before { background: var(--exc-dark); width: 2px; }
.pin:first-child { translate: -30% 0; }
.pin:last-child { translate: -70% 0; }
.qa-draft { color: var(--on-dark-2); font-size: 0.66rem; text-transform: none; }
.qa-draft span { color: var(--on-dark); }

.vis-incident {
  padding: var(--s-4);
  border: 1px solid var(--dark-line);
  border-radius: var(--r-md);
  min-height: 190px;
  display: grid;
  align-content: center;
}
.trace { display: grid; gap: var(--s-2); }
.trace-row, .trace-verdict {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-3);
  padding: 0.65rem 0.8rem;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.04);
}
.trace-row .mono, .trace-verdict .mono { color: var(--on-dark-2); font-size: 0.64rem; }
.trace-row b { font-weight: 500; font-size: var(--fs-sm); }
.trace-row:nth-child(1) b { color: var(--on-dark); }
.trace-row:nth-child(2) b { color: var(--exc-dark); font-family: var(--mono); font-size: 0.78rem; }
.trace-verdict { background: transparent; border: 1px dashed var(--exc-dark); }
.trace-verdict b { font-family: var(--mono); font-size: 0.8rem; color: var(--exc-dark); }
.trace-verdict .mono { color: var(--exc-dark); }

/* --- 06 Knowledge strip --- */
.project--strip { padding-block: clamp(1.25rem, 0.8rem + 1.6vw, 2rem); background: transparent; }
@media (min-width: 1100px) {
  .project--strip { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: center; }
}
.project--strip .project-title { font-size: var(--fs-xl); }
.vis-knowledge {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}
.vis-knowledge li {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-2);
}
.vis-knowledge li:not(:last-child)::after { content: "→"; color: var(--muted); margin-right: calc(-1 * var(--s-1)); }
.vis-knowledge li:last-child { color: var(--ink); border-color: var(--line-strong); }

.noscript-list { margin-top: var(--s-6); }

/* =========================================================
   Experience
   ========================================================= */
.experience { padding-block: var(--s-9); }
.exp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-7);
}
@media (min-width: 1100px) { .exp-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: var(--s-8); } }
.exp-copy .section-title { margin-top: var(--s-4); margin-bottom: var(--s-6); }
.exp-copy p:not(.section-index) { max-width: 52ch; color: var(--on-dark-2); font-size: var(--fs-lg); line-height: 1.55; }
.exp-copy p + p { margin-top: var(--s-4); }
.exp-copy strong { color: var(--on-dark); font-weight: 600; }
.exp-copy p.exp-confidential { font-size: var(--fs-xs); color: var(--on-dark-2); opacity: 0.8; margin-top: var(--s-6); text-transform: none; letter-spacing: 0.02em; }

.call-map { position: relative; display: grid; gap: 0; }
.call-ring { display: none; }
.call-layers { display: grid; gap: 0; border-top: 1px solid var(--dark-line); }
.call-layer {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: var(--s-4);
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--dark-line);
}
.call-layer h3 { color: var(--on-dark-2); font-weight: 500; padding-top: 0.35rem; }
.call-layer p { font-size: var(--fs-lg); font-weight: 500; line-height: 1.35; letter-spacing: -0.015em; }
.call-layer--accent h3 { color: var(--accent-on-dark); }
.call-layer--accent p { color: var(--on-dark); }
@media (max-width: 419px) {
  .call-layer { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
}

/* =========================================================
   Approach: the sorter
   ========================================================= */
.approach { padding-block: var(--s-9) var(--s-8); }
.approach .section-title { max-width: 22ch; }
.sorter-cases {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
}
.case {
  min-height: 44px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: var(--fs-sm);
  text-align: left;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.case:hover { border-color: var(--ink); }
.case[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
}
.lane {
  position: relative;
  padding: var(--s-5) var(--s-5) var(--s-5) 0;
  transition: background var(--dur-2) var(--ease);
}
.lane + .lane { padding-left: var(--s-5); border-left: 1px solid var(--line); }
.lane-tag { color: var(--muted); }
.lane-title {
  margin-top: var(--s-2);
  font-weight: 600;
  font-size: var(--fs-xl);
  letter-spacing: -0.03em;
  line-height: 1.1;
  transition: color var(--dur-2) var(--ease);
}
.lane-desc { margin-top: var(--s-3); color: var(--ink-2); font-size: var(--fs-sm); max-width: 30ch; }
.lane-slot { position: relative; min-height: 56px; margin-top: var(--s-4); }
.lane-token {
  display: inline-block;
  max-width: 100%;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: var(--fs-sm);
}
@media (prefers-reduced-motion: no-preference) {
  .lane-token { animation: drop var(--dur-2) var(--ease) both; }
}
.lane.is-active .lane-title { color: var(--ink); }
.lane.is-active::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}
.lane + .lane.is-active::before { left: 0; }
.sorter-result {
  margin-top: var(--s-5);
  min-height: 3.2em;
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  max-width: 70ch;
}
.sorter-result b { color: var(--ink); font-weight: 600; }
.sorter-result button {
  background: none;
  border: 0;
  padding: 0;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.2em;
}
@media (max-width: 819px) {
  .lanes { grid-template-columns: minmax(0, 1fr); }
  .lane, .lane + .lane { padding: var(--s-4) 0; border-left: 0; }
  .lane + .lane { border-top: 1px solid var(--line); }
  .lane { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-4); align-items: end; }
  .lane-tag, .lane-title, .lane-desc { grid-column: 1; }
  .lane-title { font-size: var(--fs-xl); }
  .lane-slot { grid-column: 1 / -1; min-height: 0; margin-top: 0; }
  .lane.is-active .lane-slot { margin-top: var(--s-3); }
}

/* =========================================================
   Help
   ========================================================= */
.help { padding-block: var(--s-8); }
.help-list { list-style: none; padding: 0; border-top: 1px solid var(--line-strong); }
.help-item {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 0.7fr);
  gap: var(--s-5);
  align-items: baseline;
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--line);
  transition: background var(--dur-2) var(--ease);
}
.help-num { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); line-height: 1.6; }
.help-item h3 { font-weight: 600; font-size: var(--fs-lg); letter-spacing: -0.02em; line-height: 1.25; }
.help-item p { color: var(--ink-2); }
.help-seen { color: var(--muted); text-transform: none; letter-spacing: 0.02em; }
.help-seen button {
  background: none;
  border: 0;
  min-height: 44px;
  padding: 0.6rem 0.1rem;
  font: inherit;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.25em;
}
.help-seen button:hover { text-decoration-color: var(--accent); }
@media (max-width: 1099px) {
  .help-item { grid-template-columns: 2.5rem minmax(0, 1fr); row-gap: var(--s-2); }
  .help-item > :not(.help-num) { grid-column: 2; }
}

/* =========================================================
   About
   ========================================================= */
.about { padding-block: var(--s-8) var(--s-9); }
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-6);
}
@media (min-width: 1100px) {
  .about-grid { grid-template-columns: 10rem minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--s-6) var(--s-7); }
}
.about-title { font-family: var(--mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-top: 0.4rem; }
.about-copy p { font-size: var(--fs-lg); font-weight: 500; letter-spacing: -0.015em; line-height: 1.5; }
.about-copy p + p { margin-top: var(--s-4); color: var(--ink-2); font-weight: 400; }
.about-copy a { text-decoration-color: var(--line-strong); }
.about-copy a:hover { text-decoration-color: var(--accent); }
.notes { list-style: none; padding: 0; display: grid; gap: 0; align-self: start; }
.notes li {
  position: relative;
  padding: var(--s-3) 0 var(--s-3) 1.75rem;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.notes li::before {
  content: "—";
  position: absolute;
  left: 0;
  top: var(--s-3);
  color: var(--muted);
}

/* =========================================================
   Contact + footer
   ========================================================= */
.contact { padding-block: var(--s-8) var(--s-9); }
.contact .wrap > * { min-width: 0; }

.contact-grid { display: grid; gap: var(--s-5); }
.contact-title {
  font-weight: 600;
  font-size: clamp(2.2rem, 1.3rem + 3.6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 16ch;
}
.contact-title em { font-style: normal; color: var(--muted); }
.contact-copy { max-width: 56ch; color: var(--ink-2); font-size: var(--fs-lg); line-height: 1.55; }
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-6);
  margin-top: var(--s-5);
  padding-top: var(--s-6);
  border-top: 0;
  padding-top: 0;
}
.contact-direct { display: grid; gap: var(--s-1); }
.contact-direct .mono { color: var(--muted); }
.contact-direct a { font-size: var(--fs-base); min-height: 40px; display: inline-flex; align-items: center; text-decoration-color: var(--line-strong); overflow-wrap: anywhere; }
.contact-direct a:hover { text-decoration-color: var(--accent); }
@media (max-width: 559px) { .contact-actions .btn { width: 100%; } }

.site-footer {
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-3);
  padding-block: var(--s-5) calc(var(--s-5) + env(safe-area-inset-bottom, 0px));
}

/* =========================================================
   Case-study overlay
   ========================================================= */
.casefile {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  width: min(1080px, calc(100vw - 2 * var(--gutter)));
  max-width: none;
  height: min(92vh, 1000px);
  max-height: none;
  margin: auto;
  overflow: visible;
}
.casefile::backdrop {
  background: rgba(17, 18, 20, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.case-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.45);
}
.case-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-3) var(--s-3) clamp(1.25rem, 0.5rem + 3vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.case-bar-meta { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case-bar-meta span:first-child { color: var(--ink); }
.case-close {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 500;
  flex: none;
}
.case-close:hover { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.case-close:focus-visible { outline-color: var(--accent); }
.case-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: clamp(1.5rem, 0.5rem + 4vw, 3.5rem) clamp(1.25rem, 0.5rem + 3vw, 3rem) var(--s-8);
}
.case-body:focus { outline: none; }

@media (max-width: 819px) {
  .casefile {
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    margin: 0;
    inset: 0;
  }
  .case-panel { border-radius: 0; }
  .case-bar { padding-top: calc(var(--s-3) + env(safe-area-inset-top, 0px)); }
  .case-body { padding-bottom: calc(var(--s-8) + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 419px) {
  .case-close-label { display: none; }
  .case-close { width: 44px; padding: 0; justify-content: center; }
}

/* Open/close animation */
@media (prefers-reduced-motion: no-preference) {
  .casefile[open] .case-panel { animation: panel-in var(--dur-2) var(--ease) both; }
  .casefile[open]::backdrop { animation: fade var(--dur-2) ease both; }
  .casefile.is-closing .case-panel { animation: panel-out 220ms var(--ease-in-out) both; }
  .casefile.is-closing::backdrop { animation: fade-out 220ms ease both; }
}

/* Overlay content */
.cs-head { display: grid; gap: var(--s-4); padding-bottom: var(--s-6); border-bottom: 1px solid var(--line); }
.cs-num { display: none; }
.cs-title { font-weight: 600; font-size: clamp(2.2rem, 1.4rem + 3.4vw, 4rem); line-height: 1; letter-spacing: -0.045em; outline: none; }
.cs-tagline { font-size: var(--fs-lg); color: var(--ink-2); max-width: 46ch; line-height: 1.45; }
.cs-facts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); margin-top: var(--s-2); }
.cs-status { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); color: var(--ink-2); }
.cs-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.cs-links { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.cs-links .btn { min-height: 44px; padding-block: 0.55rem; }

.cs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-7);
  margin-top: var(--s-7);
}
@media (min-width: 900px) {
  .cs-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--s-7) var(--s-8); }
  .cs-wide { grid-column: 1 / -1; }
}
.cs-block h3 { color: var(--muted); margin-bottom: var(--s-3); }
.cs-block > p { font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); line-height: 1.6; max-width: var(--measure); }
.cs-block ul { padding-left: 1.1rem; display: grid; gap: var(--s-2); max-width: var(--measure); }
.cs-block li::marker { color: var(--muted); }
.cs-block--quote > p { font-size: var(--fs-lg); font-weight: 500; letter-spacing: -0.015em; line-height: 1.5; max-width: 70ch; }

.flow { list-style: none; padding: 0; position: relative; }
.flow-step {
  position: relative;
  display: grid;
  grid-template-columns: 1.5rem 5.5rem minmax(0, 1fr);
  gap: var(--s-3);
  padding-bottom: var(--s-4);
}
.flow-step::before {
  content: "";
  position: absolute;
  left: calc(0.75rem - 0.5px);
  top: 1.2rem;
  bottom: 0;
  width: 1px;
  background: var(--line-strong);
  transform-origin: top;
}
.flow-step:last-child::before { display: none; }
.flow-marker {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  margin: 0.3rem auto 0;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--surface);
}
.flow-step[data-kind="input"] .flow-marker { background: var(--ink); }
.flow-step[data-kind="rule"] .flow-marker { border-radius: 2px; }
.flow-step[data-kind="ai"] .flow-marker { border-style: dashed; border-color: var(--watch); }
.flow-step[data-kind="human"] .flow-marker { background: var(--accent); border-color: var(--accent); }
.flow-step[data-kind="exception"] .flow-marker { border-color: var(--exc); background: var(--accent-tint); }
.flow-step[data-kind="output"] .flow-marker { background: var(--ok); border-color: var(--ok); }
.flow-label { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-top: 0.2rem; }
.flow-step[data-kind="ai"] .flow-label { color: var(--watch); }
.flow-step[data-kind="human"] .flow-label, .flow-step[data-kind="exception"] .flow-label { color: var(--exc); }
.flow-title { font-weight: 500; line-height: 1.35; }
.flow-note { display: block; font-size: var(--fs-sm); color: var(--muted); font-weight: 400; }
.flow-step.is-branch { margin-left: 1.5rem; }
.flow-step.is-branch .flow-title { color: var(--exc); }
.flow-step.is-branch::after {
  content: "↳";
  position: absolute;
  left: -1.3rem;
  top: 0;
  color: var(--exc);
  font-family: var(--mono);
}
.flow-legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin-top: var(--s-3); font-size: var(--fs-xs); color: var(--muted); }
.flow-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.flow-legend i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink); display: inline-block; }
.flow-legend .l-rule i { border-radius: 1px; }
.flow-legend .l-ai i { border-style: dashed; border-color: var(--watch); }
.flow-legend .l-human i { background: var(--accent); border-color: var(--accent); }
@media (max-width: 419px) {
  .flow-step { grid-template-columns: 1.5rem minmax(0, 1fr); row-gap: 0; }
  .flow-label { grid-column: 2; padding-top: 0.15rem; }
  .flow-title { grid-column: 2; }
  .flow-marker { grid-row: 1 / span 2; }
}

@media (prefers-reduced-motion: no-preference) {
  .casefile[open] .flow-step { animation: rise 500ms var(--ease) both; animation-delay: calc(200ms + var(--i, 0) * 70ms); }
  .casefile[open] .flow-step::before { animation: grow 500ms var(--ease) both; animation-delay: calc(300ms + var(--i, 0) * 70ms); }
}

.cs-sample {
  margin-top: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  background: var(--dark);
  color: var(--on-dark);
  overflow-x: auto;
}
.cs-sample figcaption { color: var(--on-dark-2); margin-bottom: var(--s-3); }
.cs-sample pre { margin: 0; font-family: var(--mono); font-size: 0.8rem; line-height: 1.6; white-space: pre; }

.cs-stack { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); list-style: none; padding: 0 !important; }
.cs-stack li { font-size: var(--fs-sm); padding-bottom: 2px; border-bottom: 1px solid var(--line-strong); }

.cs-media { display: grid; gap: var(--s-5); margin-top: var(--s-2); }
@media (min-width: 900px) { .cs-media.has-two { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.cs-media figure { margin: 0; }
.cs-media .shot {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #f5f5f5;
}
.cs-media .shot img { width: 100%; }
.cs-media figcaption { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--muted); }

.cs-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.cs-nav button {
  display: grid;
  gap: var(--s-1);
  min-height: 64px;
  padding: var(--s-3) 0;
  background: none;
  border: 0;
  text-align: left;
}
.cs-nav button:last-child { text-align: right; justify-items: end; }
.cs-nav .mono { color: var(--muted); }
.cs-nav b { font-weight: 600; font-size: var(--fs-lg); letter-spacing: -0.02em; line-height: 1.2; }
.cs-nav button:hover b { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.2em; }

html.is-locked { overflow: hidden; }

/* =========================================================
   Reveal on scroll
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(14px); transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
  /* Waybill: statuses light up once revealed */
  .js .project--feature .wb-state.is-hit { opacity: 0.55; transform: none; border-color: var(--line); }
  .js .project--feature.is-in .wb-state.is-hit { opacity: 1; transform: translateX(-4px); border-color: currentColor; transition-delay: 700ms; }
  .js .project--feature .wb-step { opacity: 0.3; transition: opacity 400ms var(--ease); }
  .js .project--feature.is-in .wb-step { opacity: 1; }
  .js .project--feature.is-in .wb-step:nth-child(1) { transition-delay: 250ms; }
  .js .project--feature.is-in .wb-step:nth-child(2) { transition-delay: 400ms; }
  .js .project--feature.is-in .wb-step:nth-child(3) { transition-delay: 550ms; }
}
@media (max-width: 559px) and (prefers-reduced-motion: no-preference) {
  .js .project--feature.is-in .wb-state.is-hit { transform: none; }
}

/* =========================================================
   Keyframes
   ========================================================= */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes drop { from { opacity: 0; transform: translateY(-14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(32px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes panel-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(20px) scale(0.99); } }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

@media (max-width: 559px) {
  .pin:not(.pin--flag) span { display: none; }
}

/* overlay fixes: legend size + keep the main flow line continuous past branches */
.cs-block > p.flow-legend { font-size: var(--fs-xs); line-height: 1.4; }
.flow-step.is-branch::before { left: calc(-0.75rem - 0.5px); top: 0; }

/* =========================================================
   Multi-page structure
   ========================================================= */
.page { padding-block: clamp(2.5rem, 1rem + 5vw, 5rem) var(--s-8); }
.page--tight { padding-bottom: var(--s-6); }
.page-head { margin-bottom: var(--s-7); }
.page-title { font-size: clamp(2.25rem, 1.5rem + 3vw, 4rem); max-width: 22ch; }
.work.page { padding-bottom: var(--s-9); }
.work--preview { padding-block: var(--s-8); }
.more-link { margin-top: var(--s-6); }
.nav-list a[aria-current="page"] { font-weight: 600; }
.mobile-menu-list a[aria-current="page"] { color: var(--muted); }
.wordmark[aria-current="page"] { cursor: default; }

.text-link--dark { color: var(--on-dark); text-decoration-color: rgba(255, 255, 255, 0.3); }
.text-link--dark:hover { color: #fff; text-decoration-color: var(--accent-on-dark); }

/* Home: experience preview */
.exp-preview { padding-block: var(--s-8); }
.exp-preview-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
@media (min-width: 1100px) { .exp-preview-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: var(--s-8); } }
.exp-preview .section-title { margin-top: var(--s-3); }
.exp-preview-copy p { color: var(--on-dark-2); font-size: var(--fs-lg); line-height: 1.55; max-width: 52ch; margin-bottom: var(--s-3); }

/* Closing CTA on inner pages */
.page-cta { border-top: 1px solid var(--line); }
.page-cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4) var(--s-6); padding-block: var(--s-7); }
.page-cta-title { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; max-width: 24ch; }
@media (max-width: 559px) { .page-cta .btn { width: 100%; } }

/* Related systems pair */
.pair-link { display: grid; place-items: center; color: var(--on-dark-2); }
.pair-link span {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--dark-line);
  font-size: 1rem;
}
@media (max-width: 819px) { .pair-link span { transform: rotate(90deg); } }
.project-role { margin-top: var(--s-3); color: var(--on-dark-2); font-size: 0.68rem; text-transform: none; letter-spacing: 0.02em; }

/* Project Explainer card */
.project--explainer { background: var(--surface); }
@media (min-width: 1100px) {
  .project--explainer { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--s-7); align-items: center; }
}
.vis-explainer {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-5);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.ex-tree { list-style: none; padding: var(--s-3) var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); text-transform: none; letter-spacing: 0; font-size: 0.72rem; color: var(--ink-2); line-height: 1.9; }
.ex-tree li { padding-left: calc(var(--d, 1) * 0.9rem); }
.ex-tree li.ex-root { padding-left: 0; }
.ex-dir { color: var(--ink); font-weight: 500; }
.ex-arrow { color: var(--muted); }
.ex-report { display: grid; gap: var(--s-2); }
.ex-card { padding: 0.55rem 0.8rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.ex-card .mono { display: block; font-size: 0.62rem; color: var(--muted); }
.ex-card b { font-weight: 500; font-size: var(--fs-sm); }
.ex-card--warn { border-color: color-mix(in srgb, var(--exc) 45%, transparent); }
.ex-card--warn .mono, .ex-card--warn b { color: var(--exc); }
@media (max-width: 559px) {
  .vis-explainer { grid-template-columns: minmax(0, 1fr); padding: var(--s-4); }
  .ex-arrow { transform: rotate(90deg); justify-self: center; }
}

/* =========================================================
   Case study: related, real workflow, screenshots
   ========================================================= */
.cs-related {
  display: grid;
  gap: var(--s-2);
  margin-top: var(--s-6);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.cs-related .mono { color: var(--muted); }
.cs-related p:not(.mono) { color: var(--ink-2); max-width: 70ch; }
.cs-related-link {
  justify-self: start;
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.3em;
}
.cs-block > p.cs-flow-note { font-size: var(--fs-sm); color: var(--muted); margin: calc(-1 * var(--s-2)) 0 var(--s-4); max-width: 70ch; }
.cs-gap { margin-top: var(--s-7); }

.shot-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #f5f5f5;
  cursor: zoom-in;
  text-align: left;
}
.shot-frame { position: relative; display: block; }
.shot-frame img { width: 100%; }
.shot-hint {
  position: absolute;
  right: var(--s-3);
  bottom: var(--s-3);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: rgba(17, 18, 20, 0.82);
  color: #fff;
  font-size: 0.64rem;
  opacity: 0;
  transition: opacity var(--dur-1) var(--ease);
}
.shot-btn:hover .shot-hint, .shot-btn:focus-visible .shot-hint { opacity: 1; }
@media (hover: none) { .shot-hint { opacity: 1; } }

.wf-figure { margin: 0; }
.wf-figure figcaption, .cs-media figcaption { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--muted); }
.wf-pin {
  position: absolute;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: clamp(16px, 1.6vw, 22px);
  height: clamp(16px, 1.6vw, 22px);
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: clamp(0.55rem, 0.8vw, 0.7rem);
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
  transition: background var(--dur-1) var(--ease), scale var(--dur-1) var(--ease);
  pointer-events: none;
}
.wf-pin.is-hot { background: var(--accent); scale: 1.25; }

.wf-stages {
  list-style: none;
  padding: 0 !important;
  margin-top: var(--s-6);
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 var(--s-6) !important;
  max-width: none !important;
}
@media (min-width: 900px) { .wf-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wf-stage {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  gap: var(--s-3);
  padding: var(--s-3) var(--s-2) var(--s-3) 0;
  border-top: 1px solid var(--line);
  border-radius: 2px;
  transition: background var(--dur-1) var(--ease);
}
.wf-stage.is-hot { background: var(--surface-2); }
.wf-num {
  display: grid; place-items: center;
  width: 22px; height: 22px; margin-top: 1px;
  border-radius: 50%;
  background: var(--ink); color: #fff;
  font-family: var(--mono); font-size: 0.68rem; font-weight: 600;
}
.wf-stage.is-hot .wf-num { background: var(--accent); }
.wf-stage b { display: block; font-weight: 600; }
.wf-stage code { display: block; margin-top: 2px; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-2); overflow-wrap: anywhere; }
.wf-stage p { margin-top: var(--s-1); font-size: var(--fs-sm); color: var(--muted); }
.wf-stage--exception b { color: var(--exc); }
.wf-stage--human .wf-num { box-shadow: 0 0 0 2px var(--accent-tint); }

/* Lightbox */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--dark);
  color: #fff;
  overflow: hidden;
}
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox::backdrop { background: rgba(17, 18, 20, 0.6); }
.lb-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: calc(var(--s-3) + env(safe-area-inset-top, 0px)) var(--gutter) var(--s-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.lb-caption { font-size: var(--fs-sm); color: #c9cbcf; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-actions { display: flex; gap: var(--s-2); flex: none; }
.lb-btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 44px; padding: 0 1rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: transparent; color: #fff;
  font-size: var(--fs-sm); font-weight: 500;
}
.lb-btn:hover { background: #fff; color: var(--ink); }
.lightbox :focus-visible { outline-color: #fff; }
.lb-stage {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  padding: var(--s-5) var(--gutter) calc(var(--s-5) + env(safe-area-inset-bottom, 0px));
  display: grid;
  place-items: center;
}
.lb-frame { position: relative; width: 100%; max-width: var(--lw); background: #f5f5f5; border-radius: var(--r-sm); }
.lb-frame img { width: 100%; height: auto; max-height: none; }
.lightbox:not(.is-zoomed) .lb-frame { max-height: calc(100dvh - 140px); width: auto; }
.lightbox:not(.is-zoomed) .lb-frame img { max-height: calc(100dvh - 140px); width: auto; max-width: 100%; }
.lightbox.is-zoomed .lb-stage { place-items: start; }
.lightbox.is-zoomed .lb-frame { width: var(--lw); max-width: none; }
.lightbox .wf-pin { width: 22px; height: 22px; font-size: 0.7rem; }
@media (max-width: 559px) { .lb-close-label { display: none; } .lb-caption { display: none; } .lb-actions { width: 100%; justify-content: space-between; } }

/* =========================================================
   Experience page
   ========================================================= */
.exp-list { margin-top: var(--s-5); padding-left: 1.1rem; display: grid; gap: var(--s-2); color: var(--on-dark); max-width: 54ch; }
.exp-list li::marker { color: var(--on-dark-2); }
.call-map-title { color: var(--on-dark-2); margin-bottom: var(--s-4); }
.exp-lesson {
  margin: var(--s-8) 0 0;
  padding-top: var(--s-6);
  border-top: 1px solid var(--dark-line);
}
.exp-lesson p { font-size: var(--fs-xl); font-weight: 500; letter-spacing: -0.02em; line-height: 1.35; max-width: 40ch; }

.page-section { padding-block: var(--s-7); border-top: 1px solid var(--line); }
.page-section:first-of-type { border-top: 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4) var(--s-7); }
@media (min-width: 900px) { .two-col { grid-template-columns: 14rem minmax(0, 1fr); } }
.col-label { color: var(--muted); font-weight: 500; padding-top: 0.3rem; }
.lead { font-size: var(--fs-lg); line-height: 1.5; color: var(--ink-2); max-width: 56ch; }
.inline-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); margin-top: var(--s-3); }
.inline-links button {
  min-height: 44px; padding: 0; background: none; border: 0;
  font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.3em;
}
.inline-links button:hover { text-decoration-color: var(--accent); }
.timeline { list-style: none; padding: 0; display: grid; gap: 0; }
.timeline li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-1) var(--s-6);
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--line);
}
.timeline li:first-child { padding-top: 0; }
@media (min-width: 700px) { .timeline li { grid-template-columns: 9.5rem minmax(0, 1fr); } }
.tl-when { color: var(--muted); padding-top: 0.25rem; }
.timeline h3 { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.tl-org { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.timeline li p:not(.tl-org):not(.tl-when) { margin-top: var(--s-2); color: var(--ink-2); max-width: 62ch; }

/* Contact page */
.contact.page { padding-top: clamp(2.5rem, 1rem + 5vw, 5rem); }
.contact-grid--page { border-top: 0; padding-top: 0; }
.contact-helpful { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--line); max-width: 60ch; }
.contact-helpful .mono { color: var(--muted); margin-bottom: var(--s-3); }
.contact-helpful ul { padding-left: 1.1rem; display: grid; gap: var(--s-2); color: var(--ink-2); }

.footer-links { display: inline-flex; gap: var(--s-5); }
.footer-links a { text-decoration-color: var(--line-strong); }
.footer-links a:hover { text-decoration-color: var(--accent); }

/* =========================================================
   Home: intro + three paths
   ========================================================= */
.hero { padding-bottom: var(--s-8); }
.intro { border-top: 1px solid var(--line); padding-block: var(--s-8); }
.intro-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
@media (min-width: 1100px) {
  .intro-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); grid-template-rows: auto auto; column-gap: var(--s-8); row-gap: var(--s-7); }
  .intro-id { grid-row: 1 / span 2; }
}
.intro-name { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); font-weight: 600; letter-spacing: -0.045em; line-height: 1; }
.intro-role { margin-top: var(--s-3); color: var(--muted); }
.intro-lead { font-size: var(--fs-xl); font-weight: 500; letter-spacing: -0.025em; line-height: 1.3; max-width: 28ch; }
.intro-lead + p { margin-top: var(--s-4); color: var(--ink-2); font-size: var(--fs-lg); line-height: 1.55; max-width: 60ch; }
.intro-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4) var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--line); }
@media (min-width: 820px) { .intro-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .intro-facts { grid-column: 2; } }
@media (max-width: 419px) { .intro-facts { grid-template-columns: minmax(0, 1fr); } }
.intro-facts dt { color: var(--muted); font-size: 0.6875rem; margin-bottom: var(--s-1); }
.intro-facts dd { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.45; }

.paths { padding-bottom: var(--s-6); }
.paths-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
@media (min-width: 820px) { .paths-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.path {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: var(--s-2);
  min-height: 15rem;
  padding: var(--s-5) var(--s-5) calc(var(--s-5) + 1.5rem);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-decoration: none;
  transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
@media (hover: hover) {
  .path:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 20px 40px -30px rgba(18, 19, 21, 0.35); }
}
.path-label { color: var(--muted); margin-top: var(--s-4); }
.path-title { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.path-desc { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.55; max-width: 38ch; }
.path-arrow { position: absolute; right: var(--s-5); bottom: var(--s-4); font-size: 1.25rem; transition: transform var(--dur-1) var(--ease); }
.path:hover .path-arrow { transform: translateX(4px); color: var(--accent); }
.path-vis { display: flex; align-items: flex-end; gap: 4px; height: 34px; }
.path-vis--projects i { width: 22px; border-radius: 3px; background: var(--surface-3); }
.path-vis--projects i:nth-child(1) { height: 60%; } .path-vis--projects i:nth-child(2) { height: 100%; background: var(--ink); }
.path-vis--projects i:nth-child(3) { height: 75%; } .path-vis--projects i:nth-child(4) { height: 45%; }
.path-vis--exp { align-items: center; }
.path-vis--exp i { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok) 18%, transparent); }
.path-vis--approach { align-items: center; gap: 6px; }
.path-vis--approach i { font-style: normal; font-family: var(--mono); font-size: 0.64rem; padding: 0.2rem 0.5rem; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink-2); }
.path-vis--approach i:last-child { background: var(--ink); border-color: var(--ink); color: #fff; }

.contact--home { padding-top: var(--s-8); border-top: 1px solid var(--line); }

/* =========================================================
   Project family: voice agents
   ========================================================= */
.family {
  padding: clamp(1.25rem, 0.5rem + 3vw, 3rem);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.family-head { display: grid; gap: var(--s-2); margin-bottom: var(--s-6); }
@media (min-width: 1100px) {
  .family-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: end; column-gap: var(--s-7); }
  .family-kicker { grid-column: 1 / -1; }
}
.family-kicker { color: var(--muted); }
.family-title { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.family-intro { color: var(--ink-2); max-width: 54ch; }
.family-intro strong { color: var(--ink); }
.family-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
@media (min-width: 900px) { .family-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.project--voice { align-content: start; gap: var(--s-5); }
.project--voice .project-open { margin-top: 0; padding-top: 0; }
.project-focus { margin-top: var(--s-3); color: var(--muted); font-size: 0.66rem; text-transform: none; letter-spacing: 0.02em; }
.vis-voice {
  display: grid;
  gap: 0;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.vv-row { display: grid; grid-template-columns: 3.75rem minmax(0, 1fr); gap: var(--s-3); align-items: center; padding: 0.6rem 0; }
.vv-row + .vv-row { border-top: 1px solid var(--line); }
.vv-k { color: var(--muted); font-size: 0.62rem; }
.vv-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.vv-chips i { font-style: normal; font-size: 0.72rem; padding: 0.15rem 0.5rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink-2); }
.vv-v { font-size: var(--fs-sm); color: var(--ink-2); }
.vv-gate .vv-v b { color: var(--ink); font-weight: 600; }
.vv-flag code { font-family: var(--mono); font-size: 0.72rem; color: var(--exc); }

.vis-sched { padding-block: var(--s-3); gap: var(--s-2); }
.vs-line { display: grid; grid-template-columns: 3.75rem minmax(0, 1fr); gap: var(--s-3); align-items: baseline; }
.vs-who { color: var(--muted); font-size: 0.62rem; }
.vs-line q { quotes: none; font-size: var(--fs-sm); }
.vs-line code { font-family: var(--mono); font-size: 0.7rem; color: var(--ink); overflow-wrap: anywhere; }
.vs-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-1); }
.vs-out { display: grid; gap: 2px; padding: 0.5rem 0.65rem; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.vs-out code { font-family: var(--mono); font-size: 0.66rem; overflow-wrap: anywhere; }
.vs-out span { font-size: var(--fs-sm); font-weight: 500; }
.vs-ok code { color: var(--ok); }
.vs-no code { color: var(--exc); }
.vs-no { border-style: dashed; }

/* =========================================================
   Case study: multiple related systems + evidence
   ========================================================= */
.cs-related { gap: var(--s-3); }
.cs-related-item { display: grid; gap: 0; }
.cs-related-item + .cs-related-item { padding-top: var(--s-3); border-top: 1px solid var(--line); }
.cs-evidence { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: var(--s-2); }
@media (min-width: 700px) { .cs-evidence { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-6); } }
@media (min-width: 1000px) { .cs-evidence { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cs-evidence div { padding: var(--s-3) 0; border-top: 1px solid var(--line); }
.cs-evidence dt { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.cs-evidence dd { margin-top: var(--s-1); font-size: var(--fs-sm); color: var(--ink-2); }
.cs-block > p.cs-evidence-note { margin-top: var(--s-3); }

/* =========================================================
   Experience: related case studies
   ========================================================= */
.exp-related { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--dark-line); }
.exp-related > .mono { color: var(--on-dark-2); }
.exp-copy p.exp-related-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); margin-top: var(--s-2); font-size: var(--fs-base); }
.exp-related-links button {
  min-height: 44px; padding: 0; background: none; border: 0;
  color: var(--on-dark); font-weight: 600; font-size: var(--fs-base);
  text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.3); text-underline-offset: 0.3em;
}
.exp-related-links button:hover { text-decoration-color: var(--accent-on-dark); }
.exp-related .exp-confidential { margin-top: var(--s-2); }

/* =========================================================
   Contact page (structured for a future form)
   ========================================================= */
.contact-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-7); align-items: start; }
@media (min-width: 1000px) { .contact-page { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--s-8); } }
.contact-page-copy .contact-title { margin-top: var(--s-4); }
.contact-page-copy .contact-copy { margin-top: var(--s-5); }
.contact-copy--quiet { font-size: var(--fs-base); color: var(--muted); }
.contact-card {
  padding: clamp(1.25rem, 0.8rem + 2vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.contact-card-title { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }

/* Contact form */
.cf-intro { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--muted); }
.contact-form { display: grid; gap: var(--s-4); margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.cf-field { display: grid; gap: var(--s-1); }
.cf-field label { font-size: var(--fs-sm); font-weight: 600; }
.cf-optional { margin-left: var(--s-1); font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.cf-hint { font-size: 0.8125rem; color: var(--muted); line-height: 1.45; }
.cf-field input,
.cf-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1rem; /* 16px keeps iOS from zooming on focus */
  line-height: 1.45;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.cf-field textarea { min-height: 9.5rem; resize: vertical; }
.cf-field input::placeholder, .cf-field textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.cf-field input:hover, .cf-field textarea:hover { border-color: color-mix(in srgb, var(--ink) 35%, transparent); }
.cf-field input:focus, .cf-field textarea:focus { outline: none; border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 3px rgba(18, 19, 21, 0.08); }
.cf-field input:focus-visible, .cf-field textarea:focus-visible { outline: none; }
.cf-field.is-invalid input, .cf-field.is-invalid textarea { border-color: var(--exc); }
.cf-field.is-invalid input:focus, .cf-field.is-invalid textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--exc) 14%, transparent); }
.cf-error { font-size: 0.8125rem; color: var(--exc); font-weight: 500; }
.cf-hp { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); opacity: 0; pointer-events: none; }
.cf-submit { margin-top: var(--s-1); }
.cf-submit:disabled { cursor: progress; background: #2b2d31; border-color: #2b2d31; }
.cf-status {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  border-left-width: 2px;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--ink-2);
}
.cf-status:focus { outline: none; }
.cf-status b { color: var(--ink); font-weight: 600; }
.cf-status a { color: var(--ink); text-decoration-color: var(--line-strong); }
.cf-status--ok { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 6%, var(--surface)); }
.cf-status--error { border-left-color: var(--exc); background: color-mix(in srgb, var(--exc) 5%, var(--surface)); }
.contact-card-btn { width: 100%; }
.contact-card-alt { margin-top: var(--s-4); font-size: var(--fs-sm); color: var(--muted); }
.contact-card-alt a { color: var(--ink); text-decoration-color: var(--line-strong); }
.contact-card-alt a:hover { text-decoration-color: var(--accent); }
.exp-copy .exp-related > p.mono { font-size: var(--fs-xs); line-height: 1.4; }
