:root {
  color-scheme: light;
  --paper: #f0eee6;
  --paper-deep: #e5e1d5;
  --ink: #171714;
  --muted: #68665f;
  --line: #aaa69a;
  --accent: #b63c16;
  --accent-soft: #f8cdbf;
  --focus: #005fcc;
  --panel: rgba(255, 255, 255, 0.24);
  --header: rgba(240, 238, 230, 0.94);
  --max: 1320px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #151512;
  --paper-deep: #1e1e19;
  --ink: #ece8dd;
  --muted: #aaa69a;
  --line: #5e5a52;
  --accent: #ff7648;
  --accent-soft: #4d2a20;
  --focus: #ffbf47;
  --panel: rgba(255, 255, 255, 0.035);
  --header: rgba(21, 21, 18, 0.94);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    linear-gradient(rgba(127, 127, 127, 0.055) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 28px;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 4px; }
button { color: inherit; font: inherit; cursor: pointer; }

:where(a, button):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 9px 12px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-140%);
}
.skip-link:focus { transform: none; }

.case-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto auto;
  min-height: 68px;
  border-bottom: 1px solid var(--ink);
  background: var(--header);
  backdrop-filter: blur(12px);
}

.case-brand,
.case-back,
.theme-toggle {
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 0 clamp(16px, 3vw, 42px);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.case-brand { gap: 10px; }
.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.case-back,
.theme-toggle { border-left: 1px solid var(--ink); }
.theme-toggle { gap: 9px; border-top: 0; border-right: 0; border-bottom: 0; background: transparent; }

.case-back:hover,
.case-back:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.theme-icon {
  position: relative;
  width: 16px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.theme-icon::after {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  transform: translateX(3px);
}
html[data-theme="dark"] .theme-icon::after { transform: translateX(-3px); }

.case-hero {
  display: grid;
  grid-template-columns: minmax(250px, .36fr) minmax(0, 1fr);
  min-height: calc(82vh - 68px);
  border-bottom: 1px solid var(--ink);
}

.case-rail {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 64px);
  border-right: 1px solid var(--ink);
  background: var(--paper-deep);
}

.eyebrow,
.section-label,
.meta-label {
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.eyebrow,
.section-label { color: var(--accent); }

.case-rail dl { margin: 40px 0 0; }
.case-rail div {
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.case-rail dt {
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
}
.case-rail dd {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
}

.case-hero-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(58px, 8vw, 120px) clamp(24px, 6vw, 90px);
}

h1, h2, h3 { font-weight: 500; letter-spacing: -.05em; line-height: 1.03; }
h1 {
  max-width: 1000px;
  margin: 0 0 42px;
  font-size: clamp(3.5rem, 8vw, 8.8rem);
}
h1 em {
  display: block;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}
.case-summary {
  max-width: 810px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2.3vw, 2.2rem);
  line-height: 1.35;
}

.case-main { max-width: var(--max); margin: 0 auto; }

.case-section {
  display: grid;
  grid-template-columns: minmax(180px, .28fr) minmax(0, 1fr);
  gap: clamp(30px, 7vw, 110px);
  padding: clamp(70px, 9vw, 130px) clamp(20px, 5vw, 70px);
  border-bottom: 1px solid var(--ink);
}

.case-content { max-width: 860px; }
.case-content > p:first-child {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 2.7vw, 2.65rem);
  line-height: 1.3;
}

.case-content h2 {
  margin: 0 0 24px;
  font-size: clamp(2.4rem, 5vw, 5.7rem);
}

.case-content h3 {
  margin: 38px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  letter-spacing: -.025em;
}

.case-content p,
.case-content li { max-width: 760px; }

.case-content ul {
  margin: 22px 0 0;
  padding-left: 20px;
}
.case-content li { margin-bottom: 11px; }

.fact-grid,
.decision-grid,
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 38px;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.fact,
.decision,
.evidence-card {
  padding: 24px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--panel);
}

.fact strong,
.decision strong,
.evidence-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: .69rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.fact p,
.decision p,
.evidence-card p { margin: 0; font-size: .9rem; }

.placeholder {
  padding: 22px;
  border-left: 5px solid var(--accent);
  background: var(--accent-soft);
}
.placeholder strong {
  display: block;
  margin-bottom: 7px;
  font-size: .72rem;
  text-transform: uppercase;
}

.visual-placeholder {
  display: grid;
  min-height: 330px;
  place-items: center;
  margin: 38px 0;
  border: 1px solid var(--ink);
  background:
    linear-gradient(135deg, transparent 49.8%, var(--line) 50%, transparent 50.2%),
    linear-gradient(45deg, transparent 49.8%, var(--line) 50%, transparent 50.2%),
    var(--paper-deep);
  text-align: center;
}
.visual-placeholder span {
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--ink);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.case-cta {
  padding: clamp(70px, 9vw, 120px) clamp(20px, 5vw, 70px);
  border-top: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}
.case-cta-inner { max-width: var(--max); margin: 0 auto; }
.case-cta h2 {
  max-width: 900px;
  margin: 0 0 35px;
  font-size: clamp(2.8rem, 6vw, 7rem);
}
.case-cta-links { display: flex; flex-wrap: wrap; gap: 12px; }
.case-cta a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  font-size: .72rem;
}
.case-cta a:hover,
.case-cta a:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.case-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(20px, 5vw, 70px);
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
  color: var(--ink);
  font-size: .68rem;
  text-transform: uppercase;
}

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

@media (max-width: 780px) {
  .case-header { grid-template-columns: 1fr auto; }
  .case-back { display: none; }
  .case-hero,
  .case-section { grid-template-columns: 1fr; }
  .case-rail { border-right: 0; border-bottom: 1px solid var(--ink); }
  .case-section { gap: 28px; }
  .fact-grid,
  .decision-grid,
  .evidence-grid { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .theme-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .theme-toggle { padding-inline: 17px; }
  .case-brand { padding-inline: 16px; }
  .case-footer { display: block; }
  .case-footer p { margin-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}


.prototype-artifact {
  margin: 42px 0;
  border: 1px solid var(--ink);
  background: var(--paper-deep);
}

.artifact-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}

.artifact-toolbar span {
  padding: 6px 9px;
  border: 1px solid var(--ink);
  font-size: .68rem;
  text-transform: uppercase;
}

.artifact-layout {
  display: grid;
  grid-template-columns: minmax(160px, .32fr) minmax(0, 1fr);
  min-height: 320px;
}

.artifact-sidebar {
  padding: 20px;
  border-right: 1px solid var(--ink);
}

.artifact-sidebar h4,
.artifact-panel h4 {
  margin: 0 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 400;
}

.artifact-sidebar ul {
  margin: 0;
  padding-left: 18px;
  font-size: .8rem;
}

.artifact-sidebar li {
  margin-bottom: 8px;
}

.artifact-main {
  position: relative;
  padding: 26px;
  overflow: hidden;
}

.annotation-canvas {
  min-height: 260px;
  background:
    linear-gradient(rgba(127,127,127,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127,127,127,.12) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  border: 1px solid var(--line);
  position: relative;
}

.annotation-stroke {
  position: absolute;
  height: 8px;
  border-radius: 999px;
  transform-origin: left center;
}

.annotation-stroke.one {
  width: 44%;
  top: 31%;
  left: 12%;
  background: var(--accent);
  transform: rotate(15deg);
}

.annotation-stroke.two {
  width: 32%;
  right: 12%;
  bottom: 26%;
  background: #2d8b68;
  transform: rotate(-21deg);
}

.annotation-chip {
  position: absolute;
  padding: 5px 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: .66rem;
}

.annotation-chip.one { top: 16%; left: 10%; }
.annotation-chip.two { right: 9%; bottom: 14%; }

.draft-board {
  display: grid;
  grid-template-columns: 1fr .65fr;
  gap: 18px;
}

.draft-list,
.score-breakdown {
  border: 1px solid var(--ink);
  background: var(--paper);
}

.draft-row,
.score-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: .8rem;
}

.draft-row:last-child,
.score-row:last-child { border-bottom: 0; }

.score-row strong {
  color: var(--accent);
  font-family: "Courier New", monospace;
}

.waveform-demo {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 92px;
  padding: 20px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.waveform-demo span {
  flex: 1;
  max-width: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.waveform-demo span:nth-child(1),
.waveform-demo span:nth-child(12) { height: 20%; }
.waveform-demo span:nth-child(2),
.waveform-demo span:nth-child(11) { height: 42%; }
.waveform-demo span:nth-child(3),
.waveform-demo span:nth-child(10) { height: 64%; }
.waveform-demo span:nth-child(4),
.waveform-demo span:nth-child(9) { height: 88%; }
.waveform-demo span:nth-child(5),
.waveform-demo span:nth-child(8) { height: 55%; }
.waveform-demo span:nth-child(6),
.waveform-demo span:nth-child(7) { height: 100%; }

.transcript-demo {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  margin-top: 18px;
}

.artifact-panel {
  padding: 18px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.artifact-panel p,
.artifact-panel li {
  font-size: .8rem;
}

.artifact-panel ul {
  margin: 0;
  padding-left: 18px;
}

.metric-list {
  display: grid;
  gap: 10px;
  margin: 26px 0 0;
}

.metric-list article {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.metric-list strong {
  color: var(--accent);
  font-family: "Courier New", monospace;
}

.metric-list p { margin: 0; }

.pending-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px dashed currentColor;
  opacity: .72;
  font-size: .72rem;
  text-transform: uppercase;
}

@media (max-width: 680px) {
  .artifact-layout,
  .draft-board,
  .transcript-demo,
  .metric-list article {
    grid-template-columns: 1fr;
  }

  .artifact-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }
}
