/* InterviewAI — IELTS Practice design system
   Dark, blue-tinted. Accent gradient violet → cyan. Signature: band gauge. */

:root {
  --bg: #0a0a12;
  --surface: #16162a;
  --surface-2: #1d1d36;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.16);
  --text: #e7e7f0;
  --muted: #9a9ab0;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --accent-grad: linear-gradient(120deg, #8b5cf6 0%, #22d3ee 100%);

  --red: #ef4444;
  --amber: #f59e0b;
  --green: #22c55e;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --maxw: 920px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(900px 500px at 80% -10%, rgba(139, 92, 246, 0.12), transparent 60%),
    radial-gradient(800px 500px at -10% 10%, rgba(34, 211, 238, 0.08), transparent 55%);
  background-attachment: fixed;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 0.4em; }
h2 { font-size: 1.35rem; margin: 0 0 0.5em; }
h3 { font-size: 1.05rem; margin: 0 0 0.4em; }
p { margin: 0 0 1em; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: var(--font-mono); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--surface); padding: 10px 14px; border-radius: var(--r-sm);
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Top nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 12px clamp(14px, 4vw, 32px);
  background: rgba(10, 10, 18, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.wordmark {
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  color: var(--text); text-decoration: none; letter-spacing: -0.02em;
}
.wordmark span {
  background: var(--accent-grad); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.nav-links { display: flex; gap: 6px; margin-left: 8px; }
.nav-links a {
  color: var(--muted); padding: 7px 12px; border-radius: var(--r-sm);
  text-decoration: none; font-size: 0.95rem;
}
.nav-links a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-links a.active { color: var(--text); background: var(--surface); }
.nav-cta { margin-left: auto; }

/* ---------- Layout ---------- */
#app { display: block; }
.page {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(14px, 4vw, 32px) 80px;
}
.lead { color: var(--muted); font-size: 1.05rem; max-width: 60ch; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stack { display: grid; gap: 14px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 10px 18px; border-radius: var(--r-md);
  border: 1px solid var(--hairline-strong); background: var(--surface); color: var(--text);
  text-decoration: none; transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-gradient {
  background: var(--accent-grad); color: #0a0a12; border: none;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.28);
}
.btn-gradient:hover { background: var(--accent-grad); filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 0.9rem; border-radius: var(--r-sm); }
.btn-danger { border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: clamp(16px, 3vw, 24px);
}
.card + .card { margin-top: 16px; }
.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.module-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: 22px; text-decoration: none; color: var(--text);
  position: relative; overflow: hidden; transition: border-color 0.15s ease, transform 0.1s ease;
}
.module-card:hover { border-color: var(--hairline-strong); transform: translateY(-2px); text-decoration: none; }
.module-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent-grad);
  opacity: 0.85;
}
.module-card .tag { font-size: 0.8rem; color: var(--muted); }
.module-card h3 { margin: 4px 0 2px; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
.field { margin-bottom: 16px; }
.field .hint { color: var(--muted); font-size: 0.85rem; margin-top: 5px; }
input[type="text"], input[type="password"], input[type="number"], input[type="url"],
select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--hairline-strong); border-radius: var(--r-md);
  padding: 11px 13px; outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}
.essay-area { min-height: 320px; font-size: 1.02rem; }

/* visible keyboard focus everywhere */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* segmented toggle */
.segmented { display: inline-flex; background: var(--bg); border: 1px solid var(--hairline-strong); border-radius: var(--r-md); padding: 3px; gap: 3px; }
.segmented button {
  font: inherit; font-weight: 600; cursor: pointer; border: none; background: transparent;
  color: var(--muted); padding: 7px 14px; border-radius: var(--r-sm);
}
.segmented button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--hairline-strong); color: var(--muted);
}
.pill.ok { color: var(--green); border-color: rgba(34, 197, 94, 0.4); }
.pill.warn { color: var(--amber); border-color: rgba(245, 158, 11, 0.4); }
.pill.err { color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }

/* ---------- Notices ---------- */
.notice { border-radius: var(--r-md); padding: 12px 14px; border: 1px solid var(--hairline-strong); background: var(--surface); }
.notice.error { border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.08); color: #fecaca; }
.notice.warn { border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.08); color: #fde68a; }
.notice.ok { border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.08); color: #bbf7d0; }

/* ---------- Code blocks ---------- */
pre.code {
  background: #0c0c18; border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: 14px 16px; overflow-x: auto; font-size: 0.86rem; line-height: 1.5; color: #cdd2ff;
}
pre.code .cmt { color: var(--muted); }

/* ---------- Empty state ---------- */
.empty {
  text-align: center; padding: 48px 24px; border: 1px dashed var(--hairline-strong);
  border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.015);
}
.empty h2 { margin-bottom: 6px; }

/* ---------- Examiner / Q&A ---------- */
.turn { border-left: 2px solid var(--hairline-strong); padding: 2px 0 2px 14px; margin-bottom: 14px; }
.turn .speaker { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.turn.examiner { border-color: var(--violet); }
.turn.candidate { border-color: var(--cyan); }
.examiner-q { font-family: var(--font-display); font-size: 1.15rem; margin: 4px 0 10px; }
.progress-dots { display: flex; gap: 6px; margin: 4px 0 16px; }
.progress-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--hairline-strong); }
.progress-dots i.done { background: var(--cyan); }
.progress-dots i.current { background: var(--violet); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25); }

/* ---------- Timer / word count ---------- */
.statbar { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat .v { font-family: var(--font-display); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat.warn .v { color: var(--amber); }
.stat.danger .v { color: var(--red); }

/* ---------- Band gauge ---------- */
.gauge { display: inline-grid; place-items: center; }
.gauge svg { display: block; }
.gauge-arc { transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.gauge-band { font-family: var(--font-display); font-weight: 700; font-size: 2.6rem; }
.gauge-label { font-family: var(--font-body); fill: var(--muted); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.gauge-sub { font-family: var(--font-body); fill: var(--muted); font-size: 0.72rem; }

.result-head { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.result-head .summary { flex: 1; min-width: 240px; }

/* criteria */
.criteria { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.crit {
  background: var(--surface-2); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 14px 16px;
}
.crit .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.crit .name { font-weight: 600; font-size: 0.95rem; }
.crit .band { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.crit .comment { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }
.crit.na .band { color: var(--muted); }

.feedback-list { display: grid; gap: 10px; }
.fb { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 12px 14px; }
.fb .quote { font-style: italic; color: var(--text); }
.fb .issue { color: #fca5a5; font-size: 0.9rem; margin-top: 4px; }
.fb .fix { color: var(--green); font-size: 0.9rem; margin-top: 2px; }

.two-col { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .two-col.reading { grid-template-columns: 1.1fr 1fr; align-items: start; } }

.passage { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 20px 22px; }
.passage h3 { font-size: 1.25rem; }
.passage p { line-height: 1.7; }
.passage.sticky { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; }

.q { border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 14px 16px; background: var(--surface); margin-bottom: 12px; }
.q .qnum { font-weight: 700; color: var(--violet); margin-right: 6px; }
.q .qtype { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.q .opt { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.q.correct { border-color: rgba(34, 197, 94, 0.5); }
.q.wrong { border-color: rgba(239, 68, 68, 0.5); }
.q .verdict { font-size: 0.85rem; margin-top: 8px; }
.q .verdict.correct { color: var(--green); }
.q .verdict.wrong { color: #fca5a5; }

/* history */
.hist-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.hist-row:last-child { border-bottom: none; }
.hist-row .meta { color: var(--muted); font-size: 0.85rem; }
.spark { display: block; }

/* spinner */
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: var(--cyan);
  animation: spin 0.7s linear infinite; display: inline-block; vertical-align: -3px;
}
.loading { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 24px 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* dividers + misc */
.hr { height: 1px; background: var(--hairline); border: none; margin: 22px 0; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.section-title h2 { margin: 0; }
ul.clean { margin: 0; padding-left: 1.1em; }
ul.clean li { margin-bottom: 6px; }
.kbd { font-family: var(--font-mono); background: var(--bg); border: 1px solid var(--hairline-strong); border-radius: 6px; padding: 1px 6px; font-size: 0.85em; }

@media (max-width: 620px) {
  .nav-links { display: none; }
  .gauge-band { font-size: 2.2rem; }
}

/* ---------- Speaking v2 (live exam) ---------- */
.q-banner-wrap { display: flex; justify-content: center; }
.q-banner {
  font-family: var(--font-display); font-size: clamp(1.2rem, 2.6vw, 1.7rem); line-height: 1.3;
  text-align: center; max-width: 40ch; color: var(--text);
}
.speak-stage { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; align-items: stretch; }
@media (max-width: 720px) { .speak-stage { grid-template-columns: 1fr; } }

.candidate-panel, .examiner-panel {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; align-items: stretch;
}
.cam-wrap {
  position: relative; aspect-ratio: 4 / 3; width: 100%; border-radius: var(--r-md); overflow: hidden;
  background: #05050b; display: grid; place-items: center;
}
.cam-video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-placeholder { color: var(--muted); font-size: 0.9rem; }
.cand-tag { text-align: center; font-size: 0.78rem; color: var(--muted); }

.mic-meter { height: 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--hairline-strong); overflow: hidden; }
.mic-fill { height: 100%; width: 0%; background: var(--accent-grad); transition: width 0.06s linear; }

.ptt {
  width: 100%; padding: 16px; font-size: 1.05rem; border-radius: var(--r-md);
  background: var(--accent-grad); color: #0a0a12; border: none; font-weight: 700; cursor: pointer;
  user-select: none; touch-action: none;
}
.ptt[disabled] { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.ptt.recording { background: linear-gradient(120deg, #ef4444, #f59e0b); color: #1a0606; animation: pttpulse 1.1s ease-in-out infinite; }
@keyframes pttpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); } 50% { box-shadow: 0 0 0 10px rgba(239,68,68,0); } }

.examiner-panel { align-items: center; justify-content: center; text-align: center; }
.exo-stage { position: relative; width: 180px; height: 180px; display: grid; place-items: center; }
.exo-orb {
  position: absolute; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #22d3ee, #8b5cf6 70%);
  filter: blur(10px); opacity: 0.4; transform: scale(1); transition: transform 0.07s ease, opacity 0.12s ease;
}
.exo-avatar {
  position: relative; width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.6rem;
  color: #e7e7f0; background: linear-gradient(150deg, #1d1d36, #2a2a4a); border: 1px solid var(--hairline-strong);
}
.examiner-panel.is-speaking .exo-avatar { border-color: var(--cyan); }
.exo-name { font-family: var(--font-display); font-weight: 600; }
.exo-tag { font-size: 0.78rem; color: var(--muted); }
.exo-status { font-size: 0.85rem; color: var(--muted); min-height: 1.2em; }
.examiner-panel[data-state="speaking"] .exo-status { color: var(--cyan); }

.ptt-status { text-align: center; color: var(--muted); min-height: 1.3em; }
.answer-area { min-height: 1em; }
.answer-card { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 12px; }
.answer-card .speaker { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px; }
.answer-metrics { margin-top: 8px; font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* agent picker */
.agent-picker { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .agent-picker { grid-template-columns: 1fr; } }
.agent-card {
  background: var(--surface-2); border: 1px solid var(--hairline-strong); border-radius: var(--r-md);
  padding: 14px; cursor: pointer; transition: border-color 0.15s ease, transform 0.1s ease;
}
.agent-card:hover { transform: translateY(-2px); }
.agent-card[aria-pressed="true"] { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.25); }
.agent-card[data-accent="violet"][aria-pressed="true"] { border-color: var(--violet); box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3); }
.agent-head { display: flex; gap: 10px; align-items: center; }
.agent-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; color: #0a0a12; background: var(--accent-grad);
}
.agent-card[data-accent="violet"] .agent-avatar { background: linear-gradient(150deg, #8b5cf6, #6d28d9); color: #fff; }
.agent-name { font-family: var(--font-display); font-weight: 600; }
.agent-tag { font-size: 0.78rem; color: var(--muted); }

/* coach tip */
.tip-card {
  background: rgba(34, 211, 238, 0.07); border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 12px;
}
.tip-card .speaker { font-size: 0.78rem; color: var(--cyan); margin-bottom: 4px; font-weight: 600; }

/* examiner accent variants */
.examiner-panel[data-accent="violet"] .exo-orb { background: radial-gradient(circle at 35% 30%, #a78bfa, #6d28d9 70%); }
.examiner-panel[data-accent="cyan"] .exo-orb { background: radial-gradient(circle at 35% 30%, #22d3ee, #0ea5b7 70%); }
.examiner-panel[data-accent="cyan"].is-speaking .exo-avatar { border-color: var(--cyan); }
.examiner-panel[data-accent="violet"].is-speaking .exo-avatar { border-color: var(--violet); }

/* ---------- Writing v2 ---------- */
.chart-box { position: relative; height: 280px; background: var(--bg); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 10px; }
.chart-box canvas { max-height: 100%; }

.hl-text { line-height: 1.8; white-space: pre-wrap; }
mark.hl {
  background: rgba(245, 158, 11, 0.22); color: inherit; border-bottom: 2px solid var(--amber);
  border-radius: 3px; padding: 0 1px; cursor: help;
}
mark.hl:hover, mark.hl:focus { background: rgba(245, 158, 11, 0.38); outline: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 0.8rem; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--hairline-strong); color: var(--muted); background: var(--bg);
}
.chip-rep { border-color: rgba(245, 158, 11, 0.35); color: #fcd9a0; }
.chip-warn { border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }

.vocab-from { text-decoration: line-through; color: var(--muted); }
.vocab-arrow { color: var(--muted); }
.vocab-to { color: var(--cyan); font-weight: 600; }

/* ---------- Reading v2 ---------- */
.reading-section + .reading-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--hairline); }
.q .explain { margin: 8px 0 4px; font-size: 0.9rem; color: var(--text); }
.q .evidence { font-size: 0.85rem; color: var(--muted); font-style: italic; }
mark.ev { background: rgba(34, 211, 238, 0.16); color: inherit; border-radius: 3px; padding: 0 1px; cursor: help; }

/* ---------- Progress dashboard ---------- */
.plan-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.plan-item:last-child { border-bottom: none; }
.flip-card {
  background: var(--surface-2); border: 1px solid var(--hairline-strong); border-radius: var(--r-lg);
  padding: 32px 24px; text-align: center; display: grid; gap: 12px; place-items: center;
}
.flip-term { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 5vw, 2.4rem); }
.flip-meaning { color: var(--text); font-size: 1.05rem; max-width: 50ch; }
.transcript-log { display: grid; gap: 10px; margin-top: 10px; max-height: 320px; overflow-y: auto; }

/* ---------- Mobile bottom navigation ---------- */
.mobilenav { display: none; }
@media (max-width: 720px) {
  .mobilenav {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(13, 13, 22, 0.92); backdrop-filter: blur(12px) saturate(140%);
    border-top: 1px solid var(--hairline);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobilenav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px; padding: 8px 0 6px; color: var(--muted);
    text-decoration: none; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.01em;
  }
  .mobilenav a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mobilenav a.active { color: var(--cyan); }
  .mobilenav a:active { background: rgba(255, 255, 255, 0.04); }
  .page { padding-bottom: 96px; }
  .nav-cta { display: none; }
  .topnav { padding-top: max(12px, env(safe-area-inset-top)); }
}

/* ---------- Type polish ---------- */
h1 { letter-spacing: -0.025em; }
h2, .section-title h2 { letter-spacing: -0.015em; }
.wordmark { letter-spacing: -0.03em; }
.lead { letter-spacing: -0.005em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
