/* CivilDetective — one small stylesheet for the whole site.
   Colours are CSS variables at the top: change them here and every page follows. */

:root {
  --bg: #0f1115;          /* page background */
  --bg-card: #171a21;     /* cards, panels */
  --bg-soft: #1e222b;     /* table header, inputs */
  --line: #2a2f3a;        /* borders */
  --text: #f1f3f6;        /* main text */
  --text-dim: #b4bac6;    /* secondary text (still high contrast) */
  --accent: #ff7a1a;      /* orange: buttons, links */
  --designed: #4aa3ff;    /* "as designed" */
  --built: #e5484d;       /* "as built" / weak member */
  --radius: 14px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 19px; line-height: 1.6;     /* large on purpose: much of the audience is 45+ and on TV */
}
img, video, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #ff9a4d; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5.5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.wrap { width: min(100% - 32px, var(--maxw)); margin-inline: auto; }   /* 16px side gutter on phones */
.dim { color: var(--text-dim); }
.small { font-size: .9rem; }

/* keyboard users: always see where focus is */
:focus-visible { outline: 3px solid var(--designed); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #000; padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- header / nav ---------- */
.site-header { border-bottom: 1px solid var(--line); background: rgba(15,17,21,.92); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(6px); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.3rem; }
.brand img { width: 40px; height: 40px; border-radius: 8px; }
.brand span b { color: var(--accent); }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a { color: var(--text); text-decoration: none; padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--bg-soft); color: var(--accent); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 26px; border-radius: 12px; border: 2px solid var(--accent);
  background: var(--accent); color: #111; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.btn:hover { background: #ff9a4d; border-color: #ff9a4d; color: #111; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--bg-soft); color: #ff9a4d; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 32px; }
.hero p.lead { font-size: 1.35rem; color: var(--text-dim); max-width: 46ch; }
.hero h1 em { color: var(--accent); font-style: normal; }

/* ---------- e-mail sign-up box ---------- */
.signup { background: var(--bg-card); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 22px; margin: 28px 0; }
.signup h2, .signup h3 { margin-bottom: 12px; }
.signup form { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 10px; }
.signup label { position: absolute; left: -9999px; }   /* visually hidden, still read by screen readers */
.signup input { min-height: 52px; padding: 10px 14px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg-soft); color: var(--text); font: inherit; width: 100%; }
.signup input::placeholder { color: #8b93a3; }
.signup .msg { grid-column: 1 / -1; margin: 0; }
.signup .msg:empty { display: none; }
@media (max-width: 760px) { .signup form { grid-template-columns: 1fr; } }

/* ---------- case cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card a.thumb { display: block; aspect-ratio: 16 / 9; background: #000; }
.card a.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card .date { font-size: .9rem; color: var(--text-dim); }
.card .more { margin-top: auto; font-weight: 700; }
section.block { padding: 36px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------- case page ---------- */
.crumbs { padding: 20px 0 0; color: var(--text-dim); font-size: .95rem; }
.crumbs a { color: var(--text-dim); }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-frame.empty { display: grid; place-items: center; text-align: center; padding: 20px; color: var(--text-dim); }

.replay { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 36px 0; }
.replay .video-frame { margin-bottom: 14px; }
.replay .video-frame video { object-fit: contain; background: #000; }
.play-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); border: 0; cursor: pointer; width: 100%; color: #fff; }
.play-overlay .tri { width: 96px; height: 96px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; box-shadow: 0 6px 30px rgba(0,0,0,.5); }
.play-overlay .tri::before { content: ""; border-style: solid; border-width: 18px 0 18px 30px; border-color: transparent transparent transparent #111; margin-left: 8px; }
.play-overlay.hidden { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 14px 30px; font-weight: 800; margin: 0 0 12px; }
.legend .designed { color: var(--designed); }
.legend .built { color: var(--built); }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; background: currentColor; }
.weak { border-left: 5px solid var(--built); padding: 8px 0 8px 16px; margin: 0 0 14px; font-size: 1.1rem; }
.weak b { color: var(--built); }
.disclaimer { background: #20140f; border: 1px solid #5a3a22; color: #ffd9bd; border-radius: 10px; padding: 12px 16px; font-size: .95rem; margin: 0; }

.sources li { margin-bottom: 8px; word-break: break-word; }
.share { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.qr { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.qr .code { background: #fff; padding: 10px; border-radius: 10px; line-height: 0; }
.qr .code svg { width: 150px; height: 150px; }

/* ---------- New Tech Watch table ---------- */
.tools { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; align-items: center; }
.tools input[type="search"] { flex: 1 1 260px; min-height: 52px; padding: 10px 14px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg-soft); color: var(--text); font: inherit; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.tracker { border-collapse: collapse; width: 100%; min-width: 880px; font-size: 1rem; }
table.tracker th, table.tracker td { padding: 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
table.tracker th { background: var(--bg-soft); position: sticky; top: 0; font-size: .95rem; white-space: nowrap; }
table.tracker th button { all: unset; cursor: pointer; font-weight: 800; color: var(--text); display: inline-flex; gap: 6px; align-items: center; }
table.tracker th button:focus-visible { outline: 3px solid var(--designed); outline-offset: 3px; }
table.tracker th button::after { content: "↕"; color: var(--text-dim); }
table.tracker th[aria-sort="ascending"] button::after { content: "↑"; color: var(--accent); }
table.tracker th[aria-sort="descending"] button::after { content: "↓"; color: var(--accent); }
table.tracker td:first-child { font-weight: 800; min-width: 190px; }
table.tracker tr:last-child td { border-bottom: 0; }
table.tracker ul { margin: 0; padding-left: 18px; }
.tracker-note { color: var(--text-dim); font-size: .95rem; margin-top: 14px; }

/* ---------- about / sponsor ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; align-items: center; }
.about-grid img { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
blockquote.quote { margin: 0; background: var(--bg-card); border: 1px solid var(--line); border-left: 5px solid var(--designed); border-radius: var(--radius); padding: 20px; }
blockquote.quote p { font-size: 1.1rem; }
blockquote.quote footer { color: var(--text-dim); font-size: .9rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin: 20px 0 28px; }
.stat { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat b { display: block; font-size: 1.8rem; color: var(--accent); line-height: 1.2; }
.packages { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.package { background: var(--bg-card); border: 1px solid var(--line); border-top: 5px solid var(--accent); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.package .price { margin-top: auto; font-weight: 800; color: var(--accent); }
ul.ticks { list-style: none; padding: 0; }
ul.ticks li { padding-left: 28px; position: relative; margin-bottom: 8px; }
ul.ticks li::before { content: "✔"; position: absolute; left: 0; color: var(--accent); }

/* ---------- footer + cookie notice ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 32px 0 44px; color: var(--text-dim); font-size: .95rem; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 12px; }
.site-footer .links a { color: var(--text); font-weight: 600; }
.cookie { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 80; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; box-shadow: 0 10px 40px rgba(0,0,0,.6); max-width: 760px; margin-inline: auto; }
.cookie p { margin: 0; flex: 1 1 280px; font-size: .95rem; }
.cookie[hidden] { display: none; }
.err { color: var(--built); }
.ok { color: #6fdc8c; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- touch: every tappable text link gets a 44px-high hit area (phone and TV remote friendly) ---------- */
.site-footer .links a, .card .more, .section-head a, .crumbs a, table.tracker th button { display: inline-flex; align-items: center; min-height: 44px; padding-block: 8px; }
.card .more { padding-right: 8px; }
@media (max-width: 600px) {
  .site-header { position: static; }          /* a two-row sticky bar would eat a quarter of a phone screen */
  .nav a { padding: 10px 11px; }
  .hero { padding: 36px 0 20px; }
  .btn { width: 100%; }                        /* big full-width buttons on phones */
  .hero p .btn + .btn, .share .btn { margin-top: 0; }
  .share { display: grid; grid-template-columns: 1fr 1fr; }
  .share .btn { padding-inline: 10px; }
}
@media (max-width: 600px) {
  .site-header .wrap { padding: 6px 0; gap: 2px; }
  .nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }   /* one row, swipe if needed */
  .nav a { white-space: nowrap; padding: 10px 12px; font-size: 1rem; }
  .video-frame.empty a { display: inline-block; padding: 10px 0; }
}
@media (max-width: 400px) { .nav a { padding: 10px 8px; font-size: .95rem; } }

/* =====================================================================
   Version 2: split hero, proof strip, cards with badges, chips, tech cards, recent collapses
   ===================================================================== */
.sr { position: absolute; left: -9999px; }
.hero-split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center; padding: 48px 0 24px; }
.hero-split h1 { margin-bottom: 14px; }
.hero-split .lead { margin-bottom: 22px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.btn.sub { background: #ff0033; border-color: #ff0033; color: #fff; }       /* YouTube red: the subscribe button should be unmistakable */
.btn.sub:hover { background: #ff3358; border-color: #ff3358; color: #fff; }
.hero-media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: 0 12px 50px rgba(0,0,0,.5); line-height: 0; }
.hero-media video { width: 100%; height: auto; display: block; max-height: 520px; object-fit: cover; }
@media (max-width: 860px) { .hero-split { grid-template-columns: 1fr; padding-top: 28px; } .hero-media { max-width: 460px; } }

.proof { margin: 8px 0 8px; padding: 16px 20px; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); font-size: 1.05rem; text-align: center; color: var(--text-dim); }
.proof b { color: var(--text); font-size: 1.15em; }
.proof i { font-style: normal; color: var(--accent); margin: 0 6px; }

/* cards: thumbnail with badge */
.card a.thumb { position: relative; }
.card a.thumb .thumb-ico { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-dim); background: var(--bg-soft); }
.card a.thumb .thumb-ico .ico { width: 64px; height: 64px; }
.badge { position: absolute; left: 10px; bottom: 10px; padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: .85rem; line-height: 1.2; }
.badge.replay { background: var(--accent); color: #111; }
.badge.plain { background: rgba(15,17,21,.85); color: var(--text); border: 1px solid var(--line); }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.card[hidden] { display: none; }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
@media (max-width: 520px) { .grid.two { grid-template-columns: 1fr; } }

/* filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; padding: 8px 20px; border-radius: 999px; border: 2px solid var(--line); background: var(--bg-card); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #111; }
.tools input[type="search"] { flex: 1 1 220px; }

/* case page */
.soon { margin: 10px 0 0; font-size: .95rem; }
.summary { font-size: 1.2rem; max-width: 62ch; }
.replay { margin-top: 0; }

/* new tech cards + recent collapses */
.tech-card .body, .recent-card .body { gap: 10px; }
.tech-head { display: flex; align-items: center; gap: 12px; }
.tech-head h3 { margin: 0; }
.type-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--bg-soft); color: var(--accent); flex: none; }
.type-ico .ico { width: 26px; height: 26px; }
.tech-card p, .recent-card p { margin: 0; }
.tech-card .srcs { margin: 0; padding-left: 18px; font-size: .95rem; }
.recent-top { display: flex; align-items: center; gap: 12px; }
.status { align-self: flex-start; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: .85rem; border: 1px solid var(--line); }
.st-unknown { color: var(--text-dim); }
.st-inv { color: #ffc266; border-color: #6b4a14; background: #231a0b; }
.st-rep { color: #7fd1a0; border-color: #1f5a3a; background: #0d2018; }
.links-row { font-weight: 600; }
.map { height: 360px; border-radius: var(--radius); border: 1px solid var(--line); margin: 0 0 24px; background: var(--bg-card); }

/* base size: 19px was already large; nav a little bigger for older eyes and TV browsers */
.nav a { font-size: 1.05rem; }

/* =====================================================================
   Brand alignment with the SponsorNext page: gold accent, condensed UPPERCASE headings,
   monospace sub-lines, faint grid background. Body copy stays Inter (easier to read for long text).
   ===================================================================== */
:root {
  --bg: #111214;
  --bg-card: #1b1c1f;
  --bg-soft: #232428;
  --line: #2c2d31;
  --accent: #c9a85c;           /* gold */
  --accent-hi: #ddc07a;
  --text-dim: #a9a9a2;
  --font-head: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
body {
  background-color: var(--bg);
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 34px 34px;
}
h1, h2, h3, .brand { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .01em; font-weight: 700; }
h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); line-height: 1.02; }
h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h3 { font-size: 1.45rem; line-height: 1.15; }
.hero h1 em { color: var(--accent); }
.hero p.lead, .lead, .date, .proof, .badge, .status, .chip, .small, .tools input, .signup input, .nav a, .legend, .tracker-note, .crumbs {
  font-family: var(--font-mono);
}
.nav a { font-size: .95rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 500; }
.lead { font-size: 1.1rem; color: var(--text-dim); }
.btn { font-family: var(--font-head); font-size: 1.25rem; text-transform: uppercase; letter-spacing: .04em; }
.btn, .btn:hover { color: #111; }
.btn.ghost { color: var(--accent); }
.btn.ghost:hover { color: var(--accent-hi); }
.btn:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
a { color: var(--accent); }
a:hover { color: var(--accent-hi); }
.brand span b { color: var(--accent); }
.card, .signup, .proof, .replay, .package, .stat, blockquote.quote, .qr { background: rgba(27,28,31,.92); border-radius: 6px; }
.card, .signup, .proof, .package, .stat, .qr, .replay, blockquote.quote, .hero-media, .video-frame, .map { border-radius: 6px; }
.signup { border-left-width: 4px; }
.package .price, .stat b { font-family: var(--font-head); font-size: 2rem; color: var(--accent); }
.package .price { font-size: 1.6rem; }
.chip { text-transform: uppercase; letter-spacing: .03em; font-size: .9rem; border-radius: 4px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.badge.replay { background: var(--accent); }
.proof b { font-family: var(--font-head); font-size: 1.5em; color: var(--text); }
.proof i { color: var(--accent); }
.type-ico { color: var(--accent); border-radius: 6px; }
.site-header { background: rgba(17,18,20,.94); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
.hero-split h1 { max-width: 12ch; }
@media (max-width: 600px) { h1 { font-size: 2.6rem; } .btn { font-size: 1.2rem; } }
