/* =========================================================================
   ELRVD — Extreme Low-Light RAW Video Denoising
   Shared stylesheet. Dark editorial / academic theme.
   ========================================================================= */

:root {
  --bg:            #0a0c10;
  --bg-elev:       #11141b;
  --bg-card:       #151926;
  --ink:           #eef1f7;
  --ink-soft:      #aab2c5;
  --ink-mute:      #6b7588;
  --line:          #232838;
  --accent:        #6cf2c9;   /* signal-restored teal */
  --accent-2:      #f2b56c;   /* warm low-light amber  */
  --accent-glow:   rgba(108, 242, 201, 0.16);
  --maxw:          1080px;
  --radius:        14px;
  --nav-h:         60px;
  --font-sans:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono:     'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* atmospheric background: subtle grain + radial glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--accent-glow), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(242, 181, 108, 0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  opacity: 0.025;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

a { color: var(--accent); }

/* =========================================================================
   NAV
   ========================================================================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(10, 12, 16, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; height: 100%;
  padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 14px; letter-spacing: 0.04em;
  color: var(--ink); text-decoration: none; font-weight: 500;
}
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent-glow);
  flex: none;
}
.brand b { color: var(--accent); font-weight: 600; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: 0.02em;
  color: var(--ink-soft); text-decoration: none;
  padding: 8px 13px; border-radius: 8px;
  transition: color .18s, background .18s;
}
.nav-links a:hover { color: var(--ink); background: var(--bg-card); }
.nav-links a.active { color: var(--accent); }
.nav-links a.ext { color: var(--ink-mute); }
.nav-links a.ext:hover { color: var(--accent); }
.nav-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); padding: 7px 10px; cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; display: block; }

/* =========================================================================
   HERO
   ========================================================================= */
header.hero { padding: 76px 0 48px; text-align: center; }

.venue-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 16px; margin-bottom: 26px; background: var(--bg-elev);
}

h1.title {
  font-family: var(--font-sans); font-weight: 700;
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  line-height: 1.06; letter-spacing: -0.035em; margin-bottom: 12px;
}
h1.title .accent { color: var(--accent); }

.subtitle {
  font-size: clamp(1rem, 2vw, 1.22rem);
  color: var(--ink-soft); max-width: 780px; margin: 0 auto 30px; font-weight: 300;
  text-wrap: balance;
}

.affil { font-size: 0.95rem; color: var(--ink-mute); margin-bottom: 28px; }
.affil sup { color: var(--accent); font-size: 0.7em; }

.links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.02em;
  color: var(--ink); background: var(--bg-card);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 20px; text-decoration: none;
  transition: transform .18s ease, border-color .18s, background .18s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--bg-elev); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--accent); color: #06231c; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: #8af7d6; }

/* =========================================================================
   PAGE HEADER (interior pages)
   ========================================================================= */
.page-head { padding: 60px 0 8px; }
.page-head .eyebrow {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.page-head h1 {
  font-family: var(--font-sans); font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 2.9rem); line-height: 1.08; letter-spacing: -0.035em; margin-bottom: 16px;
}
.page-head .lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 720px; font-weight: 300; }

/* =========================================================================
   SECTIONS
   ========================================================================= */
section { padding: 50px 0; position: relative; }
.section-label {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
h2 {
  font-family: var(--font-sans); font-weight: 600;
  font-size: clamp(1.55rem, 3.2vw, 2.2rem);
  letter-spacing: -0.025em; margin-bottom: 24px; line-height: 1.15;
}
h3 {
  font-family: var(--font-sans); font-weight: 600; font-size: 1.24rem;
  letter-spacing: -0.015em; margin: 34px 0 14px; color: var(--ink);
}
h4 {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-2);
  margin: 26px 0 10px;
}
p { color: var(--ink-soft); margin-bottom: 18px; }
p strong, li strong { color: var(--ink); font-weight: 600; }
ul.bullets, ol.bullets { color: var(--ink-soft); margin: 0 0 18px 1.1em; }
ul.bullets li, ol.bullets li { margin-bottom: 10px; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent); border: 0; margin: 0; }

.lead { font-size: 1.1rem; color: var(--ink); }

/* =========================================================================
   BEFORE / AFTER VIDEO SLIDER
   ========================================================================= */
.ba-slider {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: #000;
  cursor: ew-resize; user-select: none; -webkit-user-select: none; touch-action: none;
}
.ba-slider video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ba-after { clip-path: inset(0 0 0 var(--pos, 50%)); }
.ba-divider {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%);
  width: 2px; margin-left: -1px; background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow); pointer-events: none;
}
.ba-handle {
  position: absolute; top: 50%; left: var(--pos, 50%);
  transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #06231c;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.5); pointer-events: none;
  font-family: var(--font-mono); font-size: 15px; font-weight: 600;
}
.ba-label {
  position: absolute; top: 14px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px);
  color: #fff; pointer-events: none;
}
.ba-label.left { left: 14px; }
.ba-label.right { right: 14px; color: var(--accent); }
.ba-hint {
  text-align: center; font-family: var(--font-mono);
  font-size: 12px; color: var(--ink-mute); margin-top: 12px;
}

/* =========================================================================
   FIGURES
   ========================================================================= */
figure.fig { margin: 26px 0; }
figure.fig img {
  width: 100%; border-radius: var(--radius); border: 1px solid var(--line);
  display: block; background: var(--bg-card);
}
figure.fig.padded img { padding: 18px; }
figcaption {
  font-size: 0.92rem; color: var(--ink-mute);
  margin-top: 12px; line-height: 1.6; text-align: center;
}
figcaption b { color: var(--ink-soft); font-weight: 600; }

/* =========================================================================
   TABLES
   ========================================================================= */
.table-scroll { overflow-x: auto; margin: 22px 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 13.5px; }
th, td { padding: 11px 14px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
thead th { color: var(--ink); background: var(--bg-elev); font-weight: 500; letter-spacing: 0.03em; position: sticky; top: 0; }
tbody td { color: var(--ink-soft); }
tbody tr:last-child td { border-bottom: 0; }
tr.highlight td { background: rgba(108, 242, 201, 0.06); color: var(--ink); }
td.best { color: var(--accent); font-weight: 500; }
td.up { color: var(--accent); }
td.down { color: var(--accent-2); }
.table-note { font-size: 0.85rem; color: var(--ink-mute); margin: 8px 2px 0; line-height: 1.5; }

/* =========================================================================
   KEY STAT CALLOUTS
   ========================================================================= */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 26px 0; }
.stat {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 22px; text-align: center;
}
.stat .num { font-family: var(--font-sans); font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; color: var(--accent); line-height: 1; }
.stat .num small { font-size: 1rem; color: var(--ink-mute); }
.stat .lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mute); margin-top: 10px; }

/* =========================================================================
   CARDS / CALLOUTS
   ========================================================================= */
.card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 26px; margin: 22px 0;
}
.card.accent { border-color: rgba(108, 242, 201, 0.35); background: rgba(108, 242, 201, 0.04); }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.callout {
  border-left: 3px solid var(--accent); padding: 4px 0 4px 20px; margin: 22px 0;
  color: var(--ink-soft);
}
.callout.warn { border-left-color: var(--accent-2); }

.formula {
  font-family: var(--font-mono); font-size: 14px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 20px; margin: 18px 0; color: var(--ink); overflow-x: auto;
  text-align: center; letter-spacing: 0.01em;
}

/* nav cards (home -> sections) */
.nav-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 12px; }
.nav-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; transition: transform .18s, border-color .18s;
}
.nav-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.nav-card .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.nav-card h3 { font-family: var(--font-sans); font-size: 1.25rem; margin: 10px 0 8px; color: var(--ink); }
.nav-card p { font-size: 0.95rem; margin: 0; }
.nav-card .go { font-family: var(--font-mono); font-size: 13px; color: var(--accent); margin-top: 14px; display: inline-block; }

/* badges */
.badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.badge {
  font-family: var(--font-mono); font-size: 13px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 14px; color: var(--ink-soft);
}
.badge b { color: var(--accent); font-weight: 500; }

/* pipeline steps */
.steps { display: grid; gap: 12px; margin: 22px 0; counter-reset: step; }
.step {
  display: grid; grid-template-columns: 44px 1fr; gap: 18px; align-items: start;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px;
}
.step .n {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 16px;
  background: var(--bg-elev); border: 1px solid var(--line); color: var(--accent);
}
.step .t { color: var(--ink); font-weight: 600; }
.step .t b { color: var(--accent); }
.step p { margin: 4px 0 0; font-size: 0.97rem; }

/* =========================================================================
   GALLERY
   ========================================================================= */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; margin-top: 12px; }
.gitem { }
.gitem .gtitle {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
}
.gitem .gtitle .name { font-family: var(--font-sans); font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.gitem .gtitle .meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); }

/* side-by-side simultaneous video pair (e.g. YOLO noisy vs. ours) */
.duo-stack { display: grid; gap: 28px; margin-top: 14px; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.duo .vcard {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line); background: #000;
}
.duo .vcard.ours { border-color: var(--accent); }
.duo .vcard video { width: 100%; height: 100%; object-fit: cover; display: block; }
.duo .vtag {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px); color: #fff;
}
.duo .vtag.ours { color: var(--accent); }

/* =========================================================================
   FOOTER
   ========================================================================= */
footer { padding: 50px 0 70px; text-align: center; border-top: 1px solid var(--line); margin-top: 30px; }
footer .links { margin-bottom: 18px; }
footer p { font-size: 0.88rem; color: var(--ink-mute); font-family: var(--font-mono); }
footer .small { font-size: 0.8rem; margin-top: 8px; }

/* =========================================================================
   REVEAL ANIMATION
   ========================================================================= */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 820px) {
  body { font-size: 16px; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-elev); border-bottom: 1px solid var(--line);
    padding: 8px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; border-radius: 8px; }
  .nav-sep { display: none; }
  .nav-toggle { display: inline-flex; }
  .stats { grid-template-columns: 1fr; }
  .nav-cards { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .duo { grid-template-columns: 1fr; }
  .step { grid-template-columns: 1fr; }
  .step .n { display: none; }
  header.hero { padding: 52px 0 36px; }
}
