/* Track Lab — JG BeatsLab look: near-black, white, brand red.
   Fonts: Archivo Black (headings) and Roboto Condensed (body), self-hosted
   from /fonts when present (see README), with system fallbacks. Nothing is
   loaded from a third-party server. */

@font-face { font-family: "Archivo Black"; src: local("Archivo Black"), local("ArchivoBlack-Regular"), url("fonts/ArchivoBlack-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Roboto Condensed"; src: local("Roboto Condensed"), local("RobotoCondensed-Regular"), url("fonts/RobotoCondensed-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Roboto Condensed"; src: local("Roboto Condensed Bold"), local("RobotoCondensed-Bold"), url("fonts/RobotoCondensed-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #0a0a0a;
  --surface: #151515;
  --surface-2: #1d1d1d;
  --border: #2c2c2c;
  --text: #f5f5f5;
  --muted: #a8a8a8;
  --brand: #e50914;
  --brand-hover: #ff1f2b;
  --green: #4ade80;
  --amber: #fbbf24;
  --red: #ff5a5f;
  --wave: #cfcfcf;
  --grid: #333333;
  --ref: #fbbf24;
  --accent-line: #ff5a5f;
  --silence: rgba(160, 160, 160, 0.22);
  --dropout: rgba(251, 191, 36, 0.22);
  --font-head: "Archivo Black", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { 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: 17px;
  line-height: 1.5;
}
a { color: var(--text); text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--text); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.visually-hidden, .sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 920px; margin: 0 auto; padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-mark {
  font-family: var(--font-head); background: var(--brand); color: #fff;
  padding: 2px 7px; border-radius: 4px; font-size: 15px; letter-spacing: 0.5px;
}
.brand-name { font-family: var(--font-head); font-size: 17px; letter-spacing: 0.5px; }
.product { color: var(--muted); font-size: 15px; text-transform: uppercase; letter-spacing: 1.5px; }

main { max-width: 920px; margin: 0 auto; padding: 0 16px 48px; }

h1, h2, h3 { font-family: var(--font-head); font-weight: 400; letter-spacing: 0.3px; line-height: 1.15; }
.hero { padding: 40px 0 12px; }
.hero h1 { font-size: clamp(34px, 7vw, 56px); margin: 0 0 8px; }
.tagline { color: var(--muted); margin: 0; font-size: 19px; max-width: 40em; }

.intro {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; margin: 20px 0 0;
}
.intro h2 { font-size: 18px; margin: 0 0 8px; }
.intro ul { margin: 0 0 8px; padding-left: 20px; }
.link-button { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 15px; padding: 0; }
.link-button:hover { color: var(--text); }

.drop { margin-top: 24px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 6px; min-height: 200px; padding: 28px 16px;
  border: 2px dashed #4a4a4a; border-radius: 12px; background: var(--surface);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: #1a1111; }
.drop-icon { width: 36px; height: 36px; color: var(--brand); }
.drop-title { font-size: 20px; font-weight: 700; }
.drop-sub { color: var(--muted); font-size: 15px; }
.privacy { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; margin: 12px 0 0; }
.privacy::before { content: ""; width: 14px; height: 14px; flex: none; background: var(--green); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l8 4v6c0 5-3.5 9-8 10-4.5-1-8-5-8-10V6z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l8 4v6c0 5-3.5 9-8 10-4.5-1-8-5-8-10V6z'/%3E%3C/svg%3E") center/contain no-repeat; }
.warning { color: var(--amber); font-size: 15px; }

.progress { margin-top: 28px; }
.progress-file { font-weight: 700; margin: 0 0 8px; overflow-wrap: anywhere; }
.bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--brand); transition: width 0.15s; }
.progress-stage { color: var(--muted); font-size: 15px; margin: 8px 0 0; }

.error {
  margin-top: 24px; padding: 14px 18px; border-radius: 10px;
  background: #2a1214; border: 1px solid #5a1d22;
}

.results { margin-top: 28px; }
.summary h2 { font-size: clamp(20px, 4vw, 28px); margin: 0 0 10px; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px 16px; margin: 0 0 16px; }
.facts div { background: var(--surface); border-radius: 8px; padding: 8px 12px; }
.facts dt { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.8px; }
.facts dd { margin: 0; font-weight: 700; }
.compare-note { color: var(--muted); font-size: 15px; }

.chart { margin: 16px 0; padding: 14px; background: var(--surface); border-radius: 10px; }
.chart h3 { font-size: 16px; margin: 0 0 10px; }
.chart canvas { display: block; width: 100%; }
.chart figcaption { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--muted); font-size: 14px; }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.sw-red { background: var(--red); }
.sw-silence { background: var(--silence); outline: 1px solid #555; }
.sw-dropout { background: var(--dropout); outline: 1px solid #7a5d16; }
.chart-summary { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

.checks { list-style: none; margin: 20px 0; padding: 0; display: grid; gap: 10px; }
.check {
  display: grid; grid-template-columns: 92px 1fr; gap: 4px 16px;
  background: var(--surface); border: 1px solid var(--border); border-left-width: 4px;
  border-radius: 10px; padding: 14px 16px;
}
.check.green { border-left-color: var(--green); }
.check.amber { border-left-color: var(--amber); }
.check.red { border-left-color: var(--red); }
.light { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; align-self: start; padding-top: 2px; }
.light svg { width: 20px; height: 20px; flex: none; }
.light.green { color: var(--green); }
.light.amber { color: var(--amber); }
.light.red { color: var(--red); }
.check-body { min-width: 0; }
.check-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.check-name { font-size: 17px; margin: 0; font-family: var(--font-body); font-weight: 700; }
.check-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.check-sub { color: var(--muted); font-size: 14px; margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.check-meaning { margin: 6px 0 0; }
.check-next { margin: 4px 0 0; }
.check-next strong { color: var(--muted); font-weight: 700; }
.check-extra { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.check-before { margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 14px; color: var(--muted); }
.check-before .light { font-size: 14px; padding: 0; }
.check-before .light svg { width: 16px; height: 16px; }

.routing { margin: 24px 0; }
.card {
  background: linear-gradient(180deg, #1c1010, var(--surface)); border: 1px solid #4a1a1d;
  border-radius: 12px; padding: 20px;
}
.card h2 { font-size: 22px; margin: 0 0 6px; }
.card .price { color: var(--muted); font-size: 15px; margin: 0 0 8px; }
.card p { margin: 0 0 14px; }
.secondary-lines { list-style: none; padding: 0; margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.secondary-lines li { margin-top: 4px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 10px 20px; border-radius: 8px; border: 2px solid var(--brand);
  background: var(--brand); color: #fff; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.button.secondary { background: transparent; border-color: #555; color: var(--text); }
.button.secondary:hover { border-color: var(--text); }
.button.secondary[aria-pressed="true"] { border-color: var(--amber); color: var(--amber); }
.button:disabled { opacity: 0.45; cursor: not-allowed; }
.button[aria-disabled="true"] { opacity: 0.6; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.email { margin-top: 32px; padding: 18px 20px; background: var(--surface); border-radius: 10px; }
.email label { font-weight: 700; display: block; margin-bottom: 8px; }
.email-row { display: flex; flex-wrap: wrap; gap: 8px; }
.email input[type="email"] {
  flex: 1 1 220px; min-height: 44px; padding: 8px 12px; border-radius: 8px;
  border: 1px solid #555; background: var(--bg); color: var(--text); font: inherit;
}
.email-note { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

.site-footer { max-width: 920px; margin: 0 auto; padding: 20px 16px 40px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.site-footer a { color: var(--muted); }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .check { grid-template-columns: 1fr; }
  .hero { padding-top: 28px; }
}

/* Light palette for the printed report. app.js adds .printing on beforeprint
   and redraws the charts, so canvases pick these colours up too. */
:root.printing {
  --bg: #fff; --surface: #fff; --surface-2: #eee; --border: #ccc; --text: #000; --muted: #444;
  --green: #157a3c; --amber: #8a5a00; --red: #b3121b; --wave: #555; --grid: #ccc; --ref: #8a5a00;
  --accent-line: #b3121b; color-scheme: light;
}

@media print {
  body { font-size: 12pt; background: #fff; color: #000; }
  .site-header, .hero, .intro, .drop, .progress, .no-print, .skip { display: none !important; }
  .results { margin-top: 0; }
  .check, .chart, .card { break-inside: avoid; border-color: #bbb; }
  .card { background: #fff; }
  a { color: #000; }
}
