/* ============================================================
   VeriScite design system — case file / evidence room
   Palette: ink-black + aged paper, red grading-pen accent
   Type: Fraunces (display) / IBM Plex Sans (body) / JetBrains Mono (data)
   ============================================================ */

:root {
  /* Color */
  --bg: #191510;
  --bg-raised: #1f1a13;
  --panel: #221c14;
  --panel-raised: #2b2318;
  --border: #3d3324;
  --border-soft: #2e2719;

  --paper: #ede3cc;
  --paper-dim: #ded1af;
  --text: #ece4d3;
  --text-muted: #9c9078;
  --text-on-paper: #211c12;

  --accent: #c1442d;        /* red pen — the only bright color on the page */
  --accent-soft: #7a3324;
  --accent-wash: rgba(193, 68, 45, 0.12);

  --verified: #5b8c5a;
  --contradict: #c1442d;
  --nei: #8b8470;
  --unresolved: #5f5744;

  /* Type */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-hand: 'Caveat', cursive;

  /* Layout */
  --max-width: 1100px;
  --radius: 4px;
  --radius-sm: 2px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% -10%, rgba(193, 68, 45, 0.05), transparent 45%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 3px);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em 0;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5.4vw, 4rem); font-weight: 500; }
h2 { font-size: clamp(1.7rem, 3vw, 2.35rem); font-weight: 500; }
h3 { font-family: var(--font-body); font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1em 0; color: var(--text); }
p.muted, .muted { color: var(--text-muted); }

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

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

code, .mono { font-family: var(--font-mono); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- Nav ---------------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(25, 21, 16, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}

.site-nav .logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.site-nav .logo span { color: var(--accent); font-style: italic; }
.site-nav .logo:hover { text-decoration: none; }

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
}

.site-nav a {
  position: relative;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
}
.site-nav a:hover, .site-nav a.active { color: var(--text); text-decoration: none; }
.site-nav a.active {
  color: var(--accent);
}
.site-nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 2px;
  background: var(--accent);
}

@media (max-width: 720px) {
  .site-nav ul { gap: 16px; }
  .site-nav a { font-size: 0.82rem; }
}

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--paper);
  box-shadow: 2px 2px 0 0 var(--accent-soft);
}
.btn-primary:hover {
  background: #d14e35;
  text-decoration: none;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 0 var(--accent-soft);
}
.btn-primary:active { transform: translate(0,0); box-shadow: 1px 1px 0 0 var(--accent-soft); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); text-decoration: none; }

/* ---------------- Cards / panels ---------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  display: block;
}
.eyebrow::before { content: '— '; }

/* ---------------- Verdict badges ---------------- */

.verdict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.verdict::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.verdict-support { color: var(--verified); background: rgba(91, 140, 90, 0.14); }
.verdict-contradict { color: var(--contradict); background: rgba(193, 68, 45, 0.14); }
.verdict-not_enough_info { color: var(--nei); background: rgba(139, 132, 112, 0.14); }
.verdict-unresolved { color: var(--unresolved); background: rgba(95, 87, 68, 0.16); }

/* ---------------- Footer ---------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 80px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

.footer-copyright {
  display: block;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  font-size: 0.76rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ---------------- Section rhythm ---------------- */

section { padding: 64px 0; }
section.tight { padding: 40px 0; }

.section-header { max-width: 640px; margin-bottom: 40px; }

/* ---------------- Utility ---------------- */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 780px) { .grid-2 { grid-template-columns: 1fr; } }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }

/* ---------------- Persistent 3D background ---------------- */

#bg-canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

.panel, .finding-card, .result-card, .trace-panel {
  background: rgba(34, 28, 20, 0.94);
  backdrop-filter: blur(6px);
}

/* ---------------- Custom cursor: red-pen ring ---------------- */

.custom-cursor-dot,
.custom-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transition: opacity 0.2s ease;
}

.custom-cursor-dot {
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  background: var(--accent);
}

.custom-cursor-ring {
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 1.5px solid var(--accent-soft);
  border-radius: 48% 52% 51% 49% / 53% 48% 52% 47%;
  transition: width 0.2s ease, height 0.2s ease, margin 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.custom-cursor-ring.hovering {
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-color: var(--accent);
}

body.custom-cursor-active,
body.custom-cursor-active a,
body.custom-cursor-active button,
body.custom-cursor-active textarea {
  cursor: none;
}

/* ---------------- Scroll reveal ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------- Paper grain texture (used on content pages instead of
   a competing full 3D scene — keeps the two 3D moments, hero + stamp,
   as the actual signature rather than diluting into a sixth wireframe) --- */

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  background-image:
    repeating-linear-gradient(90deg, transparent, transparent 118px, rgba(193,68,45,0.4) 119px, transparent 120px),
    repeating-linear-gradient(0deg, transparent 0px, transparent 27px, rgba(237,227,204,0.5) 28px, transparent 29px);
}
