:root {
  --oxford: #002147;
  --oxford-mid: #003366;
  --gold: #C9A84C;
  --gold-light: #E8D5A3;
  --cream: #FAF8F3;
  --warm-white: #F5F2EB;
  --text: #1a1a1a;
  --text-muted: #5a5a5a;
  --border: #D4CFC4;
  --sidebar-w: 260px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
}

/* ── TOP NAV ── */
nav {
  background: var(--oxford);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--gold);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'EB Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: white;
  text-decoration: none;
}

.logo svg { width: 28px; height: 28px; fill: var(--gold); }

nav .nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

nav .nav-links a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}

nav .nav-links a:hover { color: var(--gold); }
nav .nav-links a.active { color: var(--gold); border-bottom-color: var(--gold); }

.search-bar {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 6px 12px;
  gap: 8px;
}

.search-bar input {
  background: none;
  border: none;
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  width: 180px;
  outline: none;
}

.search-bar input::placeholder { color: rgba(255,255,255,0.5); }

/* ── HERO ── */
.hero {
  background: var(--oxford);
  color: white;
  padding: 3.5rem 2rem 3rem;
  text-align: center;
  background-image:
    linear-gradient(135deg, rgba(201,168,76,0.08) 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,0.03) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,0.03) 40px);
}

.hero h1 {
  font-family: 'EB Garamond', serif;
  font-size: 2.8rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.hero h1 em { color: var(--gold); font-style: italic; }

.hero p {
  color: rgba(255,255,255,0.65);
  font-size: 0.95rem;
  font-weight: 300;
  max-width: 520px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.hero-tags {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.tag {
  border: 1px solid var(--gold);
  color: var(--gold-light);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.tag:hover, .tag.active {
  background: var(--gold);
  color: var(--oxford);
}

/* ── LAYOUT ── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  max-width: 1200px;
  margin: 0 auto;
  gap: 0;
  padding: 2rem 1.5rem;
}

.layout-full {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── SIDEBAR ── */
aside { padding-right: 2rem; }

.sidebar-section { margin-bottom: 2rem; }

.sidebar-title {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 0.75rem;
}

.taxonomy-tree { list-style: none; }
.taxonomy-tree > li { margin-bottom: 4px; }

.taxonomy-parent {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--oxford);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.taxonomy-parent:hover { background: var(--warm-white); }

.taxonomy-parent .dot {
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
}

.taxonomy-children {
  list-style: none;
  padding-left: 18px;
  margin-top: 2px;
  display: none;
}

.taxonomy-children.open { display: block; }

.taxonomy-children li a {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 3px 6px;
  border-radius: 3px;
  transition: color 0.15s;
}

.taxonomy-children li a:hover { color: var(--oxford); }

.cross-ref-box {
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  padding: 0.9rem;
  font-size: 0.78rem;
}

.cross-ref-box h4 {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.cross-ref-box ul { list-style: none; }
.cross-ref-box li { margin-bottom: 4px; }
.cross-ref-box a {
  color: var(--oxford-mid);
  text-decoration: none;
  font-size: 0.8rem;
  font-style: italic;
}
.cross-ref-box a:hover { text-decoration: underline; }

/* ── SECTION HEADER ── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-header h2 {
  font-family: 'EB Garamond', serif;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--oxford);
}

.view-all {
  font-size: 0.75rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.view-all:hover { border-color: var(--gold); }

/* ── CASE CARD ── */
.case-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.case-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gold);
  opacity: 0;
  transition: opacity 0.2s;
}

.case-card:hover {
  box-shadow: 0 4px 20px rgba(0,33,71,0.08);
  transform: translateY(-1px);
}

.case-card:hover::before { opacity: 1; }

.case-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 3px;
}

.badge-tort { background: #E8F0F9; color: #003366; }
.badge-criminal { background: #F9E8E8; color: #660000; }
.badge-cyber { background: #E8F4F0; color: #005533; }
.badge-animal { background: #F0EDE8; color: #4A3000; }
.badge-juris { background: #F0E8F4; color: #440066; }

.case-year { font-size: 0.75rem; color: var(--text-muted); }

.case-jurisdiction {
  font-size: 0.72rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 2px;
}

.case-card h3 {
  font-family: 'EB Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--oxford);
  margin-bottom: 0.35rem;
  font-style: italic;
}

.case-card .ratio {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.case-card .ratio strong { color: var(--text); }

.case-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.btn-read {
  background: var(--oxford);
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.03em;
  transition: background 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-read:hover { background: var(--oxford-mid); }

.btn-outline {
  background: none;
  color: var(--oxford);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s;
}

.btn-outline:hover { border-color: var(--oxford); }

/* ── FULL CASE ── */
.case-full {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.case-full-header {
  background: var(--oxford);
  color: white;
  padding: 1.5rem;
  border-bottom: 2px solid var(--gold);
}

.case-full-header h2 {
  font-family: 'EB Garamond', serif;
  font-size: 1.6rem;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 0.25rem;
}

.case-full-header p { font-size: 0.8rem; color: rgba(255,255,255,0.65); }

.case-full-body { padding: 1.5rem; }

.case-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.case-section:last-child { border-bottom: none; margin-bottom: 0; }

.case-section-label {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.case-section p {
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
}

.critical-eval {
  background: var(--warm-white);
  border-left: 3px solid var(--oxford);
  padding: 1rem 1.25rem;
  border-radius: 0 4px 4px 0;
}

/* ── GLOSSARY TOOLTIP ── */
.gloss {
  border-bottom: 1px dashed var(--gold);
  cursor: help;
  position: relative;
}

.gloss::after {
  content: attr(data-def);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--oxford);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: normal;
  max-width: 240px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 50;
  border: 1px solid var(--gold);
}

.gloss:hover::after { opacity: 1; }

/* ── ESSAY STRIP ── */
.essay-strip {
  background: var(--oxford);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  color: white;
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none;
}

.essay-strip:hover { opacity: 0.92; }

.essay-icon { font-size: 2rem; flex-shrink: 0; }

.essay-strip h4 {
  font-family: 'EB Garamond', serif;
  font-size: 1.1rem;
  font-style: italic;
  margin-bottom: 4px;
  color: white;
}

.essay-strip p {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
}

.essay-tag {
  margin-left: auto;
  flex-shrink: 0;
  background: var(--gold);
  color: var(--oxford);
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── STATS BAR ── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.stat { background: white; padding: 1rem; text-align: center; }

.stat-num {
  font-family: 'EB Garamond', serif;
  font-size: 1.8rem;
  color: var(--oxford);
  display: block;
  font-weight: 600;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── PAGE HERO (smaller, for inner pages) ── */
.page-hero {
  background: var(--oxford);
  color: white;
  padding: 2.5rem 2rem 2rem;
  background-image:
    linear-gradient(135deg, rgba(201,168,76,0.08) 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,0.03) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,0.03) 40px);
}

.page-hero h1 {
  font-family: 'EB Garamond', serif;
  font-size: 2.2rem;
  font-weight: 400;
  margin-bottom: 0.4rem;
}

.page-hero h1 em { color: var(--gold); font-style: italic; }

.page-hero p {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  max-width: 500px;
  line-height: 1.6;
}

/* ── FOOTER ── */
footer {
  background: var(--oxford);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.75rem;
  border-top: 1px solid var(--gold);
  margin-top: 3rem;
}

footer strong { color: var(--gold); }

/* ── GLOSSARY PAGE ── */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.glossary-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2rem;
  transition: box-shadow 0.2s;
}

.glossary-card:hover { box-shadow: 0 4px 16px rgba(0,33,71,0.07); }

.glossary-term {
  font-family: 'EB Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--oxford);
  margin-bottom: 0.4rem;
}

.glossary-def {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.glossary-source {
  font-size: 0.72rem;
  color: var(--gold);
  margin-top: 0.5rem;
  font-style: italic;
}

.alpha-jump {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.alpha-jump a {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--oxford);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s;
}

.alpha-jump a:hover {
  background: var(--oxford);
  color: white;
  border-color: var(--oxford);
}

.alpha-heading {
  font-family: 'EB Garamond', serif;
  font-size: 1.8rem;
  color: var(--oxford);
  border-bottom: 2px solid var(--gold);
  margin: 1.5rem 0 1rem;
  padding-bottom: 4px;
}

/* ── ABOUT PAGE ── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.about-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
}

.about-card h3 {
  font-family: 'EB Garamond', serif;
  font-size: 1.2rem;
  color: var(--oxford);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.about-card p {
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--text-muted);
}

.roadmap-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.roadmap-num {
  width: 28px;
  height: 28px;
  background: var(--oxford);
  color: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}

.roadmap-text h4 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--oxford);
  margin-bottom: 2px;
}

.roadmap-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── FILTER BAR ── */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.filter-btn {
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: none;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-muted);
  transition: all 0.15s;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--oxford);
  color: white;
  border-color: var(--oxford);
}
