/* JakSystems — site styles. Tokens first; every colour below comes from them. */

:root {
  --paper: #f5f3ee;
  --paper-2: #ebe8e0;
  --card: #ffffff;
  --ink: #15140f;
  --ink-2: #3a3832;
  --muted: #69655c;
  --line: #dcd7cb;
  --line-2: #c9c3b5;
  --accent: #2346e8;
  --accent-ink: #ffffff;
  --accent-soft: #e2e7fd;
  --accent-text: #1d3bc9;
  --ok: #1f8a52;
  --warn: #c98a12;
  --band-bg: #15140f;
  --band-ink: #f5f3ee;
  --band-muted: #b7b2a6;
  --grid-line: rgba(21, 20, 15, 0.06);
  --shadow: 0 1px 2px rgba(21, 20, 15, 0.05), 0 12px 32px -16px rgba(21, 20, 15, 0.22);

  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 1180px;
  --gutter: 24px;
  --radius: 16px;
  --radius-sm: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e0e0c;
    --paper-2: #161613;
    --card: #1a1a17;
    --ink: #f1eee6;
    --ink-2: #d2cec4;
    --muted: #9b968b;
    --line: #2c2b26;
    --line-2: #3b3a33;
    --accent: #8ea2ff;
    --accent-ink: #0e0e0c;
    --accent-soft: #1c2244;
    --accent-text: #a9b8ff;
    --ok: #4cc786;
    --warn: #e6b04a;
    --band-bg: #1a2146;
    --band-ink: #f1eee6;
    --band-muted: #b8bdd6;
    --grid-line: rgba(241, 238, 230, 0.05);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -20px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e0e0c;
  --paper-2: #161613;
  --card: #1a1a17;
  --ink: #f1eee6;
  --ink-2: #d2cec4;
  --muted: #9b968b;
  --line: #2c2b26;
  --line-2: #3b3a33;
  --accent: #8ea2ff;
  --accent-ink: #0e0e0c;
  --accent-soft: #1c2244;
  --accent-text: #a9b8ff;
  --ok: #4cc786;
  --warn: #e6b04a;
  --band-bg: #1a2146;
  --band-ink: #f1eee6;
  --band-muted: #b8bdd6;
  --grid-line: rgba(241, 238, 230, 0.05);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -20px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.mono { font-family: var(--mono); font-size: 0.78em; letter-spacing: 0; }
.link { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link:hover { text-decoration-thickness: 2px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 12.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.eyebrow-invert { color: var(--band-muted); }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font: 600 15px/1 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-light { background: var(--band-ink); color: var(--band-bg); }
.btn-light:hover { background: var(--accent); color: var(--accent-ink); }
.btn-outline-light { border-color: color-mix(in srgb, var(--band-ink) 35%, transparent); color: var(--band-ink); }
.btn-outline-light:hover { border-color: var(--band-ink); }
.arrow::after { content: "→"; transition: transform 0.15s ease; display: inline-block; }
a:hover .arrow::after, .arrow:hover::after { transform: translateX(3px); }

/* ---- Header -------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color 0.2s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-row { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.03em; }
.mark { width: 30px; height: 30px; flex: none; }
.mark-bg { fill: var(--ink); }
.mark-j { fill: none; stroke: var(--paper); stroke-width: 3.2; stroke-linecap: round; }
.mark-dot { fill: var(--accent); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a:not(.btn) { padding: 10px 12px; border-radius: 8px; text-decoration: none; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--paper-2); }
.nav-cta { margin-left: 10px; }
.header-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-2); background: var(--paper-2); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}
.menu-toggle { display: none; }
.menu-toggle span { display: block; width: 18px; height: 1.7px; background: currentColor; border-radius: 2px; transition: transform 0.2s ease; grid-area: 1 / 1; }
.menu-toggle span:first-child { transform: translateY(-3.5px); }
.menu-toggle span:last-child { transform: translateY(3.5px); }
.menu-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

@media (max-width: 920px) {
  .header-row { height: 64px; }
  .menu-toggle { display: inline-grid; }
  .header-tools { margin-left: auto; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px; margin: 0;
    padding: 12px var(--gutter) 20px; background: var(--paper); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding: 13px 12px; font-size: 17px; }
  .nav-cta { margin: 10px 0 0; }
}

/* ---- Sections ------------------------------------------------------------ */
.section { padding: 112px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-tight { padding: 72px 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 64px; align-items: end; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); margin-top: 16px; }
.section-head > p { color: var(--muted); font-size: 18px; max-width: 46ch; }
@media (max-width: 860px) {
  .section { padding: 80px 0; }
  .section-head { grid-template-columns: 1fr; margin-bottom: 40px; }
}

/* ---- Hero ---------------------------------------------------------------- */
.hero { position: relative; padding: 72px 0 96px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 30%, transparent 75%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.7rem, 6.4vw, 5.4rem); line-height: 0.98; letter-spacing: -0.045em; margin: 22px 0 26px; }
.hero h1 em { letter-spacing: -0.02em; color: var(--accent-text); }
.lede { font-size: clamp(1.08rem, 1.6vw, 1.28rem); color: var(--ink-2); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-note { margin-top: 18px; font-size: 14px; color: var(--muted); }
@media (max-width: 980px) {
  .hero { padding: 48px 0 72px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
}

/* "Systems we run" board */
.board { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); font: 500 12.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.board ul { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.board li:last-child { border-bottom: 0; }
.board a { text-decoration: none; }
.board a:hover strong { color: var(--accent-text); }
.board strong { display: block; font-size: 15.5px; font-weight: 600; }
.board small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.board .metric { font: 500 12.5px/1.3 var(--mono); color: var(--ink-2); text-align: right; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 20%, transparent); }
.board-foot { padding: 12px 20px; background: var(--paper-2); font-size: 13px; color: var(--muted); }
@media (max-width: 480px) {
  .board li { grid-template-columns: auto minmax(0, 1fr); }
  .board .metric { grid-column: 2; text-align: left; }
}

/* ---- Stats ---------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.stat { padding: 22px 24px 4px 0; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat-value { font-size: clamp(2rem, 3.6vw, 2.9rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.stat-value small { font-size: 0.45em; letter-spacing: -0.01em; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat p { margin-top: 10px; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.stat .src { display: block; margin-top: 6px; font: 500 11.5px/1.3 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); margin-top: 18px; }
}
@media (max-width: 440px) {
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); margin-top: 18px; }
}

/* ---- Work cards ------------------------------------------------------------ */
.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.work-card {
  display: flex; flex-direction: column; text-decoration: none; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.work-card:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.work-visual { position: relative; aspect-ratio: 16 / 9.5; background: var(--paper-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.work-visual img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.work-body { display: flex; flex-direction: column; gap: 12px; padding: 26px 26px 28px; flex: 1; }
.work-body h3 { font-size: clamp(1.35rem, 2.1vw, 1.65rem); }
.work-body p { color: var(--muted); }
.work-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.work-foot { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-weight: 600; font-size: 15px; }
.work-foot .mono { color: var(--muted); font-weight: 500; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid var(--line-2); color: var(--ink-2);
}
.tag-client { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.tag-live::before, .tag-soon::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.tag-soon::before { background: var(--warn); }
@media (max-width: 760px) { .work-grid { grid-template-columns: 1fr; } }

/* Trace visual: a mono "request trace" used where there is no screenshot */
.trace { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 9px; padding: 22px 26px; font: 500 13px/1.35 var(--mono); }
.trace-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 9px; background: var(--card); border: 1px solid var(--line); }
.trace-row b { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trace-row span:last-child { color: var(--muted); font-size: 12px; }
.trace-row .ok { color: var(--ok); }
.trace-row.hl { border-color: var(--accent); background: var(--accent-soft); }
.trace-row.hl b, .trace-row.hl span:last-child { color: var(--accent-text); }
@media (max-width: 420px) { .trace { padding: 14px; gap: 6px; font-size: 11.5px; } .trace-row { padding: 7px 10px; } }

/* ---- Services ---------------------------------------------------------- */
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); }
.service { padding: 30px 28px 8px 0; }
.service + .service { padding-left: 28px; border-left: 1px solid var(--line); }
.service .num { font: 500 13px/1 var(--mono); color: var(--accent-text); }
.service h3 { font-size: 1.45rem; margin: 18px 0 12px; }
.service > p { color: var(--muted); }
.service ul { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 9px; }
.service li { position: relative; padding-left: 20px; font-size: 15.5px; color: var(--ink-2); }
.service li::before { content: ""; position: absolute; left: 0; top: 0.68em; width: 8px; height: 1.5px; background: var(--accent); }
.service .proof { display: inline-block; margin-top: 22px; font-size: 14.5px; font-weight: 600; text-decoration: none; }
.service .proof:hover { color: var(--accent-text); }
@media (max-width: 900px) {
  .services { grid-template-columns: 1fr; }
  .service, .service + .service { padding: 28px 0; border-left: 0; }
  .service + .service { border-top: 1px solid var(--line); }
}

/* ---- Products ------------------------------------------------------------ */
.products { display: grid; gap: 0; border-top: 1px solid var(--line); }
.product { display: grid; grid-template-columns: 56px minmax(0, 1.1fr) minmax(0, 1.6fr) 210px; gap: 24px; align-items: center; padding: 26px 0; border-bottom: 1px solid var(--line); }
.product-icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--paper-2); border: 1px solid var(--line); font: 700 22px/1 var(--sans); letter-spacing: -0.04em; overflow: hidden; }
.product-icon img { width: 100%; height: 100%; }
.product h3 { font-size: 1.3rem; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.product .kind { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.product > p { color: var(--ink-2); }
.product-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 900px) {
  .product { grid-template-columns: 56px minmax(0, 1fr); gap: 16px 18px; }
  .product > p, .product-links { grid-column: 1 / -1; }
  .product-links { justify-content: flex-start; }
}

/* ---- Process --------------------------------------------------------------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; counter-reset: step; }
.steps li { counter-increment: step; padding: 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.steps li::before { content: "0" counter(step); display: block; font: 500 13px/1 var(--mono); color: var(--accent-text); margin-bottom: 30px; }
.steps h3 { font-size: 1.15rem; margin-bottom: 8px; }
.steps p { color: var(--muted); font-size: 15.5px; }
@media (max-width: 980px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } .steps li::before { margin-bottom: 16px; } }

/* ---- About ------------------------------------------------------------------ */
.about { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
.portrait {
  aspect-ratio: 4 / 5; border-radius: var(--radius); background: var(--band-bg); color: var(--band-ink);
  display: flex; flex-direction: column; justify-content: space-between; padding: 28px; position: relative; overflow: hidden;
}
.portrait::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 240px; height: 240px; border-radius: 40px; background: var(--accent); opacity: 0.9; transform: rotate(12deg); }
.portrait .initials { font: 400 clamp(5rem, 11vw, 8.5rem)/0.9 var(--serif); font-style: italic; position: relative; z-index: 1; }
.portrait .caption { font: 500 12.5px/1.5 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--band-muted); position: relative; z-index: 1; }
.about h2 { font-size: clamp(2rem, 4vw, 3rem); margin: 16px 0 24px; }
.about .prose p + p { margin-top: 16px; }
.about .prose { color: var(--ink-2); font-size: 18px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 36px 0 0; padding: 0; }
.facts div { padding: 14px 0; border-top: 1px solid var(--line); }
.facts dt { font: 500 12px/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.facts dd { margin: 6px 0 0; font-size: 15.5px; }
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; gap: 40px; }
  .portrait { aspect-ratio: 16 / 9; max-height: 320px; }
}
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; } }

/* ---- CTA band ------------------------------------------------------------- */
.cta-band { background: var(--band-bg); color: var(--band-ink); padding: 96px 0; }
.cta-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: end; }
.cta-band h2 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); margin: 18px 0 20px; letter-spacing: -0.04em; }
.cta-band h2 em { color: color-mix(in srgb, var(--accent) 70%, var(--band-ink)); }
.cta-band p { color: var(--band-muted); max-width: 44ch; font-size: 17.5px; }
.cta-actions { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
@media (max-width: 860px) { .cta-band { padding: 72px 0; } .cta-inner { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .cta-actions .btn { white-space: normal; text-align: center; } }

/* ---- Footer ---------------------------------------------------------------- */
.site-footer { padding: 64px 0 40px; border-top: 1px solid var(--line); font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.footer-brand p { color: var(--muted); margin-top: 14px; max-width: 34ch; }
.footer-h { font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer ul a { text-decoration: none; color: var(--ink-2); }
.site-footer ul a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.legal { margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.6; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }

/* ---- Case study pages ------------------------------------------------------ */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font: 500 13px/1 var(--mono); color: var(--muted); margin-bottom: 30px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.cs-hero { padding: 56px 0 48px; }
.cs-hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.6rem); line-height: 1; letter-spacing: -0.045em; margin: 20px 0 24px; max-width: 18ch; }
.cs-hero h1 em { color: var(--accent-text); }
.cs-hero .lede { max-width: 40em; }
.cs-hero .work-meta { margin-top: 4px; }
.meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 48px 0 0; border-top: 1px solid var(--ink); }
.meta-grid div { padding: 18px 20px 0 0; }
.meta-grid div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.meta-grid dt { font: 500 12px/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.meta-grid dd { margin: 8px 0 0; font-size: 15.5px; line-height: 1.5; }
@media (max-width: 860px) {
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta-grid div:nth-child(3) { padding-left: 0; border-left: 0; }
  .meta-grid div:nth-child(n + 3) { margin-top: 18px; border-top: 1px solid var(--line); }
}
@media (max-width: 440px) {
  .meta-grid { grid-template-columns: 1fr; }
  .meta-grid div + div { padding-left: 0; border-left: 0; margin-top: 18px; border-top: 1px solid var(--line); }
}

.figure { margin: 0 0 8px; }
.figure-frame { border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.figure-bar { display: flex; align-items: center; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.figure-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.figure-bar span { margin-left: 10px; font: 500 12px/1 var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.figure figcaption { margin-top: 12px; font-size: 14px; color: var(--muted); }

.cs-section { padding: 72px 0; border-top: 1px solid var(--line); }
.cs-grid { display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.6fr); gap: 32px 64px; }
.cs-grid > h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); position: sticky; top: 96px; align-self: start; }
.cs-grid > h2 .eyebrow { display: flex; margin-bottom: 14px; }
@media (max-width: 860px) { .cs-section { padding: 56px 0; } .cs-grid { grid-template-columns: 1fr; } .cs-grid > h2 { position: static; } }

.prose { font-size: 18px; color: var(--ink-2); max-width: 66ch; }
.prose p + p { margin-top: 18px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent-text); text-underline-offset: 3px; }

.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.features > div { padding: 22px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); }
.features h3 { font-size: 1.08rem; margin-bottom: 8px; letter-spacing: -0.015em; }
.features p { color: var(--muted); font-size: 15.5px; }
.features .mono { color: var(--accent-text); display: block; margin-bottom: 12px; }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }

/* Flow diagram: wraps on wide screens, stacks on narrow ones */
.flow-wrap { margin-top: 32px; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper-2); }
.flow-label { font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 14px; }
.flow-label:not(:first-child) { margin-top: 26px; }
.flow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px 0; }
.flow li { display: flex; align-items: center; }
.flow li + li::before { content: "→"; padding: 0 10px; color: var(--muted); font-family: var(--mono); }
.flow-node { padding: 11px 14px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.3; }
.flow-node b { display: block; font-weight: 600; font-size: 14.5px; }
.flow-node small { display: block; color: var(--muted); font-size: 12.5px; font-family: var(--mono); margin-top: 3px; }
.flow-node.hl { border-color: var(--accent); background: var(--accent-soft); }
.flow-node.hl small { color: var(--accent-text); }
.flow-node.human { border-style: dashed; border-color: var(--ink-2); }
@media (max-width: 640px) {
  .flow { flex-direction: column; align-items: stretch; gap: 0; }
  .flow li { flex-direction: column; align-items: stretch; }
  .flow li + li::before { content: "↓"; padding: 6px 0; text-align: center; }
}

.callout { margin-top: 32px; padding: 24px 26px; border-left: 3px solid var(--accent); background: var(--card); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.callout p { color: var(--ink-2); }
.callout .eyebrow { margin-bottom: 12px; display: flex; }

.stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.stack span { padding: 7px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font: 500 13px/1 var(--mono); color: var(--ink-2); }

.next-case { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 40px 0 96px; }
.next-case a.big { text-decoration: none; display: block; }
.next-case .eyebrow { margin-bottom: 14px; }
.next-case h2 { font-size: clamp(1.8rem, 3.8vw, 2.8rem); }
.next-case a.big:hover h2 { color: var(--accent-text); }

/* ---- Work index, contact, misc ---------------------------------------------- */
.page-hero { padding: 64px 0 56px; }
.page-hero h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); letter-spacing: -0.045em; line-height: 1; margin: 20px 0 22px; }
.page-hero h1 em { color: var(--accent-text); }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.contact-card { padding: 32px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.contact-card h2 { font-size: 1.5rem; margin-bottom: 10px; }
.contact-card > p { color: var(--muted); }
.contact-card .btn { margin-top: 22px; }
.contact-list { list-style: none; margin: 20px 0 0; padding: 0; counter-reset: c; display: grid; gap: 14px; }
.contact-list li { counter-increment: c; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; color: var(--ink-2); }
.contact-list li::before { content: counter(c); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); font: 600 13px/1 var(--mono); }
.email-big { display: inline-block; margin-top: 18px; font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 600; letter-spacing: -0.03em; text-decoration: none; border-bottom: 2px solid var(--accent); overflow-wrap: anywhere; }
.email-big:hover { color: var(--accent-text); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

.notfound { padding: 120px 0 140px; }
.notfound h1 { font-size: clamp(3rem, 8vw, 6rem); letter-spacing: -0.05em; margin: 20px 0; }
.notfound p { color: var(--muted); font-size: 18px; max-width: 40ch; }

.legal-page .prose h2 { font-size: 1.4rem; color: var(--ink); margin: 40px 0 12px; }

@media (max-width: 480px) { :root { --gutter: 16px; } body { font-size: 16.5px; } .prose { font-size: 17px; } }

/* Client quote */
.quote { margin: 40px 0 0; padding: 32px 0 0; border-top: 1px solid var(--line); }
.quote blockquote { margin: 0; }
.quote blockquote p { font: 400 clamp(1.5rem, 3vw, 2.2rem)/1.2 var(--serif); font-style: italic; letter-spacing: -0.01em; color: var(--ink); max-width: 30ch; }
.quote figcaption { margin-top: 16px; font-size: 15px; color: var(--muted); }
.quote figcaption::before { content: ""; display: inline-block; width: 24px; height: 1.5px; background: var(--accent); vertical-align: middle; margin-right: 10px; }

/* Board rows link to case studies */
.board li > a { display: block; min-width: 0; }

/* Featured (wide) work card */
.work-card.wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.work-card.wide .work-visual { aspect-ratio: auto; min-height: 340px; border-bottom: 0; border-right: 1px solid var(--line); }
.work-card.wide .work-body { padding: 40px; justify-content: center; }
.work-card.wide h3 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
@media (max-width: 860px) {
  .work-card.wide { display: flex; }
  .work-card.wide .work-visual { aspect-ratio: 16 / 9.5; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .work-card.wide .work-body { padding: 26px 26px 28px; }
}
@media (max-width: 560px) {
  .work-visual:has(.trace), .work-card.wide .work-visual:has(.trace) { aspect-ratio: auto; }
  .trace { position: relative; inset: auto; }
}

/* Charity cards */
.charity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.charity-card { display: flex; flex-direction: column; gap: 12px; padding: 32px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-decoration: none; transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; }
.charity-card:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.charity-card .mono { color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.charity-card h3 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); }
.charity-card > p:not(.mono) { color: var(--muted); }
.charity-card .arrow { margin-top: auto; padding-top: 8px; font-weight: 600; font-size: 15px; }
@media (max-width: 760px) { .charity-grid { grid-template-columns: 1fr; } }

/* Spacing utilities (no inline styles: the CSP blocks them) */
.mt-28 { margin-top: 28px; }
.mt-64 { margin-top: 64px; }
.pt-0 { padding-top: 0; }

/* Cover tiles: a case study's visual where there is no screenshot */
.cover { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: clamp(22px, 3vw, 34px); color: #fff; background: linear-gradient(150deg, var(--c1), var(--c2)); overflow: hidden; }
.cover::after { content: ""; position: absolute; right: -12%; top: -30%; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.28), transparent 65%); }
.cover span { position: relative; font-size: 14px; font-weight: 600; opacity: 0.85; }
.cover strong { position: relative; font-size: clamp(1.6rem, 3.2vw, 2.5rem); font-weight: 700; line-height: 1.06; letter-spacing: -0.035em; max-width: 14ch; }
.cover-mhd { --c1: #0060d0; --c2: #12a5b8; }
.cover-ff { --c1: #1d1d1f; --c2: #34507a; }
.cover-farms { --c1: #1e7f4f; --c2: #12a5b8; }

/* Hero background: scattered data drifts in, passes through a glass lens and leaves as
   calm, ordered streams. Fills the hero and runs up under the floating header. */
.hero { overflow: visible; }
.hero > .wrap { position: relative; z-index: 1; }
.hero-bg {
  --fv-in: 110, 110, 115; --fv-apps: 0, 113, 227; --fv-ai: 0, 150, 210; --fv-auto: 20, 150, 120; --fv-glow: 0;
  position: absolute; left: 0; right: 0; top: -72px; bottom: 0; z-index: 0; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent);
  mask-image: linear-gradient(to bottom, #000 78%, transparent);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-bg { --fv-in: 161, 161, 166; --fv-apps: 41, 151, 255; --fv-ai: 100, 210, 255; --fv-auto: 70, 215, 170; --fv-glow: 1; } }
:root[data-theme="dark"] .hero-bg { --fv-in: 161, 161, 166; --fv-apps: 41, 151, 255; --fv-ai: 100, 210, 255; --fv-auto: 70, 215, 170; --fv-glow: 1; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--paper) 40%, transparent) 0%, color-mix(in srgb, var(--paper) 12%, transparent) 38%, transparent 56%);
}
.fv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fv-lens { position: absolute; left: 72%; top: 54%; width: clamp(110px, 10vw, 160px); height: 76%; transform: translate(-50%, -50%); border-radius: 999px; pointer-events: none; }
.fv-label {
  position: absolute; right: max(24px, calc((100vw - var(--maxw)) / 2 + var(--gutter)));
  font-size: 13px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; pointer-events: none;
}
.fv-apps { color: rgb(var(--fv-apps)); }
.fv-ai { color: rgb(var(--fv-ai)); }
.fv-auto { color: rgb(var(--fv-auto)); }
/* Phones and tablets: the animation stays behind the hero text, softened for legibility */
@media (max-width: 980px) {
  .hero { padding-bottom: 56px; }
  .hero-bg { top: -64px; }
  .hero-bg::after {
    background: linear-gradient(to bottom, color-mix(in srgb, var(--paper) 55%, transparent) 0%, color-mix(in srgb, var(--paper) 35%, transparent) 65%, transparent 100%);
  }
  .fv-lens { left: 66%; top: 60%; width: 64px; height: 62%; }
  .hero h1 em { display: block; }
  .fv-label { right: 16px; font-size: 12px; }
}

.contact-card h3 { font-size: 1.5rem; margin-bottom: 10px; }
