/* ==============================================
   Den Osynliga Väven — stylesheet
   ============================================== */

:root {
  --ink: #1a1612;
  --bg: #ffffff;
  --soft: #f7f5f1;
  --rust: #a8451f;
  --rust-deep: #7d2f12;
  --sage: #5a6b4f;
  --ochre: #c08a3e;
  --rule: rgba(26, 22, 18, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.narrow { max-width: 720px; margin: 0 auto; padding: 0 2rem; }

/* ===== MASTHEAD ===== */
.masthead {
  border-bottom: 1px solid var(--ink);
  padding: 1.2rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: var(--bg);
}
.masthead-left { display: flex; gap: 2rem; align-items: center; }
.masthead-right { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }

.masthead-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  transition: opacity 0.2s;
}
.masthead-logo:hover { opacity: 0.7; }
.masthead .logo-img,
img.logo-img {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  display: inline-block;
  flex-shrink: 0;
  object-fit: contain;
}
.logo-text {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: none;
}
.logo-domain {
  color: var(--rust);
  font-weight: 400;
}
.masthead-tagline {
  font-style: italic;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.6;
  border-left: 1px solid var(--rule);
  padding-left: 1.5rem;
}

.issue-number { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.7rem; opacity: 0.6; }
.nav-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav-link:hover { border-bottom-color: var(--rust); }

/* ===== HERO ===== */
.hero {
  padding: 6rem 0 4rem;
  border-bottom: 3px double var(--ink);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 3rem;
  align-items: end;
}
.hero-meta {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.8;
}
.hero-meta strong {
  display: block;
  color: var(--rust);
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.hero-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(3rem, 8vw, 7.5rem);
  line-height: 0.92;
  font-weight: 300;
  letter-spacing: -0.04em;
}
.hero-title em { font-style: italic; font-weight: 400; color: var(--rust); }
.hero-subtitle {
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.5;
  font-weight: 300;
  opacity: 0.78;
}
.zebra-mark { width: 80px; height: 80px; margin-bottom: 2rem; }
.zebra-mark svg { width: 100%; height: 100%; }

/* ===== STANDFIRST ===== */
.standfirst {
  padding: 4rem 0;
  border-bottom: 1px solid var(--rule);
}
.standfirst-text {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.6rem;
  line-height: 1.5;
  font-weight: 300;
  font-style: italic;
}

/* ===== ARTICLE BODY ===== */
.article-section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--rule);
}

/* ===== TAB NAVIGATION ===== */
.tab-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--ink);
  overflow: hidden;
}
.tab-bar-wrap {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}
.tab-bar-inner {
  padding: 0 1rem;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tab-bar-inner::-webkit-scrollbar { display: none; }

/* Fade-indikatorer på sidorna när det går att scrolla */
.tab-bar-wrap::before,
.tab-bar-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s;
}
.tab-bar-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
}
.tab-bar-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
}
.tab-bar-wrap.scroll-start::after { opacity: 1; }
.tab-bar-wrap.scroll-middle::before,
.tab-bar-wrap.scroll-middle::after { opacity: 1; }
.tab-bar-wrap.scroll-end::before { opacity: 1; }

.tab-btn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 1.05rem 0.7rem 0.95rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.25s ease;
  opacity: 0.55;
  position: relative;
  white-space: nowrap;
  font-weight: 500;
}
.tab-btn:hover { opacity: 1; }
.tab-btn[aria-selected="true"] {
  opacity: 1;
  border-bottom-color: var(--rust);
  color: var(--rust);
}
.tab-btn:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: -2px;
}
.tab-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  margin-right: 0.3rem;
  opacity: 0.7;
}

/* På smala viewports — dölj siffrorna helt så texten får plats */
@media (max-width: 1200px) {
  .tab-num { display: none; }
}
@media (max-width: 1000px) {
  .tab-btn { padding: 1.05rem 0.55rem 0.95rem; font-size: 0.66rem; }
}

/* TAB PANELS */
.tab-panel {
  display: none;
  animation: tabFadeIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.tab-panel.active {
  display: block;
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Inside a tab panel, sections behave a bit differently */
.tab-panel .article-section,
.tab-panel .test-section {
  border-bottom: none;
  padding-top: 4rem;
}

/* Inter-chapter navigation buttons */
.chapter-nav {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
}
.chapter-nav-btn {
  flex: 1;
  min-width: 240px;
  background: var(--soft);
  border: 1px solid var(--ink);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: all 0.25s ease;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.chapter-nav-btn:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-3px);
  box-shadow: 4px 6px 0 var(--rust);
}
.chapter-nav-btn.next { text-align: right; }
.chapter-nav-direction {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 0.4rem;
}
.chapter-nav-btn:hover .chapter-nav-direction { color: var(--ochre); }
.chapter-nav-label {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.3rem;
  line-height: 1.2;
  font-weight: 500;
  font-style: italic;
}

/* Mobile: stack chapter nav */
@media (max-width: 600px) {
  .chapter-nav { flex-direction: column; }
  .chapter-nav-btn { min-width: 100%; }
}
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.section-label::before {
  content: '';
  width: 3rem;
  height: 1px;
  background: var(--rust);
}
.section-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1;
  font-weight: 300;
  letter-spacing: -0.025em;
  margin-bottom: 2rem;
}
.section-title em { font-style: italic; color: var(--rust); }

.article-body p { font-size: 1.13rem; line-height: 1.75; margin-bottom: 1.4rem; }
.article-body p.lead { font-size: 1.35rem; line-height: 1.6; font-weight: 300; margin-bottom: 2rem; }
.dropcap::first-letter {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 600;
  font-size: 5rem;
  line-height: 0.85;
  float: left;
  margin: 0.15rem 0.5rem 0 -0.2rem;
  color: var(--rust);
}
.article-body h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.7rem;
  font-weight: 400;
  margin: 3rem 0 1.2rem;
  letter-spacing: -0.015em;
  color: var(--rust-deep);
}
.article-body h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 2rem 0 1rem;
}
.article-body ul, .article-body ol { margin: 1.4rem 0 1.4rem 1.5rem; }
.article-body li { font-size: 1.08rem; line-height: 1.7; margin-bottom: 0.6rem; }
.article-body strong { font-weight: 600; color: var(--rust-deep); }
.article-body em { font-style: italic; }

/* ===== PULL QUOTE ===== */
.pullquote {
  margin: 4rem 0;
  padding: 2.5rem 0;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;
}
.pullquote-attr {
  display: block;
  margin-top: 1.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-style: normal;
  color: var(--rust);
  font-weight: 500;
}

/* ===== STATS ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 3rem 0;
  border: 1px solid var(--ink);
}
.stat {
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--ink);
  text-align: center;
}
.stat:last-child { border-right: none; }
.stat-number {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1;
  font-weight: 300;
  color: var(--rust);
  margin-bottom: 0.5rem;
}
.stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  line-height: 1.4;
  opacity: 0.8;
}

/* ===== CARD GRID ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}
.card {
  background: var(--soft);
  padding: 2rem;
  border: 1px solid var(--ink);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 6px 8px 0 var(--ink);
}
.card-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--rust);
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
}
.card-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 0.8rem;
  line-height: 1.2;
}
.card-body { font-size: 0.95rem; line-height: 1.6; }

/* ===== SUBTYPE TABLE ===== */
.subtype-table {
  margin: 3rem 0;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
.subtype-table th {
  text-align: left;
  padding: 1rem 0.8rem;
  border-bottom: 2px solid var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
}
.subtype-table td {
  padding: 1rem 0.8rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.subtype-table tr:hover { background: var(--soft); }
.subtype-name {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 500;
  font-style: italic;
  color: var(--rust-deep);
}
.subtype-gene {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--sage);
}

.arv-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}
.arv-pct {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--rust);
  line-height: 1;
}
.arv-type {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* Termförklaringar — subtil rust-färgad markering med info-ikon */
.term {
  cursor: help;
  text-decoration: none;
  color: var(--rust-deep);
  position: relative;
  font-style: normal;
  font-weight: 500;
  background: rgba(168, 69, 31, 0.08);
  padding: 0.05em 0.3em;
  border-radius: 2px;
  transition: background 0.2s;
  display: inline;
}
.term::after {
  content: '?';
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.65em;
  font-weight: 600;
  color: var(--bg);
  background: var(--rust);
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: 50%;
  margin-left: 0.3em;
  vertical-align: 1px;
}
.term:hover, .term:focus, .term.open {
  background: rgba(168, 69, 31, 0.18);
  outline: none;
}

/* Popup-bubblan */
.term-popup {
  position: absolute;
  background: var(--ink);
  color: var(--bg);
  padding: 0.85rem 1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  width: 280px;
  max-width: calc(100vw - 2rem);
  text-align: left;
  z-index: 1000;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.18s, transform 0.18s;
}
.term-popup.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.term-popup::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 20px;
  width: 12px;
  height: 12px;
  background: var(--ink);
  transform: rotate(45deg);
}
.term-popup-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--bg);
  opacity: 0.6;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 6px;
  line-height: 1;
}
.term-popup-close:hover { opacity: 1; }

/* ===== TIMELINE ===== */
.timeline {
  margin: 3rem 0;
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--ink);
}
.timeline-item { margin-bottom: 2.5rem; position: relative; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.45rem;
  top: 0.3rem;
  width: 14px;
  height: 14px;
  background: var(--bg);
  border: 2px solid var(--rust);
  border-radius: 50%;
}
.timeline-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--rust);
  letter-spacing: 0.1em;
}
.timeline-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0.3rem 0 0.5rem;
}
.timeline-body { font-size: 1rem; line-height: 1.6; }

/* ===== MECHANISM ===== */
.mechanism-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}
.mechanism {
  padding: 2rem 1.5rem;
  background: var(--soft);
  border: 1px solid var(--ink);
  transition: transform 0.4s;
}
.mechanism:hover { transform: translateY(-4px); }
.mechanism-icon {
  width: 50px;
  height: 50px;
  margin-bottom: 1rem;
  color: var(--rust);
}
.mechanism h4 {
  font-family: 'Newsreader', Georgia, serif !important;
  font-size: 1.2rem !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
  font-weight: 500 !important;
  margin: 0 0 0.6rem !important;
}
.mechanism p { font-size: 0.95rem; line-height: 1.55; margin: 0; }

/* ===== TEST SECTION ===== */
.test-section {
  background: var(--ink);
  color: var(--bg);
  padding: 6rem 0;
}
.test-section .section-title { color: var(--bg); }
.test-section .section-label { color: var(--ochre); }
.test-section .section-label::before { background: var(--ochre); }
.test-intro { font-size: 1.15rem; line-height: 1.7; margin-bottom: 2rem; opacity: 0.9; }
.test-info-list {
  margin: 1rem 0 2.5rem 1.5rem;
  opacity: 0.92;
}
.test-info-list li { margin-bottom: 0.6rem; }
.test-info-list strong { color: var(--ochre); }

/* QUIZ */
.quiz-container {
  background: var(--bg);
  color: var(--ink);
  padding: 3rem;
  border: 1px solid var(--ochre);
  min-height: 500px;
  display: flex;
  flex-direction: column;
}
.quiz-progress {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.progress-segment {
  flex: 1;
  min-width: 8px;
  height: 4px;
  background: var(--soft);
  border: 1px solid var(--ink);
  transition: background 0.3s;
}
.progress-segment.active { background: var(--rust); }
.progress-segment.complete { background: var(--ink); }
.quiz-section-header {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 0.5rem;
}
.quiz-question {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.4rem;
  line-height: 1.4;
  font-weight: 400;
  margin: 1rem 0;
  letter-spacing: -0.015em;
}
.quiz-helper {
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  opacity: 0.7;
  font-style: italic;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex-grow: 1;
}
.quiz-option {
  background: var(--soft);
  border: 1px solid var(--ink);
  padding: 0.9rem 1.2rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.98rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--ink);
}
.quiz-option:hover {
  background: var(--rust);
  color: var(--bg);
  transform: translateX(4px);
}
.quiz-option.selected { background: var(--ink); color: var(--bg); }
.quiz-option-letter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  background: var(--ink);
  color: var(--bg);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.quiz-option:hover .quiz-option-letter { background: var(--bg); color: var(--rust); }
.quiz-option.selected .quiz-option-letter { background: var(--ochre); color: var(--ink); }
.quiz-nav {
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.quiz-nav button {
  background: transparent;
  border: 1px solid var(--ink);
  padding: 0.7rem 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--ink);
}
.quiz-nav button:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
.quiz-nav button:disabled { opacity: 0.3; cursor: not-allowed; }
.quiz-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* RESULTS */
.results-container {
  background: var(--bg);
  color: var(--ink);
  padding: 3rem;
  border: 1px solid var(--ochre);
  display: none;
}
.results-container.active { display: block; }
.quiz-container.hidden { display: none; }

.result-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}
.result-section:last-child { border-bottom: none; }
.result-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.result-verdict {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  background: var(--soft);
  border: 1px solid var(--ink);
}
.result-verdict.high { background: var(--rust); color: var(--bg); border-color: var(--rust); }
.result-verdict.moderate { background: var(--ochre); color: var(--ink); border-color: var(--ochre); }
.result-verdict.low { background: var(--bg); color: var(--ink); }
.result-score-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--rust);
  margin-bottom: 1rem;
}
.result-interpretation {
  font-size: 1rem;
  line-height: 1.6;
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  background: var(--soft);
  border-left: 3px solid var(--rust);
}
.result-interpretation.flag {
  background: rgba(168, 69, 31, 0.08);
  border-left-color: var(--rust-deep);
}
.result-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  opacity: 0.7;
  margin-top: 0.6rem;
}
.results-summary {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--ink);
  color: var(--bg);
}
.results-summary h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 1rem;
  color: var(--ochre);
}
.results-summary p { font-size: 1rem; line-height: 1.6; margin-bottom: 1rem; }
.restart-btn {
  background: transparent;
  color: var(--bg);
  border: 1px solid var(--ochre);
  padding: 0.8rem 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 1rem;
}
.restart-btn:hover { background: var(--ochre); color: var(--ink); }

/* REFERENCES & FOOTER */
.references {
  background: var(--soft);
  padding: 5rem 0;
  border-top: 3px double var(--ink);
}
.ref-list {
  list-style: none;
  counter-reset: ref;
  font-size: 0.85rem;
  line-height: 1.6;
}
.ref-list li {
  counter-increment: ref;
  padding: 0.8rem 0;
  padding-left: 3rem;
  position: relative;
  border-bottom: 1px solid var(--rule);
}
.ref-list li::before {
  content: counter(ref, decimal-leading-zero);
  position: absolute;
  left: 0;
  font-family: 'JetBrains Mono', monospace;
  color: var(--rust);
  font-size: 0.8rem;
}

.footer {
  background: var(--ink);
  color: var(--bg);
  padding: 3rem 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
.footer-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-style: italic;
  color: var(--ochre);
}
.footer-logo {
  width: 64px !important;
  height: 64px !important;
  max-width: 64px !important;
  max-height: 64px !important;
  display: block;
  margin-bottom: 1.2rem;
  object-fit: contain;
}

/* ANIMATIONS */
@keyframes zebraStripeFlow {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(2px); }
}
.zebra-stripe { animation: zebraStripeFlow 6s ease-in-out infinite; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero { padding: 4rem 0 3rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .container, .narrow { padding: 0 1.2rem; }
  .article-section { padding: 3.5rem 0; }
  .test-section { padding: 4rem 0; }
  .quiz-container, .results-container { padding: 1.8rem; }
  .masthead { flex-direction: column; gap: 0.8rem; padding: 1rem; }
  .masthead-left, .masthead-right { gap: 1rem; flex-wrap: wrap; justify-content: center; }
  .masthead-tagline { border-left: none; padding-left: 0; }
}
@media (max-width: 600px) {
  .subtype-table { font-size: 0.82rem; }
  .subtype-table th, .subtype-table td { padding: 0.6rem 0.4rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
