/* ESPLEX Companion — landing site stylesheet.
   Hand-rolled, no framework. Dark is the default; light responds to the OS. */

:root {
  --bg: #0a0e13;
  --bg-soft: #0f151d;
  --surface: #121a24;
  --surface-2: #172231;
  --fg: #e7eef5;
  --muted: #a4b2c0;
  --border: #22303f;
  --accent: #3ad6c8;
  --accent-soft: rgba(58, 214, 200, 0.12);
  --accent-ink: #06201f;
  --warn: #f2b544;
  --radius: 14px;
  --maxw: 1060px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbfcfd;
    --bg-soft: #f2f6f9;
    --surface: #ffffff;
    --surface-2: #f5f8fb;
    --fg: #0d1720;
    --muted: #4a5b6b;
    --border: #dce5ed;
    --accent: #0d8f87;
    --accent-soft: rgba(13, 143, 135, 0.10);
    --accent-ink: #ffffff;
    --warn: #a86400;
    --shadow: 0 8px 24px rgba(13, 23, 32, 0.08);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- header ---------- */
header.site {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 62px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; }
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px var(--accent);
}
nav.top { display: flex; gap: 20px; font-size: 15px; }
nav.top a { color: var(--muted); }
nav.top a:hover { color: var(--fg); text-decoration: none; }

/* ---------- hero ---------- */
.hero { padding: 66px 0 54px; }
.hero-grid {
  display: grid; gap: 40px; align-items: center;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
}
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; gap: 30px; } }

/* TV mock — illustrative rendering of the channel, not a screenshot */
.tv {
  border: 1px solid var(--border); border-radius: 18px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  padding: 12px; box-shadow: var(--shadow);
}
.tv-screen {
  border-radius: 10px; background: #05080c; border: 1px solid #1a2632;
  padding: 16px 16px 18px; color: #dfe8f1;
}
@media (prefers-color-scheme: light) {
  .tv-screen { background: #0a1017; }
}
.tv-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: #7f8fa0; margin-bottom: 12px;
}
.tv-head b { color: #3ad6c8; font-weight: 700; letter-spacing: 0.14em; }
.tv-row { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.tv-row + .tv-row { border-top: 1px solid #16202b; }
.poster { width: 34px; height: 46px; border-radius: 5px; flex: none; }
.poster.p1 { background: linear-gradient(150deg, #3b5c78, #1d2c3a); }
.poster.p2 { background: linear-gradient(150deg, #6b4a3a, #2a1f1a); }
.poster.p3 { background: linear-gradient(150deg, #3f4f6b, #1b2230); }
.tv-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tv-meta b { font-size: 13.5px; font-weight: 600; color: #e7eef5; }
.pill {
  font-size: 10.5px; letter-spacing: 0.04em; padding: 1px 7px; border-radius: 999px;
  align-self: flex-start; border: 1px solid transparent;
}
.pill.ok { color: #3ad6c8; background: rgba(58,214,200,.12); border-color: rgba(58,214,200,.35); }
.pill.dl { color: #f2b544; background: rgba(242,181,68,.10); border-color: rgba(242,181,68,.3); }
.pill.q  { color: #c3d0dc; background: rgba(195,208,220,.10); border-color: rgba(195,208,220,.3); }
.tv-note { font-size: 11.5px; color: #66788a; text-align: center; padding-top: 10px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding: 5px 11px; border-radius: 999px;
}
h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.6rem);
  line-height: 1.08; letter-spacing: -0.03em;
  margin: 18px 0 14px; font-weight: 720;
}
.lede {
  font-size: clamp(1.05rem, 1.9vw, 1.3rem);
  color: var(--muted); max-width: 44ch; margin: 0 0 30px;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block; padding: 12px 20px; border-radius: 10px;
  font-weight: 620; font-size: 15.5px; border: 1px solid transparent;
  transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 86%, white); }
.btn-ghost { border-color: color-mix(in srgb, var(--fg) 26%, transparent); color: var(--fg); background: transparent; }
.btn-ghost:hover { text-decoration: none; background: var(--surface-2); }

/* ---------- sections ---------- */
section { padding: 46px 0; }
section + section { border-top: 1px solid var(--border); }
h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  letter-spacing: -0.02em; margin: 0 0 10px; font-weight: 680;
}
.sub { color: var(--muted); margin: 0 0 28px; max-width: 62ch; }

.grid-3 {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.grid-4 {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
}
.grid-2 {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.subhead { margin: 38px 0 14px; font-size: 1.15rem; font-weight: 640; letter-spacing: -0.01em; }
.caption { color: var(--muted); font-size: 14px; margin: 26px 0 0; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.card h3 { margin: 10px 0 8px; font-size: 1.12rem; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.card .step-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--accent);
}

figure.diagram { margin: 8px 0 0; }
figure.diagram svg { width: 100%; height: auto; display: block; }
figure.diagram figcaption {
  color: var(--muted); font-size: 14px; margin-top: 10px; text-align: center;
}

/* ---------- lists / tables ---------- */
ul.need { list-style: none; padding: 0; margin: 0; }
ul.need li {
  position: relative; padding: 10px 0 10px 32px;
  border-bottom: 1px solid var(--border); font-size: 15.5px;
}
ul.need li:last-child { border-bottom: 0; }
ul.need li::before {
  content: "✓"; position: absolute; left: 4px; top: 10px;
  color: var(--accent); font-weight: 700;
}
ul.need li b { font-weight: 640; }
ul.need li span { color: var(--muted); }

/* download rows */
.dl-list { display: flex; flex-direction: column; gap: 12px; }
.dl {
  display: grid; grid-template-columns: 190px minmax(0, 1fr) auto;
  gap: 8px 22px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
}
.dl .os { font-weight: 650; font-size: 16px; }
.dl .os span { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.dl .sha {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  overflow-wrap: anywhere; line-height: 1.45;
}
.dl .sha b { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.dl .get { text-align: right; white-space: nowrap; }
.dl .get .btn { padding: 9px 16px; font-size: 14.5px; }
.dl .get .alt { display: block; font-size: 12.5px; margin-top: 6px; }
@media (max-width: 760px) {
  .dl { grid-template-columns: 1fr; gap: 10px; }
  .dl .get { text-align: left; }
}

table.spec {
  width: 100%; border-collapse: collapse; font-size: 15px;
  display: block; overflow-x: auto;
}
table.spec th, table.spec td {
  text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.spec th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }
table.spec td.sha { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

pre {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.55; margin: 12px 0;
}
code { font-family: var(--mono); font-size: 0.92em; }
p code, li code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; white-space: nowrap; }

.callout {
  border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--border));
  background: color-mix(in srgb, var(--warn) 9%, transparent);
  border-radius: var(--radius); padding: 18px 20px; margin: 0 0 26px;
}
.callout p { margin: 0; font-size: 15.5px; }
.callout strong { color: var(--warn); }
.callout.ok { border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-soft); }
.callout.ok strong { color: var(--accent); }

/* ---------- footer ---------- */
footer.site {
  border-top: 1px solid var(--border); padding: 34px 0 46px; margin-top: 20px;
  color: var(--muted); font-size: 14.5px;
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--fg); }

.prose { max-width: 74ch; }
.prose h2 { margin-top: 34px; }
.prose h3 { margin: 26px 0 6px; font-size: 1.05rem; }
.prose p, .prose li { color: var(--muted); }
.prose li { margin-bottom: 6px; }
.updated { font-size: 14px; color: var(--muted); }

@media (max-width: 620px) {
  body { font-size: 16px; }
  .hero { padding: 48px 0 36px; }
  nav.top { gap: 14px; font-size: 14px; }
  header.site nav.top { display: none; }
  .brand { white-space: nowrap; }
  header.site .wrap { min-height: 56px; }
  section { padding: 34px 0; }
}
