:root {
  color-scheme: light;
  --ink: #130018;
  --muted: #5e4058;
  --soft: #fff0fa;
  --paper: #ff8bc5;
  --line: #f12191;
  --blue: #2443b8;
  --teal: #1aa8bd;
  --rust: #e91b8c;
  --gold: #ffb11f;
  --bubble: #ffffff;
  --shadow: 10px 10px 0 rgba(19, 0, 24, 0.92);
  --header-h: 48px;
  font-family: "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
  --page-w: 1440px;
  --page-gutter: clamp(36px, 7vw, 112px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #ff9bd1 0%, #ff7fc1 48%, #ffb2dc 100%);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  min-height: var(--header-h);
  padding: 8px clamp(20px, 5vw, 72px);
  background: rgba(255, 139, 197, 0.9);
  border-bottom: 5px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 2px 2px 0 var(--line), 4px 4px 0 var(--ink);
}

.paper-masthead {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
  gap: 14px;
  align-items: center;
  width: min(calc(100% - 28px), 1240px);
  margin: 18px auto 0;
  padding: 10px 16px;
  border: 5px solid var(--line);
  background: var(--bubble);
  box-shadow: var(--shadow);
}

.paper-copy {
  min-width: 0;
}

.paper-label {
  display: inline-block;
  margin: 0 10px 0 0;
  padding: 5px 9px;
  border: 3px solid var(--ink);
  background: var(--soft);
  color: var(--rust);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.paper-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
}

.paper-masthead h2 {
  display: inline;
  margin: 0;
  color: var(--ink);
  font-size: clamp(0.98rem, 1.45vw, 1.25rem);
  font-weight: 900;
  line-height: 1.12;
}

.authors {
  margin: 8px 0 0;
  font-size: clamp(0.82rem, 1vw, 0.95rem);
  line-height: 1.25;
}
.authors a {
  color: var(--rust);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.authors a:hover {
  color: var(--blue);
}

.venue-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(0.88rem, 1.2vw, 1rem);
  font-weight: 800;
  line-height: 1.4;
}

.venue-note {
  display: inline-block;
  padding: 7px 10px;
  border: 3px solid var(--line);
  border-left: 10px solid var(--gold);
  background: var(--soft);
  color: var(--ink);
}

.paper-links {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

.paper-logo-stack {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.icml-logo {
  width: min(118px, 22vw);
  height: auto;
}

.logo-link {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--line);
  opacity: 1;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.logo-link:hover {
  transform: translateY(-3px);
  background: #ffffff;
  color: var(--rust);
  box-shadow: 7px 7px 0 var(--ink);
}

.logo-link:focus-visible {
  outline: 4px solid var(--gold);
  outline-offset: 4px;
}

.logo-link svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.arxiv-logo {
  width: auto;
  min-width: 45px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  font-weight: 700;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(360px, 1.18fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  min-height: auto;
  padding: clamp(48px, 7vw, 88px) clamp(20px, 5vw, 72px);
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 18px;
  display: inline-block;
  padding: 7px 11px;
  border: 3px solid var(--line);
  background: var(--bubble);
  color: var(--rust);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--ink);
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin: 0;
  color: #ffffff;
  font-family: Impact, "Arial Black", "Comic Sans MS", sans-serif;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  font-weight: 900;
  line-height: 0.96;
  text-transform: uppercase;
  text-shadow:
  4px 4px 0 #f12191,
  8px 8px 0 #130018;
}

.dek {
  max-width: 650px;
  margin: 18px 0 0;
  color: var(--ink);
  font-size: clamp(0.95rem, 1.25vw, 1.2rem);
  font-weight: 900;
  line-height: 1.28;
}

.hero-visual {
  position: relative;
  min-height: 460px;
  margin: 0;
  border: 5px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.avatar-guide {
  position: absolute;
  right: -5%;
  bottom: 4px;
  z-index: 2;
  width: min(440px, 70%);
  height: auto;
  /* filter: drop-shadow(7px 7px 0 rgba(19, 0, 24, 0.9)); */
}

.connection-lines {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.connection-lines i {
  position: absolute;
  left: 50%;
  top: 45%;
  height: 5px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, var(--blue) 0 18px, var(--rust) 18px 36px, var(--teal) 36px 54px);
  box-shadow: 3px 3px 0 rgba(19, 0, 24, 0.28);
  transform-origin: left center;
}

.connection-lines {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.connection-lines line {
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(2px 2px 0 rgba(241, 33, 145, 0.9));
}

.connection-lines .line-code,
.connection-lines .line-graph,
.connection-lines .line-natural {
  width: auto;
  transform: none;
}

.interface-chip,
.procedure-core {
  position: absolute;
  display: grid;
  gap: 6px;
  width: min(215px, 42%);
  min-height: 116px;
  padding: 12px;
  border: 4px solid var(--ink);
  background: var(--bubble);
  box-shadow: 6px 6px 0 var(--line);
  transform-origin: center;
  transition:
    transform 180ms ease,
    width 180ms ease,
    min-height 180ms ease,
    box-shadow 180ms ease;
}

.interface-chip {
  z-index: 6;
  animation: float-card 4.8s ease-in-out infinite;
}

.interface-chip:hover,
.procedure-core:hover {
  z-index: 8;
  width: min(285px, 56%);
  min-height: 148px;
  transform: translateY(-8px) scale(1.06);
  box-shadow: 10px 10px 0 var(--ink);
}

.graph-chip {
  animation-delay: -1.4s;
}

.natural-chip {
  animation-delay: -2.8s;
}

.interface-chip span,
.procedure-core span {
  color: #6f5b69;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.interface-chip code {
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  white-space: nowrap;
}

.interface-chip p {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.1;
}

.code-chip {
  top: 48px;
  left: 34px;
}

.graph-chip {
  top: 74px;
  right: 34px;
}

.natural-chip {
  right: 34px;
  bottom: 118px;
}

.procedure-core {
  right: clamp(150px, 34%, 245px);
  bottom: clamp(260px, 40%, 310px);
  z-index: 7;
  background: var(--rust);
  color: #ffffff;
  animation: float-core 4.8s ease-in-out infinite;
}

.procedure-core strong {
  color: #ffffff;
  font-family: Impact, "Arial Black", "Comic Sans MS", sans-serif;
  font-size: 1.35rem;
  line-height: 0.95;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 var(--ink);
}

.mini-dag {
  position: relative;
  width: 92px;
  height: 36px;
}

.mini-dag::before,
.mini-dag::after {
  content: "";
  position: absolute;
  height: 2px;
  background: var(--teal);
  transform-origin: left center;
}

.mini-dag::before {
  top: 15px;
  left: 12px;
  width: 46px;
  transform: rotate(12deg);
}

.mini-dag::after {
  top: 22px;
  left: 38px;
  width: 40px;
  transform: rotate(-18deg);
}

.mini-dag i {
  position: absolute;
  width: 11px;
  height: 11px;
  border: 2px solid var(--teal);
  border-radius: 50%;
  background: var(--bubble);
}

.mini-dag i:nth-child(1) {
  top: 10px;
  left: 6px;
}

.mini-dag i:nth-child(2) {
  top: 18px;
  left: 35px;
}

.mini-dag i:nth-child(3) {
  top: 4px;
  right: 21px;
}

.mini-dag i:nth-child(4) {
  bottom: 2px;
  right: 5px;
}

@keyframes float-card {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -10px;
  }
}

@keyframes float-core {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 8px;
  }
}

.tldr-box {
  width: min(calc(100% - var(--page-gutter)), 980px);
  margin: clamp(24px, 4vw, 46px) auto clamp(18px, 3vw, 32px);
  padding: clamp(16px, 2.6vw, 26px);
  border: 5px solid var(--line);
  background: var(--soft);
  box-shadow: var(--shadow);
}

.tldr-box span {
  display: inline-block;
  margin: 0 0 10px;
  padding: 3px 8px;
  border: 3px solid var(--line);
  background: var(--soft);
  color: var(--rust);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--ink);
}

.tldr-box h2 {
  margin: 0 0 14px;
  color: var(--rust);
  font-family: Impact, "Arial Black", "Comic Sans MS", sans-serif;
  font-size: clamp(1.5rem, 2.15vw, 1.8rem);
  font-weight: 900;
  line-height: 0.98;
  text-transform: uppercase;
}

.tldr-box ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 1.45rem;
  color: #21121f;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(1.05rem, 1.5vw, 1.24rem);
  line-height: 1.55;
}

.tldr-box li::marker {
  color: var(--rust);
  font-weight: 900;
}

.article-shell {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  width: min(calc(100% - 40px), 1240px);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 32px) 0 clamp(46px, 7vw, 88px);
}

.section-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: 18px;
  border: 5px solid var(--line);
  background: var(--bubble);
  box-shadow: 7px 7px 0 var(--ink);
}

.section-sidebar p {
  margin: 0 0 12px;
  color: var(--rust);
  font-family: Impact, "Arial Black", "Comic Sans MS", sans-serif;
  font-size: 1.55rem;
  line-height: 1;
  text-transform: uppercase;
}

.section-sidebar nav {
  display: grid;
  gap: 8px;
}

.section-sidebar a {
  display: block;
  padding: 8px 10px;
  border: 3px solid var(--ink);
  background: var(--soft);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.15;
}

.section-sidebar a:hover {
  background: #ffe0f3;
  color: var(--rust);
}

.article {
  display: grid;
  gap: clamp(18px, 3vw, 32px);
  min-width: 0;
}

.fold-section {
  scroll-margin-top: calc(var(--header-h) + 24px);
  min-width: 0;
  padding: clamp(14px, 2.5vw, 24px);
  border: 5px solid var(--line);
  background: var(--bubble);
  box-shadow: var(--shadow);
}

.fold-section summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.fold-section summary::-webkit-details-marker {
  display: none;
}

.fold-section summary::after {
  content: "-";
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 2;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 3px solid var(--ink);
  background: var(--soft);
  color: var(--rust);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}

.fold-section:not([open]) summary::after {
  content: "+";
}

.fold-section summary span {
  display: inline-block;
  grid-column: 1;
  width: max-content;
  max-width: 100%;
  margin: 0 0 2px;
  padding: 2px 6px;
  border: 3px solid var(--line);
  background: var(--soft);
  color: var(--rust);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--ink);
}

.fold-section summary strong {
  display: block;
  grid-column: 1;
  color: var(--rust);
  font-family: Impact, "Arial Black", "Comic Sans MS", sans-serif;
  font-size: clamp(1.5rem, 2.15vw, 1.8rem);
  font-weight: 900;
  line-height: 0.98;
  text-transform: uppercase;
}

.section-body {
  padding-top: 14px;
}

.fold-section > summary + p {
  margin-top: 14px;
}

.fold-section > p,
.section-body p,
.panel-foot {
  margin: 0 0 22px;
  color: #21121f;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(1.05rem, 1.5vw, 1.24rem);
  line-height: 1.68;
}

.section-body p:last-child {
  margin-bottom: 0;
}

.motivation-previews {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

.case-preview {
  border: 3px solid var(--ink);
  background: #ffffff;
  box-shadow: 5px 5px 0 var(--line);
}

.case-preview summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.case-preview summary::-webkit-details-marker {
  display: none;
}

.case-preview summary::after {
  content: "+";
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 2;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  background: var(--soft);
  color: var(--rust);
  font-family: "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
}

.case-preview[open] summary::after {
  content: "-";
}

.case-preview summary span {
  display: block;
  grid-column: 1;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-family: "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-preview summary strong {
  display: block;
  grid-column: 1;
  color: var(--ink);
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 900;
  line-height: 1.15;
  text-transform: none;
}

.case-preview-body {
  padding: 4px 14px 14px;
}

.case-preview-body p,
.case-preview-body .statement,
.case-preview-body .question {
  font-size: clamp(0.98rem, 1.3vw, 1.12rem) !important;
  line-height: 1.55 !important;
}

.case-preview-body blockquote {
  margin: 18px 0;
  padding: 18px clamp(16px, 3vw, 28px);
  border-radius: 18px;
}

blockquote {
  margin: 34px 0;
  padding: 30px clamp(24px, 4vw, 42px);
  border: 5px solid var(--line);
  border-radius: 28px;
  background: var(--soft);
  color: var(--ink);
  font-size: clamp(0.8rem, 1.4vw, 1.2rem);
  font-weight: 900;
  line-height: 1;
  box-shadow: 7px 7px 0 var(--ink);
}

.callout,
.statement,
.question,
.book-smart,
.closing-line {
  color: var(--ink) !important;
  font-family: Impact, "Arial Black", "Comic Sans MS", sans-serif;
  font-size: clamp(1rem, 1.8vw, 1.4rem) !important;
  font-weight: 900;
  line-height: 1.08 !important;
  text-transform: uppercase;
}

.examples-grid,
.representation-grid,
.timeline {
  display: grid;
  gap: 18px;
}

.examples-grid,
.representation-grid {
  grid-template-columns: 1fr;
  margin: 10px 0 28px;
}

.examples-grid > div,
.representation-card,
.stage {
  min-width: 0;
  border: 4px solid var(--ink);
  background: var(--bubble);
  box-shadow: 6px 6px 0 var(--line);
}

.examples-grid > div {
  display: grid;
  gap: 18px;
  align-items: start;
  min-height: 0;
  padding: 20px;
}

.examples-grid span,
.representation-card span,
.stage span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.examples-grid strong {
  color: var(--rust);
  font-size: 1rem;
  line-height: 1.2;
}

.examples-grid em {
  color: var(--ink);
  font-family: Impact, "Arial Black", "Comic Sans MS", sans-serif;
  font-size: 1.3rem;
  font-style: normal;
  font-weight: 650;
  line-height: 1.16;
}

.speech-bubble {
  position: relative;
  border: 4px solid var(--ink);
  border-radius: 28px;
  background: var(--soft);
  box-shadow: 6px 6px 0 var(--line);
  padding: 22px;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  right: 28px;
  top: -20px;
  width: 32px;
  height: 32px;
  border-top: 4px solid var(--ink);
  border-left: 4px solid var(--ink);
  background: var(--soft);
  transform: rotate(45deg);
}

.speech-bubble p {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  font-weight: 900;
  line-height: 1.25;
}

.case-procedure {
  display: grid;
  gap: 10px;
}

.case-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  gap: 18px;
  align-items: center;
}

.case-side-pic {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 4px solid var(--ink);
  background: var(--soft);
  box-shadow: 6px 6px 0 var(--line);
}

.analogy-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 30px 0;
}

.analogy-results div {
  min-width: 0;
  padding: 22px;
  border: 4px solid var(--ink);
  background: var(--soft);
  box-shadow: 6px 6px 0 var(--line);
}

.analogy-results span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.analogy-results strong {
  display: block;
  margin: 12px 0;
  color: var(--rust);
  font-family: Impact, "Arial Black", "Comic Sans MS", sans-serif;
  font-size: clamp(1.4rem, 2.5vw, 2.15rem);
  line-height: 1;
  text-transform: uppercase;
}

.analogy-results p {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.5;
}

.implication-grid {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.implication-grid > div {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.implication-grid .closing-line {
  margin-top: auto;
  padding-top: 16px;
}

.implication-grid strong {
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  line-height: 1.08;
}

.implication-grid span {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  border: 2px solid var(--ink);
  background: #ffffff;
  color: var(--rust);
  box-shadow: 3px 3px 0 var(--line);
}

.representation-card,
.stage {
  min-height: 200px;
  padding: 24px;
}

.representation-card h3,
.stage h3 {
  margin: 20px 0 14px;
  color: var(--rust);
  font-family: Impact, "Arial Black", "Comic Sans MS", sans-serif;
  font-size: 1.4rem;
  line-height: 1;
  text-transform: uppercase;
}

.representation-card p,
.stage p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.timeline {
  position: relative;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 30px 0;
  isolation: isolate;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 20px;
  left: calc(50% - 16px);
  width: calc(50% - 64px);
  height: 4px;
  border: 2px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--blue) 0 32px, var(--rust) 32px 64px, var(--teal) 64px 96px);
  transform: translateY(-50%) scaleX(0);
  transform-origin: left center;
  animation: curriculum-grow 1.4s ease-out 350ms forwards;
  z-index: 0;
}

.timeline::after {
  display: none;
}

.stage {
  position: relative;
  z-index: 1;
  animation: stage-pop 520ms ease-out both;
}

.stage:nth-child(2) {
  animation-delay: 850ms;
}

.stage::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 3px 3px 0 var(--line);
}

@keyframes curriculum-grow {
  to {
    transform: translateY(-50%) scaleX(1);
  }
}

@keyframes stage-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .timeline::before,
  .timeline::after,
  .stage {
    animation: none;
  }

  .timeline::before {
    transform: translateY(-50%) scaleX(1);
  }

  .timeline::after {
    display: none;
  }
}

.paper-figure,
.paper-table-figure,
.meme-panel {
  margin: 30px 0;
  border: 5px solid var(--ink);
  background: var(--bubble);
  box-shadow: 7px 7px 0 var(--line);
  overflow: hidden;
}

.paper-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.paper-figure img {
  background: #ffffff;
}

.paper-figure figcaption,
.paper-table-figure figcaption,
.meme-panel figcaption {
  margin: 0;
  padding: 14px 16px;
  border-top: 4px solid var(--ink);
  background: var(--soft);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.35;
}

.paper-table-figure {
  overflow-x: auto;
}

.paper-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: #ffffff;
  color: var(--ink);
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(0.92rem, 1.15vw, 1.05rem);
}

.paper-table.compact-table {
  min-width: 480px;
}

.paper-table.analogy-table {
  min-width: 720px;
}

.paper-table caption {
  caption-side: top;
  padding: 14px 16px;
  border-bottom: 4px solid var(--ink);
  background: var(--soft);
  color: var(--ink);
  font-family: "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.3;
  text-align: left;
}

.paper-table th,
.paper-table td {
  padding: 10px 12px;
  border: 2px solid var(--ink);
  text-align: center;
  vertical-align: middle;
}

.paper-table th:first-child {
  text-align: left;
}

.paper-table thead th {
  background: var(--rust);
  color: #ffffff;
  font-family: "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.2;
}

.paper-table tbody th {
  font-weight: 900;
}

.paper-table .table-highlight th,
.paper-table .table-highlight td {
  background: #fff0fa;
}

.paper-table td.id-cell {
  background: #fff1bd;
}

.paper-table td.ood-cell {
  background: #dff7fb;
}

.paper-table .table-divider th,
.paper-table .table-divider td {
  border-top-width: 5px;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.figure-grid .paper-figure {
  margin: 0;
}

.meme-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(240px, 1.05fr);
  align-items: stretch;
}

.meme-card {
  display: grid;
  gap: 14px;
  align-content: center;
  justify-items: center;
  min-height: 220px;
  padding: 22px;
  background:
    radial-gradient(circle at 14px 14px, rgba(241, 33, 145, 0.18) 2px, transparent 3px),
    linear-gradient(135deg, #ffffff 0%, #fff0fa 100%);
  background-size: 24px 24px, auto;
  color: var(--ink);
  text-align: center;
}

.meme-card span {
  padding: 6px 10px;
  border: 3px solid var(--ink);
  background: var(--soft);
  color: var(--rust);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meme-card strong {
  color: #ffffff;
  font-family: Impact, "Arial Black", "Comic Sans MS", sans-serif;
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  line-height: 0.95;
  text-transform: uppercase;
  text-shadow:
    3px 3px 0 var(--line),
    6px 6px 0 var(--ink);
}

.meme-panel figcaption {
  display: grid;
  align-content: center;
  border-top: 0;
  border-left: 4px solid var(--ink);
  font-family: Impact, "Arial Black", "Comic Sans MS", sans-serif;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.05;
  text-transform: uppercase;
}

.takeaway {
  background:
    radial-gradient(circle at 18px 18px, rgba(255, 255, 255, 0.28) 2px, transparent 3px),
    #f12191;
  background-size: 28px 28px;
}

.takeaway summary span {
  color: var(--rust);
}

.takeaway summary strong,
.takeaway .closing-line {
  color: #ffffff !important;
  text-shadow: 3px 3px 0 var(--ink);
}

.takeaway .section-body p {
  color: #ffffff;
  text-shadow: 1px 1px 0 rgba(19, 0, 24, 0.35);
}

@media (max-width: 980px) {
  .paper-masthead {
    grid-template-columns: minmax(0, 1fr) minmax(110px, auto);
    padding: 10px 14px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-visual {
    min-height: 460px;
  }

  .article-shell {
    grid-template-columns: 1fr;
  }

  .section-sidebar {
    position: sticky;
    top: var(--header-h);
    z-index: 12;
    padding: 12px;
    overflow-x: auto;
  }

  .section-sidebar p {
    display: none;
  }

  .section-sidebar nav {
    display: flex;
    gap: 8px;
    min-width: max-content;
  }

  .section-sidebar a {
    white-space: nowrap;
  }

  .examples-grid,
  .representation-grid,
  .analogy-results,
  .figure-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

  .case-topline {
    grid-template-columns: 1fr;
  }

  .case-side-pic {
    max-width: 260px;
    justify-self: start;
  }

  .meme-panel {
    grid-template-columns: 1fr;
  }

  .meme-panel figcaption {
    border-top: 4px solid var(--ink);
    border-left: 0;
  }

  .timeline::before,
  .stage::before {
    display: none;
  }
}

@media (max-width: 560px) {
  :root {
    --header-h: 46px;
  }

  .site-header {
    min-height: var(--header-h);
    padding: 8px 20px;
  }

  .paper-masthead {
    width: min(calc(100% - 28px), 1240px);
    margin-top: 12px;
    padding: 10px;
  }

  .paper-title-row {
    align-items: flex-start;
    flex-direction: row;
    gap: 8px;
  }

  h1 {
    font-size: clamp(1.45rem, 5vw, 2.2rem);
  }

  .hero {
    padding: 24px 20px 32px;
  }

  .hero-visual {
    min-height: 420px;
  }

  .connection-lines i {
    left: 52%;
    top: 48%;
  }

  .line-code {
    width: 220px;
    transform: rotate(-118deg);
  }

  .line-graph {
    width: 170px;
    transform: rotate(-82deg);
  }

  .line-natural {
    width: 220px;
    transform: rotate(62deg);
  }

  .interface-chip,
  .procedure-core {
    width: calc(100% - 48px);
    min-height: 104px;
  }

  .interface-chip:hover,
  .procedure-core:hover {
    width: calc(100% - 48px);
    min-height: 122px;
  }

  .code-chip,
  .graph-chip,
  .natural-chip {
    left: 24px;
    right: auto;
  }

  .code-chip {
    top: 24px;
  }

  .graph-chip {
    top: 100px;
  }

  .procedure-core {
    right: 58px;
    bottom: 276px;
    left: auto;
    width: min(240px, calc(100% - 48px));
  }

  .natural-chip {
    bottom: 24px;
  }

  .avatar-guide {
    right: -58px;
    bottom: 42px;
    width: 330px;
    opacity: 0.9;
  }

  .article-shell {
    width: min(calc(100% - 28px), 1240px);
    padding: 34px 0 56px;
  }

  .fold-section {
    padding: 14px;
  }

  .fold-section summary {
    grid-template-columns: 1fr;
  }

  .fold-section summary::after {
    justify-self: start;
  }

  .fold-section summary strong {
    font-size: clamp(1.5rem, 3vw, 2.8rem);
  }
}

.paper-masthead .paper-copy h2 {
  display: block !important;
  margin: 0 !important;
  font-size: clamp(0.98rem, 1.45vw, 1.25rem) !important;
  line-height: 1.08 !important;
  max-width: 1200px;
}

/* ===== Polished hero diagram layout: percentage-based cards + SVG branches ===== */
.hero {
  min-height: auto;
  padding: 10px clamp(20px, 5vw, 72px);
}

.hero-visual {
  min-height: 250px;
  background: #ffffff;
}

/* Keep the avatar anchored on the left side of the visual. */
.avatar-guide {
  left: 0% !important;
  right: auto !important;
  bottom: 0;
  width: min(250px, 40%);
}

/* The connection layer is now an SVG, so the line endpoints scale with the visual. */
.connection-lines {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.connection-lines {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.connection-lines line {
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(2px 2px 0 rgba(241, 33, 145, 0.9));
}

/* Hide the old rotated <i> lines if they are still in the HTML. */
.connection-lines i {
  display: none;
}

/* Diagram cards use percentage positions so they move with the visual. */
.interface-chip,
.procedure-core {
  width: clamp(100px, 18%, 150px);
  min-height: 92px;
}

.code-chip {
  top: 24%;
  left: 60%;
  transform: translate(-50%, -50%);
}

.graph-chip {
  top: 36%;
  left: 76%;
  right: auto;
  transform: translate(-50%, -50%);
}

.natural-chip {
  top: 68%;
  left: 76%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
}

/* Put the core card near the avatar hand. The SVG lines branch from this same point. */
.procedure-core {
  left: 42%;
  top: 46%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  z-index: 7;
  width: clamp(100px, 18%, 150px);
}

.procedure-core:hover {
  transform: translate(-50%, -50%) translateY(-8px) scale(1.06);
}

/* The hover expansion now keeps cards anchored in place instead of drifting away from lines. */
.interface-chip:hover {
  width: clamp(175px, 27%, 235px);
  transform: translate(-50%, -50%) translateY(-8px) scale(1.06);
}

@media (max-width: 980px) {
  .hero {
    padding: 12px clamp(20px, 5vw, 48px);
  }

  .hero-visual {
    min-height: 380px;
  }

  .avatar-guide {
    width: min(310px, 48%);
    left: -8% !important;
  }

  .procedure-core {
    left: 42%;
    top: 46%;
  }
}

@media (max-width: 560px) {
  .hero {
    padding: 12px 20px 20px;
  }

  .hero-visual {
    min-height: 480px;
  }

  .avatar-guide {
    left: -70px !important;
    right: auto !important;
    bottom: 120px;
    width: 270px;
    opacity: 0.9;
  }

  .interface-chip,
  .procedure-core,
  .interface-chip:hover,
  .procedure-core:hover {
    width: calc(100% - 48px);
    min-height: 104px;
  }

  .code-chip {
    top: 24px;
    left: 24px;
    right: auto;
  }

  .procedure-core {
    left: 24px;
    top: 190px;
    right: auto;
    bottom: auto;
    transform: none;
  }

  .procedure-core:hover {
    transform: translateY(-8px) scale(1.03);
  }

  .graph-chip {
    top: 342px;
    left: 24px;
    right: auto;
  }

  .natural-chip {
    left: 24px;
    right: auto;
    bottom: 24px;
  }
}

/* ===== Shared page alignment ===== */
.paper-masthead,
.article-shell {
  width: min(calc(100% - var(--page-gutter)), var(--page-w));
  margin-left: auto;
  margin-right: auto;
}

.hero {
  width: min(calc(100% - var(--page-gutter)), 1120px);
  margin-left: auto;
  margin-right: auto;
}

/* Hero already has padding, so include it inside the aligned width */
.hero {
  padding-left: clamp(20px, 4vw, 56px);
  padding-right: clamp(20px, 4vw, 56px);
}

/* Article shell already controls its own internal spacing */
.article-shell {
  padding-left: 0;
  padding-right: 0;
}

@media (max-width: 560px) {
  :root {
    --page-gutter: clamp(24px, 5vw, 80px);
  }

  .paper-masthead,
  .article-shell {
    width: min(calc(100% - var(--page-gutter)), var(--page-w));
  }

  .hero {
    width: min(calc(100% - var(--page-gutter)), 1120px);
  }

  .hero {
    padding-left: 20px;
    padding-right: 20px;
  }
}
