/* ============================================================
   TrueHz — Premium display toolkit
   ============================================================ */

:root {
  /* Dark theme (default) */
  --bg: #07070c;
  --bg-2: #0c0c16;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f5fb;
  --text-dim: #a6a8bd;
  --text-faint: #6d6f85;

  --accent: #593bd0;
  --accent-2: #109bb5;
  --accent-3: #1c9d72;
  --danger: #ef4444;
  --warn: #f59e0b;

  --grad: linear-gradient(120deg, #593bd0 0%, #109bb5 50%, #1c9d72 100%);
  --grad-soft: linear-gradient(120deg, rgba(89, 59, 208, 0.18), rgba(16, 155, 181, 0.18));

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 24px 70px -20px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 60px -12px rgba(89, 59, 208, 0.5);

  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", var(--font);
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1180px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="light"] {
  --bg: #eef0f7;
  --bg-2: #e4e7f2;
  --surface: rgba(255, 255, 255, 0.7);
  --surface-2: rgba(255, 255, 255, 0.9);
  --border: rgba(20, 22, 40, 0.09);
  --border-strong: rgba(20, 22, 40, 0.16);
  --text: #14162a;
  --text-dim: #4c4f68;
  --text-faint: #8688a0;
  --shadow: 0 24px 70px -24px rgba(40, 44, 90, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

::selection { background: rgba(89, 59, 208, 0.35); color: #fff; }

a { color: inherit; text-decoration: none; }

kbd {
  font-family: var(--font-mono);
  font-size: 0.78em;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 1px 7px;
}

/* ============ Animated background ============ */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(ellipse at top, var(--bg-2), var(--bg) 70%);
  /* Promote the fixed backdrop to its own GPU layer so iOS Safari doesn't
     re-rasterize it every scroll frame (which reads as a flicker/refresh).
     `contain` + `isolation` stop it from repainting when siblings scroll. */
  transform: translateZ(0);
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  contain: strict;
  isolation: isolate;
}
.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}
.aurora-1 {
  width: 46vw; height: 46vw;
  background: radial-gradient(circle, #593bd0, transparent 60%);
  top: -12%; left: -8%;
  animation: float1 22s ease-in-out infinite;
}
.aurora-2 {
  width: 40vw; height: 40vw;
  background: radial-gradient(circle, #109bb5, transparent 60%);
  top: 8%; right: -10%;
  animation: float2 26s ease-in-out infinite;
}
.aurora-3 {
  width: 44vw; height: 44vw;
  background: radial-gradient(circle, #1c9d72, transparent 60%);
  bottom: -18%; left: 30%;
  animation: float3 30s ease-in-out infinite;
}
:root[data-theme="light"] .aurora { opacity: 0.4; }

/* Gauge ring uses a brighter version of the accents so it pops */
#gaugeGrad stop:nth-child(1) { stop-color: #7d5cf0; }
#gaugeGrad stop:nth-child(2) { stop-color: #1fc3e0; }
#gaugeGrad stop:nth-child(3) { stop-color: #33cf97; }

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 78%);
}
:root[data-theme="light"] .grid-overlay {
  background-image:
    linear-gradient(rgba(20,22,40,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,22,40,0.04) 1px, transparent 1px);
}

@keyframes float1 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(6%,8%) scale(1.1)} }
@keyframes float2 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-8%,10%) scale(1.15)} }
@keyframes float3 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(4%,-8%) scale(1.08)} }

/* ============ Glass utility ============ */
/* Premium liquid glass: glossy top edge + soft inner reflection (dark theme) */
.glass {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01) 44%, rgba(255, 255, 255, 0.035)),
    radial-gradient(130% 80% at 12% -10%, rgba(255, 255, 255, 0.1), transparent 55%),
    var(--surface);
  backdrop-filter: blur(26px) saturate(150%) brightness(1.02);
  -webkit-backdrop-filter: blur(26px) saturate(150%) brightness(1.02);
  border: 1px solid var(--border);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 0 -22px 42px -32px rgba(255, 255, 255, 0.08);
}
/* Frosted-white premium glass for the light theme */
:root[data-theme="light"] .glass {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.55) 45%, rgba(255, 255, 255, 0.72)),
    radial-gradient(130% 80% at 12% -10%, rgba(255, 255, 255, 0.95), transparent 55%),
    var(--surface);
  backdrop-filter: blur(30px) saturate(160%) brightness(1.03);
  -webkit-backdrop-filter: blur(30px) saturate(160%) brightness(1.03);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    0 24px 60px -24px rgba(40, 44, 90, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    inset 0 -22px 42px -34px rgba(120, 130, 170, 0.12);
}

/* ============ Navigation ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px clamp(18px, 5vw, 48px);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
  /* Give the sticky bar its own compositing layer so iOS Safari doesn't
     re-rasterize its blurred backdrop against the moving page each frame. */
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.brand-mark {
  color: var(--accent);
  font-size: 1.1em;
  animation: spin 8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.brand-accent { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.nav-links a {
  padding: 8px 15px;
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.25s var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.theme-toggle {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  transition: all 0.3s var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(-20deg); }

/* ============ Hero ============ */
.hero {
  padding: clamp(24px, 4vw, 44px) clamp(18px, 5vw, 48px) clamp(40px, 6vw, 60px);
}
.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  /* Same rhythm as the space between sections (hero bottom pad + section top pad)
     so the tool box reads as its own block, separated from the intro copy. */
  gap: calc(clamp(40px, 6vw, 60px) + clamp(60px, 9vw, 110px));
  align-items: stretch;
}
.hero-copy { text-align: center; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 26px;
}
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 0 0 var(--accent-3);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52,211,153,0.6); }
  70% { box-shadow: 0 0 0 10px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 4.4vw, 3.8rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}
.gradient-text {
  background: var(--grad);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }
.hero-sub {
  max-width: 640px;
  margin: 0 auto 26px;
  color: var(--text-dim);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
}

/* ============ Gauge ============ */
.gauge-wrap { width: 100%; margin: 0 auto; }
.gauge-card {
  border-radius: var(--radius);
  padding: 40px 34px 30px;
  position: relative;
  overflow: hidden;
}
.gauge-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(89,59,208,0.12), transparent 60%);
  pointer-events: none;
}
.gauge-body {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
}
.gauge-left {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gauge-right {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* In the horizontal panel the right-column blocks read left-aligned */
.gauge-right .gauge-note { margin: 0; max-width: none; }
.gauge {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto 8px;
}
.gauge-svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.gauge-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 14;
}
.gauge-fill {
  fill: none;
  stroke: url(#gaugeGrad);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 540;
  stroke-dashoffset: 540;
  transition: stroke-dashoffset 1.1s var(--ease);
  filter: drop-shadow(0 0 10px rgba(125, 92, 240, 0.6));
}
.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.gauge-value {
  font-family: var(--font-display);
  font-size: 3.6rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.gauge-unit {
  font-size: 0.95rem;
  color: var(--text-dim);
  font-weight: 600;
  margin-top: 2px;
}
.gauge-precise {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-faint);
  margin-top: 6px;
  min-height: 0.9em;
}
.refining-tag {
  color: var(--accent-2);
  font-weight: 600;
  animation: refiningPulse 1.4s ease-in-out infinite;
}
@keyframes refiningPulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .refining-tag { animation: none; opacity: 1; }
}
.gauge-status {
  margin-top: 8px;
  max-width: 150px;
  text-align: center;
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--accent-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.gauge-explain {
  margin: 18px auto 0;
  max-width: 400px;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-dim);
}
.gauge-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 12px auto 0;
  padding: 10px 14px;
  max-width: 460px;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-align: left;
}
.gauge-note-icon { flex-shrink: 0; font-size: 1rem; line-height: 1.35; }
.gauge-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 20px 0;
}
.stat { cursor: help; }.stat {
  text-align: center;
  padding: 14px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
.stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}

.gauge-actions { display: flex; flex-direction: column; gap: 16px; }

/* Precision toggle */
.precision-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.switch { position: relative; display: inline-flex; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 44px; height: 25px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background 0.3s var(--ease);
  display: flex;
  align-items: center;
  padding: 3px;
}
.switch-thumb {
  width: 19px; height: 19px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.3s var(--ease);
  box-shadow: 0 2px 5px rgba(0,0,0,0.35);
}
.switch input:checked + .switch-track { background: var(--grad); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(19px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.precision-label { display: flex; flex-direction: column; text-align: left; line-height: 1.3; }
.precision-title { font-weight: 600; font-size: 0.92rem; color: var(--text); }
.precision-sub { font-size: 0.78rem; color: var(--text-faint); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.28s var(--ease);
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-primary:active { transform: translateY(0); }
.btn-icon { font-size: 1.1em; }

.frame-graph {
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 8px;
  overflow: hidden;
}
#frameCanvas { width: 100%; height: 70px; display: block; }

.hero-hint {
  margin: 4px auto 0;
  font-size: 0.88rem;
  color: var(--text-faint);
  max-width: 460px;
}

/* ============ Sections ============ */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(60px, 9vw, 110px) clamp(18px, 5vw, 48px);
}
.section-head { text-align: center; max-width: 640px; margin: 0 auto 54px; }
.section-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 14px;
}
.section-desc { color: var(--text-dim); font-size: 1.05rem; }

/* ============ Info grid ============ */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.info-card {
  border-radius: var(--radius-sm);
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.35s var(--ease);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  animation: rise 0.6s var(--ease) forwards;
  /* Keep each translucent card on its own stable GPU layer so iOS Safari
     doesn't re-rasterize it over the fixed aurora while scrolling (flicker). */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
@keyframes rise { to { opacity: 1; transform: translate3d(0, 0, 0); } }
.info-card:hover {
  border-color: var(--border-strong);
  transform: translate3d(0, -4px, 0);
  box-shadow: var(--shadow);
}
.info-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.35s;
}
.info-card:hover::after { opacity: 1; }
.info-icon {
  font-size: 1.5rem;
  margin-bottom: 12px;
  display: block;
}
.info-label {
  font-size: 0.78rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.info-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}
.info-sub { font-size: 0.82rem; color: var(--text-dim); margin-top: 4px; }
.res-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
  color: #fff;
  background: var(--grad);
}

/* ============ Test grid ============ */
.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.test-card {
  border-radius: var(--radius-sm);
  padding: 28px 24px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font);
  transition: all 0.35s var(--ease);
  position: relative;
  overflow: hidden;
}
.test-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--c) 22%, transparent), transparent 55%);
  opacity: 0;
  transition: opacity 0.4s;
}
.test-card:hover { transform: translateY(-5px); border-color: var(--border-strong); }
.test-card:hover::before { opacity: 1; }
.test-icon {
  font-size: 1.9rem;
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  margin-bottom: 16px;
}
.test-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 7px;
}
.test-desc { display: block; color: var(--text-dim); font-size: 0.9rem; }

/* ============ About ============ */
.about { max-width: var(--maxw); }
.about-card {
  border-radius: var(--radius);
  padding: clamp(30px, 5vw, 56px);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 44px;
  align-items: center;
}
.about-list { list-style: none; margin-top: 22px; display: grid; gap: 16px; }
.about-list li {
  display: flex;
  gap: 12px;
  color: var(--text-dim);
  font-size: 1rem;
}
.about-list strong { color: var(--text); }
.check {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--grad-soft);
  border: 1px solid var(--border-strong);
  color: var(--accent-3);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
}
.about-meta {
  display: grid;
  gap: 14px;
}
.meta-item {
  text-align: center;
  padding: 24px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.meta-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.meta-cap {
  font-size: 0.8rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 8px;
}

/* ============ Footer ============ */
.footer {
  border-top: 1px solid var(--border);
  padding: 30px clamp(18px, 5vw, 48px);
  margin-top: 40px;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-faint);
  font-size: 0.88rem;
}
.footer-inner .brand-mark { animation: none; }
.footer-year { margin-left: auto; font-family: var(--font-mono); }
.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-dim);
  font-size: 0.88rem;
  transition: color 0.2s var(--ease);
}
.footer-links a:hover { color: var(--text); }

/* ============ SEO prose / guide ============ */
.prose {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(26px, 4vw, 46px);
  border-radius: var(--radius);
}
.prose p { color: var(--text-dim); margin-bottom: 20px; font-size: 1.02rem; }
.prose p:last-child { margin-bottom: 0; }
.prose h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.32rem;
  color: var(--text);
  margin: 30px 0 12px;
}
.prose strong { color: var(--text); font-weight: 600; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px;
}

/* ============ FAQ ============ */
.faq-list {
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}
.faq-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.25s var(--ease);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 24px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--accent-2);
  transition: transform 0.25s var(--ease);
  line-height: 1;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--accent-2); }
.faq-body { padding: 0 24px 22px; }
.faq-body p { color: var(--text-dim); margin: 0; }

/* ============ Troubleshooting / fix grid ============ */
.fix-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.fix-card {
  padding: 26px;
  border-radius: var(--radius);
}
.fix-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}
.fix-os {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  font-size: 1rem;
}
.fix-steps, .fix-list {
  padding-left: 20px;
  display: grid;
  gap: 10px;
}
.fix-steps li, .fix-list li { color: var(--text-dim); font-size: 0.95rem; }
.fix-steps strong, .fix-list strong { color: var(--text); }
.fix-card > p { color: var(--text-dim); font-size: 0.95rem; line-height: 1.55; }

/* ============ Content pages (legal/about/contact) ============ */
.page-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(96px, 12vh, 140px) clamp(18px, 5vw, 48px) 60px;
}
.page-wrap h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 8px;
}
.page-wrap .updated { color: var(--text-faint); font-size: 0.9rem; margin-bottom: 30px; display: block; }
.page-wrap h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  margin: 34px 0 12px;
}
.page-wrap p, .page-wrap li { color: var(--text-dim); margin-bottom: 14px; }
.page-wrap ul { padding-left: 22px; margin-bottom: 14px; }
.page-wrap a.inline-link { color: var(--accent-2); text-decoration: underline; }
.page-wrap .back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  color: var(--accent-2);
}

/* ============ Fullscreen test overlay ============ */
.test-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: none;
  cursor: none;
}
.test-overlay.active { display: block; }
#testCanvas { display: block; width: 100vw; height: 100vh; }
.test-hud {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  transition: opacity 0.4s;
}
.test-hud-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 24px;
  border-radius: 14px;
}
.hud-title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--text); }
.hud-hint { font-size: 0.8rem; color: var(--text-dim); }
.test-overlay.hide-hud .test-hud { opacity: 0; }
.test-exit {
  position: fixed;
  top: 22px; right: 22px;
  z-index: 1001;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.test-exit:hover { background: var(--danger); transform: rotate(90deg); }

/* ============ Responsive ============ */
@media (max-width: 820px) {
  .hero-inner {
    text-align: center;
  }
  .hero-copy { text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-hint { margin-left: auto; margin-right: auto; }
  .gauge-wrap { max-width: 520px; }
  .gauge-body { flex-direction: column; gap: 18px; }
  .gauge-right .gauge-note { margin: 0 auto 10px; max-width: 460px; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  /* With the links hidden, push the theme toggle to the far right
     instead of letting it sit next to the brand name. */
  .theme-toggle { margin-left: auto; }
  .about-card { grid-template-columns: 1fr; }
  .about-meta { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .gauge-card { padding: 30px 20px 24px; }
  .gauge { width: 200px; height: 200px; }
  .gauge-value { font-size: 3.2rem; }
  .gauge-stats { grid-template-columns: 1fr; }
  .about-meta { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
