/* darkzamaon: dossier-style archive, ordered by time
   Palette: ink, panel, line, bone, mute, amber */
:root {
  --ink: #0e171b;
  --panel: #14222a;
  --line: #28393f;
  --bone: #dcd6c6;
  --mute: #8a9a96;
  --amber: #e8a83a;
  --max: 1080px;
  --type: 'Special Elite', 'Courier New', monospace;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--amber); }
p { margin: 0 0 1rem; }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.wrap { width: min(var(--max), 100% - 2.5rem); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--amber); color: var(--ink); padding: .5rem 1rem; text-decoration: none;
}
.skip:focus { top: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 23, 27, .97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; justify-content: space-between; padding: .6rem 0; }
.brand img { height: 38px; width: auto; }
.site-header nav a {
  color: var(--bone); text-decoration: none; margin-left: 1.5rem;
  font-family: var(--type); font-size: 1.05rem;
}
.site-header nav a:hover { color: var(--amber); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: url('../images/hero-grid.svg') center / cover no-repeat;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5rem);
  border-bottom: 1px solid var(--line);
}
.hero-year {
  font-family: var(--type);
  font-size: clamp(6rem, 24vw, 16rem);
  line-height: .95;
  letter-spacing: -.02em;
  color: var(--amber);
  margin: 0 0 1rem;
  font-variant-numeric: tabular-nums;
}
.hero h1 {
  font-family: var(--type);
  font-weight: 400;
  font-size: clamp(1.7rem, 4.2vw, 2.8rem);
  line-height: 1.2;
  max-width: 20ch;
  margin: 0 0 1.25rem;
}
.lede { max-width: 56ch; font-size: 1.15rem; color: var(--bone); opacity: .9; }
.hero-count { font-family: var(--type); color: var(--mute); margin-bottom: 1.75rem; }

.actions { display: flex; flex-wrap: wrap; gap: .85rem; }
.btn {
  display: inline-block; padding: .7rem 1.4rem; text-decoration: none;
  font-family: var(--type); font-size: 1.05rem;
  background: var(--amber); color: var(--ink); border: 1px solid var(--amber);
}
.btn:hover { background: var(--bone); border-color: var(--bone); }
.btn.ghost { background: transparent; color: var(--bone); border-color: var(--mute); }
.btn.ghost:hover { border-color: var(--amber); color: var(--amber); }

.hero .wrap { position: relative; z-index: 1; }
.hero-net { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.hero-year.glitch { animation: glitch .55s steps(2, end) 1; }
@keyframes glitch {
  0%   { transform: translate(0); text-shadow: none; }
  20%  { transform: translate(-4px, 1px); text-shadow: 4px 0 var(--bone); }
  40%  { transform: translate(4px, -1px); text-shadow: -4px 0 var(--mute); }
  60%  { transform: translate(-2px, 0); text-shadow: 2px 0 var(--bone); }
  100% { transform: none; text-shadow: none; }
}

.progress {
  position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 70;
  background: var(--amber); transform: scaleX(0); transform-origin: left;
}

/* ---------- Controls ---------- */
.timeline { padding: 3rem 0 2rem; }

.controls {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line);
}
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  font-family: var(--serif); font-size: .95rem; color: var(--bone);
  background: transparent; border: 1px solid var(--line);
  padding: .4rem .9rem; cursor: pointer; border-radius: 2px;
}
.chip:hover { border-color: var(--mute); }
.chip[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--ink); }

.meta { display: flex; align-items: center; gap: 1.25rem; color: var(--mute); font-size: .95rem; }
.meta p { margin: 0; }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--amber); font: inherit; text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- Eras ---------- */
.era { margin-top: 4rem; }
.era h2 {
  font-family: var(--type); font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.15;
  margin: 1.5rem 0 .4rem;
}
.era-intro { color: var(--mute); margin-bottom: 2.25rem; }

.banner, .banner-pair img, canvas.scene { border: 1px solid var(--line); }
img.banner { width: 100%; aspect-ratio: 1200 / 260; object-fit: cover; }
.banner-pair img { width: 100%; aspect-ratio: 600 / 300; object-fit: cover; }
canvas.scene { display: block; width: 100%; height: auto; background: var(--panel); }
.banner-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---------- Cases ---------- */
.cases { position: relative; list-style: none; margin: 0 0 0 .4rem; padding: 0; border-left: 1px solid var(--line); }
.cases::after {
  content: ''; position: absolute; left: -2px; top: 0; width: 3px;
  height: calc(var(--p, 0) * 100%); background: var(--amber);
}
.case { position: relative; padding: 0 0 2.75rem 2rem; max-width: 46rem; }
.case::before {
  content: ''; position: absolute; left: -5px; top: .75rem;
  width: 9px; height: 9px; background: var(--amber);
}
.case-year {
  font-family: var(--type); font-size: 2.4rem; line-height: 1;
  color: var(--amber); margin: 0 0 .35rem;
}
.case h3 {
  font-family: var(--type); font-weight: 400;
  font-size: clamp(1.3rem, 3vw, 1.65rem); line-height: 1.25; margin: 0 0 .6rem;
}
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.tag {
  font-size: .85rem; line-height: 1.4; color: var(--mute);
  border: 1px solid var(--line); padding: .1rem .55rem;
}

details { margin-top: .5rem; }
summary {
  cursor: pointer; color: var(--amber); list-style: none;
  font-family: var(--type); font-size: 1.05rem; width: fit-content;
}
summary::-webkit-details-marker { display: none; }
summary::before { content: '+ '; }
details[open] > summary::before { content: '\2212  '; }
summary:hover { text-decoration: underline; text-underline-offset: 4px; }
details[open] > summary { margin-bottom: 1rem; }

.why {
  border-left: 3px solid var(--amber);
  background: var(--panel);
  padding: .8rem 1rem; margin-top: 1.25rem;
}

/* ---------- Motion that answers scrolling and clicks ---------- */
.reveal-on .case { transition: opacity .6s ease, transform .6s ease; }
.reveal-on .case:not(.in) { opacity: 0; transform: translateX(-16px); }
.case.in::before { animation: ping 1.2s ease-out 1; }
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(232, 168, 58, .7); }
  100% { box-shadow: 0 0 0 16px rgba(232, 168, 58, 0); }
}
details[open] > :not(summary) { animation: unfold .35s ease both; }
@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.chip { transition: background .2s ease, border-color .2s ease, color .2s ease; }
.btn { transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease; }
.btn:hover { transform: translateY(-2px); }

/* ---------- Year marker ---------- */
.year-marker {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 40;
  font-family: var(--type); font-size: 1.4rem; color: var(--amber);
  background: var(--panel); border: 1px solid var(--line);
  padding: .25rem .8rem; opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.year-marker.on { opacity: 1; }

/* ---------- About + footer ---------- */
.about { background: var(--panel); border-block: 1px solid var(--line); padding: 3.5rem 0 2.5rem; }
.about h2 { font-family: var(--type); font-weight: 400; font-size: 2rem; margin: 0 0 1rem; }
.about p { max-width: 60ch; }

.site-footer { padding: 2rem 0 3rem; color: var(--mute); font-size: .95rem; }
.site-footer p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .banner-pair { grid-template-columns: 1fr; }
  .case { padding-left: 1.25rem; }
  .site-header nav a { margin-left: 1rem; }
  .brand img { height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-year.glitch, .case.in::before, details[open] > :not(summary) { animation: none; }
  .btn:hover { transform: none; }
  .year-marker { transition: none; }
}
