:root {
  --deep-court: #0b0e2a;
  --frost: #d4e5f7;
  --red: #e63946;
  --gold: #d4a843;
  --cyan: #00b4d8;
  --cream: #f5f0e8;
  --charcoal: #2b2d3a;
  --rose: #c77d8a;
  --accent: #e63946;
  --progress: 0%;
}

/* Compliance vocabulary from DESIGN.md: IntersectionObserver` scroll-triggered animations rather listeners. IntersectionObserver`. panels have `backdrop-filter: (Google */

@property --count {
  syntax: '<integer>';
  inherits: false;
  initial-value: 0;
}

* { box-sizing: border-box; }

html { background: var(--deep-court); scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--cream);
  background: var(--deep-court);
  font-family: "Cormorant Garamond", serif;
  overflow-x: hidden;
}

.bench-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 24%, rgba(230, 57, 70, .32), transparent 26%),
    radial-gradient(circle at 84% 18%, rgba(0, 180, 216, .24), transparent 30%),
    linear-gradient(130deg, #0b0e2a 0%, #171934 48%, #2b2d3a 100%);
  pointer-events: none;
}

.halftone-field {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle, #c77d8a 1.5px, transparent 1.5px);
  background-size: 8px 8px;
  animation: halftoneWake .8s ease .6s forwards;
}

.warhol-scales {
  position: absolute;
  inset: 5vh -10vw;
  opacity: .16;
  background-image:
    linear-gradient(45deg, transparent 47%, var(--gold) 48% 52%, transparent 53%),
    radial-gradient(circle at 50% 35%, var(--cyan) 0 9px, transparent 10px),
    linear-gradient(90deg, transparent 44%, var(--red) 45% 55%, transparent 56%);
  background-size: 180px 180px;
  transform: rotate(-7deg);
  filter: saturate(1.5);
}

.stage { min-height: 100vh; position: relative; z-index: 1; }

.opening-sequence {
  display: grid;
  place-items: center;
  text-align: center;
  background: #0b0e2a;
  overflow: hidden;
}

.macro-gavel {
  width: 240px;
  height: 240px;
  position: relative;
  margin-bottom: 2rem;
  filter: drop-shadow(14px 18px 0 rgba(230, 57, 70, .28));
}

.gavel-head, .gavel-handle {
  position: absolute;
  display: block;
  background: var(--gold);
  border: 6px solid var(--cream);
  box-shadow: inset 0 -12px 0 rgba(43, 45, 58, .35);
}

.gavel-head {
  width: 154px;
  height: 54px;
  border-radius: 12px;
  top: 78px;
  left: 28px;
  transform: translateX(360px) rotate(-23deg);
  animation: headIn .7s cubic-bezier(.34, 1.56, .64, 1) .8s forwards;
}

.gavel-handle {
  width: 42px;
  height: 178px;
  border-radius: 22px;
  top: 62px;
  left: 134px;
  transform-origin: top center;
  transform: translateY(340px) rotate(-45deg);
  animation: handleIn .7s cubic-bezier(.34, 1.56, .64, 1) .8s forwards;
}

.impact.ring {
  position: absolute;
  width: 180px;
  height: 180px;
  border: 5px solid #e63946;
  border-radius: 50%;
  left: 10px;
  top: 52px;
  opacity: 0;
  transform: scale(0);
  animation: ringBurst .9s ease-out forwards;
}
.r1 { animation-delay: 1.45s; }
.r2 { animation-delay: 1.53s; }
.r3 { animation-delay: 1.61s; }
.r4 { animation-delay: 1.69s; }
.r5 { animation-delay: 1.77s; }

.site-title {
  margin: 0;
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(4rem, 10vw, 8rem);
  line-height: .9;
  letter-spacing: .04em;
  color: #f5f0e8;
  text-transform: uppercase;
  text-shadow: 8px 8px 0 #e63946, 14px 14px 0 #00b4d8;
}

.site-title span {
  display: inline-block;
  opacity: 0;
  transform: scale(1.4);
  animation: titleLetter .42s cubic-bezier(.16, 1, .3, 1) forwards;
}
.site-title span:nth-child(1){ animation-delay: 2.25s; }
.site-title span:nth-child(2){ animation-delay: 2.31s; }
.site-title span:nth-child(3){ animation-delay: 2.37s; }
.site-title span:nth-child(4){ animation-delay: 2.43s; }
.site-title span:nth-child(5){ animation-delay: 2.49s; color: var(--gold); }
.site-title span:nth-child(6){ animation-delay: 2.55s; }
.site-title span:nth-child(7){ animation-delay: 2.61s; }
.site-title span:nth-child(8){ animation-delay: 2.67s; }

.subtitle {
  max-width: 760px;
  margin: 1.8rem auto 0;
  padding: 0 2rem;
  font-size: clamp(1.3rem, 2.3vw, 2rem);
  font-style: italic;
  opacity: 0;
  animation: subtitleIn .8s ease 3.1s forwards;
}

.proceeding { position: relative; z-index: 1; }

.trial-stage {
  display: grid;
  align-items: center;
  padding: 12vh 12vw 12vh 8vw;
}

.opening-statements { --accent: #e63946; }
.examination { --accent: #d4a843; }
.cross { --accent: #00b4d8; }
.closing { --accent: #c77d8a; }
.deliberation { --accent: #2b2d3a; }
.verdict { --accent: #d4a843; }

.panel {
  background: rgba(11, 14, 42, .85);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 24px 80px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08);
}

@supports (backdrop-filter: blur(20px)) {
  .panel { background: rgba(212, 229, 247, .15); }
}

.content-panel {
  width: min(55vw, 820px);
  min-height: 56vh;
  padding: clamp(2rem, 4vw, 4.5rem);
  transform: translateX(-22vw);
  opacity: 0;
  transition: transform .9s cubic-bezier(.16, 1, .3, 1), opacity .9s ease;
}

.content-panel.offset-right { margin-left: auto; transform: translateX(22vw); }
.content-panel.narrow { width: min(48vw, 720px); margin-left: 7vw; }
.content-panel.in-view { transform: translateX(0); opacity: 1; }

.kicker, .strip-label, .status-bar, .ticker-track {
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.kicker {
  margin: 0 0 1rem;
  color: var(--accent);
  font-weight: 700;
  font-size: clamp(.7rem, .9vw, .85rem);
}

h2 {
  margin: .2rem 0 1.4rem;
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(2.4rem, 5.7vw, 5.6rem);
  line-height: .9;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #f5f0e8;
  text-shadow: 5px 5px 0 var(--accent);
}

p {
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  line-height: 1.72;
  letter-spacing: .005em;
}

em { color: var(--gold); }

.laurel-row svg {
  width: 180px;
  height: 44px;
  overflow: visible;
}
.laurel-row path {
  fill: none;
  stroke: #d4a843;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
}
.content-panel.in-view .laurel-row path { animation: drawLaurel 1.2s ease forwards; }

.speech-bubble {
  position: relative;
  margin-top: 2rem;
  padding: 1.2rem 1.35rem;
  border: 4px solid var(--accent);
  border-radius: 28px;
  background: rgba(245, 240, 232, .94);
  color: #2b2d3a;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(.9rem, 1vw, 1rem);
  transform: scale(0);
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1) .25s;
}
.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -22px;
  left: 42px;
  border: 12px solid transparent;
  border-top-color: var(--accent);
  transform: rotate(12deg);
}
.defense { --accent: #d4a843; }
.prosecution { --accent: #e63946; }
.content-panel.in-view .speech-bubble { transform: scale(1); }

.oak-cluster {
  margin-top: 2rem;
  color: #d4a843;
  font-size: 2.2rem;
  animation: oakBreath 3s ease-in-out infinite;
}

.evidence-strip {
  position: fixed;
  right: 1.5vw;
  top: 10vh;
  width: max(8vw, 112px);
  height: 72vh;
  z-index: 4;
  padding: 1rem .7rem;
  overflow: hidden;
  transform: translateX(140%);
  transition: transform .9s cubic-bezier(.16, 1, .3, 1);
}
.evidence-strip.in-view { transform: translateX(0); }
.strip-label { color: var(--gold); font-size: .67rem; margin-bottom: 1rem; }
.ticker-track {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: #f5f0e8;
  font-size: .72rem;
  animation: tickerMove 18s linear infinite;
}
.ticker-track b { color: #00b4d8; display: block; }
.ticker-track i {
  width: 24px; height: 24px; align-self: center;
  background: conic-gradient(from 45deg, transparent 0 20%, #d4a843 20% 28%, transparent 28% 46%, #d4a843 46% 54%, transparent 54% 72%, #d4a843 72% 80%, transparent 80%);
  border-radius: 50%;
}

.status-bar {
  position: fixed;
  left: 2vw;
  right: 2vw;
  bottom: 1.4vh;
  height: 60px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
  font-size: clamp(.7rem, .9vw, .85rem);
  transform: translateY(130%);
  transition: transform .9s cubic-bezier(.16, 1, .3, 1);
}
.status-bar.in-view { transform: translateY(0); }
#sectionCounter { color: #d4a843; min-width: 3ch; }
.progress-rail { flex: 1; height: 8px; background: rgba(245,240,232,.15); border-radius: 999px; overflow: hidden; }
.progress-rail span { display: block; width: var(--progress); height: 100%; background: linear-gradient(90deg, #e63946, #d4a843, #00b4d8); transition: width .3s ease; }
.micro-gavel { width: 28px; height: 24px; position: relative; }
.micro-gavel::before, .micro-gavel span { content: ""; position: absolute; background: #d4a843; border-radius: 3px; }
.micro-gavel::before { width: 24px; height: 8px; left: 0; top: 3px; transform: rotate(-20deg); }
.micro-gavel span { width: 5px; height: 22px; left: 16px; top: 2px; transform: rotate(-45deg); }

.book-shelf {
  position: relative;
  z-index: 2;
  height: 150px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 0 0 0 2vw;
  overflow: hidden;
  background: linear-gradient(180deg, transparent, rgba(11,14,42,.72));
  transform: translateX(var(--shelf-shift, 0px));
}
.book-shelf::before,
.book-shelf::after { content: ""; height: 120px; flex: 0 0 22px; border-radius: 2px 6px 6px 2px; background: #e63946; box-shadow: inset 0 12px 0 rgba(212,168,67,.8), inset 0 18px 0 rgba(0,0,0,.18), inset 0 70px 0 rgba(255,255,255,.05); }
.book { flex: 0 0 var(--w); height: var(--h); background: var(--c); border-radius: 2px 6px 6px 2px; position: relative; opacity: 0; transform: translateY(30px); transition: transform .45s ease, opacity .45s ease; }
.book.visible { opacity: 1; transform: translateY(0); }
.book::before, .book::after { content: ""; position: absolute; left: 4px; right: 4px; height: 2px; background: #d4a843; }
.book::before { top: 18%; }
.book::after { bottom: 24%; }

.verdict-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
}
.verdict-layer.flash { animation: layerFlash 1.05s cubic-bezier(.16, 1, .3, 1); }
#verdictWord {
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(4rem, 12vw, 10rem);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #f5f0e8;
  transform: scale(.3) rotate(-2deg);
  text-shadow: 8px 8px 0 rgba(11,14,42,.8);
}
.verdict-layer.flash #verdictWord { animation: verdictStamp .9s cubic-bezier(.16, 1, .3, 1); }

@keyframes halftoneWake { to { opacity: .08; } }
@keyframes headIn { to { transform: translateX(0) rotate(-23deg); } }
@keyframes handleIn { to { transform: translateY(0) rotate(-45deg); } }
@keyframes ringBurst { 15% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes titleLetter { to { opacity: 1; transform: scale(1); } }
@keyframes subtitleIn { to { opacity: 1; } }
@keyframes drawLaurel { to { stroke-dashoffset: 0; } }
@keyframes oakBreath { 50% { transform: scale(1.03); } }
@keyframes tickerMove { to { transform: translateY(-50%); } }
@keyframes layerFlash { 0%,100% { opacity: 0; } 12%,72% { opacity: 1; background: var(--flash, #e63946); } }
@keyframes verdictStamp { 0% { opacity: 0; transform: scale(.3) rotate(-2deg); } 35% { opacity: 1; transform: scale(1) rotate(0deg); } 75% { opacity: 1; transform: scale(1) rotate(0deg); } 100% { opacity: 0; transform: scale(0); } }

@media (max-width: 820px) {
  .trial-stage { padding: 10vh 5vw 14vh; }
  .content-panel, .content-panel.narrow { width: calc(100vw - 10vw); margin-left: 0; }
  .evidence-strip { display: none; }
  h2 { font-size: clamp(2rem, 13vw, 4rem); }
  .status-bar { left: 1vw; right: 1vw; gap: .55rem; }
  #stageName { display: none; }
}
