/* =====================================================================
   DesMind design system
   1. Tokens          5. Header & navigation   9. Pages
   2. Base            6. Buttons & links      10. Forms
   3. Typography      7. Cards & components   11. Motion
   4. Layout          8. Sections             12. Utilities
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* colour: dark is the default theme */
  --bg: #0a0d14;
  --surface-1: #0f131b;
  --surface-2: #151a24;
  --surface-3: #1c2230;
  --border: #222938;
  --border-strong: #323b4d;
  --text: #f2f4f7;
  --text-2: #b3bbc8;
  --text-3: #8891a2;
  --accent: #7c9bff;
  --accent-hover: #9fb5ff;
  --accent-soft: rgba(124, 155, 255, 0.12);
  --accent-contrast: #0a0d14;
  --success: #4bd19a;
  --warning: #f3a95f;
  --violet: #b39cff;
  --danger: #ff8a8a;
  --header-bg: rgba(15, 19, 27, 0.86);
  --overlay: rgba(4, 6, 10, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  --grid-line: rgba(255, 255, 255, 0.035);

  /* type */
  --font-sans: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-display: clamp(2.5rem, 1.55rem + 3.8vw, 4.25rem);
  --fs-h1: clamp(2.2rem, 1.5rem + 2.8vw, 3.5rem);
  --fs-h2: clamp(1.8rem, 1.35rem + 1.8vw, 2.7rem);
  --fs-h3: clamp(1.12rem, 1.04rem + 0.35vw, 1.3rem);
  --fs-lead: clamp(1.05rem, 0.98rem + 0.35vw, 1.22rem);
  --fs-body: 1rem;
  --fs-small: 0.9rem;
  --fs-label: 0.74rem;

  /* space, shape, motion */
  --container: 1200px;
  --container-narrow: 760px;
  --gutter: clamp(20px, 4vw, 40px);
  --section: clamp(72px, 9vw, 128px);
  --header-h: 68px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 160ms;
  --t-base: 280ms;
  --t-slow: 600ms;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --surface-1: #f7f8fa;
  --surface-2: #f0f2f5;
  --surface-3: #e7eaef;
  --border: #e4e7ec;
  --border-strong: #cfd5de;
  --text: #0b1220;
  --text-2: #475467;
  --text-3: #5d6879;
  --accent: #2b59f5;
  --accent-hover: #1d44d6;
  --accent-soft: #eef2ff;
  --accent-contrast: #ffffff;
  --success: #067647;
  --warning: #b54708;
  --violet: #6941c6;
  --danger: #b42318;
  --header-bg: rgba(255, 255, 255, 0.86);
  --overlay: rgba(11, 18, 32, 0.4);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 8px 24px -10px rgba(16, 24, 40, 0.14);
  --shadow-lg: 0 24px 60px -24px rgba(16, 24, 40, 0.22);
  --grid-line: rgba(11, 18, 32, 0.045);
  color-scheme: light;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
body.nav-lock { overflow: hidden; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 200;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--text); color: var(--bg); font-weight: 600;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 12px; }

/* ---------- 3. Typography ---------- */
h1, h2, h3, h4 { margin: 0 0 0.5em; font-weight: 600; color: var(--text); text-wrap: balance; }
.display { font-size: var(--fs-display); line-height: 1.04; letter-spacing: -0.038em; }
h1, .h1 { font-size: var(--fs-h1); line-height: 1.08; letter-spacing: -0.032em; }
h2, .h2 { font-size: var(--fs-h2); line-height: 1.12; letter-spacing: -0.026em; }
h3, .h3 { font-size: var(--fs-h3); line-height: 1.3; letter-spacing: -0.012em; }
h4 { font-size: 1rem; letter-spacing: -0.005em; }
.lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--text-2); max-width: 62ch; text-wrap: pretty; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-small); }
.label {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
}
.label::before { content: ""; width: 18px; height: 1px; background: currentColor; opacity: 0.7; }
.meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-3); letter-spacing: 0.01em; }
.prose { max-width: var(--container-narrow); }
.prose h2 { font-size: 1.4rem; margin-top: 2em; }
.prose p, .prose li { color: var(--text-2); }
.prose ul { padding-left: 20px; display: grid; gap: 6px; margin-bottom: 1em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 4. Layout ---------- */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.container--narrow { max-width: calc(var(--container-narrow) + var(--gutter) * 2); }
.section { padding: var(--section) 0; }
.section + .section { padding-top: 0; }
.section--alt { background: var(--surface-1); border-block: 1px solid var(--border); }
.section--alt + .section, .section + .section--alt { padding-top: var(--section); }
.section-head { display: grid; gap: 14px; max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 { margin: 0; }
.section-head .lead { margin: 0; }
.section-head--split { max-width: none; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; }
.section-head--split > div { display: grid; gap: 14px; max-width: 720px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section-head--split { grid-template-columns: 1fr; }
}

/* ---------- 5. Header & navigation ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  transition: box-shadow var(--t-base), border-color var(--t-base);
}
.site-header.scrolled { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.nav { display: flex; align-items: center; height: var(--header-h); gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.1rem; letter-spacing: -0.02em; margin-right: auto; }
.brand img { width: 28px; height: 28px; }
.nav-menu { display: flex; align-items: center; }
.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav-links a {
  position: relative; display: block; padding: 8px 12px; border-radius: var(--r-sm);
  font-size: 0.92rem; font-weight: 500; color: var(--text-2);
  transition: color var(--t-fast), background-color var(--t-fast);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent);
}
.nav-cta { margin-left: 10px; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; cursor: pointer;
  border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-1); color: var(--text);
  transition: background-color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(0.95); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }
.nav-toggle { display: none; }
.nav-toggle .bars { position: relative; width: 18px; height: 12px; }
.nav-toggle .bars span {
  position: absolute; left: 0; width: 100%; height: 1.75px; border-radius: 2px; background: currentColor;
  transition: transform var(--t-base) var(--ease), opacity var(--t-fast), top var(--t-base) var(--ease);
}
.nav-toggle .bars span:nth-child(1) { top: 0; }
.nav-toggle .bars span:nth-child(2) { top: 5px; }
.nav-toggle .bars span:nth-child(3) { top: 10px; }
.nav-open .nav-toggle .bars span:nth-child(1) { top: 5px; transform: rotate(45deg); }
.nav-open .nav-toggle .bars span:nth-child(2) { opacity: 0; transform: scaleX(0.3); }
.nav-open .nav-toggle .bars span:nth-child(3) { top: 5px; transform: rotate(-45deg); }
.nav-backdrop { display: none; }
.drawer-foot { display: none; }
@media (min-width: 941px) and (max-width: 1100px) { .nav-links a { padding: 8px 9px; } }

@media (max-width: 940px) {
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface-1); }
  .nav-toggle { display: inline-grid; }
  .nav-menu {
    position: fixed; top: var(--header-h); right: 0; bottom: 0; z-index: 2;
    width: min(360px, 88vw); height: calc(100dvh - var(--header-h));
    flex-direction: column; align-items: stretch; justify-content: space-between;
    padding: 24px 20px 28px; overflow-y: auto;
    background: var(--surface-1); border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%); visibility: hidden;
    transition: transform 420ms var(--ease), visibility 0s linear 420ms;
  }
  .nav-open .nav-menu { transform: none; visibility: visible; transition: transform 420ms var(--ease), visibility 0s; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-links li {
    opacity: 0; transform: translateX(16px);
    transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
  }
  .nav-open .nav-links li { opacity: 1; transform: none; transition-delay: calc(80ms + var(--i, 0) * 40ms); }
  .nav-links a { padding: 14px 12px; font-size: 1.08rem; color: var(--text); }
  .nav-links a[aria-current="page"] { background: var(--surface-2); }
  .nav-links a[aria-current="page"]::after { left: 0; right: auto; top: 12px; bottom: 12px; width: 2px; height: auto; }
  .nav-cta { margin: 14px 0 0; }
  .nav-cta .btn { width: 100%; }
  .drawer-foot { display: block; padding-top: 24px; border-top: 1px solid var(--border); font-size: var(--fs-small); color: var(--text-3); opacity: 0; transition: opacity var(--t-base) var(--ease); }
  .nav-open .drawer-foot { opacity: 1; transition-delay: 320ms; }
  .drawer-foot a { color: var(--text-2); }
  .drawer-foot a:hover { color: var(--accent); }
  .nav-backdrop {
    display: block; position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; z-index: 1;
    background: var(--overlay); opacity: 0; visibility: hidden;
    transition: opacity 420ms var(--ease), visibility 0s linear 420ms;
  }
  .nav-open .nav-backdrop { opacity: 1; visibility: visible; transition: opacity 420ms var(--ease), visibility 0s; }
  .nav-actions { position: relative; z-index: 3; }
}

/* ---------- 6. Buttons & links ---------- */
.btn {
  --h: 46px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 20px; border-radius: 10px; border: 1px solid transparent;
  font-size: 0.94rem; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; cursor: pointer;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-base);
}
.btn svg { width: 16px; height: 16px; transition: transform var(--t-base) var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn[target="_blank"]:hover svg { transform: translate(2px, -2px); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--primary { background: var(--accent); color: var(--accent-contrast); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--accent-hover); box-shadow: 0 8px 22px -10px var(--accent); }
.btn--secondary { background: var(--surface-1); border-color: var(--border-strong); color: var(--text); }
.btn--secondary:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn--sm { --h: 38px; padding: 0 16px; font-size: 0.88rem; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.75; cursor: progress; }
.btn .spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.94rem; color: var(--text);
  transition: color var(--t-fast);
}
.link-arrow svg { width: 15px; height: 15px; transition: transform var(--t-base) var(--ease); }
.link-arrow:hover { color: var(--accent); }
.link-arrow:hover svg { transform: translateX(3px); }
.link-arrow[target="_blank"]:hover svg { transform: translate(2px, -2px); }

/* ---------- 7. Cards & components ---------- */
.card {
  position: relative; display: flex; flex-direction: column;
  padding: clamp(22px, 2.4vw, 30px); border-radius: var(--r-lg);
  background: var(--surface-1); border: 1px solid var(--border);
  transition: border-color var(--t-base), transform var(--t-base) var(--ease), box-shadow var(--t-base), background-color var(--t-base);
}
:root[data-theme="light"] .card { background: #fff; box-shadow: var(--shadow-sm); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-2); font-size: 0.95rem; }
.card > :last-child { margin-bottom: 0; }
.card--link:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card--link .link-arrow { margin-top: auto; padding-top: 18px; }
.card--link:hover .link-arrow { color: var(--accent); }
.card--link:hover .link-arrow svg { transform: translateX(3px); }
.stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }

.icon {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center; margin-bottom: 20px;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  transition: transform var(--t-base) var(--ease);
}
.icon svg { width: 21px; height: 21px; }
.card--link:hover .icon { transform: scale(1.06); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.tags li {
  font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-2);
  padding: 4px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border);
}
.bullets { list-style: none; display: grid; gap: 10px; }
.bullets li { position: relative; padding-left: 20px; color: var(--text-2); font-size: 0.95rem; line-height: 1.55; }
.bullets li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); opacity: 0.75; }

.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap; border: 1px solid currentColor;
  background: color-mix(in srgb, currentColor 8%, transparent);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--live { color: var(--success); }
.status--live::before { animation: pulse 2.4s var(--ease) infinite; }
.status--dev { color: var(--warning); }
.status--mvp, .status--pub, .status--ongoing { color: var(--violet); }
.status--done, .status--oss { color: var(--text-3); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--border); }
.stat { padding: 28px 24px 28px 0; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--border); }
.stat strong { display: block; font-size: clamp(2rem, 1.6rem + 1.4vw, 2.75rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.stat span { font-size: var(--fs-small); color: var(--text-2); }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 22px 16px 22px 0; }
  .stat + .stat { padding-left: 16px; }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--border); }
  .stat:nth-child(4) { border-top: 1px solid var(--border); }
}

.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.jump a {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  font-size: 0.86rem; font-weight: 500; color: var(--text-2); background: var(--surface-1); border: 1px solid var(--border);
  transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}
.jump a:hover { color: var(--text); border-color: var(--accent); }
.jump a span { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-3); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filter {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  font-size: 0.86rem; font-weight: 500; color: var(--text-2); background: var(--surface-1); border: 1px solid var(--border);
  transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast);
}
.filter span { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-3); }
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.filter.active span { color: inherit; opacity: 0.7; }

/* accordion (FAQ, role details) */
.accordion { border-top: 1px solid var(--border); }
.accordion details { border-bottom: 1px solid var(--border); }
details summary { list-style: none; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }
.accordion summary {
  display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0;
  font-size: 1.05rem; font-weight: 500; letter-spacing: -0.01em; transition: color var(--t-fast);
}
.accordion summary:hover { color: var(--accent); }
.plus { position: relative; width: 28px; height: 28px; flex: none; border-radius: 50%; border: 1px solid var(--border-strong); transition: border-color var(--t-fast); }
.plus::before, .plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.5px; background: currentColor; transform: translate(-50%, -50%); transition: transform var(--t-base) var(--ease); }
.plus::after { transform: translate(-50%, -50%) rotate(90deg); }
details[open] > summary .plus::after { transform: translate(-50%, -50%) rotate(0deg); }
summary:hover .plus { border-color: currentColor; }
.accordion .panel { padding: 0 52px 24px 0; color: var(--text-2); }
.accordion .panel p:last-child { margin: 0; }
.panel { overflow: hidden; }

/* table */
.table-wrap { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface-1); }
:root[data-theme="light"] .table-wrap { background: #fff; box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th { text-align: left; padding: 14px 20px; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.table td { padding: 18px 20px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--t-fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table td:first-child a { font-weight: 600; color: var(--text); }
.table td:first-child a:hover { color: var(--accent); }
.table td:first-child small { display: block; margin-top: 2px; font-size: 0.86rem; color: var(--text-3); }
.table th:last-child, .table td:last-child { text-align: right; }
@media (max-width: 760px) {
  .table thead { display: none; }
  .table tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td { padding: 0; border: 0; }
  .table td:first-child { grid-column: 1 / -1; }
  .table td:nth-child(3) { display: none; }
  .table td:last-child { text-align: left; justify-self: end; }
}

/* ---------- 8. Sections ---------- */
/* hero */
.hero { position: relative; isolation: isolate; padding: calc(var(--header-h) + clamp(56px, 8vw, 104px)) 0 clamp(56px, 7vw, 96px); overflow: hidden; }
.hero::before, .page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
}
.hero::before {
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 75% 35%, #000 10%, transparent 72%);
          mask-image: radial-gradient(ellipse 70% 70% at 75% 35%, #000 10%, transparent 72%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: clamp(40px, 6vw, 88px); align-items: center; }
.hero .label { margin-bottom: 22px; }
.hero h1 { margin-bottom: 22px; }
.hero .lead { margin-bottom: 34px; }
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } }

/* hero: system stack visual */
.stack-visual { position: relative; display: grid; gap: 10px; padding: 20px; border-radius: var(--r-xl); background: var(--surface-1); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
:root[data-theme="light"] .stack-visual { background: #fff; }
.stack-visual__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 2px 4px 8px; }
.layer {
  position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border);
  transition: transform var(--t-base) var(--ease), border-color var(--t-base), background-color var(--t-base);
}
:root[data-theme="light"] .layer { background: var(--surface-1); }
.layer:hover { transform: translateX(4px); border-color: var(--border-strong); }
.layer .icon { width: 38px; height: 38px; margin: 0; border-radius: 9px; }
.layer .icon svg { width: 18px; height: 18px; }
.layer strong { display: block; font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; }
.layer small { display: block; font-size: 0.84rem; color: var(--text-2); line-height: 1.45; }
.layer .meta { font-size: 0.7rem; }
.layer--focus, :root[data-theme="light"] .layer--focus { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
@media (max-width: 480px) { .layer { grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 12px; } .layer .meta { display: none; } .stack-visual { padding: 14px; } }

/* clients strip */
.clients { padding-top: 28px; }
.clients p { margin: 0 0 14px; }
.clients ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 32px; }
.clients li { font-weight: 600; font-size: 1rem; color: var(--text-3); letter-spacing: -0.01em; }

/* process */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: step; list-style: none; }
.step { position: relative; padding: 0 24px 0 0; counter-increment: step; }
.step::before { content: "0" counter(step); display: block; font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.step h3 { margin-bottom: 8px; }
.step p { color: var(--text-2); font-size: 0.94rem; margin: 0; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 0; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; gap: 28px; } .step { padding-right: 0; } }

/* split + statement */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.statement { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); line-height: 1.3; letter-spacing: -0.022em; font-weight: 500; text-wrap: balance; margin: 0; }

.link-list { list-style: none; border-top: 1px solid var(--border); }
.link-list a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px 4px;
  border-bottom: 1px solid var(--border); transition: padding var(--t-base) var(--ease), background-color var(--t-fast);
}
.link-list a:hover { padding-left: 12px; background: var(--surface-1); }
.link-list strong { display: block; font-weight: 600; }
.link-list small { color: var(--text-2); font-size: 0.9rem; }
.link-list svg { width: 16px; height: 16px; color: var(--text-3); transition: transform var(--t-base) var(--ease), color var(--t-fast); }
.link-list a:hover svg { color: var(--accent); transform: translate(2px, -2px); }

/* project cards */
.project { padding: 0; overflow: hidden; }
.project__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.project__media svg { width: 100%; height: 100%; }
.project__media--frame { display: grid; place-items: center; padding: clamp(16px, 3vw, 32px); background: radial-gradient(120% 90% at 0% 0%, var(--accent-soft), transparent 60%), var(--surface-2); }
.browser { width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-strong); background: var(--surface-1); box-shadow: var(--shadow-md); transition: transform var(--t-slow) var(--ease); }
.project:hover .browser { transform: translateY(-4px); }
.browser__bar { display: flex; gap: 5px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.browser__bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.browser img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; object-position: top center; }
.project__body { display: flex; flex-direction: column; flex: 1; padding: clamp(20px, 2.4vw, 28px); }
.project__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; font-size: 0.82rem; }
.project__meta .ctx { color: var(--text-2); font-weight: 500; }
.project__meta .meta { margin-left: auto; }
.project h3 { margin-bottom: 8px; }
.project p { margin-bottom: 14px; }
.project .bullets { margin-bottom: 16px; }
.project .bullets li { font-size: 0.9rem; }
.project .tags { margin-top: auto; }
.project__links { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 18px; }
.project--wide { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.project--wide .project__media { aspect-ratio: auto; min-height: 100%; border-bottom: 0; border-right: 1px solid var(--border); }
.project--wide:nth-child(even) .project__media { order: 2; border-right: 0; border-left: 1px solid var(--border); }
.project--wide .project__body { padding: clamp(24px, 3vw, 40px); justify-content: center; }
.project--wide .tags { margin-top: 0; }
@media (max-width: 900px) {
  .project--wide { grid-template-columns: 1fr; }
  .project--wide .project__media, .project--wide:nth-child(even) .project__media { order: 0; border: 0; border-bottom: 1px solid var(--border); aspect-ratio: 16 / 9; min-height: 0; }
}
.project-stack { display: grid; gap: 16px; margin-bottom: 16px; }
.work-group + .work-group { margin-top: clamp(64px, 8vw, 104px); padding-top: clamp(64px, 8vw, 104px); border-top: 1px solid var(--border); }

/* leadership */
.leader { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: clamp(36px, 6vw, 88px); align-items: start; }
.leader__photo { margin: 0; position: sticky; top: calc(var(--header-h) + 32px); }
.leader__photo img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-lg);
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-md);
}
.leader__photo figcaption { margin-top: 16px; }
.leader__photo figcaption strong { display: block; font-weight: 600; }
.leader__photo figcaption span { font-size: var(--fs-small); color: var(--text-2); }
.leader__body .role { color: var(--text-2); margin: -4px 0 26px; }
.leader__body .intro { font-size: 1.12rem; line-height: 1.6; color: var(--text); }
.leader__body p { color: var(--text-2); }
.leader__body h3 { font-size: 1rem; margin: 28px 0 8px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 24px; margin: 30px 0; border-top: 1px solid var(--border); }
.facts div { padding: 16px 0; border-bottom: 1px solid var(--border); }
.facts dt { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.facts dd { margin: 0; font-size: 0.94rem; line-height: 1.5; }
@media (max-width: 860px) {
  .leader { grid-template-columns: 1fr; gap: 28px; }
  .leader__photo { position: static; width: min(280px, 72%); margin-inline: auto; text-align: center; }
  .leader__body > .label { display: flex; justify-content: center; }
  .leader__body > h2, .leader__body > .role { text-align: center; }
  .leader__body .actions { justify-content: center; }
}

/* credentials */
.cred h3 { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 16px; }
.cred ul { list-style: none; display: grid; gap: 14px; }
.cred li { font-size: 0.95rem; line-height: 1.45; font-weight: 500; }
.cred li span { display: block; font-weight: 400; font-size: 0.86rem; color: var(--text-2); margin-top: 2px; }

/* publications */
.pubs { display: grid; gap: 12px; }
.pub { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 20px 24px; }
.pub h3 { font-size: 1rem; line-height: 1.45; margin-bottom: 4px; }
.pub small { color: var(--text-3); }
@media (max-width: 700px) { .pub { grid-template-columns: 1fr; gap: 8px; } }

/* services */
.service {
  display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(28px, 5vw, 72px);
  padding: clamp(40px, 5vw, 64px) 0; border-top: 1px solid var(--border);
}
.service:last-child { border-bottom: 1px solid var(--border); }
.service__intro .meta { display: block; margin-bottom: 14px; }
.service__intro h2 { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2rem); margin-bottom: 14px; }
.service__intro p { color: var(--text-2); }
.problem { margin: 22px 0 0; padding: 16px 18px; border-left: 2px solid var(--accent); background: var(--surface-1); border-radius: 0 var(--r-md) var(--r-md) 0; font-size: 0.95rem; color: var(--text-2); }
.problem strong { display: block; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.service__detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px; align-content: start; }
.service__detail h3 { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.service__detail .full { grid-column: 1 / -1; }
.outcome { display: flex; gap: 12px; align-items: flex-start; padding-top: 20px; border-top: 1px dashed var(--border-strong); color: var(--text); font-size: 0.95rem; margin: 0; }
.outcome svg { width: 18px; height: 18px; flex: none; margin-top: 3px; color: var(--accent); }
@media (max-width: 900px) { .service { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .service__detail { grid-template-columns: 1fr; } }

.plan__kicker { display: block; margin-bottom: 12px; }
.plan .bullets { margin: 18px 0 26px; }
.plan .btn { margin-top: auto; }
.plan--featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-md); }
:root[data-theme="light"] .plan--featured { box-shadow: 0 0 0 1px var(--accent), var(--shadow-md); }
.plan__badge { position: absolute; top: 20px; right: 20px; font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-contrast); }

/* jobs */
.jobs { display: grid; gap: 12px; }
.job { padding: 24px 26px; }
.job__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; }
.job h3 { margin-bottom: 6px; }
.job__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; font-size: 0.88rem; color: var(--text-2); }
.job__meta li:first-child { color: var(--accent); font-weight: 600; }
.job > p { margin: 14px 0 0; max-width: 72ch; }
.job details { margin-top: 16px; border-top: 1px solid var(--border); }
.job summary { display: inline-flex; align-items: center; gap: 10px; padding-top: 14px; font-weight: 600; font-size: 0.92rem; transition: color var(--t-fast); }
.job summary:hover { color: var(--accent); }
.job summary .plus { width: 22px; height: 22px; }
.job summary .plus::before, .job summary .plus::after { width: 9px; }
.job__detail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-top: 20px; }
.job__detail h4 { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
@media (max-width: 860px) { .job__detail { grid-template-columns: 1fr; } }
.empty-state { padding: 24px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); color: var(--text-2); }

/* CTA band */
.cta {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center;
  padding: clamp(32px, 5vw, 64px); border-radius: var(--r-xl);
  background: var(--surface-1); border: 1px solid var(--border);
}
.cta::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 120% at 100% 0%, var(--accent-soft), transparent 60%); }
.cta > * { position: relative; }
.cta h2 { margin-bottom: 10px; }
.cta p { margin: 0; color: var(--text-2); max-width: 56ch; }
@media (max-width: 800px) { .cta { grid-template-columns: 1fr; } }

/* page hero (inner pages) */
.page-hero { position: relative; isolation: isolate; padding: calc(var(--header-h) + clamp(56px, 7vw, 96px)) 0 clamp(48px, 6vw, 80px); }
.page-hero::before {
  -webkit-mask-image: linear-gradient(180deg, #000 10%, transparent 95%);
          mask-image: linear-gradient(180deg, #000 10%, transparent 95%);
}
.page-hero .label { margin-bottom: 20px; }
.page-hero h1 { max-width: 22ch; margin-bottom: 20px; }

/* footer */
.site-footer { margin-top: 0; padding: 64px 0 32px; border-top: 1px solid var(--border); background: var(--surface-1); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 40px; padding-bottom: 48px; }
.footer-brand p { margin: 16px 0 20px; max-width: 34ch; color: var(--text-2); font-size: var(--fs-small); }
.footer-col h2 { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 16px; }
.footer-col ul { list-style: none; display: grid; gap: 10px; }
.footer-col a { font-size: var(--fs-small); color: var(--text-2); transition: color var(--t-fast); }
.footer-col a:hover { color: var(--text); }
.socials { display: flex; gap: 8px; }
.socials a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--border); color: var(--text-2); transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast); }
.socials a:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.socials svg { width: 17px; height: 17px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--text-3); }
.footer-bottom a:hover { color: var(--text); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 440px) { .footer-grid { grid-template-columns: 1fr; } }

/* 404 */
.notfound { min-height: 72vh; display: grid; place-items: center; text-align: center; padding: calc(var(--header-h) + 48px) 0 48px; }
.notfound .code { font-family: var(--font-mono); font-size: 0.9rem; color: var(--accent); margin-bottom: 12px; }
.notfound .actions { justify-content: center; margin-top: 28px; }

/* ---------- 10. Forms ---------- */
.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 8px; min-width: 0; border: 0; margin: 0; padding: 0; }
.field label, .field legend { font-size: 0.88rem; font-weight: 500; color: var(--text); padding: 0; margin-bottom: 0; }
.field legend { margin-bottom: 8px; }
.field .hint { font-size: 0.8rem; color: var(--text-3); font-weight: 400; }
.field input:not([type="checkbox"]):not([type="file"]), .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border-strong); color: var(--text); font-size: 1rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.field select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238891a2' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--text-3); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field input[type="file"] { width: 100%; padding: 10px; border-radius: 10px; border: 1px dashed var(--border-strong); background: var(--surface-1); font-size: 0.9rem; cursor: pointer; }
.field input[type="file"]::file-selector-button { margin-right: 12px; padding: 7px 12px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--danger); }
.field .error { font-size: 0.82rem; color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label {
  cursor: pointer; padding: 8px 14px; border-radius: 999px; font-size: 0.88rem; font-weight: 500; color: var(--text-2);
  background: var(--surface-1); border: 1px solid var(--border-strong); transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast);
}
.chips label:hover { border-color: var(--text-3); color: var(--text); }
.chips input:checked + label { background: var(--text); border-color: var(--text); color: var(--bg); }
.chips input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-status { display: none; padding: 14px 16px; border-radius: 10px; font-size: 0.93rem; margin: 0; }
.form-status.ok, .form-status.err { display: block; animation: rise var(--t-base) var(--ease); }
.form-status.ok { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 35%, transparent); }
.form-status.err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.form-status a { text-decoration: underline; }
.form-note { font-size: 0.84rem; color: var(--text-3); margin: 0; }
.form-note a { text-decoration: underline; text-underline-offset: 3px; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.info-list { list-style: none; display: grid; gap: 18px; }
.info-list li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; }
.info-list .icon { width: 40px; height: 40px; margin: 0; }
.info-list .icon svg { width: 18px; height: 18px; }
.info-list strong { display: block; font-weight: 600; font-size: 0.95rem; }
.info-list span, .info-list a { font-size: 0.93rem; color: var(--text-2); overflow-wrap: anywhere; }
.info-list a:hover { color: var(--accent); }
.numbered { list-style: none; counter-reset: n; display: grid; gap: 14px; }
.numbered li { counter-increment: n; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; color: var(--text-2); font-size: 0.94rem; }
.numbered li::before { content: counter(n); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border-strong); font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); }
.stack-sm > * + * { margin-top: 16px; }

/* ---------- 11. Motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 50%, transparent); } 60% { box-shadow: 0 0 0 5px transparent; } }
.js [data-reveal] {
  opacity: 0; transform: translateY(16px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  transition-delay: calc(var(--stagger, 0) * 70ms);
}
.js [data-reveal].in { opacity: 1; transform: none; }
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color 300ms ease, border-color 300ms ease, color 300ms ease !important;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- 12. Utilities ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mt-lg { margin-top: clamp(32px, 4vw, 48px); }
[hidden] { display: none !important; }
@media (max-width: 480px) {
  .hero .actions .btn, .cta .actions .btn { flex: 1 1 100%; }
}
/* the menu CTA is a button, not a plain nav link */
.nav-links a.btn { display: inline-flex; align-items: center; justify-content: center; height: var(--h); padding: 0 16px; color: var(--accent-contrast); background: var(--accent); }
.nav-links a.btn:hover { background: var(--accent-hover); color: var(--accent-contrast); }
.nav-links a.btn::after { display: none; }
@media (max-width: 940px) { .nav-links a.btn { padding: 0 16px; font-size: 1rem; --h: 48px; } }

/* =====================================================================
   Case studies
   ===================================================================== */
.crumbs { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; font-size: 0.88rem; color: var(--text-3); }
.crumbs a { color: var(--text-2); transition: color var(--t-fast); }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { color: var(--text); }
.case-hero__meta { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.case-hero h1 { max-width: 24ch; }
.case-hero .actions { margin-top: 30px; }
.case-media { overflow: hidden; }
.case-media .project__media { aspect-ratio: 21 / 9; border-bottom: 0; }
.case-media .project__media--frame { padding: clamp(18px, 4vw, 48px); }
.case-media .browser { max-width: 960px; }
.case-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 24px 0 0; border-block: 1px solid var(--border); }
.case-facts div { padding: 20px 20px 20px 0; }
.case-facts div + div { padding-left: 20px; border-left: 1px solid var(--border); }
.case-facts dt { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.case-facts dd { margin: 0; font-weight: 500; line-height: 1.45; }
@media (max-width: 760px) {
  .case-media .project__media { aspect-ratio: 16 / 10; }
  .case-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-facts div:nth-child(3) { padding-left: 0; border-left: 0; }
  .case-facts div:nth-child(n + 3) { border-top: 1px solid var(--border); }
}

/* architecture diagram: columns flow left to right, stack on small screens */
.arch { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; counter-reset: arch; }
.arch__col { position: relative; display: grid; align-content: start; gap: 12px; }
.arch__col > .meta { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; }
.arch__col + .arch__col::before {
  content: ""; position: absolute; left: -40px; top: 58px; width: 32px; height: 2px;
  background: linear-gradient(90deg, var(--border-strong), var(--accent));
}
.arch__col + .arch__col::after {
  content: ""; position: absolute; left: -14px; top: 54px; width: 8px; height: 8px;
  border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: rotate(45deg);
}
.arch__nodes { display: grid; gap: 10px; }
.arch__node {
  padding: 16px 18px; border-radius: var(--r-md); background: var(--surface-1); border: 1px solid var(--border);
  transition: border-color var(--t-base), transform var(--t-base) var(--ease);
}
:root[data-theme="light"] .arch__node { background: #fff; box-shadow: var(--shadow-sm); }
.arch__node:hover { border-color: var(--accent); transform: translateY(-2px); }
.arch__node strong { display: block; font-weight: 600; margin-bottom: 2px; }
.arch__node small { display: block; color: var(--text-2); font-size: 0.88rem; line-height: 1.45; }
@media (max-width: 860px) {
  .arch { grid-template-columns: 1fr; gap: 40px; }
  .arch__col + .arch__col::before { left: 24px; top: -32px; width: 2px; height: 24px; background: linear-gradient(180deg, var(--border-strong), var(--accent)); }
  .arch__col + .arch__col::after { left: 21px; top: -14px; transform: rotate(135deg); }
}

.decisions { list-style: none; counter-reset: dec; }
.decision { counter-increment: dec; }
.decision::before { content: "0" counter(dec); font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); margin-bottom: 14px; }

.case-next {
  position: relative; display: grid; gap: 6px; padding: clamp(24px, 3vw, 36px); padding-right: 72px;
  border-radius: var(--r-xl); border: 1px solid var(--border); background: var(--surface-1);
  transition: border-color var(--t-base), transform var(--t-base) var(--ease);
}
:root[data-theme="light"] .case-next { background: #fff; box-shadow: var(--shadow-sm); }
.case-next strong { font-size: var(--fs-h3); letter-spacing: -0.015em; }
.case-next > svg { position: absolute; right: 28px; top: 50%; width: 22px; height: 22px; margin-top: -11px; color: var(--accent); transition: transform var(--t-base) var(--ease); }
.case-next:hover { border-color: var(--accent); transform: translateY(-2px); }
.case-next:hover > svg { transform: translateX(5px); }

/* =====================================================================
   Modern touches
   ===================================================================== */
/* smooth cross-fade between pages (supported browsers; ignored elsewhere) */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 280ms; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }

/* hero: a signal travels through the stack, layer by layer */
.stack-visual .layer { overflow: hidden; }
.stack-visual .layer::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 14%, transparent), transparent);
  transform: translateX(-100%); animation: sweep 6.4s var(--ease) infinite;
}
.stack-visual .layer:nth-of-type(2)::after { animation-delay: 0.8s; }
.stack-visual .layer:nth-of-type(3)::after { animation-delay: 1.6s; }
.stack-visual .layer:nth-of-type(4)::after { animation-delay: 2.4s; }
.stack-visual .layer:nth-of-type(5)::after { animation-delay: 3.2s; }
@keyframes sweep { 0% { transform: translateX(-100%); } 22%, 100% { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .stack-visual .layer::after { display: none; }
}

/* =====================================================================
   Signature layer: editorial accents, atmosphere and conversion
   ===================================================================== */
:root { --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif; }

/* editorial accent: an italic serif phrase inside a sans headline */
h1 em, h2 em, .footer-cta__title em {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  font-size: 1.1em; line-height: 0.9; letter-spacing: -0.012em;
  padding-right: 0.06em; /* italic overhang */
  color: var(--accent);
  background: linear-gradient(100deg, var(--accent) 10%, var(--violet) 90%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
@media (forced-colors: active) { h1 em, h2 em, .footer-cta__title em { -webkit-text-fill-color: currentColor; background: none; } }

/* hero atmosphere: slow drifting light behind the grid */
.aurora { position: absolute; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora span {
  position: absolute; width: 46vw; height: 46vw; max-width: 720px; max-height: 720px; border-radius: 50%;
  filter: blur(90px); opacity: 0.3;
  animation: drift 22s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { background: var(--accent); top: -18%; right: -6%; }
.aurora span:nth-child(2) { background: var(--violet); top: 22%; right: 24%; width: 30vw; height: 30vw; opacity: 0.18; animation-duration: 28s; animation-delay: -6s; }
.aurora span:nth-child(3) { background: var(--success); bottom: -30%; left: -12%; width: 34vw; height: 34vw; opacity: 0.08; animation-duration: 32s; animation-delay: -12s; }
:root[data-theme="light"] .aurora span { opacity: 0.14; }
:root[data-theme="light"] .aurora span:nth-child(2) { opacity: 0.09; }
:root[data-theme="light"] .aurora span:nth-child(3) { opacity: 0.05; }
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-6vw, 4vw, 0) scale(1.15); } }
.page-hero { overflow: hidden; }
.page-hero::after {
  content: ""; position: absolute; z-index: -2; top: -40%; right: -10%; width: 60vw; height: 60vw; max-width: 820px; max-height: 820px;
  border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent), transparent 65%); pointer-events: none;
}
.hero .display { font-size: clamp(2.5rem, 1.5rem + 3.9vw, 4.4rem); }

.hero-trust { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 30px; font-size: 0.88rem; color: var(--text-2); }
.hero-trust li { display: inline-flex; align-items: center; gap: 8px; }
.hero-trust svg { width: 16px; height: 16px; color: var(--success); }

/* header scroll progress */
.scroll-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; transform-origin: 0 50%; transform: scaleX(var(--progress, 0));
  background: linear-gradient(90deg, var(--accent), var(--violet)); pointer-events: none;
}

/* clients marquee (JS wraps the list in a track and duplicates it) */
.clients { overflow: hidden; }
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee-track:hover { animation-play-state: paused; }
.marquee-track .marquee { flex-wrap: nowrap; padding-right: 48px; gap: 48px; }
.marquee-track .marquee li { white-space: nowrap; font-size: 1.12rem; transition: color var(--t-fast); }
.marquee-track .marquee li:hover { color: var(--text); }
.clients--moving .marquee-wrap { -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* cursor spotlight on cards (pointer devices only) */
@media (hover: hover) and (pointer: fine) {
  .card:not(.decision)::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%);
    opacity: 0; transition: opacity var(--t-base);
  }
  .card:not(.decision):hover::before { opacity: 1; }
}

/* featured work: lead case study */
#work .project-stack { margin-bottom: 16px; }

/* journey: sticky intro, timeline of steps */
.journey-wrap { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(36px, 6vw, 96px); align-items: start; }
.journey-head { position: sticky; top: calc(var(--header-h) + 40px); margin-bottom: 0; }
.journey-head .btn { justify-self: start; margin-top: 10px; }
.journey { list-style: none; counter-reset: j; position: relative; }
.journey::before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--border-strong), var(--border) 80%, transparent); }
.journey__step { counter-increment: j; position: relative; padding: 0 0 clamp(28px, 3.5vw, 40px) 64px; }
.journey__step:last-child { padding-bottom: 0; }
.journey__step::before {
  content: counter(j, decimal-leading-zero); position: absolute; left: 0; top: -4px; width: 39px; height: 39px; display: grid; place-items: center;
  border-radius: 50%; font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-2);
  background: var(--bg); border: 1px solid var(--border-strong);
  transition: background-color 600ms var(--ease), color 600ms var(--ease), border-color 600ms var(--ease), box-shadow 600ms var(--ease);
}
.journey__step.in::before { color: var(--accent-contrast); background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); transition-delay: 200ms; }
.journey__step h3 { margin-bottom: 6px; }
.journey__step p { color: var(--text-2); font-size: 0.95rem; margin: 0; max-width: 54ch; }
.journey__step .journey__out { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 12px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface-1); border: 1px solid var(--border); color: var(--text); font-size: 0.88rem; }
.journey__out strong { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
@media (max-width: 900px) { .journey-wrap { grid-template-columns: 1fr; } .journey-head { position: static; } }
@media (max-width: 480px) { .journey__step { padding-left: 54px; } }

/* testimonials */
.quote { justify-content: space-between; gap: 28px; margin: 0; }
.quote blockquote { margin: 0; }
.quote blockquote p { font-family: var(--font-serif); font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.6rem); line-height: 1.3; color: var(--text); margin: 0; }
.quote blockquote p::before { content: "\201C"; display: block; font-size: 3em; line-height: 0.6; color: var(--accent); margin-bottom: 8px; }
.quote figcaption { display: flex; align-items: center; gap: 12px; }
.quote__avatar { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.quote figcaption strong { display: block; font-weight: 600; font-size: 0.95rem; }
.quote figcaption small { color: var(--text-2); font-size: 0.86rem; }
.quote figcaption a { color: var(--accent); }

/* CTA band: richer light */
.cta { border-color: color-mix(in srgb, var(--accent) 28%, var(--border)); }
.cta::before { background: radial-gradient(55% 140% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 62%), radial-gradient(45% 120% at 0% 100%, color-mix(in srgb, var(--violet) 14%, transparent), transparent 60%); }
.cta h2 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem); }

/* footer call to action */
.footer-cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px; padding-bottom: 56px; margin-bottom: 56px; border-bottom: 1px solid var(--border); }
.footer-cta__title { margin: 0; font-size: clamp(2rem, 1.2rem + 3.4vw, 3.8rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 600; text-wrap: balance; max-width: 18ch; }
@media (max-width: 800px) { .footer-cta { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .footer-cta .btn { flex: 1 1 100%; } }

/* floating contact dock */
.dock {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40;
  display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 999px;
  background: var(--header-bg); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  opacity: 0; visibility: hidden; transform: translateY(16px);
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease), visibility 0s linear var(--t-base);
}
.dock.show { opacity: 1; visibility: visible; transform: none; transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease), visibility 0s; }
.dock__cta { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--accent); color: var(--accent-contrast); font-weight: 600; font-size: 0.9rem; white-space: nowrap; transition: background-color var(--t-fast); }
.dock__cta:hover { background: var(--accent-hover); }
.dock__cta svg { width: 15px; height: 15px; transition: transform var(--t-base) var(--ease); }
.dock__cta:hover svg { transform: translateX(3px); }
.dock__icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: var(--text-2); cursor: pointer; transition: background-color var(--t-fast), color var(--t-fast); }
.dock__icon:hover { background: var(--surface-2); color: var(--text); }
.dock__icon svg { width: 18px; height: 18px; }
body.nav-lock .dock { opacity: 0; visibility: hidden; }
@media (max-width: 480px) { .dock { left: 16px; right: 16px; } .dock__cta { flex: 1; justify-content: center; } }
/* keep the end of the page reachable above the dock */
.site-footer { padding-bottom: 96px; }

@media (prefers-reduced-motion: reduce) {
  .aurora span, .marquee-track { animation: none; }
}
