:root {
  color-scheme: light;
  --ink: #13201f;
  --muted: #526362;
  --paper: #fbfdfd;
  --soft: #eef6f5;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --line: #d9e5e3;
  --teal: #087b75;
  --teal-dark: #075b57;
  --blue: #334f76;
  --coral: #b84a2d;
  --amber: #a76813;
  --charcoal: #162323;
  --white: #ffffff;
  --shadow: 0 22px 70px rgba(19, 32, 31, 0.12);
  --header-border: rgba(217, 229, 227, 0.7);
  --header-bg: rgba(251, 253, 253, 0.86);
  --header-bg-scrolled: rgba(251, 253, 253, 0.96);
  --header-shadow: 0 8px 28px rgba(19, 32, 31, 0.08);
  --brand-border: rgba(8, 123, 117, 0.24);
  --brand-bg: #ffffff;
  --brand-shadow: 0 6px 16px rgba(19, 32, 31, 0.08);
  --author-link: #1788e8;
  --affiliation-text: #2f3c43;
  --project-button-bg: #303030;
  --project-button-hover-bg: #111111;
  --button-muted-text: #70807f;
  --button-muted-bg: #f3f8f7;
  --hover-border: rgba(8, 123, 117, 0.45);
  --focus-ring: rgba(8, 123, 117, 0.55);
  --dark-section-bg: #162323;
  --dark-section-text: #ffffff;
  --dark-section-muted: #c4d5d3;
  --tab-text: #405150;
  --tab-active-index: #dff5f2;
  --prose-text: #354847;
  --scrollbar-thumb: rgba(8, 123, 117, 0.36);
  --scrollbar-thumb-strong: rgba(8, 123, 117, 0.4);
  --table-border: rgba(255, 255, 255, 0.16);
  --table-bg: rgba(255, 255, 255, 0.04);
  --table-row-border: rgba(255, 255, 255, 0.14);
  --table-head: #d7e5e3;
  --table-cell: #f2f7f6;
  --table-ours-bg: rgba(8, 123, 117, 0.25);
  --table-ours-strong-bg: rgba(184, 74, 45, 0.28);
  --chip-bg: #f5faf9;
  --trace-panel-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 249, 0.94)), var(--surface);
  --trace-prompt-bg: #ffffff;
  --trace-line: linear-gradient(180deg, rgba(8, 123, 117, 0.35), rgba(184, 74, 45, 0.3));
  --trace-heading: #18302f;
  --trace-text: #415351;
  --trace-object-border: rgba(217, 229, 227, 0.9);
  --trace-object-bg: rgba(255, 255, 255, 0.78);
  --trace-relation-text: #516260;
  --trace-bullet: #b5c4c2;
  --trace-answer-bg: #eaf6f3;
  --module-panel-bg: rgba(255, 255, 255, 0.9);
  --module-note: #758280;
  --module-axis: #7b8a88;
  --module-value: #18302f;
  --chart-grid: rgba(217, 229, 227, 0.72);
  --chart-scan-start: #3fd0c5;
  --chart-scan-end: #087b75;
  --chart-m3d-start: #8eb2e7;
  --chart-m3d-end: #334f76;
  --chart-oracle-start: rgba(237, 177, 97, 0.7);
  --chart-oracle-end: rgba(184, 74, 45, 0.62);
  --chart-oracle-line: rgba(184, 74, 45, 0.58);
  --chart-oracle-fill: rgba(184, 74, 45, 0.08);
  --chart-oracle-text: #8f3e25;
  --chart-delta-bg: rgba(255, 255, 255, 0.82);
  --chart-delta-text: #25403e;
  --peek-shadow: rgba(19, 32, 31, 0.18);
  --code-bg: #10201f;
  --code-text: #d9ebe8;
  --footer-text: #60706f;
  --theme-toggle-bg: #ffffff;
  --theme-toggle-color: #263736;
  --theme-toggle-hover-bg: #eef6f5;
  --font-sans: "Google Sans", "Google Sans Text", "Product Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-prose: "Google Sans", "Google Sans Text", "Product Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 8px;
  --container: 1160px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf5f3;
  --muted: #a8bab7;
  --paper: #0d1314;
  --soft: #172323;
  --surface: #121d1e;
  --surface-elevated: #182829;
  --line: #2b4141;
  --teal: #4fd0c6;
  --teal-dark: #91e8e1;
  --blue: #86aee8;
  --coral: #ff9a7e;
  --amber: #e7bd67;
  --charcoal: #071010;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
  --header-border: rgba(117, 149, 146, 0.28);
  --header-bg: rgba(13, 19, 20, 0.84);
  --header-bg-scrolled: rgba(13, 19, 20, 0.96);
  --header-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
  --brand-border: rgba(79, 208, 198, 0.36);
  --brand-bg: #162324;
  --brand-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  --author-link: #79bdff;
  --affiliation-text: #b8c7c4;
  --project-button-bg: #263637;
  --project-button-hover-bg: #365050;
  --button-muted-text: #9db0ad;
  --button-muted-bg: #1a292a;
  --hover-border: rgba(79, 208, 198, 0.5);
  --focus-ring: rgba(79, 208, 198, 0.62);
  --dark-section-bg: #071010;
  --dark-section-text: #f3fbf9;
  --dark-section-muted: #afc3c0;
  --tab-text: #c6d4d1;
  --tab-active-index: #e9fffc;
  --prose-text: #d3dfdc;
  --scrollbar-thumb: rgba(79, 208, 198, 0.42);
  --scrollbar-thumb-strong: rgba(79, 208, 198, 0.48);
  --table-ours-bg: rgba(79, 208, 198, 0.2);
  --table-ours-strong-bg: rgba(255, 154, 126, 0.22);
  --chip-bg: rgba(79, 208, 198, 0.12);
  --trace-panel-bg: linear-gradient(180deg, rgba(22, 35, 36, 0.96), rgba(18, 31, 32, 0.94)), var(--surface);
  --trace-prompt-bg: #101a1b;
  --trace-line: linear-gradient(180deg, rgba(79, 208, 198, 0.38), rgba(255, 154, 126, 0.3));
  --trace-heading: #edf7f5;
  --trace-text: #bdcbc8;
  --trace-object-border: rgba(84, 109, 108, 0.7);
  --trace-object-bg: rgba(255, 255, 255, 0.04);
  --trace-relation-text: #b9c9c6;
  --trace-bullet: #728582;
  --trace-answer-bg: rgba(79, 208, 198, 0.12);
  --module-panel-bg: rgba(18, 29, 30, 0.92);
  --module-note: #96a9a6;
  --module-axis: #95aaa7;
  --module-value: #edf7f5;
  --chart-grid: rgba(58, 84, 84, 0.66);
  --chart-scan-start: #73e8df;
  --chart-scan-end: #128a84;
  --chart-m3d-start: #a4c5f6;
  --chart-m3d-end: #4a6fa5;
  --chart-oracle-start: rgba(255, 198, 121, 0.74);
  --chart-oracle-end: rgba(255, 154, 126, 0.62);
  --chart-oracle-line: rgba(255, 154, 126, 0.66);
  --chart-oracle-fill: rgba(255, 154, 126, 0.1);
  --chart-oracle-text: #ffc3b2;
  --chart-delta-bg: rgba(18, 29, 30, 0.86);
  --chart-delta-text: #d7ebe8;
  --peek-shadow: rgba(0, 0, 0, 0.4);
  --code-bg: #071010;
  --code-text: #d8ebe8;
  --footer-text: #9cafac;
  --theme-toggle-bg: #152223;
  --theme-toggle-color: #edf7f5;
  --theme-toggle-hover-bg: #203334;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  text-rendering: geometricPrecision;
  transition: color 180ms ease, background 180ms ease;
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 max(20px, calc((100vw - var(--container)) / 2));
  border-bottom: 1px solid var(--header-border);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  transition: box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.site-header.is-scrolled {
  box-shadow: var(--header-shadow);
  background: var(--header-bg-scrolled);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--brand-border);
  background: var(--brand-bg);
  border-radius: 7px;
  box-shadow: var(--brand-shadow);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-nav {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-nav a {
  position: relative;
  padding: 8px 0;
}

.site-nav a::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 2px;
  content: "";
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
}

.projects-menu {
  position: relative;
}

.projects-menu::after {
  position: absolute;
  right: 0;
  top: 100%;
  width: 100%;
  height: 14px;
  content: "";
}

.projects-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--theme-toggle-color);
  background: var(--theme-toggle-bg);
  font-size: 0.9rem;
  font-weight: 760;
  cursor: pointer;
  box-shadow: var(--brand-shadow);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.projects-menu-trigger svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.projects-menu:hover .projects-menu-trigger,
.projects-menu:focus-within .projects-menu-trigger {
  border-color: var(--hover-border);
  background: var(--theme-toggle-hover-bg);
  transform: translateY(-1px);
}

.projects-menu:hover .projects-menu-trigger svg,
.projects-menu:focus-within .projects-menu-trigger svg {
  transform: rotate(180deg);
}

.projects-menu-trigger:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.projects-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 30;
  display: grid;
  width: min(500px, calc(100vw - 28px));
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-elevated);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.projects-menu-panel a {
  display: grid;
  gap: 4px;
  align-items: center;
  min-height: 58px;
  padding: 10px 11px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 720;
  line-height: 1.25;
  transition: color 160ms ease, background 160ms ease;
}

.projects-menu-panel a span {
  color: var(--ink);
  font-weight: 800;
}

.projects-menu-panel a small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.35;
}

.projects-menu-panel a:hover,
.projects-menu-panel a:focus-visible {
  color: var(--teal-dark);
  background: var(--soft);
}

.projects-menu-panel a:hover span,
.projects-menu-panel a:focus-visible span {
  color: var(--teal-dark);
}

.projects-menu-panel a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.projects-menu:hover .projects-menu-panel,
.projects-menu:focus-within .projects-menu-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.projects-menu.is-dismissed .projects-menu-panel,
.projects-menu.is-dismissed:hover .projects-menu-panel,
.projects-menu.is-dismissed:focus-within .projects-menu-panel {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
}

.projects-menu.is-dismissed .projects-menu-trigger svg,
.projects-menu.is-dismissed:hover .projects-menu-trigger svg,
.projects-menu.is-dismissed:focus-within .projects-menu-trigger svg {
  transform: none;
}

.theme-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--theme-toggle-color);
  background: var(--theme-toggle-bg);
  cursor: pointer;
  box-shadow: var(--brand-shadow);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--hover-border);
  background: var(--theme-toggle-hover-bg);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.theme-icon {
  position: absolute;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 160ms ease, transform 160ms ease;
}

.theme-icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.72);
}

html[data-theme="dark"] .theme-icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.72);
}

html[data-theme="dark"] .theme-icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.section-band {
  position: relative;
  padding: 74px 0;
}

.section-band.light {
  background: var(--surface);
}

.section-band.tinted {
  background: var(--soft);
}

.section-band.dark {
  color: var(--dark-section-text);
  background: var(--dark-section-bg);
}

.hero {
  min-height: 58vh;
  display: grid;
  align-items: center;
  padding-top: 104px;
  padding-bottom: 52px;
  overflow: hidden;
}

.title-block {
  position: relative;
  width: min(100% - 40px, 1480px);
  max-width: 1480px;
  text-align: center;
}

.title-block h1 {
  max-width: none;
  margin: 0 auto 24px;
  font-family: var(--font-serif);
  font-size: 4.15rem;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
}

.title-block h1 span {
  display: block;
  white-space: nowrap;
}

.authors {
  margin-bottom: 8px;
  color: var(--author-link);
  font-family: var(--font-sans);
  font-size: clamp(1.02rem, 1.55vw, 1.35rem);
  line-height: 1.35;
}

.authors a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.16em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.authors a:hover,
.authors a:focus-visible {
  color: var(--teal-dark);
  text-decoration: underline;
}

.authors sup,
.affiliation sup {
  font-size: 0.62em;
  line-height: 0;
}

.affiliation {
  margin-bottom: 6px;
  color: var(--affiliation-text);
  font-family: var(--font-sans);
  font-size: clamp(0.98rem, 1.35vw, 1.16rem);
  line-height: 1.45;
}

.venue {
  margin-bottom: 24px;
  color: var(--affiliation-text);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  font-weight: 700;
  line-height: 1.45;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.project-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  color: var(--white);
  background: var(--project-button-bg);
  font-weight: 750;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(19, 32, 31, 0.08);
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.project-button:hover {
  transform: translateY(-1px);
  background: var(--project-button-hover-bg);
}

.project-button.disabled {
  cursor: default;
  opacity: 0.55;
}

.project-button.disabled:hover {
  transform: none;
  background: var(--project-button-bg);
}

.project-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 980px;
  margin-bottom: 22px;
  font-family: var(--font-serif);
  font-size: clamp(3.2rem, 7.1vw, 6.9rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-family: var(--font-serif);
  font-size: clamp(1.72rem, 2.7vw, 3.15rem);
  line-height: 1.03;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.08rem;
  line-height: 1.22;
  letter-spacing: 0;
}

.button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 750;
  box-shadow: 0 8px 20px rgba(19, 32, 31, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover,
.copy-button:hover {
  transform: translateY(-1px);
  border-color: var(--hover-border);
}

.button.primary {
  color: var(--white);
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.button.muted {
  color: var(--button-muted-text);
  background: var(--button-muted-bg);
  box-shadow: none;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.65fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 34px;
}

.section-heading p,
.modular-layout p,
.bib-note {
  color: var(--muted);
  font-family: var(--font-prose);
  font-size: 0.98rem;
  line-height: 1.7;
}

.dark .section-heading p,
.dark .section-kicker {
  color: var(--dark-section-muted);
}

.figure-panel {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 42px rgba(19, 32, 31, 0.08);
}

.figure-panel.large {
  margin-top: 30px;
}

.figure-panel.compact {
  align-self: center;
}

.figure-panel img {
  width: 100%;
  height: auto;
}

.teaser-viewer {
  margin-top: 28px;
}

.teaser-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.teaser-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--tab-text);
  background: var(--surface);
  font-size: 0.92rem;
  font-weight: 760;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(19, 32, 31, 0.06);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.teaser-tab span {
  color: var(--coral);
  font-size: 0.76rem;
  font-weight: 850;
}

.teaser-tab:hover,
.teaser-tab:focus-visible {
  border-color: var(--hover-border);
  color: var(--teal-dark);
  transform: translateY(-1px);
}

.teaser-tab.is-active {
  color: var(--white);
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.teaser-tab.is-active span {
  color: var(--tab-active-index);
}

.teaser-strip {
  margin: 0;
}

.teaser-track {
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 2px 18px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--scrollbar-thumb-strong) transparent;
  scrollbar-width: thin;
}

.teaser-track:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
}

.teaser-track::-webkit-scrollbar {
  height: 8px;
}

.teaser-track::-webkit-scrollbar-track {
  background: transparent;
}

.teaser-track::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--scrollbar-thumb);
}

.teaser-slide {
  flex: 0 0 min(1040px, 90%);
  margin: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scroll-snap-align: center;
  opacity: 0.58;
  transition: opacity 180ms ease, transform 180ms ease;
}

.teaser-slide.is-active {
  opacity: 1;
  transform: none;
}

.teaser-slide img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.split {
  display: grid;
  grid-template-columns: minmax(270px, 0.78fr) minmax(0, 1fr);
  gap: 72px;
  align-items: start;
}

.split.reverse {
  grid-template-columns: minmax(0, 0.86fr) minmax(320px, 1fr);
  align-items: center;
}

.prose {
  font-family: var(--font-prose);
  color: var(--prose-text);
  font-size: clamp(1rem, 1.08vw, 1.08rem);
  line-height: 1.78;
  font-weight: 400;
}

.prose p {
  margin-bottom: 18px;
}

.footnote-ref,
.footnote-backref {
  color: var(--teal);
  font-weight: 750;
  text-decoration: none;
}

.footnote-ref {
  margin-left: 2px;
  font-size: 0.72em;
}

#fnref-apeiria,
#fn-apeiria {
  scroll-margin-top: 45vh;
  scroll-margin-bottom: 45vh;
}

.abstract-footnote {
  margin: 6px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: right;
}

.abstract-footnote sup {
  margin-right: 4px;
  color: var(--teal);
}

.abstract-footnote em {
  color: var(--prose-text);
}

.abstract-footnote:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
}

.idea-grid,
.stage-grid,
.metric-grid {
  display: grid;
  gap: 18px;
}

.idea-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 36px;
}

.idea-card,
.stage-grid article,
.metric-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.idea-card {
  padding: 22px;
}

.idea-index {
  display: inline-block;
  margin-bottom: 22px;
  color: var(--teal);
  font-family: var(--font-serif);
  font-size: 1.85rem;
  line-height: 1;
}

.idea-card p,
.stage-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-family: var(--font-prose);
  line-height: 1.62;
}

.stage-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 22px;
}

.stage-grid article {
  padding: 22px;
}

.stage-grid span {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.metric-grid {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 28px;
}

.metric-card {
  padding: 18px;
  color: var(--ink);
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 10px 0 8px;
  color: var(--teal-dark);
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.2vw, 2.65rem);
  line-height: 1;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--table-border);
  border-radius: var(--radius);
  background: var(--table-bg);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 16px;
  border-bottom: 1px solid var(--table-row-border);
  text-align: left;
}

th {
  color: var(--table-head);
  font-weight: 800;
}

td {
  color: var(--table-cell);
}

th:nth-child(2),
td:nth-child(2) {
  text-align: center;
}

th:nth-child(n + 3),
td:nth-child(n + 3) {
  text-align: right;
}

tr:last-child td {
  border-bottom: 0;
}

.ours td {
  color: #ffffff;
  background: var(--table-ours-bg);
}

.ours.strong td {
  font-weight: 850;
  background: var(--table-ours-strong-bg);
}

.trace-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.trace-highlights span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  color: var(--teal-dark);
  background: var(--chip-bg);
  font-size: 0.82rem;
  font-weight: 760;
}

.trace-plot {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--trace-panel-bg);
  box-shadow: 0 14px 44px rgba(19, 32, 31, 0.08);
}

.trace-plot figcaption {
  margin-bottom: 16px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trace-prompt {
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  background: var(--trace-prompt-bg);
}

.trace-prompt span {
  color: var(--teal-dark);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trace-prompt strong {
  font-family: var(--font-serif);
  font-size: clamp(1.18rem, 2vw, 1.52rem);
  line-height: 1.12;
}

.trace-prompt em {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: normal;
}

.trace-steps {
  position: relative;
  display: grid;
  gap: 0;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.trace-steps::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 16px;
  width: 2px;
  background: var(--trace-line);
}

.trace-step {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 0;
}

.trace-index {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--brand-border);
  border-radius: 50%;
  color: var(--teal-dark);
  background: var(--trace-prompt-bg);
  font-size: 0.72rem;
  font-weight: 850;
}

.trace-step h3 {
  margin-bottom: 5px;
  color: var(--trace-heading);
  font-size: 0.98rem;
}

.trace-step p {
  margin-bottom: 0;
  color: var(--trace-text);
  font-size: 0.9rem;
  line-height: 1.55;
}

.trace-objects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.trace-objects span {
  display: block;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--trace-object-border);
  border-radius: 7px;
  color: var(--tab-text);
  background: var(--trace-object-bg);
  font-size: 0.78rem;
  line-height: 1.35;
}

.trace-objects b {
  color: var(--teal-dark);
}

.trace-relations {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--trace-relation-text);
  font-size: 0.84rem;
  line-height: 1.38;
}

.trace-relations li {
  position: relative;
  padding-left: 18px;
}

.trace-relations li::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--trace-bullet);
}

.trace-relations .is-match {
  color: var(--teal-dark);
  font-weight: 760;
}

.trace-relations .is-match::before {
  background: var(--teal);
}

.trace-answer {
  margin-top: 4px;
  padding: 14px 0 0;
}

.trace-answer .trace-index {
  color: var(--white);
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.trace-answer div {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--trace-answer-bg);
}

.character-section {
  overflow: clip;
}

.modular-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.68fr) minmax(0, 1.12fr);
  gap: 64px;
  align-items: center;
}

.module-card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--module-panel-bg);
  box-shadow: 0 12px 42px rgba(19, 32, 31, 0.08);
}

.module-chart-header span {
  display: block;
  margin-bottom: 5px;
  color: var(--coral);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.module-chart-header strong {
  display: block;
  color: var(--module-value);
  font-size: 0.98rem;
  line-height: 1.25;
}

.module-chart-canvas {
  position: relative;
  height: 330px;
  min-height: 300px;
}

.module-chart-canvas canvas {
  width: 100% !important;
  height: 100% !important;
}

.module-chart-fallback {
  min-width: 0;
  font-size: 0.86rem;
}

.module-chart-fallback th,
.module-chart-fallback td {
  color: var(--module-value);
  border-bottom: 1px solid var(--line);
}

.module-chart-fallback th {
  color: var(--muted);
}

.module-chart-fallback .oracle-row td {
  color: var(--chart-oracle-text);
  border-top: 1px dashed var(--chart-oracle-line);
}

.module-card.is-chart-ready .module-chart-fallback {
  display: none;
}

.module-visual {
  position: relative;
  overflow: visible;
  min-height: 360px;
  padding: 28px 0 36px;
}

.bib-visual {
  position: relative;
  min-height: 212px;
  padding: 0 96px 52px 0;
}

.apeiria-side-peek {
  --peek-rest: translate(58%, 23%) rotate(34deg) scale(0.86);
  --peek-active: translate(0%, -8%) rotate(24deg) scale(0.98);
  position: absolute;
  right: -72px;
  bottom: -78px;
  z-index: 1;
  width: clamp(320px, 35vw, 470px);
  opacity: 0.04;
  pointer-events: none;
  transform: var(--peek-rest);
  transform-origin: 58% 92%;
  filter: drop-shadow(0 18px 28px var(--peek-shadow));
  transition: transform 780ms cubic-bezier(0.18, 0.86, 0.18, 1), opacity 560ms ease;
  will-change: transform, opacity;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 44px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 44px), transparent 100%);
}

.apeiria-side-peek img {
  width: 100%;
  height: auto;
  max-width: none;
}

.character-section.is-peek-visible .apeiria-side-peek,
.bib-visual:hover .apeiria-side-peek,
.bib-visual:focus-within .apeiria-side-peek {
  opacity: 0.78;
  transform: var(--peek-active);
}

.bib-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.58fr) minmax(0, 1fr);
  gap: 52px;
  align-items: start;
}

.bib-card {
  position: relative;
  overflow: hidden;
  z-index: 2;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
}

.copy-button {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 36px;
  padding: 0 14px;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: none;
}

pre {
  margin: 0;
  padding: 52px 24px 24px;
  overflow-x: auto;
  color: var(--code-text);
  font-size: 0.9rem;
  line-height: 1.55;
}

.site-footer {
  padding: 32px 0;
  color: var(--footer-text);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.footer-inner a {
  color: var(--teal-dark);
  font-weight: 750;
}

@media (max-width: 1280px) {
  .title-block h1 {
    font-size: 3.72rem;
  }
}

@media (max-width: 1060px) {
  .title-block h1 {
    font-size: 3.16rem;
  }
}

@media (max-width: 980px) {
  .site-nav {
    display: none;
  }

  .hero {
    min-height: auto;
  }

  .section-heading,
  .split,
  .split.reverse,
  .modular-layout,
  .bib-layout {
    grid-template-columns: 1fr;
  }

  .idea-grid,
  .stage-grid,
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .split,
  .split.reverse,
  .modular-layout {
    gap: 38px;
  }

  .title-block h1 {
    font-size: clamp(2.08rem, 5vw, 2.86rem);
  }
}

@media (max-width: 760px) {
  .title-block h1 {
    font-size: clamp(2.08rem, 5vw, 2.16rem);
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .site-header {
    padding: 0 14px;
  }

  .header-actions {
    gap: 10px;
  }

  .projects-menu-trigger {
    min-height: 38px;
    padding: 0 11px;
    font-size: 0.84rem;
  }

  .projects-menu-panel {
    right: -50px;
    width: min(320px, calc(100vw - 28px));
  }

  .section-band {
    padding: 68px 0;
  }

  .hero {
    padding-top: 94px;
  }

  h1 {
    font-size: clamp(2.1rem, 11vw, 3.35rem);
  }

  h2 {
    font-size: clamp(1.55rem, 8vw, 2.35rem);
  }

  .title-block h1 {
    font-size: clamp(2.1rem, 10.4vw, 3.35rem);
  }

  .title-block h1 span {
    display: inline;
    white-space: normal;
  }

  .teaser-controls {
    gap: 7px;
  }

  .teaser-tab {
    flex: 1 1 104px;
    justify-content: center;
    padding: 0 10px;
  }

  .teaser-slide {
    flex-basis: 94%;
  }

  .trace-plot {
    padding: 18px;
  }

  .trace-step {
    gap: 10px;
  }

  .trace-objects {
    grid-template-columns: 1fr;
  }

  .idea-grid,
  .stage-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .module-visual {
    min-height: auto;
    padding: 20px 0;
  }

  .module-card {
    padding: 20px 16px 18px;
  }

  .module-chart-canvas {
    height: 310px;
  }

  .bib-visual {
    min-height: 430px;
    padding: 0 0 118px;
  }

  .apeiria-side-peek {
    --peek-rest: translate(42%, 18%) rotate(33deg) scale(0.84);
    --peek-active: translate(0%, -2%) rotate(23deg) scale(0.92);
    right: 170px;
    bottom: -96px;
    width: clamp(300px, 88vw, 380px);
    opacity: 0.08;
  }

  .character-section.is-peek-visible .apeiria-side-peek,
  .bib-visual:hover .apeiria-side-peek,
  .bib-visual:focus-within .apeiria-side-peek {
    opacity: 0.72;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
