/* VITAgent styles. The rules live in DESIGN.md; this file implements them.
   Chapters 1 and 2 (confirmed 2026-11-05):
   - Hierarchy from space, then type, then tone, then surface. Lines only inside visuals and on controls.
   - No eyebrows, small labels or decorative numbering.
   - Five type roles: display (dot-matrix), title 40, heading 20, body 17, meta 15 muted.
   - Mono only inside expressive visuals.
   - Space on a 4px base: 4-8 inside an element, 32-48 between elements, 128 between sections.
   - One left edge; no side-label columns.
   - The raised surface is reserved for product cards. */
:root {
  --surface: #f3f5f5;
  --raised: #ffffff;
  --ink: #1c2426;
  --muted: #5f6b6e;
  --brand: #0e6b65;
  --brand-soft: #e2eeec;
  --signal: #d93a46;
  --control: #d3dbdb;   /* control boundaries only */
  --dot-off: #e0e6e6;
  --faint: #b9c4c4;     /* inside visuals only */
  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --wrap: 1152px;
  --g: clamp(20px, 4vw, 48px);
  --sec: clamp(96px, 12vw, 128px);
  --quick: 100ms cubic-bezier(0.2, 0, 0.38, 0.9);
  --move: 240ms cubic-bezier(0.2, 0, 0.38, 0.9);
}
@media (prefers-color-scheme: dark) {
  :root { --surface: #101516; --raised: #172022; --ink: #e6ecec; --muted: #93a1a4; --brand: #3fb1a6; --brand-soft: #15302d; --signal: #ff5c66; --control: #2c3739; --dot-off: #20292b; --faint: #46575a; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 400 17px/28px var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, figure, ul { margin: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 2px; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--g)); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 9; background: var(--raised); padding: 8px 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Type roles */
.title { font-size: 40px; line-height: 48px; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 40px; }
.dm-title { color: var(--ink); }
.dm.dm-title svg { height: 48px; width: auto; }
h3 { font-size: 20px; line-height: 28px; font-weight: 500; letter-spacing: -0.01em; }
.meta { font-size: 15px; line-height: 24px; color: var(--muted); }
@media (max-width: 640px) { .title { font-size: 32px; line-height: 40px; } .dm.dm-title svg { height: 36px; } }

/* Text link */
.link { color: var(--brand); text-underline-offset: 4px; text-decoration-thickness: 1px; transition: color var(--quick); }
.link:hover { text-decoration-line: underline; }

/* Dot-matrix */
.dm { display: block; }
.dm svg { display: block; width: 100%; height: auto; }
.dm .dot-on { fill: currentColor; }
.dm .dot-off { fill: var(--dot-off); }
/* Wordmark: VITA (life) in the signal colour; in the hero the shared A blinks like a live reading */
.dm-vita .gl[data-i="0"], .dm-vita .gl[data-i="1"], .dm-vita .gl[data-i="2"], .dm-vita .gl[data-i="3"] { fill: var(--signal); }
/* The A belongs to both words: it alternates between VITA's red and Agent's ink */
.dm-hero.dm-vita .gl[data-i="3"] { animation: shared-a 1.6s linear infinite; }
@keyframes shared-a { 0%, 49.9% { fill: var(--signal); } 50%, 100% { fill: var(--ink); } }
@keyframes pulse-a { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .dm-hero.dm-vita .gl[data-i="3"] { animation: none; } }
.boot .dot-on circle { opacity: 0; transition: opacity .05s steps(1); }
.boot.booted .dot-on circle { opacity: 1; }

/* Nav: no rule; a raised surface appears once the page scrolls */
.top { position: sticky; top: 0; z-index: 5; transition: background-color var(--move); }
.top.scrolled { background: color-mix(in srgb, var(--raised) 88%, transparent); backdrop-filter: blur(10px); }
.top-in { display: flex; align-items: center; gap: 32px; height: 72px; }
.brand { color: var(--ink); width: 120px; flex: none; }
nav { display: flex; gap: 32px; margin-left: auto; font-size: 15px; }
nav a { color: var(--muted); padding: 8px 0; transition: color var(--quick); }
nav a:hover, nav a[aria-current="true"] { color: var(--ink); }
@media (max-width: 640px) {
  .top-in { gap: 20px; height: 64px; }
  .brand { width: 92px; }
  nav { gap: 20px; overflow-x: auto; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav a { white-space: nowrap; }
}

/* Concept */
.hero { padding: clamp(48px, 8vw, 96px) 0 0; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 64px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.3fr 1fr; } }
.dm-hero { color: var(--ink); max-width: 640px; }
.claim { font-size: 40px; line-height: 48px; font-weight: 500; letter-spacing: -0.02em; margin-top: 48px; }
.lede { color: var(--muted); max-width: 38ch; margin-top: 12px; }
@media (max-width: 640px) { .claim { font-size: 32px; line-height: 40px; } }

/* Expressive visual: dot-matrix display */
.scope { justify-self: center; width: min(100% - 32px, 400px); }
.scope-disc { position: relative; aspect-ratio: 1; }
.scope-disc canvas { width: 100%; height: 100%; display: block; }
.scope-disc::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 1px solid var(--dot-off); pointer-events: none; }
.scope-cap { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 32px; }
.cap-text { font-size: 15px; color: var(--muted); }
.cap-text b { color: var(--ink); font-weight: 500; font-size: 17px; margin-right: 4px; }
.steps { display: flex; gap: 4px; }
.steps button { all: unset; cursor: pointer; width: 24px; height: 24px; display: grid; place-items: center; }
.steps button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot-off); transition: background-color var(--quick); }
.steps button:hover::before { background: var(--faint); }
.steps button[aria-current="true"]::before { background: var(--brand); }
.steps button:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; border-radius: 50%; }

/* Expressive visual: vital trace with the vīta readout */
.vitals { margin-top: 96px; display: grid; grid-template-columns: 240px 1fr; align-items: center; gap: 40px; }
.vitals canvas { width: 100%; height: 104px; display: block; }
.dict { display: grid; gap: 16px; }
.dict dt { font-size: 24px; line-height: 30px; font-weight: 500; letter-spacing: -0.015em; }
.dict dd { margin: 2px 0 0; font-size: 15px; line-height: 22px; }
.dict dd i { color: var(--muted); margin-right: 8px; }
@media (max-width: 640px) { .vitals { grid-template-columns: 1fr; gap: 16px; } .dict { grid-template-columns: 1fr 1fr; } }

/* Pathway */
.gauge { margin-bottom: 48px; }
.gauge svg { width: 100%; height: auto; display: block; }
.gauge .off { fill: var(--dot-off); }
.gauge .lit { fill: var(--brand); }
.gauge .head { fill: var(--signal); animation: pulse-a 1.2s linear infinite; }
.gauge .st.off { fill: var(--faint); }
.gauge-ends { display: flex; justify-content: space-between; margin-top: 8px; font-size: 15px; color: var(--muted); }
.path { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr; gap: 48px; }
@media (min-width: 900px) { .path { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.path li { display: flex; flex-direction: column; }
.dm.dm-num { width: auto; margin-bottom: 20px; color: var(--brand); }
.dm.dm-num svg { height: 40px; width: auto; }
.path li.now .dm-num { color: var(--signal); }
.path h3 { font-size: 22px; line-height: 30px; max-width: 22ch; }
.path .desc { margin-top: 12px; color: var(--muted); max-width: 40ch; }
.path .by { margin-top: auto; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; }
@media (max-width: 640px) { .gauge-ends { font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { .gauge .head { animation: none; } }

/* Sections: separated by space only */
.sec { padding-top: var(--sec); }

/* News */
.news { list-style: none; padding: 0; display: grid; gap: 20px; max-width: 760px; }
.news li { display: grid; grid-template-columns: 112px 1fr; gap: 24px; }
.news time { font-size: 15px; color: var(--muted); }
.news li.new time { color: var(--ink); }
.news li.new time::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); margin-left: 8px; vertical-align: 2px; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .15; } }
@media (max-width: 640px) { .news li { grid-template-columns: 1fr; gap: 0; } }

/* Expressive visual: system map. Regions are tinted; dots only on the relations. */
.system { margin-top: 80px; }
.system svg { width: 100%; height: auto; display: block; overflow: visible; }
.system .reg .base { fill: var(--brand-soft); }
.system .reg.minor .base { fill: color-mix(in srgb, var(--dot-off) 60%, var(--surface)); }
.system .reg .tex { fill: url(#pd); }
.system .pd { fill: var(--brand); opacity: .4; }
.system .pdm { fill: var(--faint); opacity: .7; }
.system .pdh { fill: var(--brand); }
.system .reg.minor .tex { fill: url(#pdm); }
.system .reg.hl .tex { fill: url(#pdh); }
.system .reg.room .base { fill: none; }
.system .reg.room .tex { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0 6; }
.system .reg.room.hl .tex { stroke-dasharray: 0 4; }
.system .rn { paint-order: stroke; stroke: var(--brand-soft); stroke-width: 6px; stroke-linejoin: round; }
.system .reg.room .rn { stroke: var(--surface); }
.system .reg.minor .rn { stroke: color-mix(in srgb, var(--dot-off) 60%, var(--surface)); }
.system .rn { font: 500 16px var(--sans); fill: var(--ink); }
.system .reg.minor .rn { fill: var(--muted); }
.system .rm, .system .el { font: 400 13px var(--sans); fill: var(--muted); }
.system .edge { fill: none; stroke: var(--faint); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0 10; }
.system .pk { fill: var(--brand); }
.system .pk.live { fill: var(--signal); }
@media (max-width: 640px) { .system { display: none; } }

/* Product cards: the only raised surfaces on the page (DESIGN.md 3.4) */
.cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(3, 1fr); } .card.feat { grid-column: span 2; } }
.card { position: relative; background: var(--raised); border-radius: 8px; padding: 28px; display: flex; flex-direction: column; gap: 28px; transition: transform var(--move); }
.card .emblem { width: 112px; height: 112px; display: block; }
.card-body { display: flex; flex-direction: column; flex: 1; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 8px; }
.card h3 a:focus-visible { outline: none; }
.card:has(h3 a:focus-visible) { outline: 2px solid var(--brand); outline-offset: 3px; }
.card:hover h3 { color: var(--brand); }
.card h3 { transition: color var(--quick); }
.card .meta { margin-top: 2px; }
.card .desc { margin-top: 12px; max-width: 46ch; }
.card .res { margin-top: auto; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 15px; }
.card .res a { position: relative; z-index: 1; }
@media (min-width: 1000px) {
  .card.feat { flex-direction: row; align-items: stretch; gap: 40px; }
  .card.feat .emblem { width: 200px; height: 200px; flex: none; }
  .card.feat h3 { font-size: 28px; line-height: 36px; }
}

/* Team */
.filter { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 48px; }
.filter button { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 15px; color: var(--muted); border: 1px solid var(--control); border-radius: 999px; padding: 4px 14px; transition: color var(--quick), border-color var(--quick); }
.filter button:hover { color: var(--ink); border-color: var(--faint); }
.filter button[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }
.filter button:active { transform: scale(0.98); }
.filter button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.team { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 48px 32px; }
.team > li { display: flex; flex-direction: column; align-items: flex-start; transition: opacity var(--move); }
.team > li.dim { opacity: .22; }
.mono-tile { width: 48px; margin-bottom: 14px; }
.mono-tile .dm, .mono-tile svg { width: 48px; height: auto; }
.mono-tile .dot-on { fill: var(--brand); }
.mono-tile .dot-off { fill: var(--dot-off); }
.mono-tile img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; filter: grayscale(1) contrast(1.05); }
.team b { font-size: 17px; font-weight: 500; }
.team .meta { margin-top: 2px; }
.mark { width: 14px; height: 14px; flex: none; }
.mark .m-on { fill: currentColor; }
.mark .m-off { fill: var(--dot-off); }
.affs { list-style: none; padding: 0; display: flex; gap: 10px; margin-top: 10px; }
.affs li { display: inline-flex; color: var(--muted); }
.affs li.primary { color: var(--brand); }
.affs .mark { width: 18px; height: 18px; }

/* Footer */
.foot { padding: var(--sec) 0 56px; }
.foot-grid { display: grid; grid-template-columns: 1fr; gap: 40px 48px; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1fr auto; } .foot-legal { grid-column: 1 / -1; } }
.foot-mark { display: block; width: 104px; color: var(--ink); }
.foot-id p { margin-top: 10px; color: var(--muted); font-size: 15px; }
.foot-links { margin: 0; display: grid; gap: 8px; font-size: 15px; }
.foot-links div { display: grid; grid-template-columns: 80px auto; gap: 16px; }
.foot-links dt { color: var(--muted); }
.foot-links dd { margin: 0; }
.foot-legal { display: grid; gap: 4px; font-size: 13px; line-height: 20px; color: var(--muted); max-width: 72ch; }

/* Project pages */
.page-hero { padding: clamp(48px, 8vw, 96px) 0 0; }
.page-hero .dm-mono { width: 32px; color: var(--brand); margin-bottom: 32px; }
.page-hero h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.08; font-weight: 500; letter-spacing: -0.03em; }
.page-hero .meta { margin-top: 12px; }
.page-hero .lede { margin-top: 16px; }
.page-hero .res { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 4px 24px; }
.slot { background-image: radial-gradient(var(--dot-off) 1.6px, transparent 1.8px); background-size: 12px 12px; min-height: 320px; display: grid; place-items: center; color: var(--muted); font-size: 15px; }
.slot.tall { min-height: 480px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
