@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&family=JetBrains+Mono:wght@400;500;700&family=Playfair+Display:wght@400;600;700;900&family=Lora:wght@400;600&display=block");

:root {
  --paper: #f9f9f7;
  --ink: #111111;
  --muted: #e5e5e0;
  --red: #cc0000;
  --soft: #f5f5f5;
  --caption: #525252;
}

* {
  box-sizing: border-box;
  border-radius: 0 !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23111111' fill-opacity='0.04' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
  font-family: "Lora", Georgia, serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

button,
a {
  min-height: 44px;
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 4px solid var(--ink);
}

.edition-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav {
  max-width: 1280px;
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-right: 1px solid var(--ink);
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 28px;
  font-weight: 900;
  text-decoration: none;
}

.nav-links {
  display: flex;
  margin-left: auto;
}

.nav-links a,
.menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid var(--ink);
  background: transparent;
  font-family: "Inter", "Helvetica Neue", sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.nav-links a:hover,
.menu-button:hover,
.footer a:hover {
  color: var(--red);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.menu-button {
  display: none;
}

.ticker {
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 1px solid var(--ink);
  font-family: "JetBrains Mono", "Courier New", monospace;
}

.ticker-track {
  width: max-content;
  padding: 10px 0;
  display: flex;
  gap: 28px;
  align-items: center;
  animation: ticker 34s linear infinite;
  white-space: nowrap;
}

.ticker span,
.ticker strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ticker span {
  padding: 2px 8px;
  background: var(--red);
}

@keyframes ticker {
  from {
    transform: translateX(100vw);
  }
  to {
    transform: translateX(-100%);
  }
}

.hero,
.section,
.footer {
  max-width: 1280px;
  margin: 0 auto;
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: 8fr 4fr;
  border-bottom: 4px solid var(--ink);
}

.page-hero h1 {
  font-size: clamp(52px, 7vw, 96px);
}

.hero-lead {
  padding: 48px 32px 40px;
  border-right: 1px solid var(--ink);
}

.hero h1 {
  margin: 0 0 24px;
  max-width: 900px;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: clamp(56px, 8vw, 124px);
  font-weight: 900;
  line-height: 0.9;
}

.dek {
  max-width: 860px;
  margin: 0;
  font-size: 18px;
  text-align: justify;
}

.dropcap::first-letter {
  float: left;
  padding: 9px 8px 0 0;
  color: var(--red);
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 76px;
  font-weight: 900;
  line-height: 0.75;
}

.label,
.kicker {
  display: inline-block;
  margin: 0 0 12px;
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.kicker {
  padding: 3px 7px;
  background: var(--ink);
  color: var(--paper);
}

.red {
  color: var(--red);
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr;
}

.stat-cell {
  padding: 24px;
  border-bottom: 1px solid var(--ink);
}

.stat-cell:last-child {
  border-bottom: 0;
}

.stat-cell span {
  display: block;
  font-family: "Inter", "Helvetica Neue", sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-cell strong {
  display: block;
  margin-top: 10px;
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 34px;
  line-height: 1;
}

.section {
  padding: 0;
  border-bottom: 4px solid var(--ink);
}

.section-title {
  padding: 28px 24px 24px;
  border-bottom: 1px solid var(--ink);
}

.section-link {
  display: inline-flex;
  align-items: center;
  margin-top: 16px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: "Inter", "Helvetica Neue", sans-serif;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.section-link:hover {
  background: var(--paper);
  color: var(--ink);
}

h2,
h3 {
  margin: 0;
  font-family: "Playfair Display", "Times New Roman", serif;
  line-height: 1.08;
}

h2 {
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 900;
}

h3 {
  font-size: clamp(25px, 3vw, 36px);
  font-weight: 800;
}

.body-text {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 16px;
  text-align: justify;
}

.newsprint-texture {
  position: relative;
}

.newsprint-texture::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    linear-gradient(0deg, transparent 98%, rgba(0, 0, 0, 0.025) 100%),
    linear-gradient(90deg, transparent 98%, rgba(0, 0, 0, 0.025) 100%);
  background-size: 3px 3px;
}

.newspaper-grid {
  display: grid;
  border-top: 0;
}

.grid-cell {
  padding: 24px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: rgba(249, 249, 247, 0.96);
}

.grid-cell:last-child {
  border-right: 0;
}

.dataset-grid {
  grid-template-columns: 8fr 4fr;
}

.feature-cell {
  padding: 28px;
}

.data-ledger {
  background: var(--soft);
}

.data-ledger dl {
  margin: 20px 0 0;
}

.data-ledger div {
  padding: 14px 0;
  border-bottom: 1px solid var(--ink);
}

.data-ledger dt {
  font-family: "Inter", "Helvetica Neue", sans-serif;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.data-ledger dd {
  margin: 4px 0 0;
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 18px;
  font-weight: 700;
}

.figure-frame {
  margin: 22px 0 0;
}

.figure-frame img {
  display: block;
  width: 100%;
  border: 1px solid var(--ink);
  filter: grayscale(1);
  background:
    radial-gradient(#000 1px, transparent 1px),
    var(--muted);
  background-size: 16px 16px;
}

.figure-frame img:hover {
  filter: grayscale(1) sepia(0.5);
}

.paper-figure-frame {
  margin: 0;
  padding: 24px;
  background: #ffffff;
}

.paper-figure-frame img {
  display: block;
  width: 100%;
  border: 1px solid var(--ink);
  background: #ffffff;
  filter: none;
}

.paper-figure-frame figcaption {
  max-width: 1120px;
}

figcaption {
  padding: 8px 0 0;
  color: var(--caption);
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 12px;
}

.method-grid {
  grid-template-columns: repeat(3, 1fr);
}

.hard-shadow-hover {
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, background 0.2s ease-out;
}

.hard-shadow-hover:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 0 var(--ink);
  background: var(--soft);
}

.inverted {
  max-width: none;
  padding: 0;
  background: var(--ink);
  color: var(--paper);
  border-left: 0;
  border-right: 0;
}

.inverted-grid,
.process-strip {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  border-left: 1px solid var(--paper);
  border-right: 1px solid var(--paper);
}

.inverted-grid {
  grid-template-columns: 5fr 7fr;
}

.inverted-grid > div,
.inverted-grid > p {
  margin: 0;
  padding: 34px 24px;
  border-right: 1px solid var(--paper);
}

.inverted-grid > p {
  border-right: 0;
  color: var(--paper);
}

.inverted-link {
  display: inline-flex;
  align-items: center;
  margin-top: 18px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--paper);
  color: var(--paper);
  font-family: "Inter", "Helvetica Neue", sans-serif;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.inverted-link:hover {
  background: var(--paper);
  color: var(--ink);
}

.process-strip {
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--paper);
}

.process-strip div {
  padding: 20px;
  border-right: 1px solid var(--paper);
}

.process-strip div:last-child {
  border-right: 0;
}

.process-strip strong {
  display: block;
  color: var(--red);
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 46px;
  line-height: 1;
}

.process-strip span {
  display: block;
  margin-top: 8px;
  font-family: "Inter", "Helvetica Neue", sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.result-lede {
  padding: 24px;
  border-bottom: 1px solid var(--ink);
}

.table-frame {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: var(--paper);
}

th,
td {
  padding: 12px 14px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  text-align: left;
  white-space: nowrap;
}

th {
  background: var(--ink);
  color: var(--paper);
  font-family: "Inter", "Helvetica Neue", sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

td {
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 13px;
}

tr:hover td {
  background: var(--soft);
}

.model-link {
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.model-link:hover {
  color: var(--red);
}

.model-download-link,
.model-netron-link,
.model-local-hint {
  display: inline-block;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--ink);
  font-family: "Inter", "Helvetica Neue", sans-serif;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.model-download-link,
.model-netron-link {
  color: var(--red);
}

.model-local-hint {
  color: var(--ink);
  opacity: 0.65;
  cursor: help;
}

.model-download-link:hover,
.model-netron-link:hover {
  color: var(--ink);
}

.figure-grid,
.run-grid {
  grid-template-columns: 1fr 1fr;
}

.print-list {
  margin: 18px 0 0;
  padding-left: 20px;
}

.print-list li {
  margin: 10px 0;
}

code {
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 0.92em;
}

.code-block {
  margin: 18px 0 0;
  padding: 16px;
  overflow-x: auto;
  border: 1px solid var(--ink);
  background: var(--soft);
  white-space: pre-wrap;
}

.model3d-section {
  max-width: none;
  border-left: 0;
  border-right: 0;
}

.model3d-section .section-title,
.model3d-notes {
  max-width: 1280px;
  margin: 0 auto;
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
}

.model3d-toolbar {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 0;
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}

.model3d-viewer {
  max-width: 1280px;
  margin: 0 auto;
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  background: var(--paper);
}

.model3d-window-bar {
  min-height: 42px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.model3d-window-bar span:nth-child(2) {
  padding: 0 18px;
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  color: var(--red);
}

.model3d-window-bar span:last-child {
  text-align: right;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
}

.viz-button {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: "Inter", "Helvetica Neue", sans-serif;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.control-group:last-child .viz-button:first-child {
  border-left: 1px solid var(--ink);
}

.viz-button:hover,
.viz-button.active {
  background: var(--ink);
  color: var(--paper);
}

.viz-button.disabled,
.viz-button:disabled {
  color: #7a7a7a;
  background: #d9d9d2;
  cursor: not-allowed;
}

.model3d-stage {
  position: relative;
  width: 100%;
  height: min(66vh, 720px);
  min-height: 560px;
  overflow: hidden;
  background: var(--paper);
}

.model3d-stage.webgl-active {
  background: var(--ink);
}

.model3d-graph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.model3d-stage.webgl-active .model3d-graph {
  opacity: 1;
}

.model3d-loading {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(760px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 18px;
  color: var(--ink);
  border: 1px solid var(--ink);
  background: rgba(249, 249, 247, 0.96);
  box-shadow: 8px 8px 0 var(--ink);
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 14px;
  text-align: left;
}

.model3d-loading.hidden {
  display: none;
}

.webgl-start-button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: "Inter", "Helvetica Neue", sans-serif;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.webgl-start-button:hover {
  background: var(--red);
  color: var(--paper);
}

.model3d-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 70px minmax(170px, 1.3fr) 70px minmax(170px, 1.3fr) 70px minmax(140px, 1fr);
  align-items: center;
  gap: 0;
  padding: 64px max(28px, 8vw) 112px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(17, 17, 17, 0.08) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px, 32px 32px, auto;
  perspective: 900px;
}

.model3d-stage.webgl-active .model3d-fallback {
  display: none;
}

.model3d-detail,
.model3d-summary {
  position: absolute;
  z-index: 5;
  width: min(360px, calc(100% - 32px));
  padding: 14px;
  border: 1px solid var(--paper);
  color: var(--paper);
  background: rgba(17, 17, 17, 0.88);
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.model3d-detail {
  right: 18px;
  top: 18px;
}

.model3d-summary {
  left: 18px;
  top: 18px;
}

.model3d-stage:not(.webgl-active) .model3d-detail,
.model3d-stage:not(.webgl-active) .model3d-summary {
  color: var(--ink);
  border-color: var(--ink);
  background: rgba(249, 249, 247, 0.96);
  box-shadow: 6px 6px 0 var(--ink);
}

.model3d-detail strong,
.model3d-summary strong {
  display: block;
  margin-bottom: 6px;
  color: var(--red);
  font-family: "Inter", "Helvetica Neue", sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.model3d-summary span {
  display: block;
}

.fallback-layer {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 22px;
  border: 2px solid var(--ink);
  background: rgba(249, 249, 247, 0.96);
  box-shadow: 10px 10px 0 rgba(204, 0, 0, 0.82);
  transform: rotateY(-18deg) rotateX(8deg);
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.fallback-layer strong {
  display: block;
  margin-top: 8px;
  color: var(--red);
  font-size: 19px;
}

.fallback-layer.predictor {
  min-height: 230px;
  background: #ffffff;
}

.fallback-arrow {
  height: 2px;
  background: var(--ink);
  position: relative;
}

.fallback-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-top: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
  transform: translateY(-50%) rotate(45deg);
}

.model3d-notes {
  border-top: 0;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--ink);
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer strong,
.footer span {
  display: block;
}

.footer a {
  font-weight: 800;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (max-width: 820px) {
  .edition-bar {
    flex-direction: column;
  }

  .nav {
    flex-wrap: wrap;
  }

  .brand {
    flex: 1;
    font-size: 22px;
  }

  .menu-button {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    width: 100%;
    border-top: 1px solid var(--ink);
  }

  body.menu-open .nav-links {
    display: grid;
  }

  .nav-links a {
    justify-content: flex-start;
    border-left: 0;
    border-bottom: 1px solid var(--ink);
  }

  .hero,
  .dataset-grid,
  .method-grid,
  .inverted-grid,
  .process-strip,
  .figure-grid,
  .run-grid {
    grid-template-columns: 1fr;
  }

  .hero-lead,
  .grid-cell,
  .inverted-grid > div,
  .inverted-grid > p,
  .process-strip div {
    border-right: 0;
  }

  .hero-lead {
    padding: 36px 20px 28px;
    border-bottom: 1px solid var(--ink);
  }

  .hero h1 {
    font-size: clamp(46px, 18vw, 76px);
  }

  .dek,
  .body-text {
    font-size: 15px;
    text-align: left;
  }

  .section-title,
  .grid-cell,
  .result-lede {
    padding: 20px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .model3d-toolbar,
  .model3d-loading {
    flex-direction: column;
    align-items: stretch;
  }

  .model3d-window-bar {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 10px 14px;
  }

  .model3d-window-bar span,
  .model3d-window-bar span:last-child {
    text-align: left;
  }

  .model3d-window-bar span:nth-child(2) {
    margin: 8px 0;
    padding: 8px 0;
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
  }

  .model3d-stage {
    min-height: 720px;
  }

  .model3d-fallback {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 36px 24px 168px;
  }

  .fallback-arrow {
    width: 2px;
    height: 34px;
    justify-self: center;
  }

  .fallback-arrow::after {
    right: auto;
    top: auto;
    left: 50%;
    bottom: -1px;
    transform: translateX(-50%) rotate(135deg);
  }

  .model3d-detail,
  .model3d-summary {
    position: static;
    width: auto;
    margin: 12px;
  }

  .model3d-stage.webgl-active .model3d-detail,
  .model3d-stage.webgl-active .model3d-summary {
    position: absolute;
    left: 12px;
    right: 12px;
  }

  .model3d-stage.webgl-active .model3d-detail {
    top: 112px;
  }

  .model3d-stage.webgl-active .model3d-summary {
    top: 12px;
  }
}
