/* Atlastrum — night sky + brass.
   Tokens are drawn from inputs/design-tokens-starglass (midnight / starlight / brass ramps)
   and reduced to a small semantic set. Dark is the native theme; light is the ivory
   adaptation. Both are bound three ways: media query for "system", [data-theme] for an
   explicit choice, and :not([data-theme]) so an explicit choice always wins. */

:root {
  color-scheme: dark;
  /* primitives (StarGlass) */
  --midnight-1000: #07060A; --midnight-950: #0B0A11; --midnight-900: #12111A; --midnight-800: #1B1925;
  --midnight-700: #242232; --midnight-600: #302C3F; --midnight-500: #3E3950; --midnight-400: #585067; --midnight-300: #7C7288;
  --starlight-100: #FAF7F1; --starlight-200: #EDE8DF; --starlight-300: #D2C9BC; --starlight-400: #AEA596; --starlight-500: #948B7E;
  --brass-200: #F3E3C0; --brass-300: #E5C98E; --brass-400: #C9A86A; --brass-500: #A2823C; --brass-600: #8A6F33; --brass-700: #63502A;
  --verdigris-300: #8FD9B0; --amber-300: #F3A671; --ember-300: #F0949A;
  /* semantic: dark */
  --canvas: var(--midnight-950);
  --canvas-deep: var(--midnight-1000);
  --surface: var(--midnight-900);
  --raised: var(--midnight-800);
  --surface-3: var(--midnight-700);
  --line: var(--midnight-600);
  --line-strong: var(--midnight-300);
  --text: var(--starlight-200);
  --text-2: var(--starlight-400);
  --muted: var(--starlight-500);
  --accent: var(--brass-300);
  --accent-hover: var(--brass-200);
  --accent-deep: var(--brass-400);
  --accent-ink: var(--midnight-1000);
  --geometry: var(--brass-600);
  --wash: rgba(46, 37, 19, .5);
  --focus: var(--brass-300);
  --star: var(--brass-200);
  --ok: var(--verdigris-300);
  --warn: var(--amber-300);
  --bad: var(--ember-300);
  --shadow: 0 4px 14px -4px rgba(5, 3, 8, .78), 0 1px 2px rgba(5, 3, 8, .65);
  /* type */
  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Public Sans", "Helvetica Neue", Helvetica, "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* motion */
  --d1: 120ms; --d2: 180ms; --d3: 260ms;
  --ease: cubic-bezier(.2, .6, .2, 1);
  --radius: 5px; --radius-lg: 8px;
}
html[data-theme="light"] {
  color-scheme: light;
  --canvas: #F4F0E8; --canvas-deep: #EAE4D8; --surface: #FFFCF7; --raised: #EEE7DC; --surface-3: #E4DBCC;
  --line: #CFC4B3; --line-strong: #786858;
  --text: #241F2C; --text-2: #50475A; --muted: #655C6D;
  --accent: #705016; --accent-hover: #513907; --accent-deep: #705016; --accent-ink: #FFFCF7;
  --geometry: #8A6F33; --wash: rgba(112, 80, 22, .06); --focus: #705016; --star: #705016;
  --ok: #1C513C; --warn: #6E3614; --bad: #6B2228;
  --shadow: 0 4px 14px -6px rgba(36, 31, 44, .18), 0 1px 2px rgba(36, 31, 44, .08);
}
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) {
    color-scheme: light;
    --canvas: #F4F0E8; --canvas-deep: #EAE4D8; --surface: #FFFCF7; --raised: #EEE7DC; --surface-3: #E4DBCC;
    --line: #CFC4B3; --line-strong: #786858;
    --text: #241F2C; --text-2: #50475A; --muted: #655C6D;
    --accent: #705016; --accent-hover: #513907; --accent-deep: #705016; --accent-ink: #FFFCF7;
    --geometry: #8A6F33; --wash: rgba(112, 80, 22, .06); --focus: #705016; --star: #705016;
    --ok: #1C513C; --warn: #6E3614; --bad: #6B2228;
    --shadow: 0 4px 14px -6px rgba(36, 31, 44, .18), 0 1px 2px rgba(36, 31, 44, .08);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--canvas); color: var(--text);
  font: 400 1rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
main { flex: 1; }
[hidden] { display: none !important; }
::selection { background: var(--brass-700); color: var(--starlight-100); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .22em; transition: color var(--d1) var(--ease); }
a:hover { color: var(--accent-hover); }
button { font: inherit; color: inherit; cursor: pointer; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.12; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 5.6vw, 4.25rem); font-weight: 300; letter-spacing: -.02em; line-height: 1.04; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.375rem; }
h4 { font-family: var(--font-body); font-size: 1.0625rem; font-weight: 600; }
p, li { max-width: 68ch; }
small { font-size: .875rem; }
code, kbd { font-family: var(--font-mono); font-size: .875em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
abbr[title] { text-decoration: underline dotted; text-decoration-thickness: 1px; }

.wrap { width: min(1120px, 100% - 2 * clamp(20px, 5vw, 56px)); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -8rem; z-index: 20; padding: .7rem 1rem; background: var(--accent-deep); color: var(--accent-ink); text-decoration: none; border-radius: var(--radius); }
.skip:focus { top: 1rem; outline-color: var(--text); }

/* ---------- type roles ---------- */
.eyebrow {
  font-family: var(--font-mono); font-size: .6875rem; font-weight: 400; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 14px;
}
.eyebrow .sep { color: var(--muted); padding-inline: .5em; }
.tech { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .04em; color: var(--text-2); }
.lead { font-family: var(--font-display); font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.4; color: var(--text); max-width: 34em; }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3 { margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: .6em; }
.prose p, .prose li { color: var(--text-2); }
.prose p strong, .prose li strong { color: var(--text); font-weight: 500; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose blockquote { margin: 1.5em 0; padding-left: 1.1em; border-left: 2px solid var(--geometry); font-family: var(--font-display); font-size: 1.25rem; line-height: 1.45; color: var(--text); }
.measure { max-width: 68ch; }
.muted { color: var(--muted); }
.confirm { font-family: var(--font-mono); font-size: .8em; color: var(--warn); border: 1px dashed var(--warn); border-radius: 3px; padding: 0 .4em; white-space: normal; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--canvas); }
.site-header .wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 28px; min-height: 76px; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font: 500 1.375rem/1 var(--font-display); letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.mark { width: 28px; height: 31px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.2; }
.mark .inner { stroke: var(--geometry); }
.mark circle { fill: var(--accent); stroke: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-left: auto; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--text-2); font-size: .9rem; text-decoration: none; border-radius: var(--radius); }
.site-nav a:hover { color: var(--text); background: var(--raised); }
.site-nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent-deep); border-radius: 0; }
.site-nav a.nav-cta { color: var(--accent); }
.theme-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 6px 12px; background: transparent; color: var(--text-2); border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: .8rem; transition: background-color var(--d1) var(--ease), color var(--d1) var(--ease); }
.theme-btn:hover { color: var(--text); background: var(--raised); }
.theme-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.theme-btn svg path { fill: currentColor; stroke: none; }

/* ---------- hero + atlas ---------- */
.hero { position: relative; isolation: isolate; padding-block: clamp(40px, 7vw, 88px) clamp(28px, 4vw, 56px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background:
    radial-gradient(1.4px 1.4px at 8% 22%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 23% 78%, var(--star) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 41% 12%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 57% 64%, var(--star) 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 88% 18%, var(--star) 50%, transparent 51%),
    radial-gradient(1px 1px at 94% 82%, var(--star) 50%, transparent 51%),
    radial-gradient(120% 90% at 85% 0%, var(--wash) 0%, transparent 60%);
}
.hero h1 { margin: 14px 0 20px; }
.hero h1 .point { color: var(--accent); }
.hero .lead { color: var(--text-2); }
.hero .lead strong { color: var(--text); font-weight: 400; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-top: 28px; }

.atlas { position: relative; width: 100%; aspect-ratio: 4 / 3; min-width: 0; }
.atlas-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.atlas-lines path, .atlas-lines line { fill: none; stroke: var(--accent); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: .38; }
.atlas-lines .guide { stroke: var(--geometry); stroke-dasharray: 2 6; opacity: .55; }
.atlas-lines .dust { fill: var(--star); stroke: none; opacity: .5; }
.atlas-lines .ring { fill: none; stroke: var(--geometry); stroke-width: .8; opacity: .55; vector-effect: non-scaling-stroke; }
.atlas-stars { list-style: none; margin: 0; padding: 0; }
.atlas-stars li { position: absolute; width: 0; height: 0; }
.s-services { left: 18%; top: 28%; }
.s-method { left: 42%; top: 14%; }
.s-work { left: 68%; top: 30%; }
.s-about { left: 30%; top: 66%; }
.s-contact { left: 74%; top: 70%; }
.star {
  position: absolute; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  text-decoration: none; color: var(--text); transform: translate(-8px, -50%); padding: 6px 8px 6px 0; min-height: 44px;
}
.s-work .star, .s-contact .star { flex-direction: row-reverse; transform: translate(calc(-100% + 8px), -50%); padding: 6px 0 6px 8px; }
.star .dot { position: relative; width: 16px; height: 16px; flex: none; }
.star .dot::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--star); box-shadow: 0 0 0 3px var(--canvas), 0 0 0 4px var(--geometry); transition: transform var(--d2) var(--ease), box-shadow var(--d2) var(--ease); }
.star .lab { font-family: var(--font-display); font-size: 1.25rem; line-height: 1; letter-spacing: -.01em; border-bottom: 1px solid transparent; transition: border-color var(--d1) var(--ease), color var(--d1) var(--ease); }
.star .sub { display: none; }
.star:hover .lab, .star:focus-visible .lab { color: var(--accent); border-bottom-color: var(--geometry); }
.star:hover .dot::before, .star:focus-visible .dot::before { transform: scale(1.25); box-shadow: 0 0 0 3px var(--canvas), 0 0 0 4px var(--accent), 0 0 18px 2px var(--wash); }
.star.is-contact .lab { color: var(--accent); }
.atlas-caption { position: absolute; left: 0; bottom: -6px; margin: 0; color: var(--muted); }
html[data-motion="active"] .atlas-lines .draw { stroke-dasharray: 1; pathLength: 1; animation: draw 2.4s var(--ease) both; }
html[data-motion="active"] .twinkle { animation: twinkle 7s ease-in-out infinite; }
html[data-motion="active"] .twinkle:nth-child(2n) { animation-delay: -2.3s; }
html[data-motion="active"] .twinkle:nth-child(3n) { animation-delay: -4.6s; }
@keyframes draw { from { stroke-dashoffset: 1; opacity: 0; } to { stroke-dashoffset: 0; } }
@keyframes twinkle { 0%, 100% { opacity: .25; } 50% { opacity: .75; } }
.motion-btn { background: none; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; color: var(--text-2); min-height: 44px; padding: 4px 2px; font: .72rem var(--font-mono); letter-spacing: .04em; }
.motion-btn:hover { color: var(--text); }

/* ---------- sections ---------- */
.section { padding-block: clamp(48px, 7vw, 88px); border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 18px; margin-bottom: clamp(28px, 4vw, 44px); }
.section-head p:not(.eyebrow) { color: var(--text-2); max-width: 60ch; }
@media (min-width: 900px) {
  .section-head.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
  .section-head.split .eyebrow { grid-column: 1 / -1; margin-bottom: 0; }
}
.two-col { display: grid; gap: clamp(28px, 5vw, 64px); }
@media (min-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); } }
.aside-note { align-self: start; border-top: 1px solid var(--line); padding-top: 20px; color: var(--text-2); font-size: .95rem; }
.aside-note strong { color: var(--text); font-weight: 500; }
.sticky { position: sticky; top: 24px; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.card { min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card h3 { font-size: 1.5rem; }
.card p { color: var(--text-2); font-size: .95rem; }
.card .tech { color: var(--muted); }
.card .more { margin-top: auto; padding-top: 8px; }
.card-mark { width: 40px; height: 40px; fill: none; stroke: var(--accent); stroke-width: 1; }
.card-mark circle { fill: var(--accent); stroke: none; }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card.is-door { position: relative; }
.card.is-door a.door { color: var(--text); text-decoration: none; }
.card.is-door a.door::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card.is-door:hover { border-color: var(--line-strong); }
.card.is-door:hover a.door { color: var(--accent); }
.card.is-door:has(a.door:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.card.is-door a.door:focus-visible { outline: none; }
.arrow { display: inline-block; margin-left: .3em; transition: transform var(--d1) var(--ease); }
a:hover .arrow { transform: translateX(3px); }

/* links & buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 44px; padding: 10px 18px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); text-decoration: none; font-size: .95rem; font-weight: 500; transition: background-color var(--d1) var(--ease), border-color var(--d1) var(--ease), color var(--d1) var(--ease); }
.btn:hover { background: var(--raised); color: var(--text); border-color: var(--text-2); }
.btn-primary { background: var(--accent-deep); color: var(--accent-ink); border-color: var(--accent-deep); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); border-color: var(--accent-hover); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--accent); }
.btn-quiet:hover { background: var(--raised); color: var(--accent-hover); border-color: transparent; }
.text-link { display: inline-flex; align-items: center; gap: .4em; min-height: 44px; text-decoration: none; font-weight: 500; }
.text-link:hover { text-decoration: underline; }
.btn:disabled { opacity: .55; cursor: progress; }

/* figures strip */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.figures > div { background: var(--surface); padding: 18px 18px 16px; min-width: 0; }
.figures .n { display: block; font-family: var(--font-display); font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.figures .k { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.figures-note { margin-top: 10px; color: var(--muted); font-size: .85rem; }

/* evidence marks */
.ev { display: inline-flex; align-items: center; gap: .4em; vertical-align: middle; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; line-height: 1.4; padding: 1px 7px; border: 1px solid var(--line-strong); border-radius: 3px; color: var(--text-2); white-space: nowrap; background: var(--surface); }
.ev::before { font-family: var(--font-mono); font-size: .9em; }
.ev-written::before { content: "\25CB"; }
.ev-tested::before { content: "\25C6"; color: var(--accent); }
.ev-deployed::before { content: "\25CF"; color: var(--accent); }
.ev-checked::before { content: "\2713"; color: var(--accent); }
.ev-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px 24px; margin: 0; padding: 20px 0; border-block: 1px solid var(--line); }
.ev-legend > div { display: grid; gap: 6px; min-width: 0; }
.ev-legend dt { font-size: .95rem; }
.ev-legend dd { color: var(--text-2); font-size: .9rem; }

/* phases strip */
.phases { display: flex; flex-wrap: wrap; gap: 8px 0; list-style: none; margin: 0; padding: 0; align-items: center; }
.phases li { display: inline-flex; align-items: center; max-width: none; }
.phases li + li::before { content: "\2192"; display: inline-block; margin: 0 8px; color: var(--muted); }
.phases .ph { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .03em; padding: 6px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.phases .is-key .ph { border-color: var(--accent-deep); color: var(--accent); }
.phases-note { margin-top: 12px; color: var(--text-2); font-size: .9rem; }

/* folds (details) */
.fold { border-top: 1px solid var(--line); }
.fold:last-of-type { border-bottom: 1px solid var(--line); }
.fold summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 12px 0; cursor: pointer; list-style: none; font-family: var(--font-display); font-size: 1.25rem; color: var(--text); }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: "+"; flex: none; width: 28px; height: 28px; display: inline-grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; font-family: var(--font-mono); font-size: 1rem; color: var(--text-2); transition: transform var(--d2) var(--ease); }
.fold[open] summary::after { content: "\2212"; }
.fold summary:hover { color: var(--accent); }
.fold .fold-body { padding: 4px 0 24px; }
.fold .fold-body > * + * { margin-top: .8em; }
.fold .fold-body p, .fold .fold-body li { color: var(--text-2); }
.fold .fold-body ul { padding-left: 1.2em; }

/* table */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); padding: 10px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; max-width: none; }
.table-wrap { overflow-x: auto; max-width: 100%; }

/* ---------- forms ---------- */
.form { max-width: 640px; }
fieldset { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
legend { padding: 0; font-family: var(--font-display); font-size: 1.375rem; margin-bottom: 14px; color: var(--text); }
.field { display: grid; gap: 6px; margin-bottom: 20px; }
.field > label, .choices-label { font-weight: 500; font-size: .95rem; }
.hint { color: var(--text-2); font-size: .875rem; }
.req { color: var(--accent); font-weight: 400; }
.input, .select, .textarea, input[type="date"], input[type="time"] {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color var(--d1) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-2); }
.textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.select { appearance: none; -webkit-appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:user-invalid, .textarea:user-invalid, .select:user-invalid { border-color: var(--bad); }
.field .error { color: var(--bad); font-size: .875rem; }
.field .error:empty { display: none; }
.choices { display: grid; gap: 8px; }
.choices.cols { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; min-width: 0; max-width: none; transition: border-color var(--d1) var(--ease); }
.choice:hover { border-color: var(--line-strong); }
.choice:has(:checked) { border-color: var(--accent-deep); background: var(--raised); }
.choice:has(:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice input { margin: .25em 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--accent-deep); }
.choice input:focus-visible { outline: none; }
.choice .ctext { display: grid; gap: 2px; }
.choice .ctext small { color: var(--text-2); }
.slots { display: grid; gap: 16px; }
.slot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.slot .slot-title { grid-column: 1 / -1; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.slot .field { margin: 0; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 8px; }
.form-foot { margin-top: 16px; color: var(--muted); font-size: .85rem; }
.form-status { margin-top: 16px; }
.form-status:empty { display: none; }
.notice { padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent-deep); border-radius: var(--radius); background: var(--surface); color: var(--text-2); }
.notice strong { color: var(--text); }
.notice.is-ok { border-left-color: var(--ok); }
.notice.is-bad { border-left-color: var(--bad); }
.notice.is-warn { border-left-color: var(--warn); }
.notice > * + * { margin-top: .5em; }

/* guided steps (JS enhances; without JS every step is visible) */
.stepper { display: none; }
.form[data-js] .stepper { display: flex; flex-wrap: wrap; gap: 6px 0; list-style: none; margin: 0 0 28px; padding: 0; }
.stepper li { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .04em; color: var(--muted); max-width: none; }
.stepper li + li::before { content: ""; display: inline-block; width: 22px; height: 1px; background: var(--line-strong); margin: 0 8px; }
.stepper li[aria-current="step"] { color: var(--accent); }
.stepper li.is-done { color: var(--text-2); }
.stepper li .num { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border: 1px solid currentColor; border-radius: 50%; font-size: .7rem; }
.stepper li.is-done .num::before { content: "\2713"; }
.stepper li.is-done .num span { display: none; }
.form[data-js] .step:not(.is-current) { display: none; }
.form[data-js] .step-nav { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.step-nav { display: none; }
.form[data-js] .form-actions.final { display: none; }
.form[data-js] .step.is-last .form-actions.final { display: flex; }
.summary { display: grid; gap: 8px; margin: 0 0 20px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.summary > div { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr); gap: 6px 12px; font-size: .92rem; }
.summary dt { color: var(--text-2); }
.summary dd { color: var(--text); overflow-wrap: anywhere; }

/* thanks page, keyed on :target */
.thanks-kind { display: none; }
.thanks-kind:target { display: block; }
.thanks-generic:has(~ .thanks-kind:target) { display: none; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 34px 28px; color: var(--muted); font-size: .85rem; }
.site-footer .wrap { display: grid; gap: 22px; }
@media (min-width: 760px) { .site-footer .wrap { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); } }
.site-footer p { max-width: 44ch; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.site-footer li { max-width: none; }
.site-footer a { display: inline-flex; align-items: center; min-height: 36px; color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer .foot-title { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.site-footer .motto { font-family: var(--font-display); font-size: 1.05rem; color: var(--text-2); margin-top: 8px; }
.site-footer .members { font-size: .8rem; color: var(--muted); }

/* ---------- utility pages ---------- */
.page-head { padding-block: clamp(40px, 6vw, 72px) clamp(20px, 3vw, 36px); }
.page-head h1 { margin: 12px 0 18px; }
.page-head .lead { color: var(--text-2); }
.error-page .page-head { padding-block: 96px 40px; }
.review-table td a { color: var(--accent); }
.review-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.status-pill { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; padding: 1px 7px; border: 1px solid var(--line-strong); border-radius: 3px; color: var(--text-2); }
.status-pill.is-new { border-color: var(--accent-deep); color: var(--accent); }
.kv { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr); gap: 8px 16px; }
.kv dt { color: var(--text-2); font-size: .9rem; }
.kv dd { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- responsive ---------- */
@media (max-width: 899px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .atlas { max-width: 560px; }
}
@media (max-width: 719px) {
  .site-nav { width: 100%; margin-left: 0; order: 3; gap: 0 2px; }
  .site-nav a { padding: 0 8px; font-size: .86rem; }
  .theme-btn { margin-left: auto; }
  /* The atlas becomes a plain list of stars: same markup, no absolute positioning. */
  .atlas { aspect-ratio: auto; max-width: none; margin-top: 8px; }
  .atlas-lines { display: none; }
  .atlas-stars { display: grid; gap: 2px; border-top: 1px solid var(--line); }
  .atlas-stars li { position: static; width: auto; height: auto; border-bottom: 1px solid var(--line); }
  .star, .s-work .star, .s-contact .star { position: static; transform: none; flex-direction: row; width: 100%; padding: 10px 4px; min-height: 52px; gap: 14px; }
  .star .lab { font-size: 1.2rem; }
  .star .sub { display: inline; margin-left: auto; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: normal; text-align: right; }
  .atlas-caption { position: static; margin-top: 10px; }
  .slot { grid-template-columns: 1fr; }
  .kv, .summary > div { grid-template-columns: 1fr; gap: 2px 0; }
  .ev-legend { gap: 12px; }
}
@media (max-width: 400px) {
  .site-nav a { padding: 0 6px; font-size: .82rem; }
  .brand { font-size: 1.25rem; }
}

/* ---------- motion & contrast preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .motion-btn { display: none !important; }
}
@media (forced-colors: active) {
  .mark, .card-mark, .atlas-lines path, .atlas-lines line, .atlas-lines .ring { stroke: CanvasText; }
  .mark circle, .card-mark circle, .atlas-lines .dust { fill: CanvasText; }
  .star .dot::before { background: CanvasText; box-shadow: none; }
  .btn, .choice, .ev, .status-pill { border-color: CanvasText; }
  .site-nav a[aria-current="page"] { text-decoration: underline; }
}
@media print {
  .site-header, .site-footer, .theme-btn, .motion-btn, .hero::before, .atlas-lines, .skip { display: none !important; }
  body { background: #fff; color: #191520; }
  a { color: #191520; }
  .fold .fold-body { display: block; }
}
