/* BotCourt design tokens
   palette: charcoal #1A1A1A, bone #F0E6D2, ink-black #0D0D0D, accent electric-blue #00D4FF
   type: Bangers (verdict/display) + IBM Plex Mono (case docket, everything else)
   spacing scale: 8 / 12 / 16 / 24 / 32 / 48 px. radius: 2px only, on buttons.
   motion: scale-tip on click (cubic-bezier overshoot), circuit-glow pulse loop, stamp-in on verdict.
*/

@font-face {
  font-family: 'Bangers';
  src: url('assets/fonts/bangers-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/fonts/ibm-plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/fonts/ibm-plex-mono-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --charcoal: #1a1a1a;
  --ink: #0d0d0d;
  --bone: #f0e6d2;
  --bone-dim: #cfc6b2;
  --accent: #00d4ff;
  --red-flag: #d64545;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--charcoal);
  color: var(--bone);
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

body {
  background-image:
    radial-gradient(circle at 15% 8%, rgba(240, 230, 210, 0.04), transparent 40%),
    radial-gradient(circle at 85% 92%, rgba(0, 212, 255, 0.05), transparent 45%);
}

#boot-error {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--red-flag);
  color: var(--bone);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  padding: 10px 16px;
  z-index: 999;
}

a { color: inherit; }

/* letterhead */
.letterhead {
  border-bottom: 2px solid var(--bone-dim);
  padding: 14px 20px;
}
.letterhead-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--bone-dim);
}
.court-name { font-weight: 700; color: var(--bone); }
.clock-wrap { font-variant-numeric: tabular-nums; }
.clock { color: var(--accent); }

main {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* docket */
.docket {
  padding: 24px 0 16px;
  border-bottom: 1px dashed var(--bone-dim);
}
.docket-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
}
.mono-strong { font-weight: 700; }
.status-badge {
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 3px 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  border-radius: 2px;
}
.status-badge.for-plaintiff { border-color: var(--bone); color: var(--bone); }
.status-badge.for-defendant { border-color: var(--red-flag); color: var(--red-flag); }

.matter {
  font-family: 'Bangers', cursive;
  font-weight: 400;
  letter-spacing: 0.03em;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  line-height: 1.15;
  margin: 14px 0 8px;
  text-transform: uppercase;
}
.party { color: var(--accent); }

.subject {
  font-size: 13px;
  color: var(--bone-dim);
  margin: 0 0 14px;
}

.panel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--bone-dim);
}
.panel-label { color: var(--bone); font-weight: 700; }

/* bench / figure */
.bench {
  padding: 28px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.figure-frame {
  position: relative;
  width: min(340px, 78vw);
  border: 1px solid var(--bone-dim);
  padding: 6px;
}
.figure {
  display: block;
  width: 100%;
  height: auto;
}
.glow-eyes {
  position: absolute;
  top: 8%;
  left: 42%;
  width: 26%;
  height: 12%;
  background: radial-gradient(ellipse, rgba(0, 212, 255, 0.55), transparent 70%);
  filter: blur(6px);
  animation: circuit-pulse 3.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes circuit-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.85; }
}

.base-plate {
  margin-top: -1px;
  width: min(340px, 78vw);
  background: var(--ink);
  border: 1px solid var(--bone-dim);
  border-top: none;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.05em;
}
.base-plate-label { color: var(--bone-dim); }
.base-plate-ca { color: var(--accent); word-break: break-all; text-align: right; }

/* scale module */
.scale-module {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px dashed var(--bone-dim);
  text-align: center;
}
.scale-instruction {
  font-size: 13px;
  color: var(--bone-dim);
  max-width: 46ch;
  margin: 0 auto 10px;
}

.scale-stage {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
}
.scale-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.ink {
  fill: none;
  stroke: var(--bone);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ink-thick { stroke-width: 3.4; }
.ink-thin { stroke-width: 1.6; opacity: 0.7; }
.ink-fill { fill: var(--bone); }
.pivot-dot { fill: var(--accent); }
.base-tri { fill: rgba(240, 230, 210, 0.05); }
.pan { stroke-width: 3; }

.beam-group {
  transform-origin: 200px 76px;
  transform: rotate(0deg);
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pan-hit {
  position: absolute;
  top: 46%;
  width: 26%;
  aspect-ratio: 1 / 1;
  background: transparent;
  border: none;
  color: var(--bone);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding-bottom: 6px;
  transition: transform 0.15s ease;
}
.pan-hit:hover { transform: scale(1.05); }
.pan-hit:active { transform: scale(0.94); }
.pan-hit-left { left: 3%; }
.pan-hit-right { right: 3%; }
.pan-hit-label {
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--bone-dim);
}
.pan-hit-count {
  font-size: 12px;
  font-weight: 700;
}

.stamp-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stamp {
  font-family: 'Bangers', cursive;
  font-size: clamp(1.4rem, 6vw, 2.2rem);
  letter-spacing: 0.04em;
  padding: 6px 18px;
  border: 4px solid var(--bone);
  color: var(--bone);
  transform: rotate(-8deg) scale(0);
  background: rgba(13, 13, 13, 0.85);
  white-space: nowrap;
  animation: stamp-in 0.4s cubic-bezier(0.2, 1.4, 0.5, 1) forwards;
}
.stamp.appeal-stamp {
  border-color: var(--red-flag);
  color: var(--red-flag);
  transform: rotate(6deg) scale(0);
  margin-top: 46px;
}
@keyframes stamp-in {
  0% { transform: rotate(-8deg) scale(0); opacity: 0; }
  60% { transform: rotate(-8deg) scale(1.15); opacity: 1; }
  100% { transform: rotate(-8deg) scale(1); opacity: 1; }
}
.stamp.appeal-stamp { animation-name: stamp-in-appeal; }
@keyframes stamp-in-appeal {
  0% { transform: rotate(6deg) scale(0); opacity: 0; }
  60% { transform: rotate(6deg) scale(1.15); opacity: 1; }
  100% { transform: rotate(6deg) scale(1); opacity: 1; }
}
.stamp.fade-out { animation: stamp-fade 0.5s ease forwards; }
@keyframes stamp-fade {
  to { opacity: 0; }
}

.verdict-readout {
  margin-top: 26px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  min-height: 1.4em;
}
.appeals-counter {
  font-size: 12px;
  color: var(--bone-dim);
  margin-top: 6px;
}

/* chronology */
.chronology {
  margin-top: 44px;
  border-top: 1px dashed var(--bone-dim);
  padding-top: 18px;
}
.chronology-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--bone-dim);
  margin: 0 0 14px;
}
.chrono-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chrono-list li {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 12px;
  font-size: 12.5px;
  border-left: 2px solid var(--bone-dim);
  padding: 3px 0 3px 10px;
}
.chrono-time {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.chrono-verdict { border-left-color: var(--bone); }
.chrono-appeal { border-left-color: var(--red-flag); }
.chrono-appeal .chrono-event { color: var(--red-flag); }
.chrono-new { animation: chrono-flash 1s ease; }
@keyframes chrono-flash {
  0% { background: rgba(0, 212, 255, 0.18); }
  100% { background: transparent; }
}

/* footer chrome */
.chrome-footer {
  margin-top: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.chrome-ticker {
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--bone-dim);
}
.buy-btn {
  border: 2px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 10px 20px;
  border-radius: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}
.buy-btn:hover { background: var(--accent); color: var(--ink); }
.x-link {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bone-dim);
  border-radius: 2px;
}
.x-link img { display: block; filter: invert(1); width: 20px; height: 20px; }

.noscript-note {
  text-align: center;
  color: var(--bone-dim);
  font-size: 12px;
  margin-top: 20px;
}

.fine-print {
  text-align: center;
  font-size: 11px;
  color: var(--bone-dim);
  opacity: 0.6;
  padding: 20px;
}

@media (prefers-reduced-motion: reduce) {
  .beam-group { transition: none; }
  .glow-eyes { animation: none; opacity: 0.5; }
  .stamp, .stamp.appeal-stamp { animation: none; transform: rotate(0deg) scale(1); opacity: 1; }
  .chrono-new { animation: none; }
}

@media (max-width: 480px) {
  .pan-hit-label { font-size: 9px; }
  .chrono-list li { grid-template-columns: 92px 1fr; font-size: 11.5px; }
}
