/* Savogelt public site
   Static, dependency-free. Shared by index.html, scryer.html, privacy.html.
   Sections: tokens · base · header · hero · sections · cards · programs ·
   state · footer · legal · motion · responsive
*/

:root {
  --sg-blue: #1F4E79;
  --sg-blue-2: #173b5d;
  --sg-blue-pale: #eaf1f7;
  --ink: #14202b;
  --ink-soft: #435565;
  --ink-mute: #5a6b7a;
  --line: #d5dde5;
  --line-strong: #b4c2ce;
  --paper: #f5f7f9;
  --white: #ffffff;
  --bg: #ffffff;
  --surface: #ffffff;
  --tint: #eef2f6;
  --accent: #1F4E79;         /* blue for text, rules, and outlines */
  --on-accent: #ffffff;
  --nav-ink: #2f4152;
  --grid: rgba(31, 78, 121, .07);
  --warn-line: #b08400;
  --dark: #111d29;
  --dark-line: rgba(255, 255, 255, .16);
  --dark-text: #c3ceD8;
  --dark-accent: #8fb6d6;

  --ok: #1f6048;
  --ok-bg: #e5f2ec;
  --warn: #7a5400;
  --warn-bg: #f6efd9;

  --radius: 3px;
  --shell: min(1200px, calc(100vw - 48px));
  --header-h: 68px;

  color-scheme: light;

  --font-head: Bahnschrift, "Segoe UI Semibold", "Segoe UI", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, "DejaVu Sans Mono", monospace;
}

/* Dark theme. Selected with the toggle (html[data-theme="dark"]).
   Tokens approximate what a browser's forced-dark pass produces from the
   light theme (near-neutral #121212-class canvas, lifted text, lightened
   accent), so the two paths land on the same look. color-scheme is set
   explicitly per theme so the browser renders native controls, scrollbars and
   canvas in the matching scheme and does not darken/lighten a page that is
   already in the requested scheme a second time. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --sg-blue: #2b6598;
  --sg-blue-2: #3577b0;
  --sg-blue-pale: #182838;
  --ink: #e6ebf0;
  --ink-soft: #b4c0cb;
  --ink-mute: #93a2b0;
  --line: #2b3946;
  --line-strong: #3d4f5f;
  --paper: #161f28;
  --bg: #121a22;
  --surface: #1a2530;
  --tint: #202d39;
  --accent: #8fb6d6;
  --on-accent: #0f1a24;
  --nav-ink: #c3ced8;
  --grid: rgba(143, 182, 214, .08);
  --warn-line: #d1a62c;
  --dark: #0b1219;

  --ok: #7fd1ac;
  --ok-bg: #16302a;
  --warn: #e8c766;
  --warn-bg: #33290f;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { overflow-wrap: break-word; }

::selection { background: var(--sg-blue); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.section-dark :focus-visible,
.site-footer :focus-visible { outline-color: #9cc3e4; }

.shell { width: var(--shell); margin-inline: auto; }

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

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 1000;
  transform: translateY(-200%);
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}
.skip-link:focus { transform: translateY(0); }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header::after {           /* fine blue rule under the header */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0, var(--accent) 96px, transparent 96px);
}
.nav-shell {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  line-height: 1;
}
.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
  object-fit: contain;
}
.brand-word {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .16em;
  padding-top: 2px;             /* optical centering against the mark */
}

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a {
  position: relative;
  padding: 6px 0;
  color: var(--nav-ink);
  font-size: .9rem;
  font-weight: 600;
}
.site-nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a:hover::after,
.site-nav a[aria-current]::after { transform: scaleX(1); }
.site-nav a[aria-current] { color: var(--accent); }
.site-nav .nav-cta {
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
}
.site-nav .nav-cta:hover { background: var(--accent); color: var(--on-accent); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  place-content: center;
  gap: 5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.nav-toggle span:not(.sr-only) {
  width: 20px;
  height: 2px;
  background: var(--ink);
  transition: transform .18s ease, opacity .18s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- theme toggle ---------- */

.theme-toggle {
  order: 3;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.site-nav { order: 2; margin-left: auto; }
.nav-shell { gap: 20px; }

/* ---------- typography helpers ---------- */

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero h1,
.section-heading h2,
.legal-card h1 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.04;
  text-wrap: balance;
}
.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 3.6vw, 3.1rem);
}
.lead { color: var(--ink); font-size: 1.18rem; line-height: 1.55; }
.section-intro {
  max-width: 68ch;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 1.04rem;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--paper));
}
.hero-grid {                    /* decorative drafting grid */
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(to right, transparent 5%, #000 55%);
          mask-image: linear-gradient(to right, transparent 5%, #000 55%);
}
.hero-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(36px, 6vw, 88px);
  padding-block: clamp(48px, 7vw, 92px);
}
.hero h1 {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(2.7rem, 6.2vw, 5.2rem);
}
.hero-lede {
  max-width: 56ch;
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.55;
}
.hero-lede strong { color: var(--ink); font-weight: 650; }
.hero-body {
  max-width: 60ch;
  margin: 16px 0 0;
  color: var(--ink-soft);
}
.hero-status { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.crumbs {
  margin: 0 0 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.crumbs a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--accent); }

/* ---------- buttons / links ---------- */

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.button.primary { background: var(--sg-blue); border-color: var(--sg-blue); color: #fff; }
.button.primary:hover { background: var(--sg-blue-2); border-color: var(--sg-blue-2); }
.button.ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.button.ghost:hover { border-color: var(--accent); color: var(--accent); }

.text-link {
  display: inline-block;
  color: var(--accent);
  font-family: var(--font-head);
  font-weight: 600;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- instrument panel (hero) ---------- */

.instrument {
  margin: 0;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.instrument-head,
.instrument-foot {
  min-height: 40px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--tint);
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .08em;
}
.instrument-head { border-bottom: 1px solid var(--line); }
.instrument-foot { border-top: 1px solid var(--line); }
.instrument-head .live { color: var(--ok); font-weight: 600; }
.instrument-head .live::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 7px;
  background: currentColor;
}

.flow { list-style: none; margin: 0; padding: 22px 24px; }
.flow li {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.flow li + li { margin-top: 18px; }
.flow li + li::before {          /* connector from previous step */
  content: "";
  position: absolute;
  left: 30px;
  bottom: 100%;
  height: 18px;
  border-left: 1px solid var(--line-strong);
}
.flow li + li::after {           /* arrowhead */
  content: "";
  position: absolute;
  left: 27px;
  bottom: calc(100% - 1px);
  border: 3px solid transparent;
  border-top: 5px solid var(--accent);
  border-bottom: 0;
}
.flow .n { color: var(--accent); font-family: var(--font-mono); font-size: .74rem; }
.flow strong { font-family: var(--font-head); font-size: .98rem; letter-spacing: .01em; }
.flow small { color: var(--ink-mute); font-size: .8rem; }
.flow li:first-child { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }

/* ---------- sections ---------- */

.section { padding-block: clamp(56px, 7vw, 104px); }
.section-light { background: var(--paper); border-block: 1px solid var(--line); }
.section-dark {
  position: relative;
  color: var(--white);
  background-color: var(--dark);
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 32px 32px;
}
.section-dark .eyebrow { color: var(--dark-accent); }
.section-dark .section-intro,
.section-dark .lead { color: var(--dark-text); }
.section-dark .section-heading h2 { color: var(--white); }

.split {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(36px, 7vw, 104px);
  align-items: start;
}
.section-copy { max-width: 68ch; }
.section-copy p { margin: 0 0 18px; color: var(--ink-soft); }
.section-copy .lead { color: var(--ink); }
.section-copy > :last-child { margin-bottom: 0; }

/* ---------- cell grid (principles, applications) ---------- */

.principle-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
}
.principle {
  padding: 26px 26px 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.principle .index {
  display: block;
  margin-bottom: 18px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .08em;
}
.principle h3 {
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-size: 1.28rem;
  line-height: 1.2;
}
.principle p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- programs ---------- */

.programs { background: var(--paper); border-block: 1px solid var(--line); }

.status-key {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}
.status-key .key-label {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.program-list { margin-top: 40px; display: grid; gap: 12px; }
.program-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 210px;
  gap: 24px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.program-card.is-active { border-left-color: var(--ok); }
.program-card.is-build { border-left-color: var(--accent); }
.program-card.is-research { border-left-color: var(--warn-line); }
.program-code {
  padding-top: 6px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .04em;
}
.program-titleline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.program-main h3 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.55rem;
  line-height: 1.2;
}
.program-main p { margin: 10px 0 0; max-width: 70ch; color: var(--ink-soft); }
.program-main .program-note { font-size: .93rem; color: var(--ink-mute); }
.program-main .program-note strong { color: var(--ink); }
.program-side { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }

.tags { display: flex; flex-wrap: wrap; align-content: start; gap: 6px; }
.tags span {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: .76rem;
  line-height: 1.4;
}

/* status labels — the shared vocabulary for development state */
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: .68rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 6px; height: 6px;
  flex: none;
  background: currentColor;
}
.status-active   { color: var(--ok);      background: var(--ok-bg); }
.status-build    { color: var(--accent); background: var(--sg-blue-pale); }
.status-research { color: var(--warn);    background: var(--warn-bg); }
.status-planned  { color: var(--ink-soft); background: transparent; border-style: dashed; }
.status-planned::before { background: transparent; border: 1px solid currentColor; }
.status-neutral  { color: var(--ink-soft); background: var(--tint); }

.section-dark .status { background: transparent; }
.section-dark .status-active   { color: #7fd1ac; }
.section-dark .status-build    { color: #9cc3e4; }
.section-dark .status-research { color: #e8c766; }
.section-dark .status-planned  { color: #b9c5d0; }
.section-dark .status-neutral  { color: #b9c5d0; }

/* ---------- process / layered rows ---------- */

.process { margin-top: 44px; border-top: 1px solid var(--line-strong); }
.process-step {
  display: grid;
  grid-template-columns: 56px minmax(150px, 240px) minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.process-step .n {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .78rem;
  padding-top: 4px;
}
.process-step h3 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.12rem;
  line-height: 1.3;
}
.process-step p { margin: 0; color: var(--ink-soft); }
.process.compact { margin-top: 26px; }
.process.compact .process-step { grid-template-columns: 44px minmax(0, 1fr); gap: 4px 16px; padding: 16px 0; }
.process.compact .process-step p { grid-column: 2; }

/* ---------- state table ---------- */

.state-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(36px, 7vw, 96px);
  align-items: start;
}
.state-table { margin-top: 40px; border-top: 1px solid rgba(255, 255, 255, .28); }
.state-grid .state-table { margin-top: 0; }
.state-row {
  display: grid;
  grid-template-columns: minmax(130px, 190px) minmax(140px, 200px) minmax(0, 1fr);
  gap: 8px 22px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--dark-line);
}
.state-label {
  display: block;
  color: var(--white);
  font-weight: 650;
  font-size: .95rem;
}
.state-label small {
  display: block;
  color: var(--dark-accent);
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.state-value { color: var(--white); font-weight: 650; font-size: .93rem; }
.state-note { color: var(--dark-text); font-size: .9rem; }

/* ---------- architecture (scryer) ---------- */

.arch {
  margin-top: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr) 40px minmax(0, 1fr);
  align-items: stretch;
}
.arch-node {
  padding: 22px 22px 24px;
  border: 1px solid var(--dark-line);
  border-top: 3px solid var(--dark-accent);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .04);
}
.arch-node.is-planned { border-top-style: dashed; border-top-color: #9aa9b7; }
.arch-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 18px;
  color: var(--dark-accent);
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.arch-node h3 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.7rem;
  line-height: 1.15;
  color: var(--white);
}
.arch-role {
  margin: 6px 0 16px !important;
  color: var(--white) !important;
  font-weight: 650;
  font-size: .95rem;
}
.arch-node p { margin: 0 0 12px; color: var(--dark-text); font-size: .93rem; }
.arch-node p:last-child { margin-bottom: 0; }
.arch-link {
  position: relative;
  align-self: center;
  height: 1px;
  background: var(--dark-accent);
}
.arch-link::before,
.arch-link::after {              /* double-ended arrowheads */
  content: "";
  position: absolute;
  top: -4px;
  border: 4px solid transparent;
}
.arch-link::before { left: 0;  border-right: 6px solid var(--dark-accent); border-left: 0; }
.arch-link::after  { right: 0; border-left: 6px solid var(--dark-accent);  border-right: 0; }
.arch-caption {
  margin: 22px 0 0;
  max-width: 78ch;
  color: var(--dark-text);
  font-size: .92rem;
}
.arch-caption strong { color: var(--white); font-weight: 650; }

/* ---------- collaboration / contact ---------- */

.collab-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: end;
  padding: clamp(28px, 4.5vw, 56px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.collab-panel h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  line-height: 1.06;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.collab-panel p:not(.eyebrow) { max-width: 62ch; margin: 18px 0 0; color: var(--ink-soft); }
.collab-panel .tags { justify-content: flex-end; }

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 7vw, 96px);
  align-items: end;
}
.contact-card {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
}
.contact-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.contact-email {
  color: var(--accent);
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 2.8vw, 2rem);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.contact-email:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- footer ---------- */

.site-footer {
  padding: 36px 0 32px;
  background: var(--dark);
  color: var(--dark-text);
  border-top: 2px solid var(--sg-blue);
}
.footer-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px 40px;
}
.site-footer .brand { color: var(--white); }
.site-footer .brand-mark { width: 34px; height: 34px; filter: brightness(0) invert(1); }
[data-theme="dark"] .site-header .brand-mark { filter: brightness(0) invert(.9); }
.footer-id { display: grid; gap: 8px; }
.footer-slogan { margin: 0; font-size: .86rem; color: var(--dark-text); }
.footer-nav, .footer-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .86rem; }
.footer-nav a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }
.footer-meta { color: #9aa9b7; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .04em; }

/* ---------- legal page ---------- */

.legal-main { padding: clamp(40px, 6vw, 80px) 0 clamp(64px, 8vw, 110px); background: var(--paper); }
.legal-card {
  max-width: 820px;
  padding: clamp(26px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.legal-card h1 { margin: 0 0 10px; font-size: clamp(2.2rem, 5vw, 3.6rem); }
.legal-card h2 { margin: 32px 0 8px; font-family: var(--font-head); font-size: 1.3rem; }
.legal-card p, .legal-card li { color: var(--ink-soft); max-width: 68ch; }
.legal-card a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- motion ---------- */

/* Content is visible by default; script.js marks only below-the-fold blocks. */
.reveal.is-pending { opacity: 0; transform: translateY(10px); }
.reveal { transition: opacity .45s ease, transform .45s ease; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal.is-pending { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .program-card { grid-template-columns: 64px minmax(0, 1fr); }
  .program-side { grid-column: 2; }
  .state-grid { grid-template-columns: 1fr; }
  .state-row { grid-template-columns: minmax(120px, 170px) minmax(130px, 180px) minmax(0, 1fr); }
}

@media (max-width: 900px) {
  :root { --shell: min(100vw - 40px, 760px); }

  .nav-toggle { display: grid; order: 4; }
  .nav-shell { gap: 12px; }
  .theme-toggle { margin-left: auto; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    padding: 6px 20px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid var(--line-strong);
    background: var(--surface);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 14px 2px; border-bottom: 1px solid var(--line); }
  .site-nav a:not(.nav-cta)::after { display: none; }
  .site-nav a[aria-current] { box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px; }
  .site-nav .nav-cta { margin-top: 12px; border: 1px solid var(--accent); text-align: center; }

  .hero-layout, .split, .contact-layout, .collab-panel { grid-template-columns: 1fr; }
  .instrument { max-width: 640px; }
  .principle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collab-panel .tags { justify-content: flex-start; }

  .arch { grid-template-columns: 1fr; }
  .arch-link { width: 1px; height: 32px; justify-self: center; }
  .arch-link::before, .arch-link::after { left: -4px; border: 4px solid transparent; }
  .arch-link::before { top: 0; border-bottom: 6px solid var(--dark-accent); border-top: 0; }
  .arch-link::after  { top: auto; bottom: 0; border-top: 6px solid var(--dark-accent); border-bottom: 0; right: auto; }
}

@media (max-width: 640px) {
  :root { --shell: calc(100vw - 32px); --header-h: 62px; }

  .brand-mark { width: 34px; height: 34px; }
  .brand-word { font-size: 1rem; }
  .site-nav { padding-inline: 16px; }

  .hero-actions .button { width: 100%; }
  .instrument-head, .instrument-foot { flex-direction: column; align-items: flex-start; gap: 2px; }
  .flow { padding: 16px; }
  .flow li { grid-template-columns: 30px minmax(0, 1fr); }
  .flow li small { grid-column: 2; }
  .flow li + li::before { left: 26px; }
  .flow li + li::after { left: 23px; }

  .principle-grid { grid-template-columns: 1fr; }
  .principle { padding: 20px; }

  .program-card { grid-template-columns: 1fr; gap: 12px; padding: 20px; }
  .program-side { grid-column: 1; }
  .process-step { grid-template-columns: 40px minmax(0, 1fr); gap: 4px 14px; padding: 18px 0; }
  .process-step p { grid-column: 2; }

  .state-row { grid-template-columns: 1fr; gap: 6px; padding: 16px 0; }
  .state-value { justify-self: start; }

  .contact-card { padding: 22px; }
  .contact-card .button { width: 100%; }
  .footer-layout { flex-direction: column; align-items: flex-start; }
}

.nav-shell > .button { margin-left: auto; }
