@font-face {
  font-family: "Newsreader";
  src: url("artifacts-v5/assets/newsreader-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("artifacts-v5/assets/newsreader-medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("artifacts-v5/assets/newsreader-italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f4ede0;
  --text: #2b2823;
  --muted: #7a7268;
  --accent: #1f3a5f;
  --accent-soft: #4a6a8f;
  --olive: #4a5840;
  --olive-soft: #6b7256;
  --rule: rgba(43, 40, 35, 0.12);
  --rule-warm: rgba(74, 88, 64, 0.22);
  --show-sun: none;
  --show-moon: inline-block;
  --column: 680px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #23201a;
  --text: #e9e1d3;
  --muted: #9a9183;
  --accent: #9fb9db;
  --accent-soft: #7490b2;
  --olive: #abb596;
  --olive-soft: #8c9674;
  --rule: rgba(233, 225, 211, 0.14);
  --rule-warm: rgba(171, 181, 150, 0.28);
  --show-sun: inline-block;
  --show-moon: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #23201a;
    --text: #e9e1d3;
    --muted: #9a9183;
    --accent: #9fb9db;
    --accent-soft: #7490b2;
    --olive: #abb596;
    --olive-soft: #8c9674;
    --rule: rgba(233, 225, 211, 0.14);
    --rule-warm: rgba(171, 181, 150, 0.28);
    --show-sun: inline-block;
    --show-moon: none;
  }
}

* { box-sizing: border-box; }

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-variation-settings: "opsz" 16;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
  transition: background-color 180ms ease, color 180ms ease;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent-soft) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

a:hover { color: var(--olive); text-decoration-color: var(--olive-soft); }

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

p { margin: 0 0 1.2rem; hyphens: none; }

.essay-shell {
  width: min(100%, calc(var(--column) + 4rem));
  margin: 0 auto;
  padding: 2.2rem 2rem 3.5rem;
}

.internal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--rule-warm);
}

.breadcrumb {
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-style: italic;
  letter-spacing: 0.02em;
}

.breadcrumb a { flex: 0 0 auto; color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--olive); }

.breadcrumb-current {
  min-width: 0;
  overflow: hidden;
  color: var(--olive);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-toggle {
  flex: 0 0 auto;
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.theme-toggle:hover { color: var(--olive); }

.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .sun { display: var(--show-sun); }
.theme-toggle .moon { display: var(--show-moon); }

.essay-header {
  margin: 4rem 0 2.7rem;
  padding-bottom: 2.2rem;
  border-bottom: 1px solid var(--rule-warm);
}

.essay-header h1 {
  margin: 0 0 1.15rem;
  font-size: clamp(2.5rem, 8vw, 3.35rem);
  font-variation-settings: "opsz" 60;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.kicker {
  margin-bottom: 0.75rem;
  color: var(--olive);
  font-size: 0.78rem;
  font-style: italic;
  letter-spacing: 0.13em;
}

.subtitle {
  max-width: 31rem;
  margin-bottom: 1.2rem;
  color: var(--olive);
  font-size: 1.12rem;
  font-style: italic;
  line-height: 1.48;
}

.byline { margin: 0; color: var(--muted); font-size: 0.9rem; }

.essay-copy {
  font-size: 20px;
  font-variation-settings: "opsz" 20;
  line-height: 1.65;
}

.pivot {
  margin: 2.8rem 0 2.9rem;
  color: var(--olive);
  font-size: 1.35rem;
  font-style: italic;
  font-variation-settings: "opsz" 30;
  line-height: 1.42;
}

.pressure-line {
  margin: 2.6rem 0;
  padding-left: 1.4rem;
  border-left: 1px solid var(--olive-soft);
  color: var(--olive);
  font-size: 1.12rem;
  line-height: 1.55;
}

.data-figure {
  width: min(900px, calc(100vw - 2.5rem));
  margin: 3.5rem 0 3.8rem 50%;
  transform: translateX(-50%);
}

.data-figure picture,
.data-figure img { display: block; width: 100%; }

.data-figure img { height: auto; background: #f4ede0; }

.data-figure figcaption {
  margin-top: 0.55rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--rule-warm);
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.5;
}

.data-figure figcaption p { margin-bottom: 0.42rem; }
.data-figure figcaption p:last-child { margin-bottom: 0; }

.data-figure .figure-context {
  color: var(--text);
  font-size: 1rem;
  font-style: normal;
  line-height: 1.55;
}

.figure-source,
.figure-boundary { font-size: 0.82rem; }
.figure-boundary { color: var(--olive); }

.artifact-figure {
  width: min(1280px, calc(100vw - 1.7rem));
  margin: 4rem 0 4.3rem 50%;
  transform: translateX(-50%);
}

.artifact-frame {
  display: block;
  width: 100%;
  height: min(835px, 65vw);
  min-height: 720px;
  border: 0;
  background: var(--bg);
}

.artifact-fallback {
  margin: 0.45rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--rule-warm);
  color: var(--muted);
  font-size: 0.78rem;
  font-style: italic;
  text-align: right;
}

.evidence-notes { margin-top: 4.5rem; }

.evidence-notes h2 {
  margin: 0 0 1.2rem;
  color: var(--accent);
  font-size: 1.45rem;
  font-style: italic;
  font-variation-settings: "opsz" 28;
  font-weight: 400;
  letter-spacing: 0.005em;
}

.evidence-notes h2::before {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1px;
  margin-right: 0.55rem;
  background: var(--rule-warm);
  vertical-align: 0.32em;
}

.sources-intro { color: var(--muted); font-size: 0.94rem; }

.sources { margin: 1.5rem 0 0; padding: 0; list-style: none; }

.sources li {
  padding: 1rem 0 1.05rem;
  border-top: 1px solid var(--rule);
  font-size: 0.94rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.sources li:last-child { border-bottom: 1px solid var(--rule); }

.essay-footer {
  margin-top: 4.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule-warm);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: italic;
}

.essay-footer a { color: var(--muted); text-decoration: none; }
.essay-footer a:hover { color: var(--olive); }

@media (max-width: 980px) and (min-width: 721px) {
  .artifact-frame { height: 760px; min-height: 0; }
}

@media (max-width: 720px) {
  html { font-size: 17px; }

  .essay-shell { padding: 1.4rem 1.35rem 2.8rem; }
  .essay-header { margin-top: 3.4rem; }
  .essay-copy { font-size: 18.5px; }
  .data-figure { width: calc(100vw - 1.7rem); }

  .pivot {
    margin: 2.4rem 0 2.5rem;
    font-size: 1.25rem;
  }

  .pressure-line { padding-left: 1rem; font-size: 1.05rem; }

  .artifact-figure {
    width: calc(100vw - 0.7rem);
    margin-top: 3.2rem;
    margin-bottom: 3.6rem;
  }

  .artifact-frame { height: 844px; min-height: 0; }
  .artifact-fallback { padding-right: 0.45rem; }

  .essay-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }
}

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