:root {
  color-scheme: light;
  --paper: #f5f0e6;
  --paper-deep: #ece3d2;
  --ink: #142b2b;
  --ink-soft: #526363;
  --night: #102929;
  --night-2: #173737;
  --white: #fffdf7;
  --line: rgba(20, 43, 43, 0.19);
  --line-dark: rgba(255, 253, 247, 0.22);
  --orange: #eb6744;
  --blue: #446be0;
  --mint: #3f9179;
  --gold: #d6a93b;
  --purple: #8966bd;
  --pink: #cf6b87;
  --cyan: #4d9bad;
  --gray: #9ba4a0;
  --shadow: 0 18px 45px rgba(24, 42, 40, 0.1);
  --radius: 20px;
  --role-1: #eb6744;
  --role-2: #446be0;
  --role-3: #d6a93b;
  --role-4: #cf6b87;
  --role-5: #8966bd;
  --role-6: #4d9bad;
  --role-7: #8e9b95;
  --stage-1: #eb6744;
  --stage-2: #d6a93b;
  --stage-3: #446be0;
  --stage-4: #3f9179;
  --stage-5: #8966bd;
  --stage-6: #cf6b87;
}

.metric-alert { padding: 1rem 1.2rem; border: 1px solid currentColor; border-radius: 12px; font-size: .92rem; }
.metric-alert a { color: inherit; text-underline-offset: 3px; }
.metric-alert--paper { background: var(--paper-deep); margin: 1.5rem 0; }
.metric-intro { max-width: 850px; color: var(--ink-soft); }
.metric-controls { display: flex; gap: 1rem; justify-content: space-between; align-items: center; flex-wrap: wrap; margin: 1.6rem 0 .6rem; }
.metric-controls label { display: grid; gap: .4rem; font-size: .85rem; font-weight: 650; max-width: 100%; }
.metric-controls select { padding: .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); max-width: 100%; }
.metric-controls a, .metric-details a, .metric-legacy-note a { color: inherit; text-underline-offset: 3px; }
.volume-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.volume-card { padding: 1.3rem; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.volume-card:last-child { background: var(--paper-deep); }
.metric-id { font-size: .7rem; letter-spacing: .07em; color: var(--ink-soft); }
.volume-card h3 { font-size: 1.05rem; margin: .5rem 0; }
.volume-card > strong { font-size: clamp(2rem,4vw,3rem); font-variant-numeric: tabular-nums; }
.volume-card p { font-size: .88rem; color: var(--ink-soft); margin-bottom: 0; }
.metric-table-scroll { overflow-x: auto; max-width: 100%; margin: 1.5rem 0; }
.metric-table { border-collapse: collapse; width: 100%; font-size: .8rem; font-variant-numeric: tabular-nums; }
.metric-table caption { text-align: left; color: var(--ink-soft); margin-bottom: .8rem; }
.metric-table th, .metric-table td { text-align: right; padding: .8rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.metric-table th:first-child { text-align: left; }
.metric-table thead { background: var(--paper-deep); }
.metric-table tbody th { font-weight: 550; }
.metric-table .metric-total { background: var(--paper-deep); border-top: 2px solid var(--mint); }
.metric-table .metric-total th, .metric-table .metric-total td { font-weight: 800; padding-block: 1.1rem; }
.metric-table .metric-related { color: var(--ink-soft); font-size: .75rem; }
.metric-details { border-top: 1px solid var(--line); padding: 1rem 0; font-size: .92rem; }
.metric-details summary { font-weight: 650; cursor: pointer; }
.metric-details li { margin-bottom: .6rem; }
.token-totals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; margin: 2rem 0; }
.token-totals > div { display: grid; gap: .4rem; border-top: 3px solid var(--mint); padding-top: .8rem; }
.token-totals span, .token-totals small { color: var(--ink-soft); font-size: .8rem; }
.token-totals strong { font-size: clamp(1.5rem,3vw,2.1rem); }
.token-bars { display: grid; gap: 1.2rem; margin: 1.5rem 0; }
.token-bar-row { display: grid; grid-template-columns: 155px minmax(0,1fr) 110px; align-items: center; gap: 1rem; font-size: .83rem; }
.token-bar-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.token-bar-track { height: 24px; border-radius: 4px; background: var(--paper-deep); overflow: hidden; }
.token-bar-fill { background: var(--mint); height: 100%; border-radius: 4px; }
@media (max-width: 650px) {
  .volume-cards, .token-totals { grid-template-columns: 1fr; }
  .token-bar-row { grid-template-columns: minmax(0,1fr) 105px; gap: .35rem; }
  .token-bar-row > span { grid-column: 1 / -1; }
  .metric-controls { display: grid; }
  .metric-controls select { width: 100%; min-width: 0; font-size: .85rem; }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(20, 43, 43, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 36px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 20;
  padding: 0.6rem 0.9rem;
  background: var(--white);
  color: var(--ink);
}

.skip-link:focus {
  top: 1rem;
}

.hero {
  /* The header stays dark in both themes; its text must not use a surface color. */
  --hero-text: #fffdf7;
  --hero-muted: #cbd5cf;
  --hero-link: #bce7d8;
  position: relative;
  overflow: hidden;
  padding: 3.5rem max(1.25rem, calc((100vw - 1180px) / 2)) 2.2rem;
  background:
    radial-gradient(circle at 84% 20%, rgba(68, 107, 224, 0.35), transparent 26rem),
    radial-gradient(circle at 10% 100%, rgba(235, 103, 68, 0.22), transparent 28rem),
    var(--night);
  color: var(--hero-text);
}

.hero a, .hero a:visited { color: var(--hero-link); text-underline-offset: 3px; }
.hero a:hover { color: var(--hero-text); }
.hero a:focus-visible { outline: 2px solid #ff9778; outline-offset: 5px; border-radius: 2px; }

.hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -210px;
  bottom: -260px;
  border: 1px solid rgba(255, 253, 247, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(255, 253, 247, 0.025), 0 0 0 90px rgba(255, 253, 247, 0.02);
}

.hero__eyebrow,
.kicker {
  margin: 0 0 0.6rem;
  color: var(--orange);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
  align-items: center;
  gap: 3rem;
}

.hero__eyebrow { color: #ffad90; }

.hero h1 {
  max-width: 900px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.25rem, 8vw, 7.5rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.84;
}

.hero__lede {
  max-width: 780px;
  margin: 2rem 0 0;
  color: var(--hero-muted);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
}

.hero__motif {
  display: grid;
  justify-items: center;
  gap: 0;
  padding-top: 2rem;
  align-content: center;
}

.hero__motif span {
  display: grid;
  width: 156px;
  min-height: 64px;
  place-items: center;
  border: 1px solid rgba(255, 253, 247, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.hero__motif span:last-child {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--night);
}

.hero__motif i {
  position: relative;
  width: 2px;
  height: 72px;
  margin: 14px 0 24px;
  background: linear-gradient(var(--hero-text), var(--orange));
}

.hero__motif i::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: 50%;
  bottom: 0;
  border-right: 2px solid var(--orange);
  border-bottom: 2px solid var(--orange);
  transform: translateX(-50%) rotate(45deg);
}

.hero__stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 3rem;
  border-top: 1px solid var(--line-dark);
}

.hero-stat {
  padding: 1.35rem 1.2rem 0 0;
  border-right: 1px solid var(--line-dark);
}

.hero-stat:not(:first-child) {
  padding-left: 1.2rem;
}

.hero-stat:last-child {
  border-right: 0;
}

.hero-stat__value {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2.35rem);
  font-weight: 760;
  line-height: 1;
}

.hero-stat__label {
  display: block;
  margin-top: 0.5rem;
  color: var(--hero-muted);
  font-size: 0.83rem;
}

main,
footer {
  width: min(1180px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.section {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 1.3rem;
  padding: 6rem 0;
  border-bottom: 1px solid var(--line);
}

.section__number {
  padding-top: 0.48rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.section__body {
  min-width: 0;
}

.section__heading {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  align-items: end;
  gap: 2.5rem;
  margin-bottom: 2.6rem;
}

.section__heading > p {
  margin: 0 0 0.35rem;
  color: var(--ink-soft);
}

h2,
h3,
p {
  text-wrap: pretty;
}

h2 {
  max-width: 850px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4.8vw, 4.25rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

h3 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.22;
}

.section--intro {
  padding-block: 3.7rem;
}

.section--intro h2 {
  font-size: clamp(1.9rem, 3.5vw, 3.25rem);
}

.orientation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 2rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.orientation-grid p {
  margin: 0;
  padding: 1.3rem;
  background: rgba(255, 253, 247, 0.66);
}

.story-path {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 1.5rem;
}

.story-step {
  position: relative;
  min-height: 120px;
  padding: 1rem 0.85rem 1.2rem;
  border: 0;
  border-top: 3px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.story-step::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0.85rem;
  width: 13px;
  height: 13px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--step-color, var(--ink-soft));
}

.story-step:hover,
.story-step:focus-visible {
  background: rgba(255, 253, 247, 0.5);
}

.story-step[aria-selected="true"] {
  border-top-color: var(--step-color, var(--orange));
  background: var(--white);
  box-shadow: var(--shadow);
}

.story-step__index {
  display: block;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.story-step__name {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.88rem;
  font-weight: 760;
  line-height: 1.25;
}

.stage-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(310px, 0.8fr);
  gap: 2.5rem;
  padding: clamp(1.4rem, 3vw, 2.5rem);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.stage-detail__copy > p {
  max-width: 700px;
  color: var(--ink-soft);
}

.stage-detail__outcome {
  margin-top: 1.5rem;
  padding-left: 1rem;
  border-left: 4px solid var(--stage-color, var(--orange));
  color: var(--ink) !important;
}

.stage-detail__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.misc-related {
  margin-top: 1rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
}

.misc-related summary {
  padding: 0.85rem 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 720;
  cursor: pointer;
}

.misc-related > div {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) auto minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
  padding: 0.25rem 0 1rem;
  font-size: 0.8rem;
}

.misc-related p {
  margin: 0;
}

.stage-metric {
  min-height: 100px;
  padding: 1rem;
  background: var(--paper);
}

.stage-metric strong {
  display: block;
  font-size: 1.5rem;
  line-height: 1.1;
}

.stage-metric span {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.prompt-median { display: block; margin-top: .6rem; color: var(--ink-soft); font-size: .72rem; line-height: 1.4; }
.prompt-role-panel { margin-top: 2.5rem; padding: clamp(1.15rem, 3vw, 2.5rem); border-radius: var(--radius); background: var(--night); color: #fffdf7; }
.prompt-role-panel .section__heading > p, .prompt-role-panel .chart-note { color: #c3ceca; }
.prompt-role-panel .kicker { color: #ff8b69; }
.prompt-role-panel h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.9rem, 3.8vw, 3.1rem); font-weight: 500; letter-spacing: -.04em; line-height: 1.08; }
.role-definitions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 2.5rem 0 0; }
.role-definitions > div { border-top: 3px solid var(--legend-color); padding-top: .65rem; }
.role-definitions dt { font-size: .86rem; font-weight: 750; }
.role-definitions dd { margin: .4rem 0 0; font-size: .8rem; color: #c3ceca; }
.reuse-grid, .closing-benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 2.5rem 0; }
.reuse-grid article, .closing-benefits article { padding-top: 1rem; border-top: 2px solid var(--line); }
.reuse-grid h3, .closing-benefits h3 { font-size: 1rem; margin: 0 0 .6rem; }
.reuse-grid p, .closing-benefits p { color: var(--ink-soft); font-size: .92rem; margin: 0; }
.closing-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2.5rem; }
.timeline-context { max-width: 880px; }
.plain-definitions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 2rem; margin: 1.4rem 0; }
.plain-definitions dt { font-weight: 750; color: var(--ink); }
.plain-definitions dd { margin: .35rem 0 0; color: var(--ink-soft); font-size: .88rem; }
.token-example { padding: 1rem 1.2rem; border-left: 3px solid var(--mint); background: var(--paper-deep); }
.chart .segment-value { fill: #fffdf7; paint-order: stroke; stroke: rgba(0,0,0,.25); stroke-width: 2px; }
.port-benefits strong { color: var(--ink); }
@media (max-width: 900px) {
  .role-definitions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reuse-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .role-definitions, .plain-definitions, .closing-benefits { grid-template-columns: 1fr; }
  .prompt-role-panel .role-row { grid-template-columns: 1fr 60px; }
  .prompt-role-panel { margin-inline: -.4rem; }
}

.filter-row,
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin-bottom: 1.3rem;
}

.filter-button {
  min-height: 38px;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 680;
  cursor: pointer;
}

.filter-button:hover,
.filter-button:focus-visible {
  background: var(--white);
}

.filter-button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.chart-shell {
  min-height: 380px;
  padding: 1rem 0 0;
}

.chart-shell--timeline {
  min-height: 520px;
}

.chart-shell--mix {
  min-height: 300px;
  margin-top: 2rem;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart .axis-line,
.chart .grid-line {
  stroke: var(--line);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.chart text {
  fill: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.chart .tick-label {
  fill: var(--ink-soft);
  font-size: 12px;
}

.chart .axis-title {
  fill: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.chart .value-label {
  font-size: 13px;
  font-weight: 780;
}

.chart-note,
.timeline-caption {
  margin: 1.2rem 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.section--ink {
  position: relative;
  width: calc(100% + 4rem);
  margin-left: -2rem;
  padding-inline: 2rem;
  border-bottom: 0;
  border-radius: 28px;
  background: var(--night);
  color: var(--white);
}

.section--ink .section__number,
.section--ink .section__heading > p,
.section--ink .chart-note {
  color: rgba(255, 253, 247, 0.64);
}

.section--ink .kicker {
  color: #ff8b69;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255, 253, 247, 0.78);
  font-size: 0.75rem;
}

.legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--legend-color);
}

.role-chart {
  display: grid;
  gap: 1.15rem;
  margin-top: 2rem;
}

.role-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 60px;
  align-items: center;
  gap: 1rem;
}

.role-row__label {
  font-size: 0.82rem;
  font-weight: 720;
  line-height: 1.2;
}

.role-row__total {
  color: rgba(255, 253, 247, 0.58);
  font-size: 0.74rem;
  text-align: right;
}

.role-bar {
  display: flex;
  height: 32px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.role-segment {
  position: relative;
  min-width: 0;
  border-right: 1px solid rgba(16, 41, 41, 0.28);
  background: var(--segment-color);
}

.role-segment:last-child {
  border-right: 0;
}

.role-segment:focus-visible {
  z-index: 1;
  outline: 3px solid var(--white);
  outline-offset: -3px;
}

.section--spotlight {
  border-bottom: 0;
}

.core-comparison {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  align-items: stretch;
  gap: 1rem;
}

.core-card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  min-height: 330px;
  padding: 2rem;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.core-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -80px;
  bottom: -95px;
  border-radius: 50%;
  background: var(--card-color);
  opacity: 0.13;
}

.core-card__date {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.core-card h3 {
  margin-top: 0.65rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.core-card__big {
  margin-top: 2rem;
  font-size: clamp(3.25rem, 7vw, 5.8rem);
  font-weight: 820;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.core-card__description {
  flex: 1;
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: .92rem;
  line-height: 1.6;
}

.core-card__big span {
  display: block;
  max-width: 230px;
  margin-top: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 620;
  letter-spacing: 0;
  line-height: 1.35;
}

.core-card__sub {
  margin: 1.6rem 0 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.core-arrow {
  display: grid;
  place-content: center;
  text-align: center;
}

.core-arrow strong {
  color: var(--orange);
  font-size: 1.55rem;
}

.core-arrow span {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.25;
}

.core-arrow i {
  display: block;
  width: 70px;
  height: 2px;
  margin: 0.85rem auto 0;
  background: var(--orange);
}

.core-arrow i::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-top: 2px solid var(--orange);
  border-right: 2px solid var(--orange);
  transform: translateY(-3px) rotate(45deg);
}

.core-footnote {
  margin-top: 1.5rem;
  padding: 1.2rem 1.4rem;
  border-left: 4px solid var(--orange);
  background: rgba(235, 103, 68, 0.075);
}

.timeline-caption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.timeline-caption strong {
  color: var(--ink);
}

.later-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.later-card {
  min-height: 320px;
  padding: clamp(1.5rem, 3vw, 2.2rem);
  border-radius: var(--radius);
}

.later-card--speed {
  background: rgba(137, 102, 189, 0.12);
}

.later-card--physics {
  background: rgba(207, 107, 135, 0.12);
}

.later-card h3 {
  max-width: 420px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.later-card ul {
  margin: 1.5rem 0 0;
  padding-left: 1.2rem;
  color: var(--ink-soft);
}

.later-card li + li {
  margin-top: 0.6rem;
}

.influence-verdict { padding: 1.6rem 2rem; border-left: 4px solid var(--mint); background: var(--paper-deep); border-radius: 0 16px 16px 0; }
.influence-verdict h3 { margin: .4rem 0 .7rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 500; letter-spacing: -.025em; }
.influence-verdict > p:last-child { margin-bottom: 0; max-width: 880px; color: var(--ink-soft); }
.influence-subtitle { margin: 2.6rem 0 1.1rem; font-size: 1.1rem; }
.influence-label { display: block; color: var(--ink-soft); font-size: .74rem; font-weight: 750; letter-spacing: .035em; }
.influence-stages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.influence-stages article { padding: 1.4rem; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.influence-stages article { border-top: 4px solid var(--mint); }
.influence-stages h4 { font-size: 1.06rem; line-height: 1.35; margin: .6rem 0 .7rem; }
.influence-stages p { color: var(--ink-soft); font-size: .88rem; margin: 0; }
.external-influence code { overflow-wrap: anywhere; font-size: .85em; }
.external-influence .influence-verdict { margin: 2rem 0; }
.reuse-bar { display: flex; gap: 0; height: 24px; border-radius: 6px; overflow: hidden; margin-top: 1.3rem; }
[data-reuse-category="unchanged"], [data-reuse-segment="unchanged"] { --reuse-color: var(--mint); }
[data-reuse-category="light"], [data-reuse-segment="light"] { --reuse-color: #7caa96; }
[data-reuse-category="heavy"], [data-reuse-segment="heavy"] { --reuse-color: var(--orange); }
[data-reuse-category="reference"], [data-reuse-segment="reference"] { --reuse-color: var(--blue); }
[data-reuse-category="local"], [data-reuse-segment="local"] { --reuse-color: #9d79b5; }
[data-reuse-category="unclear"], [data-reuse-segment="unclear"] { --reuse-color: #92958e; }
.reuse-bar > span { background: var(--reuse-color); }
.reuse-bar > span + span { box-shadow: inset 2px 0 var(--paper); }
.reuse-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 1.1rem 0; }
.reuse-counts article { border-top: 3px solid var(--reuse-color); padding-top: .7rem; }
.reuse-count { font-family: Georgia, "Times New Roman", serif; font-size: 3rem; line-height: 1; color: var(--ink); }
.reuse-counts h4 { margin: .5rem 0; font-size: 1rem; }
.reuse-counts p { font-size: .87rem; color: var(--ink-soft); margin: 0; }
.reuse-file-count { display: block; color: var(--ink-soft); font-size: .8rem; margin: .4rem 0; }
.reuse-filters { display: flex; flex-wrap: wrap; gap: 1rem; }
.reuse-filters label { display: grid; gap: .3rem; font-size: .8rem; flex: 1; min-width: 0; }
.reuse-filters select { max-width: 100%; width: 100%; padding: .6rem; font: inherit; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 6px; }
.reuse-file-list { margin: 0; padding: 0; list-style: none; max-height: 520px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.reuse-file-list li { border-top: 1px solid var(--line); border-left: 3px solid var(--reuse-color); padding: 1rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1rem; }
.reuse-file-list code { font-size: .8rem; }
.reuse-file-list p { grid-column: 1 / -1; margin: 0; color: var(--ink-soft); font-size: .84rem; }
.reuse-file-category { font-size: .75rem; font-weight: 700; }
.influence-later { margin-top: 1.6rem; border-left: 3px solid var(--line); padding: .3rem 0 .3rem 1.2rem; }
.influence-later h4 { margin: .5rem 0; font-size: 1rem; }
.influence-later p { font-size: .9rem; color: var(--ink-soft); margin-bottom: 0; max-width: 920px; }
.influence-evidence ul { padding-left: 1.2rem; }
@media (max-width: 900px) {
  .influence-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .influence-stages, .reuse-counts { grid-template-columns: 1fr; }
  .influence-verdict { padding: 1.2rem; }
  .reuse-filters { flex-direction: column; }
  .reuse-file-list li { grid-template-columns: 1fr; }
}

.section--closing {
  margin-top: 1.5rem;
  padding-block: 7rem;
  border: 0;
}

.section--closing h2 {
  max-width: 1000px;
  font-size: clamp(2.8rem, 6.6vw, 6rem);
}

.closing-copy {
  max-width: 800px;
  margin: 2rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
}

.method {
  margin-bottom: 5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.method summary {
  padding: 1.3rem 0;
  font-weight: 740;
  cursor: pointer;
}

.method__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  padding: 0 0 1.5rem;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.method__grid p {
  margin: 0;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 3rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.tooltip {
  position: fixed;
  z-index: 50;
  max-width: 280px;
  padding: 0.65rem 0.75rem;
  border-radius: 9px;
  background: var(--night);
  color: var(--white);
  box-shadow: var(--shadow);
  font-size: 0.76rem;
  line-height: 1.35;
  pointer-events: none;
}

@media (max-width: 900px) {
  .hero__grid,
  .section__heading,
  .stage-detail {
    grid-template-columns: 1fr;
  }

  .hero__motif {
    grid-template-columns: auto 64px auto;
    justify-content: center;
    align-items: center;
    padding-top: 0;
  }

  .hero__motif span {
    width: 112px;
    min-height: 50px;
  }

  .hero__motif i {
    width: 44px;
    height: 2px;
    margin: 0 14px 0 6px;
    background: linear-gradient(90deg, var(--hero-text), var(--orange));
  }

  .hero__motif i::after {
    left: auto;
    right: 0;
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
  }

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

  .story-path {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
  }

  .core-comparison {
    grid-template-columns: 1fr;
  }

  .core-arrow {
    grid-template-columns: auto auto auto;
    align-items: center;
    gap: 0.6rem;
  }

  .core-arrow i {
    margin: 0;
  }
}

@media (max-width: 1280px) {
  .section--ink {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 650px) {
  .hero {
    padding-top: 2rem;
  }

  .hero h1 {
    font-size: clamp(3rem, 18vw, 5rem);
  }

  .hero__motif {
    display: none;
  }

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

  .hero-stat:nth-child(2) {
    border-right: 0;
  }

  .hero-stat:nth-child(n + 3) {
    margin-top: 1rem;
    border-top: 1px solid var(--line-dark);
  }

  main,
  footer {
    width: min(100% - 1.4rem, 1180px);
  }

  .section {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding-block: 4.5rem;
  }

  .section__number {
    padding: 0;
  }

  .section__heading {
    gap: 1rem;
  }

  .orientation-grid,
  .later-grid,
  .method__grid,
  .misc-related > div {
    grid-template-columns: 1fr;
  }

  .story-path {
    display: flex;
    overflow-x: auto;
    padding: 0.35rem 0 0.7rem;
    scroll-snap-type: x mandatory;
  }

  .story-step {
    flex: 0 0 140px;
    scroll-snap-align: start;
  }

  .stage-detail {
    padding: 1.2rem;
  }

  .stage-detail__metrics {
    grid-template-columns: 1fr 1fr;
  }

  .section--ink {
    width: calc(100% + 1.4rem);
    margin-left: -0.7rem;
    padding-inline: 0.7rem;
    border-radius: 18px;
  }

  .role-row {
    grid-template-columns: 1fr 48px;
    gap: 0.45rem 0.7rem;
  }

  .role-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .chart-shell {
    min-height: 320px;
  }

  .chart-shell--timeline {
    min-height: 430px;
  }

  .timeline-caption {
    display: block;
  }

  footer {
    display: block;
  }

  footer span {
    display: block;
  }
}

.port-player {
  border-radius: 20px;
  overflow: hidden;
  background: #0c221b;
  color: #eaf2e9;
  box-shadow: var(--shadow);
}
.port-viewport { overflow-x: auto; }
#port-animation { display: block; width: 100%; height: auto; min-width: 760px; }
.port-controls {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 16px 22px; border-top: 1px solid #2e483a;
  background: #112a21; font-size: 13px;
}
.port-controls button {
  padding: 9px 17px; min-width: 78px; border: 1px solid #5c7b69;
  border-radius: 7px; background: transparent; color: #eaf2e9; cursor: pointer;
}
.port-controls button:hover { background: #244535; }
.port-controls #port-play { background: #9de7ba; border-color: #9de7ba; color: #112a21; font-weight: 700; }
.port-controls label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 230px; margin: 0 12px; }
.port-controls input { flex: 1; min-width: 70px; accent-color: #9de7ba; cursor: pointer; }
.port-controls output { min-width: 35px; font-variant-numeric: tabular-nums; }
.port-controls a { margin-left: auto; color: #bfe6ce; text-underline-offset: 4px; }
.port-caption { margin: 1.2rem 0 0.5rem; font-size: 1.08rem; min-height: 3.4em; color: var(--ink); }
.port-schematic-note { font-size: 0.78rem; color: var(--ink-soft); margin: 0; }
.port-benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; margin-top: 2.5rem; }
.port-benefits article { border-top: 2px solid var(--line); padding-top: 1rem; }
.port-benefits span { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-soft); }
.port-benefits h3 { margin-top: 0.65rem; font-size: 1.2rem; }
.port-benefits p { color: var(--ink-soft); font-size: 0.94rem; }
.port-mobile-hint { display: none; }
@media (max-width: 900px) {
  .port-benefits { grid-template-columns: 1fr; gap: 1rem; }
  .port-mobile-hint { display: inline; }
}
@media (max-width: 650px) {
  .port-controls { padding: 14px; }
  .port-controls label { order: 2; flex-basis: 100%; margin: 4px 0 0; }
  .port-caption { min-height: 5em; }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #0f2222;
    --paper-deep: #152d2d;
    --ink: #f5f0e6;
    --ink-soft: #b9c4bf;
    --night: #081818;
    --night-2: #112b2b;
    --white: #183131;
    --line: rgba(245, 240, 230, 0.17);
    --line-dark: rgba(245, 240, 230, 0.2);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
  }

  .orientation-grid p {
    background: rgba(24, 49, 49, 0.9);
  }

  .story-step[aria-selected="true"] {
    background: var(--white);
  }

  .section--ink {
    background: #071717;
  }
}
