:root {
  --paper: #f7f7f3;
  --surface: #ffffff;
  --surface-translucent: rgba(255, 255, 255, 0.68);
  --surface-subtle: #fafbf9;
  --surface-muted: #eef0ed;
  --section-muted: #eef0ed;
  --section-comparison: #f2f4f1;
  --ink: #151916;
  --on-ink: #ffffff;
  --on-accent: #ffffff;
  --muted: #626963;
  --faint: #676f68;
  --body-copy: #3e453f;
  --line: #d9ddd8;
  --line-strong: #b9c0ba;
  --blue: #1756a9;
  --blue-soft: #eaf1fa;
  --blue-border: #b7c9e2;
  --red: #9d2f25;
  --red-soft: #f8ecea;
  --green: #2f6a4b;
  --green-soft: #ebf4ef;
  --flow: #57605a;
  --header-bg: rgba(247, 247, 243, 0.94);
  --paper-translucent: rgba(247, 247, 243, 0.84);
  --menu-shadow: 0 12px 30px rgba(30, 36, 31, 0.16);
  --card-shadow: 0 18px 50px rgba(30, 36, 31, 0.12);
  --sticky-shadow: rgba(21, 25, 22, 0.7);
  --zoom-bg: rgba(255, 255, 255, 0.92);
  --figure-surface: #ffffff;
  --inverse-bg: #151916;
  --inverse-surface: #202521;
  --inverse-ink: #ffffff;
  --inverse-muted: #b8c0ba;
  --inverse-faint: #aeb6af;
  --inverse-line: #454c46;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --shell: 1180px;
  --header-height: 68px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #111411;
  --surface: #191d19;
  --surface-translucent: rgba(25, 29, 25, 0.78);
  --surface-subtle: #151915;
  --surface-muted: #242a24;
  --section-muted: #171c18;
  --section-comparison: #151a16;
  --ink: #eef1ec;
  --on-ink: #111411;
  --on-accent: #101820;
  --muted: #b3bab3;
  --faint: #858d86;
  --body-copy: #c9cec8;
  --line: #343b35;
  --line-strong: #505850;
  --blue: #7fb0ec;
  --blue-soft: #1b2d43;
  --blue-border: #365b83;
  --red: #e08d82;
  --red-soft: #382220;
  --green: #7fc098;
  --green-soft: #1d3326;
  --flow: #9ca59d;
  --header-bg: rgba(17, 20, 17, 0.94);
  --paper-translucent: rgba(17, 20, 17, 0.86);
  --menu-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  --card-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --sticky-shadow: rgba(0, 0, 0, 0.8);
  --zoom-bg: rgba(25, 29, 25, 0.94);
  --inverse-bg: #090b09;
  --inverse-surface: #121612;
  --inverse-ink: #f2f4f1;
  --inverse-muted: #aab2aa;
  --inverse-faint: #909990;
  --inverse-line: #343b35;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

button,
select,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
.theme-summary:focus-visible {
  outline: 3px solid rgba(23, 86, 169, 0.35);
  outline-offset: 3px;
}

a {
  color: inherit;
}

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

svg {
  display: block;
}

.shell {
  width: min(var(--shell), calc(100% - 48px));
  margin-inline: auto;
}

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

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

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  height: var(--header-height);
  border-bottom: 1px solid var(--line-strong);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.nav-links a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
}

.theme-menu {
  position: relative;
  flex: 0 0 auto;
}

.theme-summary {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

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

.theme-summary:hover,
.theme-menu[open] .theme-summary {
  background: var(--surface);
  color: var(--ink);
}

.theme-summary svg {
  width: 17px;
  height: 17px;
}

.theme-options {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  width: 152px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--menu-shadow);
}

.theme-options button {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 18px 1fr 16px;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.theme-options button:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.theme-options button[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 600;
}

.theme-options svg {
  width: 15px;
  height: 15px;
}

.theme-options .theme-check {
  opacity: 0;
}

.theme-options button[aria-pressed="true"] .theme-check {
  opacity: 1;
}

.nav-paper {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.nav-paper svg,
.text-link svg {
  width: 15px;
  height: 15px;
}

.hero {
  min-height: calc(100svh - var(--header-height) - 72px);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.hero-inner {
  padding-block: 70px 54px;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 24px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.kicker-divider {
  width: 26px;
  height: 1px;
  background: var(--line-strong);
}

.hero h1 {
  max-width: 970px;
  margin: 0;
  font-family: var(--serif);
  font-size: 68px;
  font-weight: 400;
  line-height: 0.98;
  text-wrap: balance;
}

.hero-dek {
  max-width: 820px;
  margin: 26px 0 0;
  color: var(--body-copy);
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.38;
}

.byline {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.button svg {
  width: 17px;
  height: 17px;
}

.button.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
}

.button.secondary {
  background: var(--surface-translucent);
}

.button:hover {
  transform: translateY(-1px);
}

.button-compact {
  display: none;
}

.hero-tuple {
  display: flex;
  align-items: stretch;
  margin-top: 48px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: var(--paper-translucent);
}

.tuple-equation {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 20px 0 0;
  font-family: var(--serif);
  font-size: 38px;
}

.tuple-equals {
  color: var(--faint);
}

.tuple-close {
  padding: 0 0 0 16px;
}

.tuple-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.tuple-grid button {
  min-width: 0;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.tuple-grid button:last-child {
  border-right: 1px solid var(--line);
}

.tuple-grid button:hover,
.tuple-grid button:focus-visible {
  background: var(--blue-soft);
  color: var(--blue);
}

.tuple-grid strong {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  line-height: 1;
}

.tuple-grid span {
  color: var(--muted);
  font-size: 11px;
}

.section {
  padding-block: 112px;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 48px;
}

.section-heading .eyebrow,
.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 400;
  line-height: 1.08;
}

.section-heading > p:not(.eyebrow) {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.heading-row {
  max-width: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.heading-row > div:first-child {
  max-width: 760px;
}

.heading-row h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 400;
  line-height: 1.08;
}

.heading-row > div:first-child > p:last-child {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.component-explorer {
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.component-tabs {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.component-tabs button {
  min-width: 0;
  min-height: 58px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--serif);
  font-size: 23px;
}

.component-tabs button:last-child {
  border-right: 0;
}

.component-tabs button:hover {
  color: var(--blue);
}

.component-tabs button[aria-selected="true"] {
  background: var(--ink);
  color: var(--on-ink);
}

.component-detail {
  min-height: 340px;
  display: grid;
  grid-template-columns: 180px minmax(280px, 1fr) minmax(330px, 1.1fr);
  align-items: center;
  gap: 48px;
  padding: 48px 0;
}

.component-symbol {
  color: var(--blue);
  font-family: var(--serif);
  font-size: 150px;
  line-height: 1;
  text-align: center;
}

.component-index {
  margin: 0 0 8px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
}

.component-copy h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 400;
  line-height: 1.1;
}

.component-question {
  margin: 8px 0 20px;
  color: var(--blue);
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.3;
}

.component-copy > p:last-child {
  margin: 0;
  color: var(--muted);
}

.component-parts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.component-part {
  min-height: 96px;
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.component-part strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  line-height: 1.1;
}

.component-part strong sub,
.coord-tag sub,
.coord-cell .coord-symbol sub {
  font-size: 0.6em;
  line-height: 0;
  vertical-align: -0.25em;
}

.component-part span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.overview-figure {
  margin: 72px 0 0;
}

.figure-open {
  position: relative;
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.overview-figure .figure-open {
  padding: 36px;
  border: 1px solid var(--line);
  background: var(--figure-surface);
}

.overview-figure img {
  width: 100%;
  max-height: 580px;
  object-fit: contain;
}

.zoom-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--zoom-bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.zoom-hint svg {
  width: 14px;
  height: 14px;
}

figcaption {
  margin-top: 16px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.45;
}

figcaption > span:first-child {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

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

.icon-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--paper);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.system-tabs {
  display: flex;
  gap: 6px;
  padding-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.system-tabs button {
  min-height: 39px;
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.system-tabs button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.system-tabs button[aria-selected="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
}

.system-workbench {
  min-height: 590px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  margin-top: 14px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.diagram-column {
  min-width: 0;
  padding: 34px 40px 30px 0;
  border-right: 1px solid var(--line);
}

.diagram-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.diagram-label {
  margin: 0 0 4px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.diagram-header h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 400;
  line-height: 1.1;
}

.system-kind {
  max-width: 220px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.diagram-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 720 / 390;
  max-height: 390px;
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--surface-subtle);
  background-size: 24px 24px;
}

#system-diagram {
  width: 100%;
  height: 100%;
}

#system-diagram .node {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 2;
}

#system-diagram .node-accent {
  fill: var(--blue-soft);
  stroke: var(--blue);
  stroke-width: 2.5;
}

#system-diagram .node-muted {
  fill: var(--surface-muted);
  stroke: var(--line-strong);
  stroke-width: 2;
}

#system-diagram .store {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 2;
}

#system-diagram .store-accent {
  fill: var(--blue-soft);
  stroke: var(--blue);
  stroke-width: 2.5;
}

#system-diagram .flow {
  fill: none;
  stroke: var(--flow);
  stroke-width: 2.4;
  marker-end: url(#arrow);
  stroke-dasharray: 8 7;
  animation: flow 1.5s linear infinite;
}

#system-diagram .flow-blue {
  stroke: var(--blue);
  marker-end: url(#arrow-blue);
}

#system-diagram .flow-red {
  stroke: var(--red);
  marker-end: url(#arrow-red);
}

#system-diagram .flow-both {
  marker-start: url(#arrow-reverse);
}

#system-diagram .marker-default {
  fill: var(--flow);
}

#system-diagram .marker-blue {
  fill: var(--blue);
}

#system-diagram .marker-red {
  fill: var(--red);
}

#system-diagram .flow-dashed {
  stroke-dasharray: 3 8;
}

#system-diagram .label {
  fill: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  text-anchor: middle;
}

#system-diagram .sub-label {
  fill: var(--muted);
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  text-anchor: middle;
}

#system-diagram .small-label {
  fill: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  text-anchor: middle;
}

#system-diagram .math-sub {
  font-size: 70%;
  baseline-shift: sub;
}

#system-diagram .cross {
  fill: var(--red);
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 600;
  text-anchor: middle;
}

@keyframes flow {
  to { stroke-dashoffset: -30; }
}

.diagram-note {
  min-height: 50px;
  margin: 20px 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.45;
}

.system-spec {
  min-width: 0;
  padding: 34px 0 30px 34px;
}

.spec-list {
  margin: 0;
  border-top: 1px solid var(--line);
}

.spec-list > div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.spec-list dt {
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.spec-list dd {
  margin: 0;
  color: var(--body-copy);
  font-size: 13px;
  line-height: 1.45;
}

.set-coordinates {
  padding-top: 20px;
}

.set-coordinates > p {
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

#system-set {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.coord-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid var(--blue-border);
  border-radius: 4px;
  background: var(--blue-soft);
  color: var(--blue);
  font-family: var(--serif);
  font-size: 16px;
}

.coord-tag small {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
}

.coordinate-map {
  margin-top: 34px;
}

.coordinate-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.coordinate-map-head > p {
  margin: 0;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.map-legend {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 10px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-mark {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
}

.primary-mark {
  background: var(--blue);
}

.coordinate-rail {
  display: grid;
  grid-template-columns: repeat(12, minmax(72px, 1fr));
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.coord-cell {
  position: relative;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.coord-cell.muted-coordinate {
  background: var(--surface-muted);
}

.coord-cell .coord-symbol {
  font-family: var(--serif);
  font-size: 22px;
}

.coord-cell .coord-name {
  color: var(--faint);
  font-size: 9px;
}

.coord-marks {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: flex;
  gap: 4px;
}

.coord-marks i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.coord-marks .primary {
  background: var(--blue);
}

.taste-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 0.9fr);
  align-items: center;
  gap: 72px;
}

.taste-copy {
  border-top: 1px solid var(--line-strong);
}

.taste-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 22px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line-strong);
}

.taste-number {
  margin: 5px 0 0;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
}

.taste-item h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 33px;
  font-weight: 400;
  line-height: 1.1;
}

.taste-item.generative h3 {
  color: var(--blue);
}

.taste-item.evaluative h3 {
  color: var(--red);
}

.taste-question {
  margin: 7px 0 10px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
}

.taste-item div > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.taste-visual {
  max-width: 520px;
  justify-self: end;
  box-shadow: var(--card-shadow);
}

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

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gallery-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.gallery-tabs button {
  min-height: 62px;
  padding: 8px 14px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.gallery-tabs button:last-child {
  border-right: 0;
}

.gallery-tabs button span {
  display: block;
  color: var(--ink);
  font-weight: 600;
}

.gallery-tabs button[aria-selected="true"] {
  background: var(--blue-soft);
  color: var(--blue);
}

.gallery-stage {
  margin: 32px 0 0;
}

.gallery-image-button {
  height: 570px;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--figure-surface);
}

.gallery-image-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-stage figcaption {
  min-height: 54px;
  max-width: 920px;
}

.visual-section {
  background: var(--section-muted);
}

.gallery-controls {
  display: flex;
  gap: 8px;
}

.visual-gallery {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 42px;
  align-items: start;
}

.visual-tabs {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-strong);
}

.visual-tabs button {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.visual-tabs button::after {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.visual-tabs button[aria-selected="true"] {
  color: var(--ink);
  font-weight: 600;
}

.visual-tabs button[aria-selected="true"]::after {
  border-color: var(--blue);
  background: var(--blue);
}

.visual-stage {
  width: min(760px, 100%);
  margin: 0 auto;
}

.visual-image-button {
  aspect-ratio: 1;
  background: var(--figure-surface);
  box-shadow: var(--card-shadow);
}

.visual-image-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.visual-stage figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.visual-stage figcaption > span {
  font-family: var(--serif);
  font-size: 18px;
  text-transform: none;
}

.visual-stage figcaption a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.visual-stage figcaption svg {
  width: 15px;
  height: 15px;
}

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

.paper-section .section-heading {
  max-width: 900px;
}

.abstract-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
  gap: 64px;
  align-items: start;
}

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

.abstract-copy p {
  margin: 0 0 22px;
  color: var(--body-copy);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.58;
}

.abstract-copy p:last-child {
  margin-bottom: 0;
}

.paper-details {
  padding-left: 28px;
  border-left: 1px solid var(--line-strong);
}

.paper-details dl {
  margin: 0 0 24px;
  border-top: 1px solid var(--line);
}

.paper-details dl > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.paper-details dt {
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.paper-details dd {
  margin: 0;
  color: var(--body-copy);
  font-size: 13px;
  line-height: 1.45;
}

.paper-details .button {
  width: 100%;
}

.citation-section {
  background: var(--inverse-bg);
  color: var(--inverse-ink);
}

.citation-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(430px, 1.2fr);
  align-items: center;
  gap: 90px;
}

.citation-section .section-heading {
  margin: 0;
}

.citation-section .section-heading .eyebrow {
  color: #7fb0ec;
}

.citation-section .section-heading > p:not(.eyebrow) {
  color: var(--inverse-muted);
}

.citation-section .text-link {
  margin-top: 20px;
  color: #9bc2f2;
}

.citation-block {
  position: relative;
  border: 1px solid var(--inverse-line);
  background: var(--inverse-surface);
}

.citation-block pre {
  margin: 0;
  padding: 34px 72px 34px 34px;
  overflow-x: auto;
  color: var(--inverse-ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.citation-copy {
  position: absolute;
  top: 14px;
  right: 14px;
  border-color: #505851;
  color: var(--inverse-ink);
}

.citation-copy:hover {
  background: #2a302b;
}

.site-footer {
  padding: 28px 0;
  background: var(--inverse-bg);
  color: var(--inverse-faint);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--inverse-line);
  font-size: 11px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner div {
  display: flex;
  gap: 18px;
}

.footer-inner a {
  color: var(--inverse-ink);
  text-decoration: none;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 4px !important;
}

.footer-meta p {
  line-height: 1.5;
}

.back-to-top {
  position: fixed;
  z-index: 45;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--menu-shadow);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.back-to-top svg {
  width: 18px;
  height: 18px;
}

.lightbox {
  width: min(96vw, 1500px);
  max-width: none;
  height: min(94vh, 1000px);
  max-height: none;
  padding: 52px 28px 28px;
  border: 1px solid var(--line-strong);
  background: var(--figure-surface);
}

.lightbox::backdrop {
  background: rgba(14, 17, 15, 0.82);
  backdrop-filter: blur(6px);
}

.lightbox img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--surface);
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 24px;
  padding: 9px 13px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 980px) {
  .hero h1 {
    font-size: 54px;
  }

  .hero-tuple {
    align-items: center;
  }

  .tuple-equation {
    display: none;
  }

  .tuple-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tuple-grid button {
    min-height: 88px;
    border-bottom: 1px solid var(--line);
  }

  .tuple-grid button:nth-child(4) {
    border-right: 0;
  }

  .tuple-grid button:nth-child(n + 5) {
    border-bottom: 0;
  }

  .component-detail {
    grid-template-columns: 120px 1fr;
  }

  .component-symbol {
    font-size: 110px;
  }

  .component-parts {
    grid-column: 1 / -1;
  }

  .system-workbench {
    grid-template-columns: 1fr;
  }

  .diagram-column {
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .system-spec {
    padding-left: 0;
  }

  .taste-layout {
    grid-template-columns: 1fr;
    gap: 46px;
  }

  .taste-visual {
    width: min(620px, 100%);
    max-width: none;
    justify-self: center;
  }

  .visual-gallery {
    grid-template-columns: 1fr;
  }

  .visual-tabs {
    flex-direction: row;
    overflow-x: auto;
    border-bottom: 1px solid var(--line-strong);
  }

  .visual-tabs button {
    min-width: max-content;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    padding-inline: 12px;
  }

  .visual-tabs button::after {
    display: none;
  }

  .visual-tabs button[aria-selected="true"] {
    background: var(--surface);
  }

  .citation-layout {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .abstract-layout {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .paper-details {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 720px) {
  :root {
    --header-height: 60px;
  }

  .shell {
    width: min(100% - 28px, var(--shell));
  }

  .nav {
    gap: 12px;
  }

  .brand span:last-child {
    display: none;
  }

  .nav-links {
    gap: 14px;
  }

  .nav-links a:first-child {
    display: none;
  }

  .nav-paper {
    padding-inline: 10px;
    font-size: 12px;
  }

  .hero {
    min-height: auto;
  }

  .hero-inner {
    padding-block: 38px 24px;
  }

  .hero-kicker {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 10px;
  }

  .kicker-divider {
    width: 15px;
  }

  .hero h1 {
    font-size: 40px;
    line-height: 1.02;
  }

  .hero-dek {
    margin-top: 16px;
    font-size: 18px;
    line-height: 1.35;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 20px;
  }

  .hero-actions .button:first-child {
    grid-column: 1 / -1;
  }

  .hero-tuple {
    margin-top: 26px;
  }

  .tuple-grid strong {
    font-size: 29px;
  }

  .tuple-grid span {
    font-size: 9px;
  }

  .tuple-grid button {
    min-height: 72px;
  }

  .section {
    padding-block: 76px;
  }

  .section-heading,
  .heading-row {
    margin-bottom: 34px;
  }

  .section-heading h2,
  .heading-row h2 {
    font-size: 38px;
  }

  .section-heading > p:not(.eyebrow),
  .heading-row > div:first-child > p:last-child {
    font-size: 15px;
  }

  .heading-row {
    align-items: flex-start;
  }

  .component-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .component-tabs button {
    min-height: 48px;
    border-bottom: 1px solid var(--line);
  }

  .component-tabs button:nth-child(4n) {
    border-right: 0;
  }

  .component-tabs button:nth-child(n + 5) {
    border-bottom: 0;
  }

  .component-detail {
    grid-template-columns: 80px 1fr;
    gap: 22px;
    padding: 34px 0;
  }

  .component-symbol {
    font-size: 75px;
  }

  .component-copy h3 {
    font-size: 34px;
  }

  .component-question {
    font-size: 20px;
  }

  .component-parts {
    grid-template-columns: 1fr;
  }

  .component-part {
    min-height: 74px;
  }

  .overview-figure {
    margin-top: 48px;
  }

  .overview-figure .figure-open {
    padding: 12px;
  }

  .overview-figure figcaption {
    font-size: 14px;
  }

  .system-workbench {
    min-height: 0;
  }

  .diagram-column {
    padding-block: 26px;
  }

  .diagram-header {
    align-items: flex-end;
  }

  .diagram-header h3 {
    font-size: 32px;
  }

  .system-kind {
    max-width: 130px;
    font-size: 10px;
  }

  .diagram-wrap {
    min-height: 245px;
  }

  .diagram-note {
    font-size: 16px;
  }

  .system-spec {
    padding-block: 26px;
  }

  .coordinate-map-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .taste-item {
    grid-template-columns: 36px 1fr;
    gap: 12px;
  }

  .taste-item h3 {
    font-size: 29px;
  }

  .gallery-tabs {
    display: flex;
    overflow-x: auto;
  }

  .gallery-tabs button {
    min-width: 150px;
  }

  .gallery-image-button {
    height: 420px;
    padding: 10px;
  }

  .visual-stage {
    width: 100%;
  }

  .visual-stage figcaption {
    align-items: flex-start;
  }

  .abstract-copy p {
    font-size: 17px;
    line-height: 1.55;
  }

  .paper-details dl > div {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .citation-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .citation-block {
    min-width: 0;
  }

  .citation-block pre {
    padding: 24px 58px 24px 20px;
    font-size: 11px;
  }

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

  .lightbox {
    width: 98vw;
    height: 92vh;
    padding: 48px 8px 8px;
  }
}

@media (max-width: 420px) {
  .nav-links a:nth-child(3) {
    display: none;
  }

  .hero h1 {
    font-size: 35px;
  }

  .hero-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-actions .button:first-child {
    grid-column: auto;
  }

  .hero-actions .button {
    min-width: 0;
    min-height: 40px;
    padding-inline: 6px;
    gap: 6px;
    font-size: 12px;
  }

  .button-wide {
    display: none;
  }

  .button-compact {
    display: inline;
  }

  .component-detail {
    grid-template-columns: 1fr;
  }

  .component-symbol {
    text-align: left;
  }

  .component-parts {
    grid-column: auto;
  }

  .taste-item {
    grid-template-columns: 1fr;
  }

  .gallery-image-button {
    height: 320px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
