/* ==========================================================================
   AutomationGen — main stylesheet
   Design tokens, base styles, layout primitives and components.
   Breakpoint overrides live in responsive.css.
   ========================================================================== */

/* ---------- Self-hosted fonts (SIL OFL, see assets/fonts/LICENSE-*) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../assets/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("../assets/fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --bg: #08090B;
  --surface: #111318;
  --surface-2: #16191F;
  --border: #242832;
  --border-strong: #343a47;
  --text: #F5F7FA;
  --muted: #8B929E;
  --purple: #7C5CFF;
  --cyan: #00E5FF;
  --purple-soft: rgba(124, 92, 255, 0.14);
  --cyan-soft: rgba(0, 229, 255, 0.12);

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --container: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
  --section-space: clamp(72px, 9vw, 128px);
  --nav-h: 68px;

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0; letter-spacing: -0.03em; }
p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; }
::selection { background: var(--purple); color: #fff; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-s);
  font-weight: 600; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 12px; }

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

/* ---------- Layout primitives ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section-space) 0; position: relative; }
.section--tight { padding: clamp(64px, 8vw, 112px) 0; }
.section--rule { border-top: 1px solid var(--border); }

.section-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.02; }
.section-head p { margin-top: 20px; color: var(--muted); font-size: clamp(1.02rem, 1.3vw, 1.15rem); max-width: 60ch; }

.lede { color: var(--muted); font-size: clamp(1.05rem, 1.4vw, 1.2rem); max-width: 58ch; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; text-decoration: none; letter-spacing: -0.005em;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .25s, transform .2s;
}
.btn--primary { background: var(--text); color: var(--bg); }
.btn--primary:hover { box-shadow: 0 0 0 4px var(--purple-soft), 0 10px 40px -10px rgba(124, 92, 255, .7); transform: translateY(-1px); }
.btn--ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--muted); background: var(--surface); }
.btn--small { min-height: 38px; padding: 0 16px; font-size: .875rem; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

.text-link {
  color: var(--text); text-decoration: none; font-weight: 500;
  background-image: linear-gradient(var(--cyan), var(--cyan));
  background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size .3s var(--ease-out);
  padding-bottom: 2px;
}
.text-link:hover { background-size: 100% 1px; }

/* ---------- Badge (status labels: internal system / concept) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: .75rem; letter-spacing: .02em;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.badge--internal { color: var(--cyan); border-color: rgba(0, 229, 255, .35); }
.badge--internal::before { background: var(--cyan); }
.badge--concept { color: #b6a6ff; border-color: rgba(124, 92, 255, .4); }
.badge--concept::before { background: var(--purple); }

/* ==========================================================================
   Navigation
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
}
.site-header.is-scrolled {
  background: rgba(8, 9, 11, .78);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom-color: var(--border);
}
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; letter-spacing: .06em;
}
.brand img { width: 28px; height: 28px; }
.nav__links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav__links a {
  display: inline-block; padding: 8px 14px; border-radius: 999px; text-decoration: none;
  color: var(--muted); font-size: .92rem; font-weight: 500; transition: color .2s, background-color .2s;
}
.nav__links a:hover { color: var(--text); }
.nav__links a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav__cta { display: flex; align-items: center; gap: 12px; }

.nav__toggle {
  display: none; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: transparent; cursor: pointer;
  position: relative;
}
.nav__toggle span {
  position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--text);
  transition: transform .35s var(--ease-out), opacity .2s;
}
.nav__toggle span:nth-child(1) { top: 17px; }
.nav__toggle span:nth-child(2) { top: 25px; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 99;
  background: var(--bg);
  padding: 32px var(--gutter) 40px;
  display: flex; flex-direction: column; justify-content: space-between;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .3s var(--ease-out), transform .35s var(--ease-out), visibility 0s linear .35s;
  overflow-y: auto;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .3s var(--ease-out), transform .35s var(--ease-out), visibility 0s; }
.mobile-menu ul { list-style: none; }
.mobile-menu li { border-bottom: 1px solid var(--border); }
.mobile-menu li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 0; text-decoration: none;
  font-family: var(--font-display); font-size: 1.9rem; font-weight: 500; letter-spacing: -0.02em;
}
.mobile-menu li a[aria-current="page"] { color: var(--cyan); }
.mobile-menu .btn { width: 100%; margin-top: 32px; }
body.menu-open { overflow: hidden; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; padding: clamp(48px, 7vw, 96px) 0 clamp(72px, 9vw, 128px); overflow: hidden; }
.hero::before {
  /* faint dot grid — the "engineering paper" behind the pipeline */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(139, 146, 158, .16) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 0%, transparent 75%);
}
.hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 88px); align-items: center; }
.hero__title {
  font-size: clamp(3rem, 5.5vw, 5.9rem); line-height: .9; letter-spacing: -0.045em; text-transform: uppercase;
}
.reveal-lines .line { display: block; overflow: hidden; padding-bottom: .04em; }
.reveal-lines .line > span { display: block; }
.hero__title .line { white-space: nowrap; }
.hero__sub { margin-top: clamp(24px, 3vw, 36px); max-width: 46ch; color: var(--muted); font-size: clamp(1.05rem, 1.35vw, 1.2rem); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero__for { margin-top: 40px; color: var(--muted); font-size: .9rem; max-width: 46ch; }

/* text reveal: lines slide up once on load (only when JS + motion allowed) */
.js .reveal-lines .line > span { transform: translateY(105%); transition: transform 1s var(--ease-out); }
.js .reveal-lines.is-in .line > span { transform: none; }
.js .reveal-lines.is-in .line:nth-child(2) > span { transition-delay: .08s; }
.js .reveal-lines.is-in .line:nth-child(3) > span { transition-delay: .16s; }
.js .reveal-lines.is-in .line:nth-child(4) > span { transition-delay: .24s; }

/* ---------- Pipeline panel (hero's live workflow) ---------- */
.pipeline {
  position: relative;
  background: linear-gradient(180deg, var(--surface) 0%, rgba(17, 19, 24, .92) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: 0 40px 120px -60px rgba(124, 92, 255, .45);
}
.pipeline__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: .75rem; color: var(--muted);
}
.pipeline__dots { display: flex; gap: 6px; }
.pipeline__dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.pipeline__state { display: inline-flex; align-items: center; gap: 8px; }
.pipeline__state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.pipeline__body { position: relative; padding: 12px 18px 18px; }

.pipeline__group { position: relative; }
.pipeline__group + .pipeline__group { margin-top: 6px; }
.pipeline__group-label {
  font-family: var(--font-mono); font-size: .7rem; color: var(--muted);
  padding: 8px 0 6px 40px; letter-spacing: .04em;
}

.p-node {
  position: relative; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px;
  padding: 7px 12px 7px 0;
}
/* the vertical connector between nodes */
.p-node::before {
  content: ""; position: absolute; left: 13px; top: -10px; bottom: 50%; width: 2px;
  background: var(--border);
}
.pipeline__group:first-child .p-node:first-of-type::before { display: none; }
.p-node::after {
  /* connector fill when the step has completed */
  content: ""; position: absolute; left: 13px; top: -10px; bottom: 50%; width: 2px;
  background: linear-gradient(180deg, var(--purple), var(--cyan));
  transform-origin: top; transform: scaleY(0); transition: transform .5s var(--ease-out);
}
.pipeline__group:first-child .p-node:first-of-type::after { display: none; }
/* first node of a later group: the rail continues up through the group label */
.pipeline__group + .pipeline__group .p-node:first-of-type::before,
.pipeline__group + .pipeline__group .p-node:first-of-type::after { top: -44px; }
.p-node.is-active::after, .p-node.is-done::after { transform: scaleY(1); }

.p-node__dot {
  position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; transition: border-color .3s, background-color .3s;
}
.p-node__dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); transition: background-color .3s, transform .3s; }
.p-node__name {
  font-family: var(--font-mono); font-size: .86rem; font-weight: 500; letter-spacing: .06em;
  padding: 9px 14px; border: 1px solid var(--border); border-radius: var(--radius-s);
  background: var(--surface-2); transition: border-color .3s, color .3s, box-shadow .3s;
  color: var(--muted);
}
.p-node__status { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); min-width: 64px; text-align: right; }

.p-node.is-done .p-node__dot { border-color: var(--purple); }
.p-node.is-done .p-node__dot::after { background: var(--purple); }
.p-node.is-done .p-node__name { color: var(--text); }
.p-node.is-active .p-node__dot { border-color: var(--cyan); animation: node-pulse 1.6s ease-out infinite; }
.p-node.is-active .p-node__dot::after { background: var(--cyan); transform: scale(1.15); }
.p-node.is-active .p-node__name { color: var(--text); border-color: rgba(0, 229, 255, .5); box-shadow: 0 0 0 3px var(--cyan-soft); }
.p-node.is-active .p-node__status { color: var(--cyan); }

@keyframes node-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 229, 255, .45); }
  100% { box-shadow: 0 0 0 12px rgba(0, 229, 255, 0); }
}

/* particle that travels down the rail into the active node */
.p-particle {
  position: absolute; left: 31px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 12px 2px rgba(0, 229, 255, .7);
  top: 0; opacity: 0; pointer-events: none; z-index: 2;
  transition: top .55s var(--ease-out), opacity .2s;
}

.pipeline__foot {
  display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px;
  border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: .72rem; color: var(--muted);
}
.pipeline__progress { flex: 1; align-self: center; height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; max-width: 140px; }
.pipeline__progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--purple), var(--cyan)); transition: width .5s var(--ease-out); }

/* ==========================================================================
   Generic flow chips (inline mini-workflows used across pages)
   ========================================================================== */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; list-style: none; }
.flow li {
  font-family: var(--font-mono); font-size: .78rem; color: var(--text);
  padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-s); background: var(--surface-2);
  display: inline-flex; align-items: center;
}
.flow li + li { position: relative; margin-left: 18px; }
.flow li + li::before {
  content: ""; position: absolute; left: -20px; top: 50%; width: 14px; height: 1px; background: var(--muted);
}
.flow li + li::after {
  content: ""; position: absolute; left: -10px; top: calc(50% - 3px);
  border: 3px solid transparent; border-left: 4px solid var(--muted);
}
.flow--vertical { flex-direction: column; align-items: flex-start; gap: 18px; }
.flow--vertical li + li { margin-left: 0; }
.flow--vertical li + li::before { left: 18px; top: -16px; width: 1px; height: 14px; }
.flow--vertical li + li::after { left: 15px; top: -5px; border: 3px solid transparent; border-top: 4px solid var(--muted); }

/* ==========================================================================
   Problem section — manual loop vs. system
   ========================================================================== */
.problem__grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; }
.problem__pane { padding: clamp(28px, 4vw, 48px); position: relative; }
.problem__pane + .problem__pane { border-left: 1px solid var(--border); background: var(--surface); }
.problem__pane h3 { font-size: 1.15rem; letter-spacing: -0.01em; margin-bottom: 6px; }
.problem__pane > p { color: var(--muted); font-size: .95rem; margin-bottom: 28px; }

.task-list { list-style: none; counter-reset: task; }
.task-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px dashed var(--border);
  font-family: var(--font-display); font-size: clamp(1.15rem, 1.8vw, 1.45rem); font-weight: 500;
  transition: color .5s, opacity .5s;
}
.task-list li span { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); font-weight: 400; }
.task-list li.task--loop { color: var(--purple); }
.problem.is-automated .task-list li { color: var(--muted); opacity: .45; text-decoration: line-through; text-decoration-thickness: 1px; }
.problem.is-automated .task-list li.task--loop { opacity: .45; }

.sys-flow { list-style: none; display: flex; flex-direction: column; gap: 0; }
.sys-flow li { display: flex; align-items: center; gap: 16px; position: relative; padding: 10px 0; }
.sys-flow li + li::before {
  content: ""; position: absolute; left: 13px; top: -10px; height: 20px; width: 2px; background: var(--border);
}
.sys-flow .sys-dot { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--bg); flex: none; position: relative; z-index: 1; transition: border-color .4s, box-shadow .4s; }
.sys-flow .sys-name {
  font-family: var(--font-mono); font-size: .9rem; letter-spacing: .06em; color: var(--muted);
  padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--surface-2);
  transition: color .4s, border-color .4s; flex: 1; max-width: 280px;
}
.sys-flow li.is-lit .sys-dot { border-color: var(--cyan); box-shadow: inset 0 0 0 5px var(--bg), inset 0 0 0 14px var(--cyan); }
.sys-flow li.is-lit .sys-name { color: var(--text); border-color: rgba(0, 229, 255, .45); }
.sys-flow li.is-lit:first-child .sys-dot, .sys-flow li.is-lit:last-child .sys-dot { border-color: var(--purple); box-shadow: inset 0 0 0 5px var(--bg), inset 0 0 0 14px var(--purple); }
.sys-flow li.is-lit + li.is-lit::before { background: linear-gradient(180deg, var(--purple), var(--cyan)); }

.problem__toggle { margin-top: 28px; }

/* ==========================================================================
   Services overview (one continuous block, not a card kit)
   ========================================================================== */
.services-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}
.service-cell {
  padding: clamp(28px, 4vw, 48px) clamp(0px, 3vw, 40px) clamp(28px, 4vw, 48px) 0;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 18px; position: relative;
}
.service-cell:nth-child(2n) { padding-left: clamp(24px, 3vw, 40px); padding-right: 0; border-left: 1px solid var(--border); }
.service-cell h3 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); line-height: 1.05; }
.service-cell h3 a { text-decoration: none; }
.service-cell h3 a::after { content: ""; position: absolute; inset: 0; } /* whole cell clickable */
.service-cell p { color: var(--muted); max-width: 44ch; }
.service-cell ul.plain { list-style: none; display: grid; gap: 6px; color: var(--muted); font-size: .94rem; }
.service-cell ul.plain li::before { content: "+ "; color: var(--cyan); font-family: var(--font-mono); }
.service-cell .flow { margin-top: auto; }
.service-cell .more { font-size: .9rem; font-weight: 500; color: var(--text); margin-top: 4px; }
.service-cell:hover h3 { color: var(--cyan); }
.service-cell h3 { transition: color .2s; }
.service-cell blockquote {
  margin: 0; padding-left: 16px; border-left: 2px solid var(--purple);
  font-family: var(--font-display); font-size: 1.15rem; line-height: 1.3; color: var(--text); font-weight: 500;
}

/* ==========================================================================
   How it works — timeline
   ========================================================================== */
.timeline { position: relative; }
.timeline__list { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 20px; width: 80%; top: 19px; height: 1px; background: var(--border);
}
.timeline__progress {
  position: absolute; left: 20px; top: 19px; height: 1px; width: 80%;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  transform-origin: left; transform: scaleX(0); transition: transform 1.6s var(--ease-out);
}
.timeline.is-visible .timeline__progress { transform: scaleX(1); }
.timeline li { position: relative; padding-right: 24px; }
.timeline__num {
  position: relative; z-index: 1;
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border-strong);
  font-family: var(--font-mono); font-size: .8rem; color: var(--text);
}
.timeline li:last-child .timeline__num { border-color: var(--cyan); color: var(--cyan); }
.timeline h3 { margin-top: 24px; font-size: 1.25rem; letter-spacing: 0; text-transform: uppercase; }
.timeline p { margin-top: 10px; color: var(--muted); font-size: .95rem; max-width: 26ch; }

/* ==========================================================================
   Work / system case studies
   ========================================================================== */
.case {
  border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--surface);
  overflow: hidden;
}
.case + .case { margin-top: 28px; }
.case__head { padding: clamp(24px, 4vw, 44px); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.case__head h3 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.05; margin-top: 16px; }
.case__head p { color: var(--muted); }
.case__intro { display: grid; gap: 16px; }
.case__flow { padding: 0 clamp(24px, 4vw, 44px) clamp(24px, 4vw, 40px); }
.case__specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.case__specs div { padding: 22px clamp(18px, 2.4vw, 28px); }
.case__specs div + div { border-left: 1px solid var(--border); }
.case__specs dt { font-family: var(--font-mono); font-size: .75rem; color: var(--cyan); margin-bottom: 8px; }
.case__specs dd { margin: 0; color: var(--muted); font-size: .92rem; }

/* ==========================================================================
   Scale section
   ========================================================================== */
.scale { overflow: hidden; }
.scale__stage { display: grid; grid-template-columns: 220px 48px 220px 48px minmax(0, 1fr); align-items: center; }
.scale__box {
  border: 1px solid var(--border-strong); border-radius: var(--radius-m); padding: 20px; background: var(--surface);
}
.scale__box strong { display: block; font-family: var(--font-mono); font-size: .82rem; letter-spacing: .06em; font-weight: 500; }
.scale__box span { display: block; margin-top: 8px; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.scale__box--system { border-color: rgba(124, 92, 255, .55); box-shadow: 0 0 0 4px var(--purple-soft); }
.scale__box--system strong { color: #c3b6ff; }
.scale__arrow { height: 1px; background: var(--border-strong); position: relative; margin: 0 6px; }
.scale__arrow::after { content: ""; position: absolute; right: -1px; top: -4px; border: 4px solid transparent; border-left: 6px solid var(--border-strong); }

.video-grid { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.video-tile {
  aspect-ratio: 9 / 13; border-radius: var(--radius-s); border: 1px solid var(--border);
  background: var(--surface-2); position: relative; overflow: hidden;
  opacity: 1; transform: none; transition: opacity .35s var(--ease-out), transform .35s var(--ease-out), border-color .4s;
}
.js .video-tile.is-pending { opacity: 0; transform: scale(.9); }
.video-tile .vt-art { position: absolute; inset: 0; }
.video-tile .vt-art i { position: absolute; display: block; border-radius: 2px; }
.video-tile .vt-label {
  position: absolute; left: 6px; bottom: 6px; right: 6px;
  font-family: var(--font-mono); font-size: .62rem; color: var(--text); background: rgba(8, 9, 11, .7); padding: 2px 5px; border-radius: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.video-tile.is-new { border-color: var(--cyan); }
.video-tile--n { border-style: dashed; border-color: var(--border-strong); background: transparent; display: grid; place-items: center; }
.video-tile--n .vt-label { position: static; background: none; color: var(--muted); font-size: .72rem; }
.scale__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 28px; align-items: baseline; }
.scale__counter { font-family: var(--font-mono); font-size: .85rem; color: var(--muted); }
.scale__counter b { color: var(--cyan); font-weight: 500; }
.scale__copy { font-family: var(--font-display); font-size: clamp(1.2rem, 2vw, 1.6rem); font-weight: 500; letter-spacing: -0.02em; max-width: 34ch; }

/* ==========================================================================
   Technology list
   ========================================================================== */
.tech-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 5vw, 72px); border-top: 1px solid var(--border); }
.tech-list li { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.tech-list strong { font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; letter-spacing: -0.01em; }
.tech-list span { color: var(--muted); font-size: .92rem; }
.fineprint { margin-top: 24px; color: var(--muted); font-size: .82rem; max-width: 70ch; }

/* ==========================================================================
   About block / CTA
   ========================================================================== */
.about-block { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.about-block h2 { font-size: clamp(2rem, 4.4vw, 3.5rem); line-height: 1.02; }
.about-block .copy { display: grid; gap: 18px; color: var(--muted); font-size: 1.08rem; padding-top: 8px; }
.about-block .copy p:first-child { color: var(--text); }

.cta { position: relative; overflow: hidden; border-top: 1px solid var(--border); }
.cta__graphic { position: absolute; inset: 0; pointer-events: none; opacity: .55; }
.cta__graphic svg { width: 100%; height: 100%; }
.cta__graphic .wire { fill: none; stroke: var(--border-strong); stroke-width: 1; }
.cta__graphic .wire--lit { stroke: url(#ctaGrad); stroke-width: 1.5; stroke-dasharray: 6 10; animation: wire-flow 2.4s linear infinite; }
.cta__graphic .node { fill: var(--bg); stroke: var(--border-strong); }
.cta__graphic .node--lit { stroke: var(--cyan); }
@keyframes wire-flow { to { stroke-dashoffset: -64; } }
.cta__inner { position: relative; text-align: center; max-width: 820px; margin: 0 auto; }
.cta h2 { font-size: clamp(2.6rem, 7vw, 5.6rem); line-height: .95; letter-spacing: -0.045em; }
.cta p { margin: 24px auto 0; color: var(--muted); font-size: clamp(1.05rem, 1.4vw, 1.2rem); max-width: 48ch; }
.cta .btn { margin-top: 36px; }

/* ==========================================================================
   Inner page heads, prose, detail layouts
   ========================================================================== */
.page-head { padding: clamp(56px, 8vw, 120px) 0 clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--border); position: relative; }
.page-head h1 { font-size: clamp(2.6rem, 6.4vw, 5.4rem); line-height: .95; letter-spacing: -0.045em; max-width: 16ch; }
.page-head .lede { margin-top: 24px; }
.crumbs { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--border-strong); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(32px, 6vw, 96px); }
.split h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.08; }
.split .copy { display: grid; gap: 16px; color: var(--muted); }
.split .copy strong { color: var(--text); font-weight: 600; }

.detail-list { list-style: none; border-top: 1px solid var(--border); }
.detail-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.detail-list h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
.detail-list p { color: var(--muted); }

.service-index { list-style: none; border-top: 1px solid var(--border); }
.service-index li { border-bottom: 1px solid var(--border); }
.service-index a {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 32px; align-items: center;
  padding: clamp(24px, 3.5vw, 40px) 0; text-decoration: none;
}
.service-index h2 { font-size: clamp(1.6rem, 3.2vw, 2.6rem); line-height: 1.05; transition: color .2s; }
.service-index p { color: var(--muted); }
.service-index .go { font-size: .9rem; font-weight: 500; white-space: nowrap; }
.service-index a:hover h2 { color: var(--cyan); }

.diagram-panel { border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--surface); padding: clamp(24px, 4vw, 44px); }
.diagram-panel .flow li { font-size: .88rem; padding: 10px 14px; }
.diagram-panel__label { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); margin-bottom: 20px; }

.hub { display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; align-items: center; }
.hub__col { display: grid; gap: 10px; }
.hub__col span {
  font-family: var(--font-mono); font-size: .82rem; padding: 10px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-s); background: var(--surface-2); text-align: center;
}
.hub__core {
  width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; text-align: center;
  border: 1px solid rgba(124, 92, 255, .6); box-shadow: 0 0 0 8px var(--purple-soft), 0 0 60px -10px rgba(0, 229, 255, .4);
  font-family: var(--font-mono); font-size: .78rem; padding: 16px; line-height: 1.35;
}

.prose { max-width: 72ch; }
.prose h2 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); letter-spacing: -0.02em; margin: 48px 0 14px; }
.prose h3 { font-size: 1.1rem; letter-spacing: -0.01em; margin: 28px 0 10px; }
.prose p, .prose li { color: #c4c9d2; }
.prose p + p { margin-top: 14px; }
.prose ul { padding-left: 1.2em; margin: 12px 0; display: grid; gap: 8px; }
.prose a { color: var(--cyan); }
.prose .ph { color: var(--cyan); font-family: var(--font-mono); font-size: .9em; }
.prose .note { margin-top: 18px; padding: 16px 18px; border: 1px solid var(--border); border-left: 2px solid var(--purple); border-radius: var(--radius-s); background: var(--surface); font-size: .94rem; }

.legal-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.legal-nav { position: sticky; top: calc(var(--nav-h) + 24px); }
.legal-nav p { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); margin-bottom: 12px; }
.legal-nav ul { list-style: none; display: grid; gap: 2px; border-left: 1px solid var(--border); }
.legal-nav a { display: block; padding: 7px 14px; text-decoration: none; color: var(--muted); font-size: .92rem; margin-left: -1px; border-left: 1px solid transparent; }
.legal-nav a:hover { color: var(--text); }
.legal-nav a[aria-current="page"] { color: var(--text); border-left-color: var(--cyan); }
.legal-meta { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); margin-top: 20px; }

/* ==========================================================================
   Contact form
   ========================================================================== */
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact-aside { display: grid; gap: 28px; color: var(--muted); }
.contact-aside h2 { font-size: 1.2rem; color: var(--text); letter-spacing: -0.01em; margin-bottom: 8px; }
.form { display: grid; gap: 22px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.field { display: grid; gap: 8px; }
.field label { font-size: .9rem; font-weight: 500; }
.field label .opt { color: var(--muted); font-weight: 400; }
.field .hint { font-size: .82rem; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; min-height: 48px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-s);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.field.has-error input, .field.has-error textarea { border-color: #ff6b81; }
.field .error { color: #ff8a9b; font-size: .84rem; min-height: 0; }
.field .error:empty { display: none; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.form__status { padding: 16px 18px; border-radius: var(--radius-s); border: 1px solid var(--border); font-size: .95rem; }
.form__status:empty { display: none; }
.form__status--info { border-color: rgba(124, 92, 255, .5); background: var(--purple-soft); }
.form__status--success { border-color: rgba(0, 229, 255, .45); background: var(--cyan-soft); }
.form__status--error { border-color: rgba(255, 107, 129, .5); background: rgba(255, 107, 129, .1); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(8, 9, 11, .25); border-top-color: var(--bg); animation: spin .8s linear infinite; display: none; }
.btn.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { border-top: 1px solid var(--border); padding: clamp(56px, 7vw, 88px) 0 32px; }
.footer__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 40px; }
.footer__brand p { margin-top: 14px; color: var(--muted); font-family: var(--font-display); font-size: 1.15rem; }
.footer__col h2 { font-family: var(--font-mono); font-size: .75rem; font-weight: 500; color: var(--muted); letter-spacing: .02em; margin-bottom: 14px; }
.footer__col ul { list-style: none; display: grid; gap: 8px; }
.footer__col a { text-decoration: none; color: var(--text); font-size: .94rem; opacity: .85; }
.footer__col a:hover { opacity: 1; color: var(--cyan); }
.footer__bottom { margin-top: clamp(48px, 6vw, 72px); padding-top: 24px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .85rem; }

/* ==========================================================================
   Scroll reveal (applied only when JS is running; content stays visible otherwise)
   ========================================================================== */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.js .reveal.is-visible { opacity: 1; transform: none; }


/* ---------- Detail rows, fit lists, statements ---------- */
dl.detail-list { margin: 0; }
.detail-list .dl-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.detail-list dd { margin: 0; }
.fit-list { list-style: none; display: grid; gap: 14px; }
.fit-list li { position: relative; padding-left: 28px; color: var(--text); }
.fit-list li::before { content: ""; position: absolute; left: 0; top: .8em; width: 14px; height: 1px; background: var(--cyan); }
.next-steps { padding-left: 1.2em; display: grid; gap: 8px; }
.statement { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 5.4vw, 4.4rem); line-height: 1; letter-spacing: -0.04em; max-width: 22ch; }
.case__note { font-size: .9rem; padding-left: 12px; border-left: 2px solid var(--purple); }
.form__legal { font-size: .85rem; color: var(--muted); }
.notfound h1 { font-size: clamp(2.6rem, 7vw, 5.4rem); line-height: .95; letter-spacing: -0.045em; }
.notfound .lede { margin-top: 24px; }

/* 404 */
.notfound { min-height: 60vh; display: grid; align-content: center; }
.notfound code { font-family: var(--font-mono); color: var(--cyan); }
