/* ==========================================================================
   TestMyPC — "clinic + repair bench" design system (Sept 2026)
   Light, calm pages for people with a problem; instrument-style readouts
   for test results. All colours come from the tokens below.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-600.woff2") format("woff2");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Surfaces */
  --bg: #f6f5f1;
  --bg-elev: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --surface-3: #e9e6de;

  /* Ink */
  --text: #17212f;
  --text-soft: #334155;
  --muted: #5b6574;
  --line: #e3dfd5;
  --line-strong: #cbc5b7;

  /* Accent: one signal colour */
  --primary: #0f766e;
  --primary-2: #115e59;
  --primary-soft: #e2f1ee;
  --primary-ink: #0b5d56;

  /* Status */
  --success: #15803d;
  --success-soft: #e6f4ea;
  --warning: #b45309;
  --warning-soft: #fcf1e1;
  --danger: #b91c1c;
  --danger-soft: #fbeaea;
  --highlight: #f59e0b;

  /* Instrument panel (readouts) */
  --panel: #10201f;
  --panel-2: #172c2a;
  --panel-line: #2a4441;
  --panel-text: #e6f4f1;
  --panel-muted: #8fb3ad;
  --panel-accent: #5eead4;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 33, 47, 0.04), 0 4px 16px rgba(23, 33, 47, 0.05);
  --shadow-lift: 0 2px 4px rgba(23, 33, 47, 0.06), 0 10px 28px rgba(23, 33, 47, 0.09);
  --container: 1200px;
  --header-h: 64px;

  color-scheme: light;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100%;
}

body {
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-ink); text-decoration: none; }
a:hover, a:focus-visible { color: var(--primary-2); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { line-height: 1.2; margin-top: 0; color: var(--text); letter-spacing: -0.015em; }
h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 750; }
h2 { font-size: clamp(1.15rem, 1.8vw, 1.4rem); font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 650; }

p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; }

code, kbd, samp { font-family: var(--mono); font-size: 0.9em; }
code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--text);
}

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

.icon { width: 1.2em; height: 1.2em; flex-shrink: 0; vertical-align: -0.2em; }

::selection { background: #c7ebe5; }

.skip-link {
  position: absolute;
  top: -48px;
  left: 8px;
  z-index: 1000;
  background: var(--text);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
}
.skip-link:focus { top: 8px; color: #fff; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }

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

.is-search-hidden, [hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Site header & navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 750;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.logo:hover, .logo:focus-visible { text-decoration: none; color: var(--text); }
.logo-mark { width: 32px; height: 32px; display: block; }
.logo-text span { color: var(--primary); }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav > a,
.site-header .nav-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--text-soft);
  font-weight: 550;
  font-size: 0.95rem;
  background: none;
  border: 0;
  cursor: pointer;
}
.main-nav > a:hover,
.nav-menu-button:hover,
.main-nav > a.active,
.nav-menu-button[aria-expanded="true"] {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.nav-menu-button .icon { width: 16px; height: 16px; transition: transform 0.15s ease; }
.nav-menu-button[aria-expanded="true"] .icon { transform: rotate(180deg); }

.nav-tools { position: relative; }

.mega-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: -12px;
  width: min(860px, calc(100vw - 40px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 18px;
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 18px;
}
.mega-menu.open { display: grid; }

.mega-group h2 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 8px 0 6px;
  font-weight: 650;
}
.mega-group ul { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 2px; }
.mega-group a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.93rem;
}
.mega-group a:hover, .mega-group a.active { background: var(--primary-soft); color: var(--primary-2); text-decoration: none; }
.mega-group .tool-icon { width: 30px; height: 30px; border-radius: 8px; }
.mega-group .tool-icon .icon { width: 16px; height: 16px; }

.header-search {
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
  width: min(300px, 32vw);
}
.header-search .icon {
  position: absolute;
  left: 11px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.header-search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 9px 12px 9px 34px;
  font-size: 0.92rem;
  color: var(--text);
}
.header-search input::placeholder { color: var(--muted); }
.header-search input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, calc(100vw - 32px));
  max-height: 70vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
  padding: 6px;
  display: none;
}
.search-results.open { display: block; }
.search-results a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.92rem;
}
.search-results a[aria-selected="true"],
.search-results a:hover { background: var(--primary-soft); text-decoration: none; }
.search-results small { color: var(--muted); display: block; font-size: 0.78rem; }
.search-results .empty { padding: 10px; color: var(--muted); font-size: 0.9rem; margin: 0; }
.search-kind {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: auto;
  flex-shrink: 0;
}

.site-header .nav-toggle {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
}
.site-header .nav-toggle:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.nav-toggle .icon { width: 18px; height: 18px; }

.mobile-panel { display: none; }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.site { min-height: 100vh; display: flex; flex-direction: column; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.page-main {
  padding-top: 24px;
  padding-bottom: 40px;
  display: grid;
  gap: 18px;
  flex: 1;
}
.page-main > * { min-width: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  min-width: 0;
}

.hero {
  background: var(--surface);
  border-color: var(--line);
  padding: 28px;
}
.hero h1 { margin-bottom: 10px; }
.hero > p { color: var(--text-soft); max-width: 72ch; font-size: 1.04rem; }

.eyebrow {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.section { display: grid; gap: 12px; }
.section > h2 { margin-bottom: 0; }

.small-note { color: var(--muted); margin: 6px 0; font-size: 0.92rem; }

.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* --------------------------------------------------------------------------
   Buttons & form controls
   -------------------------------------------------------------------------- */
.button-row, .controls-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.button, button, select, input, textarea { font: inherit; }

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.button:hover, button:hover { background: var(--primary-2); border-color: var(--primary-2); color: #fff; text-decoration: none; }
.button:disabled, button:disabled { opacity: 0.5; cursor: not-allowed; }

.button-secondary,
button.button-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}
.button-secondary:hover,
button.button-secondary:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }

.button.button-small { padding: 7px 12px; font-size: 0.88rem; }
.button .icon { width: 17px; height: 17px; }

select,
input,
textarea {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 11px;
  max-width: 100%;
}
select:focus, input:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { width: 100%; resize: vertical; }
input::placeholder, textarea::placeholder { color: #8a93a0; }

/* --------------------------------------------------------------------------
   Pills, chips, tags, status
   -------------------------------------------------------------------------- */
.tool-tag {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.74rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  color: var(--primary-ink);
  font-size: 0.88rem;
  font-weight: 550;
}
.status-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--success); }
.status-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 34px; }
.chip {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.86rem;
  font-family: var(--mono);
}

/* --------------------------------------------------------------------------
   Stat cards & readouts (instrument style)
   -------------------------------------------------------------------------- */
.status-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.status-grid.compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.trackpad-stats-grid {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
  padding: 12px 14px;
  min-width: 0;
}
.stat-card h3 {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-card p {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.meter-wrap,
.progress-wrap,
.bench-progress {
  margin-top: 14px;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  overflow: hidden;
}
.bench-progress { margin: 12px 0 16px; }
.meter-fill,
.progress-fill,
.bench-progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #14b8a6);
  transition: width 0.12s linear;
  border-radius: 999px;
}

/* --------------------------------------------------------------------------
   Content blocks used across tool pages
   -------------------------------------------------------------------------- */
.guide-section h2, .faq h2, .related-tools h2, .result-guide h2 { margin-bottom: 12px; }
.guide-section ul { padding-left: 20px; }
.guide-section li { margin-bottom: 6px; color: var(--text-soft); }
.guide-section p { color: var(--text-soft); }
.tool-intro p { max-width: 80ch; }

.result-guide, .guide-section, .related-tools, .disclaimer-box { scroll-margin-top: 90px; }

.rating-grid,
.fix-grid,
.related-link-grid,
.feature-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.rating-card,
.fix-card,
.feature-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.rating-card h3, .fix-card h3, .feature-card h3 { margin-bottom: 6px; }
.rating-card p, .fix-card p, .feature-card p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }
.rating-card { border-top-width: 4px; }
.rating-card.good { border-top-color: var(--success); }
.rating-card.good h3 { color: var(--success); }
.rating-card.average { border-top-color: var(--highlight); }
.rating-card.average h3 { color: var(--warning); }
.rating-card.poor { border-top-color: var(--danger); }
.rating-card.poor h3 { color: var(--danger); }
.feature-card.available { border-left: 4px solid var(--success); }
.feature-card.missing { border-left: 4px solid var(--danger); }

.related-link-grid a {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.related-link-grid a:hover,
.related-link-grid a:focus-visible { border-color: var(--primary); box-shadow: var(--shadow); text-decoration: none; }
.related-link-grid small { color: var(--muted); line-height: 1.45; font-weight: 400; }

.faq h3 { margin: 16px 0 4px; }
.faq p { color: var(--text-soft); margin: 0; }

.disclaimer-box { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 25%, transparent); box-shadow: none; }
.disclaimer-box p { margin: 0; color: var(--text-soft); }

.info-table { display: grid; gap: 0; }
.info-table div {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.info-table span { color: var(--muted); overflow-wrap: anywhere; }
.info-table strong { font-family: var(--mono); font-weight: 500; font-size: 0.92rem; overflow-wrap: anywhere; }

.history-list,
.event-log {
  margin: 8px 0 0;
  padding-left: 22px;
  max-height: 220px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--text-soft);
}

.summary-box {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 10px;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 0.86rem;
}

.manual-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid { display: grid; gap: 8px; }
.form-grid input, .form-grid textarea { width: 100%; }

.recommendation-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  background: var(--bg-elev);
}
.recommendation-box[data-tone="good"] { border-left-color: var(--success); background: var(--success-soft); }
.recommendation-box[data-tone="average"] { border-left-color: var(--highlight); background: var(--warning-soft); }
.recommendation-box[data-tone="poor"] { border-left-color: var(--danger); background: var(--danger-soft); }

.safety-note { background: var(--warning-soft); border-radius: 10px; padding: 10px 14px; color: var(--text-soft); }

/* Screenshots */
.shot { margin: 22px 0; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.shot figcaption { margin-top: 10px; font-size: 0.9rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   Tool cards & icons
   -------------------------------------------------------------------------- */
.tool-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}
.tool-icon .icon { width: 20px; height: 20px; }

.tool-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.tool-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  align-items: start;
  padding: 16px 18px;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}
.tool-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lift); }
.tool-card .tool-icon { grid-row: span 2; }
.tool-card h3 { margin: 2px 0 0; font-size: 1rem; }
.tool-card h3 a { color: var(--text); }
.tool-card h3 a::after { content: ""; position: absolute; inset: 0; }
.tool-card h3 a:hover { text-decoration: none; }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.tool-card .tool-tag { display: none; }

.tool-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 22px 0 10px;
  font-weight: 700;
}
.tool-group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* --------------------------------------------------------------------------
   Keyboard tester
   -------------------------------------------------------------------------- */
.keyboard-wrapper { overflow-x: auto; overflow-y: hidden; width: 100%; padding-bottom: 6px; }
.keyboard {
  width: max(900px, 100%);
  display: grid;
  gap: 6px;
  padding: 12px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
}
.keyboard-row { display: grid; grid-template-columns: repeat(var(--row-cols), minmax(0, 1fr)); gap: 6px; }
.keyboard-key {
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  min-height: clamp(34px, 3.6vw, 46px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  font-size: clamp(0.6rem, 1vw, 0.8rem);
  padding: 2px;
  text-align: center;
  font-weight: 600;
  overflow: hidden;
  transition: background 0.08s ease, border-color 0.08s ease, transform 0.08s ease;
}
.keyboard-key .main { line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.keyboard-key .sub { font-size: clamp(0.5rem, 0.85vw, 0.64rem); color: var(--muted); line-height: 1; }
.keyboard-key.tested { background: #d6efe9; border-color: #5fb3a6; color: #0b4d47; }
.keyboard-key.tested .sub { color: #3b7f75; }
.keyboard-key.active,
.keyboard-key.tested.active {
  background: var(--highlight);
  border-color: #b45309;
  color: #1f1300;
  transform: translateY(2px);
  border-bottom-width: 1px;
}
.keyboard-key.active .sub, .keyboard-key.tested.active .sub { color: #5c3a06; }
.keyboard-key.toggle-on { background: #fde7c4; border-color: #d99a3b; }
.keyboard-key.unmapped { opacity: 0.75; }

/* --------------------------------------------------------------------------
   Timer
   -------------------------------------------------------------------------- */
.timer-card { text-align: center; }
.timer-display {
  font-family: var(--mono);
  font-size: clamp(2.6rem, 9vw, 5rem);
  margin: 6px 0 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--panel-text);
  background: var(--panel);
  border-radius: 14px;
  padding: 16px 12px;
  font-variant-numeric: tabular-nums;
}
.timer-card .button-row { justify-content: center; }
.timer-page:fullscreen, .is-fullscreen { background: var(--panel); }

/* --------------------------------------------------------------------------
   Webcam / mic / sound
   -------------------------------------------------------------------------- */
.video-shell {
  background: var(--panel);
  border-radius: 12px;
  border: 1px solid var(--panel-line);
  padding: 12px;
  min-height: 240px;
  display: grid;
  place-items: center;
  color: var(--panel-muted);
}
#cameraPreview { width: min(100%, 760px); border-radius: 10px; background: #0b1413; transition: transform 0.2s ease; }

/* --------------------------------------------------------------------------
   Trackpad
   -------------------------------------------------------------------------- */
.trackpad-zone {
  position: relative;
  border: 2px dashed var(--line-strong);
  border-radius: 14px;
  min-height: 260px;
  padding: 18px;
  background:
    linear-gradient(var(--surface-2) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--surface-2) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--bg-elev);
  color: var(--muted);
  user-select: none;
}
.click-pulse {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 40%, transparent);
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 0;
  pointer-events: none;
}
.click-pulse.show { animation: pulse 420ms ease-out; }
@keyframes pulse {
  from { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(2.4); }
}

/* --------------------------------------------------------------------------
   Internet speed test
   -------------------------------------------------------------------------- */
.speedtest-shell {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(260px, 360px) 1fr;
  align-items: center;
}
.gauge-wrap { position: relative; width: min(320px, 80vw); aspect-ratio: 1; margin: 0 auto; }
.speed-gauge { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-track, .gauge-progress { fill: none; stroke-width: 15; }
.gauge-track { stroke: var(--surface-3); }
.gauge-progress { stroke: var(--primary); transition: stroke-dashoffset 0.18s linear; }
.gauge-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.live-speed-value { font-family: var(--mono); font-size: clamp(2rem, 5vw, 3rem); margin: 0; line-height: 1; font-weight: 600; }
.live-speed-unit { margin: 0; color: var(--muted); font-weight: 600; }

/* --------------------------------------------------------------------------
   Typing test
   -------------------------------------------------------------------------- */
.typing-zone { border: 1px solid var(--line); border-radius: 14px; background: var(--bg-elev); padding: 18px; }
.typing-words { font-family: var(--mono); font-size: 1.15rem; line-height: 2.1; color: var(--muted); min-height: 96px; user-select: none; }
.typing-word { padding: 2px 5px; border-radius: 6px; }
.typing-word.is-current { background: var(--primary-soft); color: var(--text); box-shadow: inset 0 -2px 0 var(--primary); }
.typing-word.is-correct { color: var(--success); }
.typing-word.is-wrong { color: var(--danger); text-decoration: line-through; }
.typing-input { width: 100%; margin-top: 14px; padding: 12px 14px; font-size: 1.1rem; font-family: var(--mono); }
.typing-duration.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.typing-note { margin-top: 12px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Reaction test (base; page adds state colours)
   -------------------------------------------------------------------------- */
.reaction-zone {
  border-radius: 14px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  user-select: none;
  padding: 24px;
  transition: background 0.1s ease;
}
.reaction-zone.is-idle { background: var(--bg-elev); border: 2px dashed var(--line-strong); }
.reaction-zone.is-waiting { background: #c2262e; border: 2px solid #9b1c22; }
.reaction-zone.is-ready { background: #138a4c; border: 2px solid #0e6b3a; }
.reaction-zone.is-false { background: #7f1d1d; border: 2px solid #5f1414; }
.reaction-message { font-size: 1.5rem; font-weight: 750; color: var(--text); margin: 0 0 8px; }
.reaction-sub { color: var(--muted); margin: 0; }

/* --------------------------------------------------------------------------
   Refresh rate test
   -------------------------------------------------------------------------- */
.hz-motion-area { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 16px; overflow: hidden; }
.hz-lane { position: relative; height: 46px; margin: 10px 0; background: var(--panel-2); border-radius: 8px; overflow: hidden; }
.hz-lane-label { position: absolute; left: 10px; top: 13px; font-size: 0.74rem; color: var(--panel-muted); z-index: 1; font-family: var(--mono); }
.hz-bar { position: absolute; top: 6px; left: 0; width: 70px; height: 34px; border-radius: 8px; background: var(--panel-accent); will-change: transform; }
.hz-bar-alt { background: #fbbf24; }
.hz-bar-third { background: #f87171; }

/* --------------------------------------------------------------------------
   Benchmarks & leaderboards
   -------------------------------------------------------------------------- */
.gpu-canvas {
  width: 100%;
  max-width: 720px;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--panel-line);
  background: var(--panel);
  display: block;
  margin: 0 auto 14px;
}
.board-submit { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.board-name-input { max-width: 280px; margin-top: 0; }
.board-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.board-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.board-table th, .board-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.board-table th { background: var(--surface-2); color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 650; }
.board-table td { color: var(--text); }
.board-table td:nth-child(3) { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.board-table td:nth-child(4) { color: var(--muted); font-size: 0.86rem; }
.board-table tbody tr:nth-child(1) td:nth-child(1):not([colspan])::before { content: "★ "; color: var(--highlight); }
.board-table tr:last-child td { border-bottom: 0; }
.board-row-you td { background: var(--primary-soft); font-weight: 700; }

/* --------------------------------------------------------------------------
   Used laptop checkup & result buttons
   -------------------------------------------------------------------------- */
.checkup-progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 14px; }
.checkup-progress span { display: block; height: 100%; width: 0; background: var(--primary); transition: width 0.25s ease; }
.checkup-step-header { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; }
.checkup-result-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.checkup-result-controls button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 18px;
}
.checkup-result-controls button:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.checkup-result-controls button[data-checkup-result="Pass"].active { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.checkup-result-controls button[data-checkup-result="Fail"].active { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.checkup-result-controls button[data-checkup-result="Not Sure"].active { background: var(--warning-soft); border-color: var(--warning); color: var(--warning); }
.notes-label { display: block; font-weight: 600; margin-bottom: 6px; }
.checkup-nav { margin-top: 14px; }
#checkupNotes { width: 100%; }

/* --------------------------------------------------------------------------
   Forms (report issue / contact)
   -------------------------------------------------------------------------- */
.feedback-form { display: grid; gap: 14px; }
.feedback-form label span { display: block; margin-bottom: 6px; color: var(--text); font-weight: 600; }
.feedback-form small { color: var(--muted); font-weight: 400; }
.feedback-form input, .feedback-form select, .feedback-form textarea { width: 100%; }
.hidden-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.contact-layout { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.contact-email-link { display: inline-block; font-size: 1.1rem; font-weight: 650; word-break: break-all; }
.contact-address { font-style: normal; line-height: 1.8; color: var(--text); }

/* --------------------------------------------------------------------------
   Controller tester (preview only; kept for when it is finished)
   -------------------------------------------------------------------------- */
.gamepad-layout { display: grid; gap: 14px; grid-template-columns: minmax(300px, 380px) 1fr; }
.hid-top-strip { margin: 12px 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elev); }
.advanced-hid summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.hid-inline-grid { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hid-inline-grid p { margin: 0; }
.gamepad-side-panel, .gamepad-main-panel { display: grid; gap: 12px; align-content: start; }
.gamepad-meta-grid, .gamepad-control-grid { display: grid; gap: 8px; }
.gamepad-meta-grid p { margin: 0; }
.gamepad-axes-grid, .gamepad-trigger-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gamepad-axes-grid div > span { display: inline-block; margin-bottom: 5px; color: var(--muted); font-weight: 600; }
.axis-track { height: 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); overflow: hidden; }
.axis-fill { width: 50%; height: 100%; background: var(--primary); transition: width 0.08s linear; }
.gamepad-button-list-wrap { overflow: auto; }
.gamepad-button-table { width: 100%; border-collapse: collapse; min-width: 360px; }
.gamepad-button-table th, .gamepad-button-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.gamepad-button-table th { color: var(--muted); font-weight: 600; }
.controller-shell {
  position: relative;
  margin: 6px auto 0;
  width: min(900px, 100%);
  aspect-ratio: 855 / 670;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 22px;
  overflow: hidden;
}
.controller-svg { width: 100%; height: 100%; display: block; }
.controller-svg .gp-part .part-shape { fill: rgba(94, 234, 212, 0.18); stroke: rgba(94, 234, 212, 0.95); stroke-width: 2.4; opacity: 0; transition: opacity 0.12s ease; }
.controller-svg .gp-part .btn-label { display: none; }
.controller-svg .gp-part.active .part-shape { fill: rgba(94, 234, 212, 0.3); opacity: 1; }
.controller-svg .touch-hit { fill: transparent; stroke: transparent; }
.controller-svg .stick-base .stick-ring { fill: none; stroke: rgba(94, 234, 212, 0.2); stroke-width: 1.6; }
.controller-svg .stick-thumb { fill: rgba(94, 234, 212, 0.95); stroke: #ccfbf1; stroke-width: 1.8; }
.controller-svg .lightbar { fill: rgba(56, 189, 248, 0.8); stroke: rgba(186, 230, 253, 0.5); stroke-width: 1.6; }
.controller-svg .tp-dot { fill: #86efac; }
.controller-svg .tp-dot-2 { fill: #bbf7d0; }
.joystick-info-grid { display: grid; gap: 12px; }
.joystick-plot-wrap { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(150px, 220px)); justify-content: center; }
.joystick-plot { position: relative; width: min(220px, 38vw); aspect-ratio: 1; border-radius: 999px; border: 2px solid var(--line-strong); background: var(--bg-elev); margin: 0 auto; }
.joystick-cross { position: absolute; background: var(--line-strong); }
.joystick-cross.x { left: 0; right: 0; top: 50%; height: 1px; }
.joystick-cross.y { top: 0; bottom: 0; left: 50%; width: 1px; }
.joystick-dot { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 999px; background: var(--primary); }
.joystick-values { text-align: center; font-family: var(--mono); font-size: 1.1rem; font-weight: 600; }
.touchpanel-grid { display: grid; gap: 12px; grid-template-columns: minmax(220px, 360px) 1fr; align-items: start; }
.touch-inline-stats { display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.touch-dot-wrap { display: flex; justify-content: center; }
.touchpad-surface { position: relative; width: min(360px, 100%); aspect-ratio: 16 / 9; border-radius: 14px; border: 2px solid var(--line-strong); background: var(--bg-elev); overflow: hidden; }
.touch-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 999px; background: var(--primary); opacity: 0; }
.touch-dot-onpad { width: 14px; height: 14px; margin: -7px 0 0 -7px; }
.touch-dot-secondary { background: #14b8a6; }
.touchpanel-stats p { margin: 0 0 7px; }
.quick-tests-list { display: grid; gap: 6px; }
.quick-test-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-radius: 10px; background: var(--bg-elev); border: 1px solid var(--line); }
.test-badge { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 0.8rem; background: var(--surface-3); color: var(--text); }
.test-badge.passed { background: var(--success-soft); color: var(--success); }
.test-badge.failed { background: var(--danger-soft); color: var(--danger); }
.test-badge.unavailable { background: var(--surface-2); color: var(--muted); }

/* --------------------------------------------------------------------------
   Homepage
   -------------------------------------------------------------------------- */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 36px 0 8px;
}
.home-hero h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.08; letter-spacing: -0.03em; margin-bottom: 16px; }
.home-hero h1 em { font-style: normal; color: var(--primary); }
.home-hero .lede { font-size: 1.12rem; color: var(--text-soft); max-width: 56ch; margin-bottom: 20px; }
.trust-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; }
.trust-list li { display: flex; gap: 10px; align-items: center; color: var(--text-soft); font-size: 0.95rem; }
.trust-list .icon { color: var(--success); width: 18px; height: 18px; }

.live-panel {
  background: var(--panel);
  color: var(--panel-text);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(16, 32, 31, 0.25);
  border: 1px solid var(--panel-line);
  min-width: 0;
}
.live-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.live-panel-head p { margin: 0; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--panel-muted); }
.live-dot { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.75rem; color: var(--panel-accent); }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: var(--panel-accent); box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.15); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

.mini-keyboard { display: grid; gap: 5px; margin-bottom: 8px; }
.mini-row { display: flex; gap: 5px; justify-content: center; }
.mini-key {
  flex: 1 1 0;
  max-width: 40px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--panel-2);
  border: 1px solid var(--panel-line);
  border-bottom-width: 3px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--panel-muted);
  transition: background 0.08s ease, color 0.08s ease, transform 0.08s ease;
}
.mini-key.space { max-width: 220px; flex: 6 1 0; aspect-ratio: auto; height: 34px; }
.mini-key.tested { background: #134e48; color: #ccfbf1; border-color: #2c7a70; }
.mini-key.active { background: #fbbf24; color: #1f1300; border-color: #d97706; transform: translateY(2px); border-bottom-width: 1px; }
.mini-hint { text-align: center; font-size: 0.86rem; color: var(--panel-muted); margin: 8px 0 16px; min-height: 1.4em; }
.mini-hint strong { color: var(--panel-text); }

.readouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.readout {
  background: var(--panel-2);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--panel-text);
  display: block;
  min-width: 0;
}
a.readout:hover { border-color: var(--panel-accent); text-decoration: none; color: var(--panel-text); }
.readout span { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--panel-muted); margin-bottom: 2px; }
.readout strong { display: block; font-family: var(--mono); font-weight: 600; font-size: 1.02rem; color: var(--panel-accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-panel-foot { margin: 14px 0 0; font-size: 0.8rem; color: var(--panel-muted); display: flex; gap: 8px; align-items: center; }
.live-panel-foot .icon { width: 15px; height: 15px; }

.finder-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
.finder-head h2 { margin: 0; }
.finder-search { position: relative; width: min(380px, 100%); }
.finder-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.finder-search input { width: 100%; padding-left: 38px; }

.problem-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; margin-top: 16px; }
.problem-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px 16px;
}
.problem-row .tool-icon { grid-row: span 2; width: 36px; height: 36px; }
.problem-row h3 { font-size: 0.98rem; margin: 0; line-height: 1.35; }
.problem-row p { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 0; font-size: 0.9rem; }
.problem-row p a { font-weight: 600; }
.problem-row p a.problem-guide { font-weight: 500; color: var(--muted); }
.problem-row p a.problem-guide:hover { color: var(--primary-2); }
.finder-empty { color: var(--muted); margin: 14px 0 0; }

.guide-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.guide-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.guide-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lift); }
.guide-card img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.guide-card-body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.guide-card h3 { margin: 0; font-size: 1rem; line-height: 1.35; }
.guide-card h3 a { color: var(--text); }
.guide-card h3 a::after { content: ""; position: absolute; inset: 0; }
.guide-card h3 a:hover { text-decoration: none; }
.guide-card p { margin: 0; font-size: 0.88rem; color: var(--muted); }
.guide-meta { font-size: 0.78rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.guide-meta .tool-tag { margin: 0; }

.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.how-grid > div { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; }
.how-grid .tool-icon { grid-row: span 2; }
.how-grid h3 { margin: 0; }
.how-grid p { margin: 0; color: var(--text-soft); font-size: 0.94rem; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; font-size: 0.95rem; }

/* --------------------------------------------------------------------------
   Tool page header (h1 area)
   -------------------------------------------------------------------------- */
.breadcrumbs { font-size: 0.85rem; color: var(--muted); margin: 0 0 -6px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span { margin: 0 6px; }

/* --------------------------------------------------------------------------
   Blog
   -------------------------------------------------------------------------- */
.blog-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.blog-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; position: relative; transition: border-color 0.14s ease, box-shadow 0.14s ease; }
.blog-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lift); }
.blog-card-img { display: block; width: 100%; aspect-ratio: 1200 / 630; height: auto; object-fit: cover; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.blog-card-img-fallback { display: grid; place-items: center; }
.blog-card-img-fallback span { color: var(--primary); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.blog-card-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; }
.blog-card-body .tool-tag { align-self: flex-start; margin: 0; }
.blog-card-body h2 { font-size: 1.02rem; margin: 0; line-height: 1.35; }
.blog-card-body h2 a { color: var(--text); }
.blog-card-body h2 a::after { content: ""; position: absolute; inset: 0; }
.blog-card-body h2 a:hover { text-decoration: none; }
.blog-card-body p { color: var(--muted); font-size: 0.9rem; margin: 0; line-height: 1.5; flex: 1; }
.blog-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.blog-read-link { font-size: 0.86rem; font-weight: 650; }
.blog-read-time { font-size: 0.78rem; color: var(--muted); }

.blog-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.blog-filter button {
  background: var(--surface);
  color: var(--text-soft);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.88rem;
  font-weight: 550;
}
.blog-filter button:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.blog-filter button[aria-pressed="true"] { background: var(--text); color: #fff; border-color: var(--text); }

/* Post */
.blog-post-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 270px; align-items: start; }
.blog-post-layout > * { min-width: 0; }
.blog-post-layout > div > article.card { padding: 32px clamp(20px, 4vw, 44px); }
.blog-post-hero { display: none; }
.blog-post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 14px; }
.blog-post-meta span, .blog-post-meta time { color: var(--muted); font-size: 0.86rem; }
.blog-post-meta .blog-tag {
  background: var(--primary-soft);
  color: var(--primary-ink);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.76rem;
  font-weight: 650;
}
.blog-post-layout article h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.15; margin-bottom: 18px; }

.blog-article { font-size: 1.05rem; line-height: 1.75; color: var(--text-soft); max-width: 72ch; }
.blog-article h2 { font-size: clamp(1.25rem, 2vw, 1.5rem); color: var(--text); margin: 38px 0 12px; }
.blog-article h3 { font-size: 1.1rem; color: var(--text); margin: 26px 0 8px; }
.blog-article p { margin: 0 0 18px; }
.blog-article ul, .blog-article ol { padding-left: 24px; margin: 0 0 18px; }
.blog-article li { margin-bottom: 8px; }
.blog-article strong { color: var(--text); }
.blog-article a { color: var(--primary-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent); text-underline-offset: 3px; }
.blog-article a:hover { text-decoration-color: var(--primary); }
.blog-article a.button { color: #fff; text-decoration: none; }
.blog-article a.button-secondary { color: var(--text); }

.blog-quick-answer {
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-left: 5px solid var(--primary);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 8px 0 26px;
  max-width: 72ch;
}
.blog-quick-answer .qa-label { color: var(--primary-ink); font-size: 0.74rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 6px; }
.blog-quick-answer p { margin: 0; color: var(--text); font-size: 1rem; line-height: 1.65; }

.blog-step-list { counter-reset: step; list-style: none; padding: 0 !important; margin: 0 0 18px; display: grid; gap: 14px; }
.blog-step-list li { counter-increment: step; position: relative; padding-left: 46px; min-height: 30px; }
.blog-step-list li::before {
  position: absolute;
  left: 0;
  top: 0;
  content: counter(step);
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.blog-scenario {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-left: 5px solid var(--highlight);
  border-radius: 12px;
  padding: 14px 20px;
  margin: 22px 0;
  color: var(--text-soft);
  font-size: 0.98rem;
}
.blog-scenario .scenario-label { color: var(--warning); font-size: 0.74rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 6px; }
.blog-scenario p { margin: 0; }

.blog-table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; }
.blog-table { width: 100%; border-collapse: collapse; min-width: 420px; font-size: 0.93rem; }
.blog-table th { background: var(--surface-2); color: var(--text); font-weight: 650; padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.blog-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--text-soft); vertical-align: top; }
.blog-table tr:last-child td { border-bottom: none; }

.blog-checklist { list-style: none; padding: 0 !important; margin: 0 0 18px; display: grid; gap: 8px; }
.blog-checklist li { display: flex; gap: 10px; padding: 10px 14px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px; font-size: 0.96rem; }
.blog-checklist li::before { content: '☐'; color: var(--primary); flex-shrink: 0; }

.blog-faq { display: grid; gap: 10px; margin-top: 8px; }
.blog-faq-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.blog-faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 650;
  font-size: 0.98rem;
  color: var(--text);
  user-select: none;
  list-style: none;
}
.blog-faq-q::-webkit-details-marker { display: none; }
.blog-faq-q:hover { background: var(--bg-elev); }
.blog-faq-q::after { content: '+'; font-size: 1.3rem; color: var(--primary); flex-shrink: 0; transition: transform 0.2s ease; }
.blog-faq-item[open] .blog-faq-q::after { transform: rotate(45deg); }
.blog-faq-a { padding: 12px 16px 14px; color: var(--text-soft); font-size: 0.97rem; line-height: 1.7; border-top: 1px solid var(--line); }
.blog-faq-a p:last-child { margin-bottom: 0; }

.blog-cta {
  background: var(--panel);
  color: var(--panel-text);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  align-items: center;
  margin: 18px 0;
  box-shadow: none;
}
.blog-cta .cta-eyebrow { color: var(--panel-accent); font-family: var(--mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0; }
.blog-cta h3 { margin: 0; font-size: 1.15rem; color: var(--panel-text); }
.blog-cta p { margin: 0; color: var(--panel-muted); font-size: 0.92rem; }
.blog-cta .button { background: var(--panel-accent); border-color: var(--panel-accent); color: var(--panel); }
.blog-cta .button:hover { background: #99f6e4; border-color: #99f6e4; color: var(--panel); }
.blog-cta .button-secondary { background: transparent; color: var(--panel-text); border-color: var(--panel-line); }
.blog-cta .button-secondary:hover { background: var(--panel-2); color: var(--panel-text); }
.blog-article .blog-cta a.button { color: var(--panel); }
.blog-article .blog-cta a.button-secondary { color: var(--panel-text); }

.blog-sidebar .blog-cta { background: var(--surface); color: var(--text); border-color: var(--line); text-align: left !important; align-items: flex-start !important; }
.blog-sidebar .blog-cta .cta-eyebrow { color: var(--primary); }
.blog-sidebar .blog-cta h3 { color: var(--text); }
.blog-sidebar .blog-cta p { color: var(--muted); }
.blog-sidebar .blog-cta .button { background: var(--primary); border-color: var(--primary); color: #fff; }
.blog-sidebar .blog-cta .button:hover { background: var(--primary-2); }
.blog-sidebar .blog-cta .button-secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.blog-sidebar .blog-cta .button-secondary:hover { background: var(--surface-2); color: var(--text); }

.blog-related-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.blog-related-card { padding: 14px 16px; position: relative; box-shadow: none; transition: border-color 0.14s ease; }
.blog-related-card:hover { border-color: var(--primary); }
.blog-related-card .related-tag { font-size: 0.72rem; color: var(--primary); text-transform: uppercase; letter-spacing: 0.07em; margin: 0 0 6px; font-weight: 700; }
.blog-related-card h3 { margin: 0; font-size: 0.95rem; line-height: 1.35; }
.blog-related-card h3 a { color: var(--text); }
.blog-related-card h3 a::after { content: ""; position: absolute; inset: 0; }

.blog-sidebar { display: grid; gap: 14px; position: sticky; top: calc(var(--header-h) + 16px); }
.blog-toc { padding: 16px 18px; }
.blog-toc h3 { margin: 0 0 10px; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.blog-toc ol { margin: 0; padding-left: 18px; display: grid; gap: 7px; }
.blog-toc ol li { font-size: 0.88rem; color: var(--muted); }
.blog-toc ol li a { color: var(--text-soft); }
.blog-toc ol li a:hover { color: var(--primary-2); }

.author-box { margin-top: 32px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elev); max-width: 72ch; }
.author-box p { margin: 0 0 8px; color: var(--text-soft); }
.author-box p:last-child { margin-bottom: 0; }
.author-box-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted) !important; font-weight: 700; }
.author-box-name { font-weight: 700; }
.author-box-note { font-size: 0.9rem; color: var(--muted) !important; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--text); color: #cbd5e1; margin-top: 24px; }
.site-footer a { color: #e2e8f0; }
.site-footer a:hover { color: #fff; }
.footer-inner { max-width: var(--container); margin: 0 auto; padding: 40px 20px 28px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1.4fr repeat(3, 1fr); }
.footer-brand p { color: #94a3b8; font-size: 0.92rem; max-width: 36ch; margin-top: 12px; }
.footer-brand .logo { color: #fff; }
.footer-brand .logo-text span { color: #5eead4; }
.site-footer h2 { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; margin-bottom: 12px; font-weight: 700; }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 0.93rem; }
.footer-bottom { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid #334155; color: #94a3b8; font-size: 0.86rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .gamepad-layout, .touchpanel-grid { grid-template-columns: 1fr; }
  .gamepad-axes-grid, .gamepad-trigger-grid, .hid-inline-grid { grid-template-columns: 1fr; }
  .mega-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .main-nav, .header-search { display: none; }
  .site-header .nav-toggle { display: inline-flex; }
  .mobile-panel.open {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: var(--bg-elev);
    overflow: auto;
    padding: 16px 20px 40px;
    z-index: 49;
    border-top: 1px solid var(--line);
  }
  .mobile-panel .header-search { display: flex; width: 100%; margin: 0 0 12px; }
  .mobile-panel .search-results { position: static; width: 100%; box-shadow: none; margin-bottom: 12px; }
  .mobile-panel .mega-group a { padding: 10px 8px; }
  .mobile-links { display: grid; gap: 2px; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
  .mobile-links a { padding: 10px 8px; color: var(--text); font-weight: 600; border-radius: 8px; }
  .mobile-links a:hover { background: var(--surface-2); text-decoration: none; }
  body.menu-open { overflow: hidden; }

  .home-hero { grid-template-columns: 1fr; padding-top: 20px; }
  .speedtest-shell { grid-template-columns: 1fr; }
  .two-column { grid-template-columns: 1fr; }
  .blog-post-layout { grid-template-columns: minmax(0, 1fr); }
  .blog-sidebar { position: static; }
  .blog-toc { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .site-header-inner { padding: 0 16px; }
  .card { padding: 18px 16px; }
  .hero { padding: 22px 18px; }
  .blog-post-layout > div > article.card { padding: 22px 18px; }
  .blog-article { font-size: 1rem; }
  .problem-list { grid-template-columns: 1fr; }
  .readouts { grid-template-columns: 1fr 1fr; }
  .readout strong { font-size: 0.92rem; }
  .info-table div { grid-template-columns: 1fr; gap: 2px; }
  .footer-grid { grid-template-columns: 1fr; }
  .board-table th:nth-child(4), .board-table td:nth-child(4) { display: none; }
  .joystick-plot-wrap { grid-template-columns: 1fr; }
  .stat-card p { font-size: 1rem; }
}

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

/* Status grids of small cards (keyboard, screen, speed, system info) read as instrument readouts */
.status-grid > .card { padding: 14px 16px; box-shadow: none; background: var(--bg-elev); }
.status-grid > .card > h2 {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 6px;
  font-weight: 650;
}
.status-grid > .card > p:not(.small-note) {
  margin: 0;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
  overflow-wrap: anywhere;
}
.status-grid > .card .small-note { font-size: 0.82rem; margin: 4px 0 0; }

/* Long settings paths and commands must wrap on phones */
.blog-article p, .blog-article li, .blog-article code, .blog-quick-answer p, .blog-faq-a { overflow-wrap: anywhere; }
.blog-table-wrap { max-width: 100%; }
.blog-table td, .blog-table th { overflow-wrap: normal; }

/* Archived (pre-fix) GPU scores: visibly secondary */
.board-table-legacy td { color: var(--muted); }
.board-table-legacy tbody tr:nth-child(1) td:nth-child(1)::before { content: none; }
