/* ============================================
   TOKENS
   ============================================ */
:root {
  --paper: #EDE6D3;
  --paper-deep: #E3DAC3;
  --ink: #1C2333;
  --ink-soft: #333B4F;
  --stamp: #9B2D20;
  --stamp-deep: #7A2118;
  --brass: #8C6F2E;
  --slate: #5B6270;
  --line: #C7BC9F;
  --line-soft: #DAD2B9;
  --paper-white: #F7F3E8;

  --font-display: 'Fraunces', serif;
  --font-body: 'Source Serif 4', serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --max-w: 1080px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* subtle paper grain */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.035;
  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='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(237, 230, 211, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.case-ref {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--slate);
  text-transform: uppercase;
}
.lang-switch {
  display: flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px;
}
.lang-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 10px;
  background: transparent;
  border: none;
  color: var(--slate);
  cursor: pointer;
  border-radius: 2px;
  letter-spacing: 0.03em;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.active {
  background: var(--ink);
  color: var(--paper-white);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  padding: 100px 24px 90px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -10%;
  right: -8%;
  width: 480px;
  height: 480px;
  border: 1px solid var(--line);
  border-radius: 50%;
  opacity: 0.5;
}
.hero::after {
  content: "";
  position: absolute;
  top: 4%;
  right: 2%;
  width: 340px;
  height: 340px;
  border: 1px solid var(--line);
  border-radius: 50%;
  opacity: 0.5;
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.stamp-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--stamp);
  border: 2px solid var(--stamp);
  padding: 6px 14px;
  border-radius: 3px;
  transform: rotate(-2deg);
  margin-bottom: 28px;
  text-transform: uppercase;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--slate);
  text-transform: uppercase;
  margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 820px;
}
.hero-sub {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 620px;
  margin: 24px 0 0;
}
.hero-stats {
  display: flex;
  gap: 48px;
  margin: 52px 0 44px;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 700;
  color: var(--stamp);
  line-height: 1;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--slate);
  margin-top: 6px;
  max-width: 130px;
}
.hero-institutions {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--slate);
  max-width: 560px;
  margin: -22px 0 34px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  font-family: var(--font-mono);
  font-size: 13.5px;
  letter-spacing: 0.02em;
  padding: 13px 22px;
  border-radius: 3px;
  text-decoration: none;
  display: inline-block;
  border: 1.5px solid var(--ink);
  transition: all 0.15s ease;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper-white);
}
.btn-primary:hover { background: var(--stamp); border-color: var(--stamp); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper-white); }
.btn-large { font-size: 16px; padding: 16px 32px; }

/* ============================================
   CORE QUOTE
   ============================================ */
.section-quote {
  background: var(--ink);
  padding: 70px 24px;
}
.quote-block {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
.quote-mark {
  font-family: var(--font-display);
  font-size: 90px;
  color: var(--stamp);
  line-height: 0.5;
  display: block;
  opacity: 0.85;
}
.quote-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.45;
  color: var(--paper-white);
  margin: 0 0 24px;
}
.quote-block cite {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #B8B0C4;
  font-style: normal;
}

/* ============================================
   SECTIONS (shared)
   ============================================ */
.section {
  padding: 100px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.section-alt { background: var(--paper-deep); max-width: none; }
.section-alt > * { max-width: var(--max-w); margin-left: auto; margin-right: auto; }
.section-dark { background: var(--ink); max-width: none; color: var(--paper-white); }
.section-dark > * { max-width: var(--max-w); margin-left: auto; margin-right: auto; }
.section-dark h2 { color: var(--paper-white); }

.section-head { margin-bottom: 48px; max-width: 640px; }
.section-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--stamp);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 10px;
}
.section-dark .section-num { color: #C77A6A; }
.section-head h2 {
  font-size: clamp(28px, 3.6vw, 38px);
  margin-bottom: 14px;
}
.section-lead {
  font-size: 17px;
  color: var(--slate);
}
.section-dark .section-lead { color: #A9AEBB; }

/* ============================================
   CHAIN DIAGRAM
   ============================================ */
.chain {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: stretch;
}
.chain-node {
  flex: 1;
  min-width: 160px;
  background: var(--paper-white);
  border: 1px solid var(--line);
  padding: 22px 18px;
  position: relative;
  margin-right: -1px;
}
.chain-node.final {
  background: var(--stamp);
  color: var(--paper-white);
  border-color: var(--stamp-deep);
}
.chain-node-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--brass);
  letter-spacing: 0.05em;
}
.chain-node.final .chain-node-num { color: #E8C4BC; }
.chain-node-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  margin: 8px 0 8px;
}
.chain-node-desc {
  font-size: 13.5px;
  color: var(--slate);
  line-height: 1.5;
}
.chain-node.final .chain-node-desc { color: #F0DDD8; }
.chain-arrow {
  display: flex;
  align-items: center;
  padding: 0 6px;
  color: var(--slate);
  font-size: 18px;
}

@media (max-width: 860px) {
  .chain { flex-direction: column; }
  .chain-node { margin-right: 0; margin-bottom: -1px; }
  .chain-arrow { transform: rotate(90deg); padding: 4px 0; align-self: center; }
}

/* ============================================
   REPORT TABS
   ============================================ */
.report-tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin-bottom: 0;
  border-bottom: 2px solid var(--ink);
}
.report-tab {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--slate);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.report-tab.active {
  color: var(--ink);
  border-bottom-color: var(--stamp);
  font-weight: 600;
}
.report-body {
  background: var(--paper-white);
  border: 1px solid var(--line);
  border-top: none;
  padding: 40px;
}
.report-panel { display: none; }
.report-panel.active { display: block; animation: fadein 0.25s ease; }
.report-panel h3 {
  font-size: 22px;
  margin-bottom: 16px;
}
.report-panel p { margin: 0 0 16px; color: var(--ink-soft); }
.report-panel ul { padding-left: 20px; color: var(--ink-soft); }
.report-panel li { margin-bottom: 10px; }
.report-panel strong { color: var(--ink); }

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ============================================
   TIMELINE
   ============================================ */
.timeline-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.filter-btn {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  background: var(--paper-white);
  border-radius: 20px;
  cursor: pointer;
  color: var(--slate);
}
.filter-btn.active {
  background: var(--ink);
  color: var(--paper-white);
  border-color: var(--ink);
}

.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--line);
}
.tl-item {
  position: relative;
  padding: 0 0 40px 24px;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: -37px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--brass);
}
.tl-item.negative::before { border-color: var(--stamp); }
.tl-item.positive::before { border-color: #4A7A5C; }
.tl-date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--stamp);
  letter-spacing: 0.03em;
  display: block;
  margin-bottom: 6px;
}
.tl-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  margin: 0 0 8px;
}
.tl-desc {
  color: var(--ink-soft);
  font-size: 15.5px;
  max-width: 640px;
}
.timeline-note {
  margin-top: 32px;
  font-size: 14px;
  color: var(--slate);
  font-style: italic;
}
.timeline-footnotes {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--slate);
}
.timeline-footnotes p { margin: 0 0 12px; }
.timeline-footnotes p:last-child { margin-bottom: 0; }
.timeline-footnotes strong { color: var(--ink-soft); }

/* Language-version disclaimer: only relevant on the translated (ES/EN)
   versions, so it stays hidden on the Catalan original and is revealed by
   the html[lang] attribute that applyStaticI18n() already sets on every
   language switch - no extra JS needed. */
.lang-note {
  display: none;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--slate);
  font-style: italic;
  max-width: 640px;
}
.lang-note p { margin: 0; }
.lang-note strong { color: var(--ink-soft); font-style: normal; }
.section-dark .lang-note {
  border-top-color: rgba(247, 243, 232, 0.2);
  color: #A9AEBB;
  margin-bottom: 8px;
}
.section-dark .lang-note strong { color: var(--paper-white); }
html[lang="es"] .lang-note,
html[lang="en"] .lang-note {
  display: block;
}

/* ============================================
   EXHIBITS
   ============================================ */
.exhibits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}
.exhibit-card {
  background: var(--paper-white);
  border: 1px solid var(--line);
  padding: 24px 24px 22px;
  position: relative;
}
.exhibit-stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--brass);
  border: 1px solid var(--brass);
  padding: 3px 8px;
  border-radius: 2px;
  transform: rotate(-1deg);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.exhibit-source {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.exhibit-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 16px;
}
.exhibit-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.exhibit-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--brass);
}

/* ============================================
   CONTRADICTION
   ============================================ */
.contra-block { text-align: center; }
.contra-lead {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.8vw, 28px);
  max-width: 720px;
  margin: 0 auto 48px;
  line-height: 1.4;
}
.contra-split {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.contra-side {
  flex: 1;
  min-width: 260px;
  max-width: 340px;
  background: rgba(255,255,255,0.05);
  border: 1px solid #3A4155;
  padding: 24px;
  border-radius: 4px;
}
.contra-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #C77A6A;
  display: block;
  margin-bottom: 10px;
}
.contra-side p {
  font-style: italic;
  font-size: 15px;
  color: #D5D8E0;
  margin: 0;
}
.contra-arrow {
  font-size: 24px;
  color: #6B7185;
}
.contra-question {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(19px, 2.4vw, 24px);
  max-width: 680px;
  margin: 0 auto 20px;
  line-height: 1.4;
  color: var(--paper-white);
}
.contra-source {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #8E93A5;
}

/* ============================================
   ACCORDION
   ============================================ */
.accordion { border-top: 1px solid var(--line); }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 22px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  gap: 20px;
}
.acc-q-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--stamp);
  margin-right: 14px;
}
.acc-icon {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--slate);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.acc-item.open .acc-icon { transform: rotate(45deg); }
.acc-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.acc-item.open .acc-a { max-height: 1200px; }
.acc-a-inner {
  padding: 0 4px 26px 44px;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.65;
}
.acc-a-inner p { margin: 0 0 14px; }
.acc-a-inner strong { color: var(--ink); }

/* ============================================
   CONTACT
   ============================================ */
.contact-inner { text-align: center; }
.contact-inner h2 { font-size: clamp(28px, 3.6vw, 38px); margin-bottom: 18px; }
.contact-inner p { color: #A9AEBB; max-width: 560px; margin: 0 auto 32px; }
.contact-docs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  margin-bottom: 36px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: #C9CCD6;
}
.contact-author {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #7C8296;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 40px 24px;
  text-align: center;
  border-top: 1px solid var(--line);
}
.footer p {
  max-width: 640px;
  margin: 0 auto;
  font-size: 13px;
  color: var(--slate);
  line-height: 1.6;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .hero { padding: 70px 20px 60px; }
  .section { padding: 64px 20px; }
  .hero-stats { gap: 32px; }
  .report-body { padding: 26px 20px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* Focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--stamp);
  outline-offset: 2px;
}

/* ============================================
   HERO SUB (multi-paragraph)
   ============================================ */
.hero-sub p { margin: 0 0 12px; }
.hero-sub p:last-child { margin-bottom: 0; }

/* ============================================
   EXHIBIT NOTE (secondary, non-quoted context)
   ============================================ */
.exhibit-note {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--slate);
  border-left: 2px solid var(--line);
  padding-left: 10px;
  margin: 0 0 16px;
}

/* ============================================
   PRESS COVERAGE
   ============================================ */
.press-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.press-item {
  border: 1px solid var(--line);
  background: var(--paper-white);
  padding: 16px 20px;
}
.press-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--brass);
  margin-bottom: 6px;
}
.press-title {
  display: block;
  font-family: var(--font-display);
  font-size: 16.5px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.4;
}
.press-title:hover { color: var(--stamp); text-decoration: underline; }

/* ============================================
   CONTACT FORM
   ============================================ */
.contact-form {
  max-width: 480px;
  margin: 36px auto 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #C9CCD6;
}
.contact-form input,
.contact-form textarea {
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 10px 12px;
  background: rgba(247, 243, 232, 0.06);
  border: 1px solid rgba(247, 243, 232, 0.25);
  color: var(--paper-white);
  border-radius: 3px;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--stamp);
}
.contact-form button { align-self: flex-start; margin-top: 4px; }

/* ============================================
   LEGAL NOTICE
   ============================================ */
.legal-body {
  max-width: var(--max-w);
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
}
.legal-body p { margin: 0 0 16px; }
.legal-body a { color: var(--stamp); }
.tl-desc a, .timeline-footnotes a { color: var(--stamp); }

.footer-legal-link {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--slate);
  text-decoration: underline;
}

/* ============================================
   CONTACT FORM — honeypot + status message
   ============================================ */
.hidden-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-status {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 3px;
  margin: 4px 0 0;
}
.form-status.success {
  background: rgba(90, 160, 110, 0.12);
  color: #7FCF9A;
  border: 1px solid rgba(127, 207, 154, 0.35);
}
.form-status.error {
  background: rgba(155, 45, 32, 0.12);
  color: #E29088;
  border: 1px solid rgba(226, 144, 136, 0.35);
}

/* ============================================
   UPDATE BANNER
   ============================================ */
.update-banner { padding: 22px 24px 0; }
.update-banner-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-left: 6px solid var(--ink);
  padding: 14px 22px 16px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
}
.update-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.update-banner-inner a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.hero { padding-top: 70px; }
