/* ═══════════════════════════════════════════════════════
   GÂNDITORUL — Fired clay, deep time
   ═══════════════════════════════════════════════════════ */

/* ── Fonts ──────────────────────────────────────────── */
@font-face {
  font-family: 'Cormorant';
  src: url('/ganditorul-hamangia/assets/fonts/Cormorant.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant';
  src: url('/ganditorul-hamangia/assets/fonts/Cormorant-Italic.woff2') format('woff2');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

/* ── Tokens: light ──────────────────────────────────── */
:root {
  --paper:    #f2ece1;
  --surface:  #e6dcc9;
  --surface-2:#d9cbb2;
  --stone:    #c2b198;

  --ink:      #201913;
  --ink-2:    #453b30;
  --ink-3:    #6b5f4f;
  --ink-4:    #8a7d69;

  --accent:   #93390f;
  --accent-bg:#f3ddc8;

  --know:     #1e5c3a;
  --know-bg:  #d9e8dc;
  --guess:    #6b4fa1;
  --guess-bg: #e5def4;
  --unknown:  #8a5a1a;
  --unknown-bg:#f2e4c8;

  --case:     #141210;
  --case-ink: #ece4d2;

  --focus:    #2f6f8f;
  --border:   rgba(32,25,19,.14);

  --bar-h:    2.75rem;
  --measure:  38rem;
  --gap:      clamp(1.5rem, 3vw, 3rem);

  --font-display: 'Cormorant', 'Georgia', 'Times New Roman', serif;
  --font-body:    'Georgia', 'Times New Roman', serif;
  --font-mono:    'SFMono-Regular', 'Consolas', monospace;
}

/* ── Tokens: dark ───────────────────────────────────── */
[data-theme="dark"] {
  --paper:    #141110;
  --surface:  #1e1a16;
  --surface-2:#292420;
  --stone:    #3d362e;

  --ink:      #efe7d6;
  --ink-2:    #d3c9b4;
  --ink-3:    #b1a48d;
  --ink-4:    #8d8271;

  --accent:   #e08a4e;
  --accent-bg:#2b1e12;

  --know:     #7cc8a0;
  --know-bg:  #162a20;
  --guess:    #b8a8e8;
  --guess-bg: #1e1a30;
  --unknown:  #ddb06a;
  --unknown-bg:#2a2210;

  --case:     #0b0a09;
  --case-ink: #ece4d2;

  --focus:    #6aadcc;
  --border:   rgba(239,231,214,.12);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:    #141110;
    --surface:  #1e1a16;
    --surface-2:#292420;
    --stone:    #3d362e;
    --ink:      #efe7d6;
    --ink-2:    #d3c9b4;
    --ink-3:    #b1a48d;
    --ink-4:    #8d8271;
    --accent:   #e08a4e;
    --accent-bg:#2b1e12;
    --know:     #7cc8a0;
    --know-bg:  #162a20;
    --guess:    #b8a8e8;
    --guess-bg: #1e1a30;
    --unknown:  #ddb06a;
    --unknown-bg:#2a2210;
    --case:     #0b0a09;
    --case-ink: #ece4d2;
    --focus:    #6aadcc;
    --border:   rgba(239,231,214,.12);
  }
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 1rem + .22vw, 1.17rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; display: block; }

/* ── Focus ──────────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── Layout ─────────────────────────────────────────── */
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem); }
.wide { max-width: 56rem; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem); }

/* ── Topbar ─────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: .5rem;
  height: var(--bar-h);
  padding: 0 clamp(.75rem, 2vw, 1.25rem);
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: .85rem;
  letter-spacing: .02em;
}
.topbar .home { color: var(--ink-3); text-decoration: none; white-space: nowrap; }
.topbar .home:hover { color: var(--ink); }
.topnav { display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  color: var(--ink-3); text-decoration: none; white-space: nowrap;
  padding: .25rem .5rem; border-radius: 4px;
}
.topnav a:hover { color: var(--ink); background: var(--surface); }
.topnav a[aria-current="true"] { color: var(--ink); font-weight: 600; }
.spacer { flex: 1; }
.chip {
  color: var(--ink-3); text-decoration: none; white-space: nowrap;
  padding: .2rem .6rem; border-radius: 4px;
  font-size: .8rem;
}
.chip:hover { color: var(--ink); background: var(--surface); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  border: none; background: none; color: var(--ink-3);
  cursor: pointer; padding: 0;
}
.icon-btn:hover { color: var(--ink); background: var(--surface); }
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none; }

/* ── Sections ───────────────────────────────────────── */
section { scroll-margin-top: calc(var(--bar-h) + 1rem); }
.block { padding: var(--gap) 0; }
.block + .block { border-top: 1px solid var(--border); }

/* ── Typography ─────────────────────────────────────── */
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 1.4rem + 3.5vw, 4.2rem);
  line-height: 1.06;
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--ink);
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.2rem);
  line-height: 1.15;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 1rem;
}
h2 .anchor { color: inherit; text-decoration: none; }
h2 .anchor:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.kicker {
  font-family: var(--font-display);
  font-size: .95rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .5rem;
}
.deck {
  font-size: clamp(1.08rem, 1rem + .35vw, 1.28rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 34rem;
}
.lede {
  font-size: 1.08rem;
  color: var(--ink-2);
  margin-bottom: 1.5rem;
}
.prose { max-width: var(--measure); }
.prose p + p { margin-top: 1em; }

/* ── Hero ───────────────────────────────────────────── */
.hero {
  padding: clamp(3rem, 8vw, 7rem) 0 clamp(2rem, 5vw, 4rem);
  text-align: center;
}
.hero-text { margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.hero h1 { margin-bottom: 1rem; }
.hero .deck { margin: 0 auto; }

/* ── Museum case (dark panel for the clay figures) ──── */
.case {
  background: var(--case);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 0 auto;
  max-width: 56rem;
}
.case img { margin: 0 auto; }
.case figcaption {
  padding: 1rem clamp(1rem, 3vw, 2rem);
  font-size: .88rem;
  color: var(--case-ink);
  opacity: .85;
  line-height: 1.5;
  border-top: 1px solid rgba(236,228,210,.14);
  text-align: left;
}
.case .cr { font-size: .78rem; display: block; margin-top: .25rem; opacity: .75; }
.case .cr a { color: var(--case-ink); }

/* ── Split layout ───────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}
@media (min-width: 50rem) {
  .split { grid-template-columns: 1fr 1fr; }
}
.split .side { display: flex; flex-direction: column; gap: 1.5rem; }

/* ── Figures ────────────────────────────────────────── */
.fig { margin: 1.5rem 0 0; }
.fig img { border-radius: 6px; }
.fig figcaption {
  font-size: .85rem;
  color: var(--ink-3);
  margin-top: .5rem;
  line-height: 1.45;
}
.fig .cr { font-size: .78rem; display: block; margin-top: .25rem; }
.fig .cr a { color: var(--ink-4); }

/* ── Facts DL ───────────────────────────────────────── */
.facts {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.facts dt {
  font-family: var(--font-display);
  font-size: .85rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: .75rem;
}
.facts dt:first-child { margin-top: 0; }
.facts dd { margin-left: 0; color: var(--ink-2); }

/* ── Scale comparison ───────────────────────────────── */
.scale {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
}
.scale h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  margin-bottom: .75rem;
}
.scale .row { margin: .6rem 0; }
.scale .lbl {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .88rem;
  color: var(--ink-2);
  margin-bottom: .2rem;
}
.scale .bar {
  height: .9rem;
  border-radius: 4px;
  background: var(--stone);
  max-width: 100%;
}
.scale .bar.haman { width: 6.2%; background: var(--accent); min-width: 6px; }
.scale .bar.rodin { width: 100%; }
.scale p.note { font-size: .85rem; color: var(--ink-3); margin-top: .75rem; }

/* ── Claim cards + filter ───────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0 0 1.25rem;
}
.filters button {
  font-family: var(--font-display);
  font-size: .95rem;
  padding: .45rem 1rem;
  min-height: 2.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink-2);
  cursor: pointer;
}
.filters button:hover { border-color: var(--ink-4); }
.filters button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.claims {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.claim {
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--paper);
}
.claim[hidden] { display: none; }
.claim .status {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-family: var(--font-display);
  padding: .15rem .6rem;
  border-radius: 999px;
  margin-bottom: .5rem;
}
.claim .status .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.claim.s-know .status { background: var(--know-bg); color: var(--know); }
.claim.s-know .status .dot { background: var(--know); }
.claim.s-guess .status { background: var(--guess-bg); color: var(--guess); }
.claim.s-guess .status .dot { background: var(--guess); }
.claim.s-unknown .status { background: var(--unknown-bg); color: var(--unknown); }
.claim.s-unknown .status .dot { background: var(--unknown); }
.claim .what { font-size: 1.05rem; color: var(--ink); }
.claim .why { font-size: .92rem; color: var(--ink-2); line-height: 1.55; margin-top: .35rem; }
.count { font-size: .85rem; color: var(--ink-3); margin-top: 1rem; min-height: 1.4em; }

/* ── Timeline ───────────────────────────────────────── */
.timeline {
  list-style: none;
  padding: 0;
  border-left: 2px solid var(--border);
  margin: 1.5rem 0 0 .5rem;
}
.timeline li {
  padding: .75rem 0 .75rem 1.5rem;
  position: relative;
  font-size: .95rem;
  color: var(--ink-2);
}
.timeline li::before {
  content: '';
  position: absolute;
  left: -6px; top: 1rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--stone);
  border: 2px solid var(--paper);
}
.timeline .year {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  display: block;
  font-size: 1rem;
}

/* ── Sources ────────────────────────────────────────── */
.srcs { padding: 0; list-style: none; }
.srcs li {
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  color: var(--ink-2);
}
.srcs li:last-child { border-bottom: none; }
.srcs a { word-break: break-all; }

/* ── Missing page ───────────────────────────────────── */
.missing { padding-top: 4rem; text-align: center; }
.missing p { margin-top: .5rem; }

/* ── Footer ─────────────────────────────────────────── */
.foot {
  padding: 2rem 0;
  text-align: center;
  font-size: .85rem;
  color: var(--ink-4);
  border-top: 1px solid var(--border);
}
.foot a { color: var(--ink-3); }
.foot p + p { margin-top: .25rem; }

/* ── Rail (desktop reading rail) ────────────────────── */
.rail { display: none; }
@media (min-width: 90rem) {
  .rail {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
  }
  .rail a {
    display: flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    color: var(--ink-4);
    font-family: var(--font-display);
    font-size: .8rem;
    padding: .2rem 0;
  }
  .rail a i {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--stone);
    flex-shrink: 0;
  }
  .rail a span { opacity: 0; transition: opacity .15s; }
  .rail a:hover span, .rail a[aria-current="true"] span { opacity: 1; }
  .rail a[aria-current="true"] { color: var(--ink); }
  .rail a[aria-current="true"] i { background: var(--accent); }
}

@media (max-width: 40rem) {
  .topnav a:nth-child(n+3) { display: none; }
  .claim { padding: 1rem 1.1rem; }
  .scale { padding: 1rem 1.1rem; }
}
