/* ==========================================================================
   Portfolio design system — implements DESIGN.md (the design source of truth).
   Tokens first, then base, then components, then page patterns.
   ========================================================================== */

/* ── Fonts (self-hosted, DESIGN.md §4) ──────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  src: url("../fonts/InterVariable.2bf3d951bf9d.woff2") format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  /* Spacing scale — DESIGN.md §3. Never use arbitrary values. */
  --sp-4: 4px;   --sp-8: 8px;   --sp-12: 12px; --sp-16: 16px;
  --sp-20: 20px; --sp-24: 24px; --sp-32: 32px; --sp-40: 40px;
  --sp-48: 48px; --sp-64: 64px; --sp-80: 80px; --sp-96: 96px; --sp-128: 128px;

  /* Type scale — DESIGN.md §4 */
  --fs-display: clamp(40px, 6vw, 60px);
  --fs-h1: clamp(34px, 5vw, 48px);
  --fs-h2: clamp(30px, 4vw, 40px);
  --fs-h3: clamp(26px, 3.2vw, 32px);
  --fs-h4: 24px;
  --fs-h5: 20px;
  --fs-body-lg: 18px;
  --fs-body: 16px;
  --fs-small: 14px;
  --fs-caption: 12px;
  --lh-heading: 1.1;
  --lh-body: 1.6;

  /* Radii — one system: 12 default, 8 small, 16 large */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;

  /* Motion — DESIGN.md §6 */
  --t-fast: 120ms; --t-std: 180ms; --t-comfy: 240ms; --t-complex: 320ms;
  --ease: cubic-bezier(0.25, 0.6, 0.35, 1);

  /* Layout */
  --max-w: 1180px;
  --reading-w: 700px;
  --nav-h: 76px;

  /* Engineering voice — mono for labels, meta, and the terminal */
  --font-mono: 'Cascadia Code', 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  color-scheme: dark;

  /* Dark theme (default) — softened neutrals, never pure black */
  --bg: #101214;
  --bg-elevated: #14171a;
  --surface: #181c20;
  --surface-2: #1f242a;
  --border: #272d34;
  --border-strong: #333b44;
  --text: #e8eaed;
  --text-2: #a3abb5;
  --text-3: #858f9b; /* AA 4.5:1 on every dark surface, incl. --surface-2 */
  --accent: #6b9aef;
  --accent-strong: #8db1f4;
  --accent-soft: rgba(107, 154, 239, 0.12);
  --on-accent: #0e1116;
  --danger: #e5757a;
  --success: #7bc79a;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-drop: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-modal: 0 16px 48px rgba(0, 0, 0, 0.45);
}

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f3f3f0;
  --bg-elevated: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f1f1ef;
  --border: #e5e5e1;
  --border-strong: #d4d4cf;
  --text: #1d2126;
  --text-2: #555c66;
  --text-3: #676e78; /* AA 4.5:1 on every light surface, incl. --surface-2 */
  --accent: #2f5fd0;
  --accent-strong: #244daf;
  --accent-soft: rgba(47, 95, 208, 0.09);
  --danger: #c23b41;
  --success: #22794a;
  --shadow-card: 0 1px 2px rgba(20, 22, 26, 0.06);
  --shadow-drop: 0 8px 24px rgba(20, 22, 26, 0.1);
  --shadow-modal: 0 16px 48px rgba(20, 22, 26, 0.16);
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5 {
  margin: 0 0 var(--sp-16);
  line-height: var(--lh-heading);
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-h5); }

p { margin: 0 0 var(--sp-24); max-width: 70ch; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: var(--accent-soft); }

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

.skip-link {
  position: absolute; top: -100px; left: var(--sp-16); z-index: 100;
  padding: var(--sp-12) var(--sp-16);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text);
}
.skip-link:focus { top: var(--sp-16); }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--sp-24); }

.section { padding: var(--sp-96) 0; }
.section--tight { padding: var(--sp-64) 0; }

.section-head { margin-bottom: var(--sp-48); }
.section-head .kicker, .kicker {
  display: inline-flex; align-items: center; gap: var(--sp-12); margin-bottom: var(--sp-8);
  font-family: var(--font-mono); font-size: var(--fs-small); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
}
.section-head .kicker::after, .kicker::after {
  content: ''; width: 48px; height: 1px; background: var(--border-strong);
}
.section-head p { color: var(--text-2); font-size: var(--fs-body-lg); }

.grid { display: grid; gap: var(--sp-24); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }

/* ── Navigation (DESIGN.md §8: invisible and predictable) ───────────────── */
.site-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--t-std) var(--ease), border-color var(--t-std) var(--ease);
}
.site-nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.site-nav .container { display: flex; align-items: center; gap: var(--sp-24); width: 100%; }
.nav-brand {
  display: inline-flex; align-items: center; gap: var(--sp-12);
  font-weight: 600; color: var(--text); font-size: var(--fs-body-lg);
}
.nav-brand::before {
  content: ''; width: 10px; height: 10px; border-radius: 3px;
  background: var(--accent); flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; gap: var(--sp-4); margin-left: auto; list-style: none; padding: 0; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 var(--sp-16); border-radius: var(--r-sm);
  color: var(--text-2); font-size: var(--fs-small); font-weight: 500;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current='page'] { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: var(--sp-8); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--r-sm);
  background: none; border: none; cursor: pointer; color: var(--text-2);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

.nav-toggle { display: none; }

/* Mobile drawer */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-drawer {
    position: fixed; inset: var(--nav-h) 0 0 0; z-index: 49;
    background: var(--bg); padding: var(--sp-24);
    display: none; flex-direction: column; gap: var(--sp-4);
  }
  .nav-drawer.is-open { display: flex; }
  .nav-drawer a {
    display: flex; align-items: center; min-height: 48px;
    padding: 0 var(--sp-16); border-radius: var(--r-md);
    color: var(--text); font-size: var(--fs-body-lg); font-weight: 500;
  }
  .nav-drawer a:hover { background: var(--surface-2); }
  body.drawer-open { overflow: hidden; }
}
@media (min-width: 861px) { .nav-drawer { display: none !important; } }

/* ── Buttons (DESIGN.md §7: min 44px, priority communicates) ────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-8);
  min-height: 44px; padding: 0 var(--sp-24);
  border-radius: var(--r-md); border: 1px solid transparent;
  font-size: var(--fs-body); font-weight: 500; font-family: inherit;
  cursor: pointer; text-decoration: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn .icon { transition: transform var(--t-fast) var(--ease); }
.btn:hover .icon { transform: translateX(3px); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover {
  background: var(--accent-strong); color: var(--on-accent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 30%, transparent);
}
html[data-theme='light'] .btn--primary { color: #ffffff; }
.btn--secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { border-color: var(--text-3); background: var(--surface-2); color: var(--text); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { color: var(--text); background: var(--surface-2); }
.btn .icon { flex-shrink: 0; }

/* ── Cards (border-first, one idea per card) ────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-24);
  box-shadow: var(--shadow-card);
  transition: border-color var(--t-std) var(--ease), transform var(--t-std) var(--ease);
}
a.card { display: block; color: inherit; }
a.card:hover { border-color: var(--border-strong); transform: translateY(-2px); color: inherit; }

/* Project cards */
.project-card { padding: 0; overflow: hidden; }
.project-card .thumb {
  aspect-ratio: 3 / 2; overflow: hidden;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.project-card .thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--t-comfy) var(--ease);
}
a.project-card:hover .thumb img { transform: scale(1.03); }
.project-card .body { padding: var(--sp-24); }
.project-card h3 { font-size: var(--fs-h5); margin-bottom: var(--sp-8); }
.project-card .desc { color: var(--text-2); font-size: var(--fs-small); margin-bottom: var(--sp-16); }

/* Chips (filters, tech stack) */
.chip {
  display: inline-flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-12); border-radius: 999px;
  border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: var(--fs-caption); font-weight: 500;
  color: var(--text-2); background: var(--surface);
}
.chip--accent { color: var(--accent); border-color: transparent; background: var(--accent-soft); }
a.chip { min-height: 32px; transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
a.chip:hover { border-color: var(--border-strong); color: var(--text); }
a.chip.is-active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.chip-row { display: flex; flex-wrap: wrap; gap: var(--sp-8); }

/* ── Hero (DESIGN.md §8: specific, 5-second value) ──────────────────────── */
.hero {
  position: relative;
  min-height: 72vh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + var(--sp-64)) 0 var(--sp-80);
  overflow: hidden;
}
/* Depth without decoration: a faint accent wash + engineering blueprint
   grid that fades out — technical, calm, works in both themes. */
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(760px 520px at 82% 8%, var(--accent-soft), transparent 70%);
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent 78%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent 78%);
}
.hero .container { position: relative; z-index: 1; }

.badge-avail {
  display: inline-flex; align-items: center; gap: var(--sp-8);
  padding: 6px 14px; margin-bottom: var(--sp-24);
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow-card);
  font-family: var(--font-mono); font-size: var(--fs-caption); color: var(--text-2);
}
.badge-avail .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  animation: avail-pulse 2.4s var(--ease) infinite;
}
@keyframes avail-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 45%, transparent); }
  60% { box-shadow: 0 0 0 6px transparent; }
}

.hero .greeting { color: var(--accent); font-weight: 500; margin-bottom: var(--sp-16); }
.hero h1 { font-size: var(--fs-display); font-weight: 700; letter-spacing: -0.025em; max-width: 17ch; }
.hero h1 .accent { color: var(--accent); }
.hero .titles {
  display: flex; align-items: center; gap: var(--sp-12);
  min-height: 32px; color: var(--accent); font-size: var(--fs-h5);
  font-weight: 500; margin-bottom: var(--sp-16);
}
.hero .titles::before { content: ''; width: 32px; height: 1px; background: var(--accent); flex-shrink: 0; }
.hero .titles .title-item { transition: opacity var(--t-complex) var(--ease); }
.hero .intro { color: var(--text-2); font-size: var(--fs-body-lg); max-width: 56ch; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: var(--sp-16); margin-top: var(--sp-40); }

.hero-stats { display: flex; flex-wrap: wrap; margin-top: var(--sp-48); }
.hero-stats .stat { padding-right: var(--sp-48); }
.hero-stats .stat + .stat { border-left: 1px solid var(--border); padding-left: var(--sp-48); }
.hero-stats .num {
  font-size: var(--fs-h3); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.hero-stats .num .accent { color: var(--accent); }
.hero-stats .lbl {
  margin-top: var(--sp-4); font-family: var(--font-mono);
  font-size: var(--fs-caption); color: var(--text-3);
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* ── Terminal panel (hero) — authentic, self-made, unapologetically nerdy ── */
.terminal {
  width: 100%; max-width: 500px;
  border-radius: var(--r-lg);
  border: 1px solid #2a333f;
  background: #0b0e12;
  box-shadow: var(--shadow-drop), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.terminal-bar {
  display: flex; align-items: center; gap: var(--sp-8);
  padding: var(--sp-12) var(--sp-16);
  background: #11151b; border-bottom: 1px solid #232b36;
}
.terminal-bar .t-dot { width: 11px; height: 11px; border-radius: 50%; background: #2e3946; }
.terminal-bar .t-dot:nth-child(1) { background: #e0655f; }
.terminal-bar .t-dot:nth-child(2) { background: #e0b054; }
.terminal-bar .t-dot:nth-child(3) { background: #6cbf7c; }
.terminal-title {
  margin-left: var(--sp-8);
  font-family: var(--font-mono); font-size: var(--fs-caption); color: #5d6b7c;
}
.terminal-body {
  margin: 0; padding: var(--sp-20) var(--sp-20) var(--sp-24);
  font-family: var(--font-mono); font-size: 13px; line-height: 1.75;
  color: #aab6c4; white-space: pre-wrap; word-break: break-word;
  min-height: 220px;
}
.terminal-body .t-cmd { color: #e8eaed; }
.terminal-body .t-cmd::before { content: '$ '; color: #6b9aef; }
.terminal-body .t-ok { color: #7bc79a; }
.terminal-body .t-out { color: #8db1f4; }
.terminal-body .t-cursor {
  display: inline-block; width: 8px; height: 15px;
  background: #6b9aef; vertical-align: -2px;
  animation: t-blink 1.1s steps(1) infinite;
}
@keyframes t-blink { 50% { opacity: 0; } }
@media (max-width: 860px) { .terminal { max-width: 100%; } }

.scroll-cue {
  position: absolute; left: 50%; bottom: var(--sp-20); transform: translateX(-50%);
  color: var(--text-3); z-index: 1;
}
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-64); align-items: center; }
.hero-photo img {
  width: 280px; height: 280px; object-fit: cover;
  border-radius: var(--r-lg); border: 1px solid var(--border);
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--sp-40); }
  .hero-photo { order: -1; }
  .hero-photo img { width: 160px; height: 160px; }
}

/* ── Timeline (experience, education, journey) ──────────────────────────── */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 1px; background: var(--border-strong);
}
.timeline li { position: relative; padding: 0 0 var(--sp-40) var(--sp-40); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: 0; top: 8px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.timeline .when { font-size: var(--fs-small); color: var(--text-3); margin-bottom: var(--sp-4); }
.timeline h3 { font-size: var(--fs-h5); margin-bottom: var(--sp-4); }
.timeline .where { color: var(--text-2); font-size: var(--fs-small); margin-bottom: var(--sp-12); }
.timeline p { color: var(--text-2); font-size: var(--fs-small); }

/* ── Skills ─────────────────────────────────────────────────────────────── */
.skill-group h3 {
  font-size: var(--fs-small); font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: var(--sp-16);
}
.skill-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-16);
  padding: var(--sp-12) 0; border-bottom: 1px solid var(--border);
}
.skill-item .name { font-weight: 500; }
.skill-item .level { font-size: var(--fs-caption); color: var(--text-3); }

/* ── Article / prose (blog, stories, project detail) ────────────────────── */
.article-head { padding: calc(var(--nav-h) + var(--sp-64)) 0 var(--sp-48); }
.article-head .meta {
  display: flex; flex-wrap: wrap; gap: var(--sp-16);
  color: var(--text-3); font-size: var(--fs-small); margin-top: var(--sp-16);
}
.article-head .meta span { display: inline-flex; align-items: center; gap: var(--sp-4); }

.reading { max-width: var(--reading-w); margin: 0 auto; padding: 0 var(--sp-24); }

.prose { font-size: var(--fs-body-lg); }
.prose h2 { font-size: var(--fs-h4); margin: var(--sp-48) 0 var(--sp-16); }
.prose h3 { font-size: var(--fs-h5); margin: var(--sp-32) 0 var(--sp-16); }
.prose img { border-radius: var(--r-md); border: 1px solid var(--border); margin: var(--sp-32) 0; }
.prose blockquote {
  margin: var(--sp-32) 0; padding: var(--sp-4) var(--sp-24);
  border-left: 2px solid var(--accent); color: var(--text-2);
}
.prose ul, .prose ol { padding-left: var(--sp-24); margin: 0 0 var(--sp-24); }
.prose li { margin-bottom: var(--sp-8); }
.prose code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.875em; background: var(--surface-2);
  padding: 2px 6px; border-radius: var(--r-sm) ;
}
.prose .codehilite {
  margin: var(--sp-32) 0; padding: var(--sp-20) var(--sp-24);
  border-radius: var(--r-md); border: 1px solid var(--border);
  overflow-x: auto; font-size: var(--fs-small); line-height: 1.55;
}
.prose .codehilite code { background: none; padding: 0; font-size: inherit; }
.prose .codehilite pre { margin: 0; }
.prose table { border-collapse: collapse; width: 100%; margin: var(--sp-32) 0; font-size: var(--fs-small); }
.prose th, .prose td { border: 1px solid var(--border); padding: var(--sp-8) var(--sp-12); text-align: left; }

/* Scroll progress (blog/story detail) */
.scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 60;
  height: 2px; width: 0; background: var(--accent);
}

/* ── Article list rows ──────────────────────────────────────────────────── */
.post-row {
  display: block; padding: var(--sp-24) 0;
  border-bottom: 1px solid var(--border); color: inherit;
}
.post-row:hover h3 { color: var(--accent); }
.post-row h3 { font-size: var(--fs-h5); margin-bottom: var(--sp-8); transition: color var(--t-fast) var(--ease); }
.post-row .excerpt { color: var(--text-2); font-size: var(--fs-small); margin-bottom: var(--sp-8); }
.post-row .meta { color: var(--text-3); font-size: var(--fs-caption); display: flex; gap: var(--sp-16); }

/* ── Testimonials ───────────────────────────────────────────────────────── */
.testimonial .stars { color: var(--accent); display: flex; gap: 2px; margin-bottom: var(--sp-16); }
.testimonial blockquote { margin: 0 0 var(--sp-16); color: var(--text-2); }
.testimonial .who { display: flex; align-items: center; gap: var(--sp-12); }
.testimonial .who img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.testimonial .who .name { font-weight: 500; font-size: var(--fs-small); }
.testimonial .who .role { color: var(--text-3); font-size: var(--fs-caption); }

/* ── FAQ ────────────────────────────────────────────────────────────────── */
.faq-item {
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); margin-bottom: var(--sp-12);
}
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-16);
  padding: var(--sp-20) var(--sp-24); cursor: pointer;
  font-weight: 500; list-style: none; min-height: 44px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { transition: transform var(--t-std) var(--ease); flex-shrink: 0; color: var(--text-3); }
.faq-item[open] summary .icon { transform: rotate(180deg); }
.faq-item .answer { padding: 0 var(--sp-24) var(--sp-20); color: var(--text-2); }

/* ── Forms (DESIGN.md §7: labels above, 48px, calm validation) ──────────── */
.field { margin-bottom: var(--sp-24); }
.field label { display: block; font-size: var(--fs-small); font-weight: 500; margin-bottom: var(--sp-8); }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: var(--sp-12) var(--sp-16);
  font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast) var(--ease);
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field .error { display: block; margin-top: var(--sp-8); font-size: var(--fs-small); color: var(--danger); }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }

.form-banner {
  display: flex; align-items: center; gap: var(--sp-12);
  padding: var(--sp-16) var(--sp-20); margin-bottom: var(--sp-32);
  border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--surface); font-size: var(--fs-small);
}
.form-banner.success { border-color: color-mix(in srgb, var(--success) 40%, transparent); color: var(--success); }

/* Honeypot — hidden from humans, present for bots */
.hp-field { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

/* ── Footer (calm and minimal) ──────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-64) 0; margin-top: var(--sp-96);
  color: var(--text-2); font-size: var(--fs-small);
}
.site-footer .cols {
  display: flex; flex-wrap: wrap; gap: var(--sp-40);
  justify-content: space-between; align-items: flex-start;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--sp-16); }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--text); }
.site-footer .socials { display: flex; gap: var(--sp-8); }
.site-footer .fineprint { margin-top: var(--sp-40); color: var(--text-3); font-size: var(--fs-caption); }

/* ── Gallery ────────────────────────────────────────────────────────────── */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-24); }
@media (max-width: 640px) { .gallery { grid-template-columns: 1fr; } }
.gallery figure { margin: 0; }
.gallery img { border-radius: var(--r-md); border: 1px solid var(--border); width: 100%; }
.gallery figcaption { margin-top: var(--sp-8); font-size: var(--fs-caption); color: var(--text-3); }

/* ── Empty & error states (calm, explain why, offer next step) ──────────── */
.empty-state {
  text-align: center; padding: var(--sp-80) var(--sp-24);
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
  color: var(--text-2);
}
.empty-state h3 { color: var(--text); }

.error-page {
  min-height: 70vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: var(--nav-h) var(--sp-24) var(--sp-64);
}
.error-page .code { font-size: var(--fs-caption); letter-spacing: 0.1em; color: var(--text-3); margin-bottom: var(--sp-16); }
.error-page p { color: var(--text-2); }

/* Theme toggle icon visibility */
.theme-icon--sun { display: none; }
html[data-theme='light'] .theme-icon--sun { display: inline; }
html[data-theme='light'] .theme-icon--moon { display: none; }

/* ── Reveal on scroll (max 16px translate, group reveals) ───────────────── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--t-complex) var(--ease), transform var(--t-complex) var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

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