/* ============================================================
   SERIAL — noir web theme
   ============================================================ */

:root {
  --bg: #07080b;
  --panel: rgba(14, 16, 21, 0.86);
  --ink: #ece7dd;
  --ink-dim: #9a9aa6;
  --line: rgba(255, 255, 255, 0.10);
  --amber: #e9962e;
  --amber-hi: #ffb857;
  --danger: #9b2f2a;
  --nav-h: 64px;

  --font-body: "Inter", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Oswald", var(--font-body);
  --font-display: "Anton", var(--font-head);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* clip (not hidden) so <body> is not forced into a scroll container,
     which would break the position:fixed .backdrop after scrolling */
  overflow-x: clip;
}
@media (min-width: 768px) { html { font-size: 16px; } }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  /* sticky footer: main grows to fill, footer pinned to the bottom on short pages.
     (.backdrop and .site-nav are position:fixed, so they aren't flex items.) */
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }

/* fixed cinematic backdrop shared by every page ------------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* `cover` cropped a DIFFERENT fraction of this image depending on the viewport's own aspect
     ratio — a wide desktop window cropped out the top (hiding the baked-in "SERIAL" title,
     which is why a separate .hero-logo image was added), but a tall mobile viewport needed much
     less cropping, so the title reappeared there too, showing "SERIAL" twice. `contain` always
     shows the whole image, scaled consistently, regardless of device shape — one title, same
     place, everywhere — so the separate overlay image is gone; this is the only wordmark now. */
  background: var(--bg) url("/img/serial-splash.webp") center center / contain no-repeat;
}
/* content sits above the fixed backdrop (avoid negative z-index — some
   browsers drop the paint of a fixed negative-z layer after scrolling) */
main { position: relative; z-index: 1; }
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  /* The old 66% floor at the very top (needed lower down for hero-text contrast) barely showed
     back when .backdrop used background-size: cover, which cropped that whole region out of view
     on desktop. Now that contain shows the full image everywhere, that same floor dimmed the
     title/photo throughout. Lightened the top of the gradient so the image/title read clearly,
     keeping the darker floor only where the bottom-anchored hero text actually needs contrast. */
  background:
    radial-gradient(150% 120% at 50% 24%, transparent 20%, rgba(7, 8, 11, 0.30) 74%),
    linear-gradient(180deg,
      rgba(7, 8, 11, 0.10) 0%,
      rgba(7, 8, 11, 0.50) 55%,
      rgba(7, 8, 11, 0.95) 100%);
}

a { color: var(--amber-hi); text-decoration: none; }
a:hover { color: var(--amber); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink);
  line-height: 1.1;
}

.kicker {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.34em;
  font-size: 0.72rem;
  color: var(--amber);
  margin: 0 0 0.9rem;
}
.lead-dim { color: var(--ink-dim); font-size: 1.05rem; max-width: 62ch; }
/* Same look as .lead-dim, minus the readable-line-length cap -- for a details/summary block
   inside a full-width panel (e.g. the Case page) where that cap just wastes vertical space. */
.case-summary { color: var(--ink-dim); font-size: 1.05rem; }

/* ---------- nav ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  min-height: var(--nav-h);
  padding: 0;
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease, backdrop-filter .25s ease;
}
.site-nav.scrolled {
  background: rgba(8, 9, 13, 0.92);
  border-bottom-color: var(--line);
  backdrop-filter: blur(8px);
}
.nav-wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 clamp(16px, 4vw, 32px);
}
/* The nav no longer carries its own small brand mark — .hero-logo below is now the only "Serial"
   wordmark on the page, large and centered under the nav instead of duplicated in the corner. */

.site-nav .navbar-nav { align-items: center; gap: clamp(6px, 1.6vw, 22px); }
.site-nav .nav-link {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--ink-dim);
  padding: 0.5rem 0.25rem;
}
.site-nav .nav-link:hover,
.site-nav .nav-link.active { color: var(--ink); }
.site-nav .nav-link.nav-cta {
  color: var(--amber-hi);
  border: 1px solid rgba(233, 150, 46, 0.5);
  border-radius: 2px;
  padding: 0.45rem 1rem;
}
.site-nav .nav-link.nav-cta:hover { color: #140d02; background: var(--amber); border-color: var(--amber); }
.site-nav .btn-link.nav-link { text-decoration: none; border: 0; background: none; }

.navbar-toggler { border-color: var(--line); color: var(--ink); }
.navbar-toggler:focus { box-shadow: 0 0 0 0.2rem rgba(233, 150, 46, 0.25); }
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(236,231,221,0.85)' stroke-linecap='round' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
@media (max-width: 767.98px) {
  .site-nav .navbar-collapse {
    background: rgba(8, 9, 13, 0.98);
    border-top: 1px solid var(--line);
    margin: 0 calc(-1 * clamp(16px, 4vw, 32px));
    padding: 10px clamp(16px, 4vw, 32px) 18px;
  }
  .site-nav .navbar-nav { align-items: stretch; gap: 2px; }
  .site-nav .nav-link { padding: 0.7rem 0.25rem; }
  .site-nav .nav-link.nav-cta { text-align: center; margin-top: 6px; }
}

/* ---------- buttons ---------- */
.btn-amber, .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 0.85rem 1.7rem;
  border-radius: 2px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.btn-amber { background: var(--amber); border: 1px solid var(--amber); color: #140d02; }
.btn-amber:hover {
  background: var(--amber-hi);
  border-color: var(--amber-hi);
  color: #140d02;
  box-shadow: 0 0 26px rgba(233, 150, 46, 0.35);
  transform: translateY(-1px);
}
.btn-ghost { background: transparent; border: 1px solid rgba(255, 255, 255, 0.35); color: var(--ink); }
.btn-ghost:hover {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  transform: translateY(-1px);
}
.btn-lg.btn-amber { padding: 1rem 2.2rem; font-size: 0.95rem; }

/* Bootstrap button/control reskins so existing pages inherit the theme */
.btn-primary, .btn-primary:focus, .btn-primary:active {
  background: var(--amber) !important;
  border-color: var(--amber) !important;
  color: #140d02 !important;
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.btn-primary:hover { background: var(--amber-hi) !important; border-color: var(--amber-hi) !important; }
.btn-primary:disabled, .btn-primary.disabled { background: rgba(255,255,255,0.14) !important; border-color: transparent !important; color: var(--ink-dim) !important; }
.btn-outline-secondary { color: var(--ink); border-color: rgba(255, 255, 255, 0.3); }
.btn-outline-secondary:hover { background: rgba(255, 255, 255, 0.08); color: var(--ink); border-color: var(--ink); }
.btn-link { color: var(--amber-hi); }

/* ---------- forms ---------- */
.form-control, .form-select {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 2px;
  padding: 0.6rem 0.8rem;
}
.form-control:focus, .form-select:focus {
  background: rgba(0, 0, 0, 0.45);
  border-color: var(--amber);
  box-shadow: 0 0 0 0.2rem rgba(233, 150, 46, 0.15);
  color: var(--ink);
}
.form-control::placeholder { color: #6b6b73; }
.form-label {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.74rem;
  color: var(--ink-dim);
  margin-bottom: 0.35rem;
}

/* ---------- shared surfaces ---------- */
.page-shell {
  position: relative;
  max-width: 1060px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 52px) clamp(16px, 5vw, 32px) 96px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: clamp(24px, 4vw, 40px);
  backdrop-filter: blur(6px);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.85);
}
.panel--narrow { max-width: 460px; margin: 0 auto; }
.recaptcha-disclosure { font-size: 0.75rem; line-height: 1.4; }
.recaptcha-disclosure a { color: var(--ink-dim); text-decoration: underline; }
.recaptcha-disclosure a:hover { color: var(--ink); }

.text-muted { color: var(--ink-dim) !important; }
.border { border-color: var(--line) !important; }
code { color: var(--amber-hi); background: rgba(0,0,0,0.35); padding: 0.1em 0.35em; border-radius: 2px; }

.alert { border-radius: 3px; }
.alert-danger { background: rgba(155, 47, 42, 0.18); border-color: rgba(155, 47, 42, 0.5); color: #f0c9c5; }
.alert-warning { background: rgba(233, 150, 46, 0.14); border-color: rgba(233, 150, 46, 0.4); color: #f2d9b4; }
.alert-secondary { background: rgba(255, 255, 255, 0.06); border-color: var(--line); color: var(--ink-dim); }
.alert-success { background: rgba(60, 140, 90, 0.16); border-color: rgba(60, 140, 90, 0.45); color: #bfe8cf; }

.table { color: var(--ink); }
.table > :not(caption) > * > * { border-bottom-color: var(--line); background: transparent; color: inherit; }
.table > thead th {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  color: var(--ink-dim);
  font-weight: 600;
}
/* highlight "you" on the leaderboard */
.table-you > td { background: rgba(233, 150, 46, 0.12) !important; color: var(--amber-hi) !important; font-weight: 600; }

.progress { background: rgba(255, 255, 255, 0.08); border-radius: 2px; }
.progress-bar { background: var(--amber); }
.spinner-border { color: var(--amber); }

/* ---------- landing: hero ---------- */
.hero {
  position: relative;
  z-index: 0;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 clamp(20px, 6vw, 76px) clamp(52px, 11vh, 130px);
}
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 68%;
  background: linear-gradient(180deg, transparent, rgba(7, 8, 11, 0.92) 82%);
  z-index: -1;
}
/* No separate .hero-logo element anymore — .backdrop (background-size: contain, see its comment)
   now reliably shows the splash art's own baked-in "SERIAL" title on every device, so a second,
   explicit wordmark here would just duplicate it again. */
.hero-inner { max-width: 640px; }
.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  margin: 0 0 1.1rem;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.7);
}
.hero-sub {
  color: #d6d2c9;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  max-width: 54ch;
  margin: 0 0 1.8rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  color: var(--ink-dim);
  font-size: 1.4rem;
  line-height: 1;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(6px); } }

/* ---------- landing: content bands ---------- */
.band {
  position: relative;
  padding: clamp(64px, 12vh, 140px) clamp(20px, 6vw, 76px);
  /* every band carries its own dark floor so copy stays legible regardless
     of what the fixed backdrop is showing behind it */
  background: rgba(7, 8, 11, 0.62);
}
.band--tint { background: linear-gradient(180deg, rgba(7, 8, 11, 0.74), rgba(7, 8, 11, 0.9)); }
.band--cta { background: rgba(7, 8, 11, 0.9); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-inner { max-width: 1080px; margin: 0 auto; }
.band-inner.center { text-align: center; }
.band h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); margin: 0 0 1rem; }
.band-inner.center .lead-dim { margin: 0 auto; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(18px, 3vw, 34px);
  margin-top: clamp(30px, 5vw, 54px);
}
.feature {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 26px 24px;
  background: rgba(0, 0, 0, 0.28);
}
.feature svg { width: 34px; height: 34px; color: var(--amber); margin-bottom: 14px; }
.feature h3 { font-size: 1.05rem; margin: 0 0 0.5rem; letter-spacing: 0.06em; }
.feature p { color: var(--ink-dim); margin: 0; font-size: 0.95rem; }

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
}
.split-text .btn-amber { margin-top: 1.4rem; }
.split-media { display: flex; justify-content: center; }
.split-media img {
  width: min(400px, 60vw);
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.6));
  /* trims the baked-in corner watermark on the source art */
  clip-path: inset(6% 9% 1% 0%);
}
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; text-align: center; }
  .split-text .lead-dim { margin-left: auto; margin-right: auto; }
}
.band--cta .btn-amber { margin-top: 1.6rem; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  background: rgba(7, 8, 11, 0.9);
  padding: 26px clamp(16px, 4vw, 32px);
}
.footer-wrap {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink-dim);
  font-size: 0.85rem;
}
.footer-wrap a { color: var(--ink-dim); }
.footer-wrap a:hover { color: var(--ink); }

/* ---------- case page: scene image expand/collapse + evidence lightbox ---------- */
.scene-image-wrap {
  position: relative;
  display: inline-block;
  max-width: 420px;
}
.scene-image-wrap img.scene-img {
  display: block;
  width: 100%;
  height: auto;
}
.zoomable-img { cursor: zoom-in; }
.expand-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(3, 3, 5, 0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.expand-badge:hover { background: rgba(3, 3, 5, 0.85); }
.scene-status-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  background: rgba(3, 3, 5, 0.75);
  border: 1px solid var(--line);
}
.scene-status-badge.status-found { color: var(--amber-hi); border-color: rgba(233, 150, 46, 0.5); }
.scene-status-badge.status-empty { color: var(--ink-dim); }
.lightbox-image-wrap .scene-status-badge { left: 12px; top: 12px; }
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 3, 5, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 3rem;
  z-index: 1050;
}
.lightbox-image-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
  flex-shrink: 0;
}
.lightbox-image-wrap img {
  display: block;
  max-width: 90vw;
  max-height: 68vh;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  cursor: crosshair;
}
/* A result/review caption always renders here, below the image -- never overlaid on top of it,
   so it can never collide with the status badge or a hotspot marker regardless of where a click
   or marker happens to sit (see wwwroot/js/case.js, showCaption). */
.lightbox-caption {
  max-width: 90vw;
  width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.lightbox-caption-img {
  display: block;
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.collapse-badge {
  right: 12px;
  bottom: 12px;
}
.hotspot-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid #140d02;
  color: #140d02;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.45);
}
.hotspot-marker:hover { background: var(--amber-hi); }
.hotspot-popover {
  position: absolute;
  z-index: 5;
  max-width: 220px;
  transform: translateX(-50%);
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.hotspot-popover-img {
  display: block;
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 4px;
}

/* ---------- case page: scene carousel ---------- */
.scene-nav-controls { display: flex; align-items: center; }
.carousel-arrow {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
}
.carousel-arrow:hover:not(:disabled) { border-color: var(--amber); color: var(--amber-hi); }
.carousel-arrow:disabled { opacity: 0.3; cursor: default; }

/* ---------- solve page: suspect/location selection cards ---------- */
.select-card { cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.select-card:hover { border-color: var(--amber); }
.btn-check:checked + .select-card {
  border-color: var(--amber);
  background: rgba(233, 150, 46, 0.14);
}
.btn-check:focus-visible + .select-card { outline: 2px solid var(--amber); outline-offset: 2px; }
