:root {
  --void-black: #0a0a0f;
  --newsprint: #1e1d1a;
  --stone-gray: #c8c0b4;
  --neon-cyan: #00ffcc;
  --neon-magenta: #ff00aa;
  --burnt-orange: #ff6b00;
  --charcoal: #2a2a30;
  --uv-hint: #1a0033;
  --cell-gap: 3px;
  --grid-pad: clamp(16px, 3vw, 48px);
}

* { box-sizing: border-box; }

html { background: var(--void-black); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--stone-gray);
  font-family: "Source Serif 4", Georgia, serif;
  background:
    radial-gradient(circle at 82% 8%, rgba(26, 0, 51, 0.85), transparent 34rem),
    linear-gradient(180deg, var(--void-black) 0%, #0d0d0d 48%, var(--void-black) 100%);
  overflow-x: hidden;
}

.compliance-token { display: none; }

.noise-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='0.9'/%3E%3C/svg%3E");
}

.uv-wash {
  position: fixed;
  inset: -20%;
  pointer-events: none;
  background: radial-gradient(ellipse at 72% 35%, rgba(0, 255, 204, 0.08), transparent 28%), radial-gradient(ellipse at 18% 70%, rgba(255, 0, 170, 0.07), transparent 30%);
  mix-blend-mode: screen;
}

.focus-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 18;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(circle, transparent 45%, rgba(10,10,15,0.9) 100%);
}

body.focus-mode .focus-vignette { opacity: 1; }

.broadsheet {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: var(--grid-pad);
}

.masthead {
  border: 1px solid rgba(0, 255, 204, 0.16);
  background: linear-gradient(135deg, rgba(30, 29, 26, 0.92), rgba(10, 10, 15, 0.96));
  padding: clamp(20px, 3.5vw, 48px);
  margin-bottom: var(--cell-gap);
  position: relative;
  overflow: hidden;
}

.masthead::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 17px, rgba(200, 192, 180, 0.025) 18px 19px), repeating-linear-gradient(0deg, transparent 0 13px, rgba(255, 0, 170, 0.025) 14px 15px);
}

.kicker, .label, .edition-rule, .caption, .stamp, .marginalia, .cell small, .case-card span {
  font-family: "IBM Plex Mono", monospace;
}

.kicker {
  color: rgba(0, 255, 204, 0.68);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  position: relative;
}

h1 {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-size: clamp(3.5rem, 10vw, 9rem);
  letter-spacing: -0.04em;
  line-height: 0.92;
  margin: 0.08em 0 0.16em;
  color: var(--neon-cyan);
  text-shadow: 2px 0 rgba(255, 0, 170, 0.65), -2px 0 rgba(255, 107, 0, 0.25), 0 0 34px rgba(0, 255, 204, 0.26);
  position: relative;
}

.edition-rule {
  border-top: 1px solid var(--charcoal);
  border-bottom: 1px solid rgba(0, 255, 204, 0.22);
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 8px 0;
  color: rgba(200, 192, 180, 0.78);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
}

.evidence-board {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(118px, auto);
  gap: var(--cell-gap);
  position: relative;
  align-items: stretch;
}

.cell {
  position: relative;
  overflow: hidden;
  min-height: 180px;
  padding: clamp(16px, 2vw, 28px);
  border: 1px solid rgba(0, 255, 204, 0.08);
  background: linear-gradient(150deg, rgba(30, 29, 26, 0.96), rgba(13, 13, 13, 0.96));
  cursor: zoom-in;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, filter 0.4s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.cell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 0, 170, 0.05), transparent 8%, transparent 92%, rgba(0, 255, 204, 0.05));
  opacity: 0.4;
}

.cell:hover { border-color: rgba(0, 255, 204, 0.55); box-shadow: inset 0 0 28px rgba(0, 255, 204, 0.08); }

.mast-cell { grid-column: span 5; grid-row: span 3; }
.wide { grid-column: span 4; grid-row: span 2; }
.square { grid-column: span 2; grid-row: span 2; }
.strip-cell { grid-column: span 1; grid-row: span 3; }
.medium { grid-column: span 3; grid-row: span 2; }
.tall { grid-column: span 3; grid-row: span 3; }
.vertical { grid-column: span 2; grid-row: span 3; }
.diamond { grid-column: span 2; grid-row: span 2; }
.panoramic { grid-column: span 7; grid-row: span 2; }
.stamp-cell { grid-column: span 3; grid-row: span 2; }
.low { grid-column: span 4; grid-row: span 2; }
.orange { grid-column: span 2; grid-row: span 2; }

.marginalia {
  grid-column: 12 / 13;
  grid-row: 1 / span 8;
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  overflow-y: auto;
  z-index: 4;
  padding: 14px 8px;
  background: rgba(10, 10, 15, 0.92);
  border: 1px solid rgba(0, 255, 204, 0.16);
  scrollbar-color: var(--neon-cyan) var(--newsprint);
}

.marginalia h2 {
  font-family: "Barlow Condensed", sans-serif;
  color: var(--neon-magenta);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 1rem;
  margin: 0 0 14px;
  writing-mode: vertical-rl;
}

.note {
  color: rgba(0, 255, 204, 0.6);
  font-size: 10px;
  line-height: 1.4;
  padding: 8px 0 8px 6px;
  margin: 0 0 8px;
  border-left: 2px solid transparent;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.note.active { border-left-color: var(--neon-cyan); color: var(--neon-cyan); background: rgba(0, 255, 204, 0.05); }

.label {
  display: inline-block;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--neon-magenta);
  margin-bottom: 0.7rem;
}

h2, h3 {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 0.98;
  margin: 0 0 0.7rem;
  color: var(--stone-gray);
}

h2 { font-size: clamp(2.1rem, 4.8vw, 5.4rem); }
h3 { font-size: clamp(1.5rem, 2.6vw, 3rem); }

p {
  font-size: clamp(0.875rem, 1.1vw, 1.05rem);
  line-height: 1.65;
  margin: 0 0 1rem;
}

.columns { column-count: 2; column-gap: 24px; }
.reveal { display: none; color: #e2d8c8; }

.photo-cell { padding: 0; }
.photo {
  position: absolute;
  inset: 0;
  filter: grayscale(0.85) contrast(1.3) brightness(0.8);
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
}

.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='g'%3E%3CfeTurbulence baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='90' height='90' filter='url(%23g)' opacity='0.55'/%3E%3C/svg%3E");
}

.photo-station { background-image: linear-gradient(135deg, rgba(0,0,0,0.2), rgba(0,255,204,0.12)), url("https://images.unsplash.com/photo-1519608487953-e999c86e7455?auto=format&fit=crop&w=1200&q=80"); }
.photo-cabinet { background-image: linear-gradient(135deg, rgba(0,0,0,0.34), rgba(255,0,170,0.12)), url("https://images.unsplash.com/photo-1520637836862-4d197d17c90a?auto=format&fit=crop&w=900&q=80"); }
.photo-room { background-image: linear-gradient(135deg, rgba(0,0,0,0.2), rgba(255,107,0,0.14)), url("https://images.unsplash.com/photo-1507842217343-583bb7270b66?auto=format&fit=crop&w=1200&q=80"); }

.caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 2;
  color: var(--neon-cyan);
  font-size: 10px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 0 8px #00ffcc;
}

.caption.magenta { color: var(--neon-magenta); text-shadow: 0 0 8px #ff00aa; }
.bleed { position: absolute; width: 80px; height: 80px; right: 16%; top: 22%; border-radius: 50%; background: var(--neon-cyan); opacity: 0.2; mix-blend-mode: screen; filter: blur(16px); }

.glyph-cell { display: grid; place-items: center; text-align: center; }
.glyph {
  font-family: "Playfair Display", serif;
  font-size: clamp(7rem, 18vw, 18rem);
  line-height: 0.78;
  color: var(--neon-cyan);
  text-shadow: 0 0 20px #00ffcc;
}

.orange .glyph { color: var(--burnt-orange); text-shadow: 0 0 24px rgba(255, 107, 0, 0.9); }
.cell small { color: rgba(200, 192, 180, 0.68); text-transform: uppercase; letter-spacing: 0.14em; }

@keyframes pulse {
  0%, 100% { text-shadow: 0 0 20px #00ffcc; }
  50% { text-shadow: 0 0 60px #00ffcc, 0 0 120px rgba(0, 255, 204, 0.3); }
}

.pulse { animation: pulse 2.4s ease-in-out infinite; }

.rotate-cell { display: grid; place-items: center; padding: 0; }
.rotate-cell span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: "Barlow Condensed", sans-serif;
  color: var(--burnt-orange);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 1.1rem;
}

blockquote {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 4vw, 4.8rem);
  line-height: 0.96;
  color: var(--neon-cyan);
  text-shadow: 0 0 20px rgba(0,255,204,0.35);
}

cite { display: block; margin-top: 16px; color: var(--burnt-orange); font-family: "Caveat", cursive; font-size: 1.3rem; }

.stamp {
  display: inline-block;
  color: var(--neon-magenta);
  border: 2px solid var(--neon-magenta);
  padding: 4px 10px;
  transform: rotate(-15deg);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  filter: blur(0.5px);
}

.stamp.big { font-size: clamp(2.3rem, 5vw, 5.7rem); margin: 20px 0; }

.thread-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.thread {
  fill: none;
  stroke: var(--neon-cyan);
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0.72;
  filter: drop-shadow(0 0 6px #00ffcc);
  transition: stroke-dashoffset 1500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.thread.drawn { stroke-dashoffset: 0; }

body.focus-mode .cell:not(.focused) { opacity: 0.15; filter: blur(2px); }
.cell.focused {
  position: fixed;
  z-index: 25;
  top: 50%;
  left: 50%;
  width: min(70vw, 980px);
  max-height: 76vh;
  overflow-y: auto;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  cursor: zoom-out;
  border-color: rgba(0, 255, 204, 0.75);
  box-shadow: 0 30px 90px rgba(0,0,0,0.65), 0 0 38px rgba(0,255,204,0.22);
}

.cell.focused .reveal { display: block; }
.cell.focused.photo-cell { min-height: 70vh; padding: clamp(22px, 3vw, 42px); display: flex; align-items: flex-end; }
.cell.focused.photo-cell .caption { bottom: auto; top: 20px; }
.cell.focused.photo-cell .reveal { position: relative; z-index: 5; max-width: 680px; background: rgba(10,10,15,0.72); padding: 18px; }

.archive-drawer {
  margin-top: var(--cell-gap);
  border: 1px solid rgba(0, 255, 204, 0.14);
  background: rgba(30, 29, 26, 0.78);
  padding: clamp(18px, 3vw, 34px);
}

.drawer-heading h2 { font-size: clamp(2rem, 4vw, 4.8rem); color: var(--stone-gray); }
.case-row { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 12px 4px 24px; }
.case-card {
  flex: 0 0 200px;
  height: 280px;
  scroll-snap-align: start;
  padding: 20px 16px;
  background: linear-gradient(145deg, #3a3020, #c1a971 14%, #9d8456 100%);
  color: #0d0d0d;
  clip-path: polygon(0 0, 100% 0, 100% 85%, 85% 100%, 0 100%);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.case-card:hover { transform: rotate(-2deg) translateY(-4px); box-shadow: 0 8px 24px rgba(255, 0, 170, 0.2); }
.case-card span { color: var(--neon-magenta); border: 2px solid var(--neon-magenta); padding: 2px 8px; font-size: 10px; }
.case-card h3 { margin-top: 28px; color: #0d0d0d; font-family: "Caveat", cursive; font-size: clamp(1.4rem, 2vw, 2rem); letter-spacing: 0; }
.case-card p { color: rgba(13, 13, 13, 0.78); font-weight: 700; }

@media (max-width: 980px) {
  .evidence-board { grid-template-columns: repeat(6, 1fr); }
  .mast-cell, .wide, .medium, .tall, .vertical, .panoramic, .stamp-cell, .low { grid-column: span 6; }
  .square, .diamond, .orange, .strip-cell { grid-column: span 3; }
  .marginalia { grid-column: span 6; grid-row: auto; position: relative; height: auto; top: auto; }
  .marginalia h2 { writing-mode: horizontal-tb; }
  .cell.focused { width: 86vw; }
}

@media (max-width: 640px) {
  .evidence-board { grid-template-columns: 1fr; }
  .cell, .mast-cell, .wide, .medium, .tall, .vertical, .panoramic, .stamp-cell, .low, .square, .diamond, .orange, .strip-cell, .marginalia { grid-column: 1; }
  .columns { column-count: 1; }
  .edition-rule { display: block; }
  .edition-rule span { display: block; margin: 4px 0; }
  .cell.focused { width: 92vw; max-height: 82vh; }
}
