/* VexWorks site styles. Plain CSS, no build step: edit and reload.
   Colours are tokens on :root, redefined for dark mode below. The palette is black, white
   and neutral greys; purple (--accent) is used sparingly for small highlights only. */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f3f3f3;
  --text: #0a0a0a;
  --muted: #5c5c5c;
  --border: #e5e5e5;
  --border-strong: #d0d0d0;
  --primary: #0a0a0a;
  --primary-hover: #2b2b2b;
  --primary-ink: #ffffff;
  --accent: #6a4ee6;
  --accent-strong: #5638d4;
  --accent-soft: rgb(106 78 230 / 0.1);
  --ring: rgb(106 78 230 / 0.3);
  --live: #16a34a;
  --soon: #ca8a04;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.04);
  --card-top: #ffffff;
  --card-bottom: #fcfcfc;
  --highlight: inset 0 1px 0 rgb(255 255 255 / 0.9);
  --header-h: 69px;
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1120px;
  --gutter: 16px;
  --edge: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (min-width: 640px) { :root { --gutter: 24px; --edge: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; --edge: 40px; } }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --surface: #111111;
    --surface-2: #191919;
    --text: #fafafa;
    --muted: #a3a3a3;
    --border: #232323;
    --border-strong: #343434;
    --primary: #fafafa;
    --primary-hover: #dcdcdc;
    --primary-ink: #0a0a0a;
    --accent: #a594ff;
    --accent-strong: #bdb1ff;
    --accent-soft: rgb(165 148 255 / 0.12);
    --ring: rgb(165 148 255 / 0.4);
    --live: #4ade80;
    --soon: #facc15;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
    --card-top: #151515;
    --card-bottom: #0f0f0f;
    --highlight: inset 0 1px 0 rgb(255 255 255 / 0.05);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a {
  color: var(--text);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--accent); }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 {
  margin: 0 0 0.5em;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 1.5rem + 3.2vw, 3.75rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.3vw, 2.25rem); letter-spacing: -0.03em; }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; }
address { font-style: normal; }
main { scroll-margin-top: calc(var(--header-h) + 16px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

.container {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Let the landing page use wide displays, while keeping individual text blocks short. */
.home { --max: 2400px; }
@media (min-width: 1024px) { .home { --gutter: clamp(32px, 4vw, 112px); } }

.muted { color: var(--muted); }

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.skip:focus { left: 8px; }

/* ---------- Brand lockup: the logo tile with the WORKS wordmark beneath it ----------
   The tile (assets/brand/logo.svg) is black in both themes. The wordmark is
   assets/brand/wordmark.svg used as a mask, so it takes the text colour. Here it's 1.35x
   the tile's width so it stays legible at header size. The master lockup files in
   assets/brand/ use 1.25x. */

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: var(--text);
  line-height: 1;
  text-decoration: none;
}
.brand:hover { color: var(--text); }

.brand-mark { display: block; width: 34px; height: auto; }

.brand-word {
  display: block;
  width: 46px;
  aspect-ratio: 61.519 / 10;
  background: currentColor;
  -webkit-mask: url("/assets/brand/wordmark.svg") center / contain no-repeat;
  mask: url("/assets/brand/wordmark.svg") center / contain no-repeat;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
}

/* Equal outer columns keep the whole navigation group at the window's centre. */
.header-inner {
  display: grid;
  grid-template-columns: minmax(46px, 1fr) auto minmax(46px, 1fr);
  align-items: center;
  gap: 8px 16px;
  max-width: none;
  min-height: 68px;
  padding: 0 var(--edge);
}

.nav { grid-column: 2; display: flex; align-items: center; justify-content: center; gap: 2px; }

.nav a {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.925rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.nav a:hover,
.nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); }

.nav .nav-cta {
  margin-left: 10px;
  padding: 0 16px;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 600;
}
.nav .nav-cta:hover,
.nav .nav-cta[aria-current="page"] { background: var(--primary-hover); color: var(--primary-ink); }

@media (max-width: 560px) {
  :root { --header-h: 125px; }
  .header-inner { grid-template-columns: 1fr; justify-items: center; min-height: 124px; padding-top: 12px; padding-bottom: 10px; }
  .nav { grid-column: 1; width: 100%; }
  .nav a { padding: 0 10px; }
  .nav .nav-cta { margin-left: 4px; padding: 0 12px; }
}

/* ---------- Buttons, pills, badges ---------- */

/* Every button is the same box: fixed height, 1px border (transparent on solid buttons)
   and the same radius, so solid and outlined buttons line up side by side. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-hover); color: var(--primary-ink); }
.btn-ghost { border-color: var(--border-strong); background: transparent; color: var(--text); }
.btn-ghost:hover { border-color: var(--text); background: transparent; color: var(--text); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn:disabled { opacity: 0.6; cursor: wait; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  margin-bottom: 28px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.pill:hover { border-color: var(--border-strong); color: var(--text); }
.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-live { color: var(--text); }
.badge-live::before { background: var(--live); }
.badge-soon::before { background: var(--soon); }
h2 .badge { margin-left: 8px; vertical-align: middle; letter-spacing: normal; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--accent);
}

.lede {
  max-width: 60ch;
  margin-bottom: 1.75em;
  color: var(--muted);
  font-size: clamp(1.075rem, 1rem + 0.4vw, 1.25rem);
}

/* ---------- Hero & page heads ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(48px, 5vw, 88px) 0 0;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 0%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 65% at 50% 0%, #000 25%, transparent 75%);
  opacity: 0.6;
}
.hero::after {
  content: "";
  position: absolute;
  top: -440px;
  left: 50%;
  z-index: -1;
  width: 760px;
  height: 760px;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--accent-soft), transparent 65%);
}
.hero-grid { display: grid; align-items: center; gap: 36px; }
.hero-copy { min-width: 0; }
.hero h1 { max-width: 20ch; font-size: clamp(2.25rem, 1.2rem + 3.3vw, 5.5rem); }
.hero .lede { max-width: 52ch; }
.hero-note { margin: 20px 0 0; color: var(--muted); font-size: 0.9rem; }
.hero-services {
  width: 100%;
  padding: clamp(20px, 2vw, 36px);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.hero-services > .eyebrow, .hero-examples > .eyebrow { font-size: 0.7rem; }
.hero-services > h2 { margin-bottom: 24px; font-size: clamp(1.5rem, 1.15rem + 1vw, 2.1rem); }
.hero-service-grid { display: grid; gap: 12px; }
.hero-service {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-content: start;
  gap: 8px 14px;
  padding: 18px 30px 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, var(--card-top), var(--card-bottom));
  text-decoration: none;
  transition: border-color 0.2s;
}
.hero-service:hover { border-color: var(--accent); }
.hero-service .icon { grid-row: span 2; width: 36px; height: 36px; margin-bottom: 0; border-radius: 9px; }
.hero-service .icon svg { width: 20px; height: 20px; }
.hero-service h3 { margin: 0; font-size: 1rem; line-height: 1.35; }
.hero-service p { max-width: 36ch; margin: 0; color: var(--muted); font-size: 0.875rem; line-height: 1.6; }
.service-arrow { position: absolute; top: 14px; right: 12px; color: var(--accent); font-size: 0.85rem; }
.hero-examples { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.hero-examples > .eyebrow { margin-bottom: 8px; }
.hero-example-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hero-example-links a { display: flex; flex-direction: column; justify-content: center; min-height: 52px; text-decoration: none; }
.hero-example-links strong { display: flex; align-items: center; gap: 8px; font-size: 0.925rem; }
.hero-example-links strong span { color: var(--accent); }
.hero-example-links a > span { color: var(--muted); font-size: 0.75rem; }
.hero-example-links a:hover strong { color: var(--accent); }
@media (min-width: 560px) {
  .hero-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-service { grid-template-columns: minmax(0, 1fr); padding: 20px; gap: 12px; }
  .hero-service .icon { grid-row: auto; }
  .hero-service h3 { font-size: 1.075rem; }
}
.hero-principles { display: grid; gap: 12px; margin: 36px 0 0; padding: 24px 0; border-top: 1px solid var(--border); list-style: none; }
.hero-principles li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.9rem; }
.hero-principles li::before { content: ""; width: 5px; height: 5px; background: var(--accent); }
@media (min-width: 640px) {
  .hero-principles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .hero-grid { grid-template-columns: 1.05fr 1fr; gap: clamp(40px, 5vw, 120px); }
  .hero-principles { margin-top: 48px; }
}

.page-head {
  padding: clamp(48px, 8vw, 88px) 0 clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--border);
}
.page-head .lede { margin-bottom: 0; }

.service-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.service-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.925rem;
  text-decoration: none;
}
.service-nav a:hover { border-color: var(--accent); }

/* ---------- Sections, grids, cards ---------- */

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section + .section,
.service-list + .section { border-top: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--muted); }
.section-head > :last-child { margin-bottom: 0; }
.section[id], .faq-list details { scroll-margin-top: calc(var(--header-h) + 16px); }
.section-tint { background: var(--surface); }
.section-head-wide { max-width: none; }
.section-head-wide h2 { max-width: 26ch; margin-bottom: 0; }
.section-head-wide > p { max-width: 54ch; margin: 16px 0 0; }
@media (min-width: 1000px) {
  .section-head-wide { display: grid; grid-template-columns: 1.1fr 1fr; align-items: end; gap: clamp(40px, 5vw, 120px); }
  .section-head-wide > p { margin: 0; }
}
.starting-grid h3 { max-width: 24ch; font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.75rem); }
.starting-grid .eyebrow { font-size: 0.7rem; }
.home .card p, .home .steps p { max-width: 58ch; }
.work-page, .case-page, .services-page { --max: 1440px; }
.work-page .page-head .lede { max-width: 62ch; }
.work-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border-strong); }
.work-story[id], .work-research article[id], .work-story .text-link[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
.work-story { display: grid; gap: 24px; padding: clamp(28px, 4vw, 56px) 0; border-bottom: 1px solid var(--border-strong); }
.work-identity .eyebrow { margin-bottom: 12px; font-size: 0.7rem; }
.work-identity h3 { margin-bottom: 14px; font-size: clamp(1.6rem, 1.2rem + 1vw, 2.25rem); }
.work-role { max-width: 34ch; margin: 14px 0 0; color: var(--muted); font-size: 0.875rem; }
.work-story-copy h4 { max-width: 28ch; margin: 0 0 12px; font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.8rem); line-height: 1.25; letter-spacing: -0.02em; }
.work-story-copy > p { max-width: 65ch; color: var(--muted); }
.work-scope { display: grid; gap: 18px; margin: 24px 0; }
.work-scope div { min-width: 0; }
.work-scope dt { margin-bottom: 6px; color: var(--muted); font: 0.7rem/1.5 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.work-scope dd { max-width: 55ch; margin: 0; font-size: 0.925rem; }
.work-story .text-link { gap: 8px; }
.work-actions { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.work-updated { margin: 24px 0 0; color: var(--muted); font-size: 0.8rem; }
.work-research { display: grid; gap: 32px; padding-top: 28px; border-top: 1px solid var(--border-strong); }
.work-research p { max-width: 60ch; color: var(--muted); }
.work-research h3 { margin: 14px 0 10px; font-size: 1.35rem; }
.home .starting-grid .card { padding: 24px 0; border: 0; border-top: 1px solid var(--border-strong); border-radius: 0; background: transparent; box-shadow: none; }
.home .starting-grid .card::before { display: none; }
.home .starting-grid .card:hover { transform: none; }
.home .starting-grid { gap: 32px; }
.home .section-tint { background: var(--bg); }
.home .hero-service { background: var(--surface); }
.research-link { margin: 24px 0 0; color: var(--muted); font-size: 0.875rem; }
.research-link a { display: inline-block; padding: 10px 0; }
.case-breadcrumb { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 24px; color: var(--muted); font-size: 0.9rem; text-decoration: none; }
.case-heading { display: grid; gap: 32px; padding: clamp(32px, 5vw, 64px) 0 48px; }
.case-heading h1 { max-width: 20ch; }
.case-heading .lede { max-width: 54ch; margin-bottom: 0; }
.case-facts { display: grid; gap: 20px; align-content: end; margin: 0; }
.case-facts div { padding-top: 16px; border-top: 1px solid var(--border); }
.case-facts dt { margin-bottom: 7px; color: var(--muted); font: 0.7rem/1.6 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.case-facts dd { max-width: 43ch; margin: 0; font-size: 0.95rem; }
.case-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.case-nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.9rem; text-decoration: none; }
.case-layout { display: grid; gap: 28px; }
.case-layout > header h2 { max-width: 20ch; }
.case-body { min-width: 0; }
.case-body > p, .case-body > .note, .implementation-step p { max-width: 68ch; }
.case-body > p, .implementation-step p { color: var(--muted); }
.delivery-list { padding: 0; margin: 28px 0 0; list-style: none; border-top: 1px solid var(--border); }
.delivery-list li { display: grid; gap: 6px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.delivery-list strong { font-size: 0.95rem; }
.delivery-list span { max-width: 66ch; color: var(--muted); font-size: 0.925rem; }
.implementation-step { padding: 0 0 28px; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.implementation-step:last-child { margin-bottom: 0; }
.implementation-step h3 { margin-bottom: 10px; font-size: 1.3rem; }
.implementation-step p { margin-bottom: 0; }
.system-outline { margin: 32px 0 0; padding: clamp(20px, 3vw, 36px); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.system-outline > .eyebrow { font-size: 0.7rem; }
.system-flow { display: grid; gap: 0; margin: 12px 0 0; padding: 0; list-style: none; counter-reset: flow; }
.system-flow li { position: relative; counter-increment: flow; padding: 20px 0 20px 42px; border-top: 1px solid var(--border); }
.system-flow li::before { content: "0" counter(flow); position: absolute; top: 23px; left: 0; color: var(--accent); font: 0.75rem/1.5 var(--mono); }
.system-flow strong, .system-flow span { display: block; }
.system-flow span { margin-top: 6px; color: var(--muted); font-size: 0.875rem; }
.system-outline figcaption { margin-top: 16px; color: var(--muted); font-size: 0.8rem; }
.case-status { padding: 24px; border-left: 3px solid var(--accent); background: var(--surface-2); }
.case-status h3 { margin-bottom: 12px; }
.case-status p { max-width: 66ch; color: var(--muted); }
.case-status > :last-child { margin-bottom: 0; }
.case-page .shot { margin-top: 24px; }
.case-page .more-details { margin-top: 28px; }
.demo-player { max-width: 1120px; margin: 0 auto; }
.demo-player video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 1px solid var(--border-strong); border-radius: var(--radius); background: #0a0a0a; }
.demo-player video::cue { font-size: clamp(14px, 1.3vw, 22px); }
.demo-player figcaption { max-width: 84ch; margin-top: 16px; color: var(--muted); font-size: 0.9rem; }
.demo-player figcaption strong { color: var(--text); }
.media-source { max-width: 84ch; margin: 12px 0 0; color: var(--muted); font-size: 0.8rem; }
.case-media > .container > .media-source, .case-media > .container > .demo-transcript { max-width: 1120px; margin-left: auto; margin-right: auto; }
.demo-transcript { max-width: 84ch; }
.demo-transcript ol { padding-left: 24px; }
.demo-transcript li { margin: 12px 0; color: var(--muted); }
.evidence-shots { display: grid; gap: 24px; margin-top: 32px; }
.media-still { min-width: 0; margin: 0; }
.media-still > a { display: block; }
.media-still img { display: block; width: 100%; height: auto; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #0a0a0a; }
.media-still figcaption { padding-top: 16px; }
.media-still h3 { margin: 0 0 8px; font-size: 1.05rem; }
.media-still p { max-width: 66ch; margin: 0; color: var(--muted); font-size: 0.9rem; }
.media-still .text-link { margin-top: 4px; font-size: 0.875rem; }
@media (min-width: 760px) { .evidence-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.related-work { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 32px; }
@media (min-width: 640px) {
  .work-scope { grid-template-columns: 1fr 1fr; gap: 24px; }
  .case-facts { grid-template-columns: 1fr 1fr; }
  .work-research { grid-template-columns: 1fr 1fr; gap: 48px; }
}
@media (min-width: 900px) {
  .work-story { grid-template-columns: 0.7fr 1.5fr; gap: clamp(40px, 5vw, 112px); }
  .case-heading { grid-template-columns: 1.45fr 0.8fr; align-items: end; gap: 80px; }
  .case-facts { grid-template-columns: 1fr; }
  .case-layout { grid-template-columns: 0.7fr 1.5fr; gap: clamp(40px, 5vw, 96px); }
}
.delivery-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.delivery-note p { max-width: 70ch; margin: 0; color: var(--muted); }
.delivery-note strong { color: var(--text); }
.delivery-note a, .text-link { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 600; text-decoration: none; }
.faq-layout { display: grid; gap: 24px; }
.faq-layout .section-head { margin-bottom: 0; }
.faq-list { min-width: 0; border-top: 1px solid var(--border-strong); }
.faq-list details { border-bottom: 1px solid var(--border-strong); }
.faq-list summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; padding: 18px 0; font-weight: 600; list-style: none; cursor: pointer; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; flex: none; color: var(--accent); font-family: var(--mono); font-size: 1.3rem; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list summary:hover { color: var(--accent); }
.faq-list p { max-width: 68ch; margin: 0; padding: 0 28px 22px 0; color: var(--muted); }
@media (min-width: 900px) { .faq-layout { grid-template-columns: 1fr 1.3fr; gap: clamp(40px, 6vw, 144px); } }

.grid { display: grid; gap: 16px; }
.project-grid { align-items: start; }
@media (min-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Cards are lit from the top (a faint gradient and a 1px highlight on the upper edge) and
   pick up a soft purple glow that follows the pointer (--mx/--my, set by main.js). */
.card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  box-shadow: var(--highlight), var(--shadow);
  transition: border-color 0.2s, transform 0.2s;
}
.card p { color: var(--muted); }
.card > :last-child { margin-bottom: 0; }
.card h3 { margin-bottom: 8px; }

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.card:hover::before,
.practice-link:hover .practice-tab::before { opacity: 1; }
.card:hover { border-color: var(--border-strong); }

a.card {
  color: inherit;
  text-decoration: none;
}
a.card:hover { transform: translateY(-2px); }

.card .more,
.card .card-link {
  margin-top: auto;
  padding-top: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.15s;
}
a.card:hover .more { color: var(--accent); }
.card .card-link { text-decoration: none; }
.card .card-link:hover { color: var(--accent); }

/* Product cards open with a header band: the hero's grid pattern, the icon at the lower
   left and the status badge at the upper right. */
.card-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 112px;
  margin: -24px -24px 20px;
  padding: 18px 20px 20px 24px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: var(--surface-2);
}
.card-top::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-strong) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 80% 120% at 100% 0%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 120% at 100% 0%, #000, transparent 75%);
  opacity: 0.55;
}
.card-top > * { position: relative; }
.card-top .icon { align-self: flex-end; margin-bottom: 0; background: var(--surface); }

.icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  transition: color 0.15s;
}
.icon svg { width: 22px; height: 22px; }
a.card:hover .icon { color: var(--accent); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 16px;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

/* A card that spans two grid columns (the lead practice on the home page). */
@media (min-width: 640px) { .span-2 { grid-column: span 2; } }

.card[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

/* Expandable "More details" inside a card: native <details>, no script. */
.more-details { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.more-details summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  transition: color 0.15s;
}
.more-details summary:hover { color: var(--accent); }
.more-details summary::-webkit-details-marker { display: none; }
.more-details summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.more-details[open] summary::before { transform: rotate(45deg); }
.more-details ul { margin: 14px 0 0; padding-left: 1.2em; color: var(--muted); }
.more-details li { margin-bottom: 8px; }
.more-details li strong { color: var(--text); font-weight: 600; }
.more-details p { margin: 12px 0 0; }

.note { color: var(--muted); font-size: 0.92rem; }

/* Product screenshots (Crux project story). The images are dark UI in both themes. Files live in
   assets/work/; blur private details such as conversation or client names before adding. */
.shot { margin: 0; }
.shot img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #07070d;
  box-shadow: var(--shadow);
}
.shot figcaption { margin-top: 10px; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
/* The dialog capture keeps its own border and rounded corners. */
.shot-dialog img { border: 0; border-radius: 16px; background: none; }
.shot-phone img { border-radius: 13.6% / 6.3%; }

.shots-row { display: grid; gap: 32px 24px; margin-top: 32px; }
@media (min-width: 900px) {
  .shots-row { grid-template-columns: 1fr 1fr; align-items: start; }
}
.phones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
/* On phones the three screens scroll sideways, each large enough to read. */
@media (max-width: 559px) {
  .phones {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 62%;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--gutter);
  }
  .phones .shot { scroll-snap-align: start; }
}

/* Numbered "how we work" steps */
.steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li {
  position: relative;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  box-shadow: var(--highlight);
  counter-increment: step;
}
.steps li::before {
  content: "0" counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
}
/* On wide screens a line runs from each step's number to the next step. */
@media (min-width: 800px) {
  .steps li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 42px;
    left: 72px;
    right: -17px;
    height: 1px;
    background: linear-gradient(90deg, var(--border-strong), var(--accent));
    opacity: 0.6;
    transform-origin: 0 50%;
  }
}
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); }

/* Services page: one block per practice */
.service {
  display: grid;
  gap: 24px;
  padding: clamp(40px, 6vw, 64px) 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.service:first-of-type { border-top: 0; }
@media (min-width: 880px) {
  .service { grid-template-columns: 1fr 1.15fr; gap: 56px; }
}
.service .icon { margin-bottom: 20px; }
.service p { color: var(--muted); }

.checks { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.checks li {
  position: relative;
  padding: 14px 16px 14px 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.checks li::before {
  content: "";
  position: absolute;
  top: 19px;
  left: 20px;
  width: 6px;
  height: 11px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Key/value facts (About page) */
.facts {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.facts div { display: grid; gap: 2px; padding: 14px 20px; border-top: 1px solid var(--border); }
.facts div:first-child { border-top: 0; }
@media (min-width: 640px) {
  .facts div { grid-template-columns: 220px 1fr; gap: 16px; }
}
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.split { display: grid; gap: 32px; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1.3fr; gap: 56px; align-items: start; }
}

/* Call-to-action band: black in both themes, with a faint purple glow. */
.cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  gap: 24px;
  align-items: center;
  padding: clamp(32px, 6vw, 56px);
  border: 1px solid #262626;
  border-radius: calc(var(--radius) + 8px);
  background: #0a0a0a;
  color: #fafafa;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 60% 120% at 100% 0%, rgb(165 148 255 / 0.18), transparent 70%);
}
@media (min-width: 800px) { .cta { grid-template-columns: 1fr auto; } }
.cta h2 { margin-bottom: 8px; color: #fff; }
.cta p { max-width: 52ch; margin: 0; color: #a3a3a3; }
.cta .btn-primary { background: #fafafa; color: #0a0a0a; }
.cta .btn-primary:hover { background: #dcdcdc; color: #0a0a0a; }

/* ---------- Contact ---------- */

.contact-grid { display: grid; gap: 32px; }
@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
}

.form {
  position: relative;
  display: grid;
  gap: 18px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.form h2 { font-size: 1.3rem; }
.form-row { display: grid; gap: 18px; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: 6px; }
.field label { font-size: 0.95rem; font-weight: 600; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.form-note { margin: 0; color: var(--muted); font-size: 0.9rem; }
.preview-label { display: block; margin-bottom: 6px; font-weight: 600; }
.draft-preview {
  width: 100%;
  min-height: 180px;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

/* Honeypot field: invisible to people, tempting to bots. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.stack { display: grid; gap: 16px; }
.stack .card h3 { margin-bottom: 4px; }
.stack .card p { margin-bottom: 0; overflow-wrap: anywhere; }

/* ---------- Legal pages ---------- */

.prose { max-width: 72ch; }
.prose h2 { margin-top: 2em; font-size: 1.3rem; letter-spacing: -0.015em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.25em; }
.prose li { margin-bottom: 0.4em; }
.updated { margin: 0; color: var(--muted); }

/* ---------- 404 ---------- */

.notfound {
  display: grid;
  place-content: center;
  min-height: 60vh;
  padding: 64px 0;
  text-align: center;
}
.notfound .code { color: var(--accent); font-family: var(--mono); font-weight: 600; }
.notfound .lede { margin-inline: auto; }
.notfound .btn-row { justify-content: center; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border); background: var(--surface); }

.footer-grid { display: grid; gap: 32px; padding-top: 48px; padding-bottom: 32px; }
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.4fr; }
}
.footer-grid p { max-width: 36ch; margin: 16px 0 0; color: var(--muted); }
.site-footer .brand-mark { width: 40px; }
.site-footer .brand-word { width: 54px; }

.site-footer h2 {
  margin-bottom: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-footer nav a,
.footer-contact a {
  display: block;
  min-height: 44px;
  padding: 9px 0;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.site-footer nav a:hover,
.footer-contact a:hover { color: var(--accent); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 20px;
  padding-bottom: 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-bottom p { margin: 0; }

/* ---------- Motion ----------
   Load animations run from CSS alone. Scroll reveals hide elements only under the "js"
   class from boot.js, and main.js adds "is-in" as each one scrolls into view; the
   selector list matches revealOnScroll() in main.js. Nothing here runs for visitors who
   ask for reduced motion. */

@keyframes rise {
  from { opacity: 0.5; translate: 0 10px; }
  to { opacity: 1; translate: none; }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes mark-in { from { opacity: 0; translate: 0 -10px; } to { opacity: 1; translate: none; } }
@keyframes word-in {
  from { opacity: 0; clip-path: inset(0 50%); }
  to { opacity: 1; clip-path: inset(0); }
}
@keyframes scroll-progress { to { transform: scaleX(1); } }

@media (prefers-reduced-motion: no-preference) {
  /* Page load: the logo settles in, then the page's heading block rises line by line. */
  .site-header .brand-mark { animation: mark-in 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .site-header .brand-word { animation: word-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

  .hero-copy > *,
  .page-head .container > *,
  .notfound > * { animation: rise 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero::before { animation: fade-in 1.4s both; }
  .hero::after { animation: fade-in 2s 0.2s both; }

  /* Scroll reveals. */
  .js :is(.section-head, .grid > *, .container > .card, .steps > li, .service > div,
    .checks > li, .cta, .split > *, .form, .stack > *) { opacity: 0; }
  .js :is(.section-head, .grid > *, .container > .card, .steps > li, .service > div,
    .checks > li, .cta, .split > *, .form, .stack > *).is-in {
    animation: rise 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) var(--reveal-delay, 0s) both;
  }
  .js :is(.section-head, .grid > *, .container > .card, .steps > li, .service > div,
    .checks > li, .cta, .split > *, .form, .stack > *):is(:focus-visible, :focus-within) {
    opacity: 1;
    animation: none;
  }
  .js .steps > li:not(.is-in)::after { transform: scaleX(0); }
  .js .steps > li.is-in::after {
    animation: grow-x 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--reveal-delay, 0s) + 0.45s) both;
  }

  /* A thin purple bar under the header fills as the page scrolls. */
  @supports (animation-timeline: scroll()) {
    .site-header::after {
      content: "";
      position: absolute;
      right: 0;
      bottom: -1px;
      left: 0;
      height: 2px;
      background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 40%, transparent), var(--accent));
      transform: scaleX(0);
      transform-origin: 0 50%;
      animation: scroll-progress linear both;
      animation-timeline: scroll(root);
    }
  }
}

/* Project evidence sits beside the offer it supports. */
.service-example { display: flex; width: fit-content; margin-top: 12px; font-size: 0.875rem; line-height: 1.5; }
