:root {
  --paper: #fff;
  --ink: #121212;
  --muted: #575757;
  --line: #dedede;
  --green: #252525;
  --gutter: clamp(20px, 4vw, 72px);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
a { color: inherit; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.skip { position: absolute; left: -100vw; }
.skip:focus { left: 12px; top: 12px; z-index: 10; padding: 10px; background: white; }
.mast, main, footer { width: min(calc(100% - 2 * var(--gutter)), 1440px); margin-inline: auto; }
.mast { height: 76px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.mast a, .hero-links a, .rail a { text-decoration: none; }
.brand { justify-self: start; font-size: 25px; font-weight: 600; letter-spacing: -.065em; line-height: 1; }
.primary-nav, .lang { display: flex; align-items: center; font-size: 14px; font-weight: 500; }
.primary-nav { gap: 28px; }
.mast-links { justify-self: end; display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); }
.repo-link { display: inline-flex; align-items: center; gap: 3px; min-height: 44px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.lang { gap: 3px; }
.lang > * { padding: 5px 9px; border-radius: 50px; }
.lang [aria-current] { background: #f0f0f0; }
.mast a:hover, .hero-links a + a:hover, .rail a:hover { text-decoration: underline; }
.hero { text-align: center; }
.intro { max-width: 900px; margin: auto; padding: clamp(45px, 6vw, 100px) 0 clamp(38px, 4vw, 70px); }
.meta { display: flex; justify-content: center; align-items: baseline; gap: 16px; margin: 0 0 20px; font-size: 14px; font-weight: 500; }
.meta time { color: var(--muted); }
h1, h2, h3 { margin: 0; letter-spacing: -.045em; line-height: 1.08; font-weight: 500; }
h1 { max-width: 23ch; margin-inline: auto; font-size: clamp(42px, 5.5vw, 80px); line-height: 1.015; text-wrap: balance; }
.keep-word { white-space: nowrap; }
.lead { max-width: 62ch; margin: 22px auto 0; font-size: clamp(17px, 1.35vw, 21px); line-height: 1.47; text-wrap: pretty; }
.hero-links { display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: 26px; font-size: 15px; font-weight: 500; }
.hero-links a:first-child { background: var(--ink); color: white; border-radius: 100px; padding: 11px 18px; }
.hero-links a:first-child:hover { background: #353535; }
.hero-links span { display: inline-block; margin-left: 3px; }
.hero + .explorer:not(:fullscreen, .ex-expanded) { padding-top: 0; }
.hero-image { margin: clamp(28px, 4vw, 60px) auto 0; max-width: 1200px; }
.hero-image a { display: block; background: #c6c6c6; overflow: hidden; }
.hero-image img { display: block; width: 100%; height: clamp(310px, 44vw, 610px); object-fit: contain; }
figcaption { color: var(--muted); font-size: 14px; line-height: 1.45; margin-top: 10px; }
.hero-image figcaption { text-align: left; }
.article-layout { margin: clamp(52px, 7vw, 108px) auto; max-width: 1280px; display: grid; grid-template-columns: minmax(150px,1fr) minmax(0,680px) minmax(0,1fr); gap: clamp(20px,3vw,48px); }
.rail { position: sticky; top: 32px; max-width: 205px; }
.contents-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 42px; padding: 0 6px 0 0; color: var(--ink);
  font-size: 15px; font-weight: 550; letter-spacing: -.015em; cursor: pointer; list-style: none;
}
.contents-toggle::-webkit-details-marker { display: none; }
.contents-toggle::after {
  content: ""; width: 7px; height: 7px; flex: 0 0 auto;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px,-1px); color: var(--muted);
}
.rail[open] > .contents-toggle::after { transform: rotate(225deg) translate(-1px,-1px); }
.rail[open] nav { margin-top: 6px; }
.rail nav { display: grid; gap: 2px; }
.rail a { display: block; color: var(--muted); font-size: 14px; padding: 4px 0; }
.rail a[aria-current] { color: var(--ink); font-weight: 600; }
article, aside { min-width: 0; }
article section { margin: 0 0 clamp(50px,5vw,76px); scroll-margin-top: 30px; }
article section:last-child { margin: 0; }
h2 { font-size: clamp(30px,3vw,44px); }
article h2 { margin: 0 0 22px; }
article p { font-size: 18px; line-height: 1.62; margin: 0 0 17px; }
article figure { margin: 28px 0; }
article figure img { display: block; width: 100%; height: auto; }
article img[src$="station.webp"] { width: auto; max-width: 100%; max-height: 500px; margin-inline: auto; }
.refs { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 22px; font-size: 15px; }
.refs a { text-decoration-color: #999; }
.refs a:hover { text-decoration-color: currentColor; }
.scroll { overflow-x: auto; margin: 22px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 7px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child { text-align: left; }
tbody tr:last-child { font-weight: 600; }
article details { border-top: 1px solid var(--line); }
article details:last-child { border-bottom: 1px solid var(--line); }
article summary { cursor: pointer; padding: 16px 0; font-weight: 550; }
.prompt-language {
  margin: 0 0 14px;
  padding: 5px 12px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.prompt-language:hover { background: #f5f5f5; border-color: var(--muted); }
.verbatim { font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; padding-bottom: 20px; }
footer { display: flex; justify-content: space-between; padding-block: 26px; font-size: 14px; }
@media (max-width: 980px) {
  .article-layout { grid-template-columns: minmax(150px,.35fr) minmax(0,680px); }
}
@media (max-width: 720px) {
  .mast { height: 58px; grid-template-columns: 1fr auto; }
  .primary-nav { display: none; }
  .brand { font-size: 22px; }
  .intro { padding: 46px 0 36px; }
  .hero-image img { height: auto; }
  .meta { margin-bottom: 16px; }
  .hero-links { gap: 17px; font-size: 14px; }
  .article-layout { display: block; margin-block: 36px 56px; }
  .rail { position: static; max-width: none; border-block: 1px solid var(--line); }
  .rail nav { padding: 8px 0; }
  article p { font-size: 17px; }
}

/* Keep section navigation and file links legible across reading widths. */
.rail a { border-left: 2px solid var(--line); padding-left: 12px; }
.rail a[aria-current] { border-color: var(--ink); }
.scroll:focus-visible, .reader-table:focus-visible { outline-offset: 2px; }
.scroll th[scope="row"] { position: sticky; left: 0; background: var(--paper); }
.file-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.file-links a, .doc-index li a { display: flex; align-items: center; min-height: 46px; padding: 9px 2px; text-decoration: none; line-height: 1.4; }
.file-links a { border-top: 1px solid var(--line); }
.file-links a:first-child { grid-column: 1 / -1; font-weight: 600; }
.file-links a:hover, .doc-index li a:hover { text-decoration: underline; }
.doc-index { margin-top: 24px; }
.doc-index ul { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.doc-index li a { font-size: 15px; }
footer { border-top: 1px solid var(--line); }
@media (max-width: 720px) {
  .lang > * { min-width: 38px; padding-block: 9px; text-align: center; }
  .article-layout > aside { position: sticky; top: 0; z-index: 2; background: var(--paper); }
  .rail { margin-bottom: 25px; padding-block: 4px; }
  .rail nav { max-height: 48dvh; overflow-y: auto; }
  .contents-toggle { min-height: 44px; }
  .rail[open] nav { margin-top: 0; }
  article section { scroll-margin-top: 68px; }
  .file-links, .doc-index ul { grid-template-columns: 1fr; }
  .hero-links { flex-wrap: wrap; row-gap: 10px; }
}
@media (max-width: 420px) {
  .intro { padding-block: 34px 32px; }
  .explorer .ex-header h2 { font-size: 30px; }
}

/* Document reader */
html:has(.doc-reader[open]) { overflow: hidden; }
.doc-reader { width: min(1020px, calc(100vw - 64px)); height: min(90dvh, 1060px); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: var(--paper); }
.doc-reader[open] { display: grid; grid-template-rows: auto minmax(0,1fr); }
.doc-reader::backdrop { background: rgb(15 15 15 / 46%); }
.reader-bar { display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); padding: 11px 22px; }
.reader-bar strong { margin-right: auto; font-weight: 550; }
.reader-download, .reader-language { font-size: 14px; }
.reader-language { text-underline-offset: 3px; }
@media(max-width: 380px) {
  .doc-reader .reader-bar { gap: 8px; padding-inline: 10px; }
  .reader-bar strong { font-size: 14px; }
  .reader-bar .reader-close { padding-inline: 10px; }
}
.reader-close { border: 0; border-radius: 999px; background: #f1f1f1; padding: 10px 15px; font: inherit; font-size: 14px; cursor: pointer; color: inherit; white-space: nowrap; }
.reader-close span { margin-left: 5px; }
.reader-close:hover { background: #e4e4e4; }
.reader-scroll { overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.reader-scroll:focus-visible { outline-offset: -3px; }
.reader-body { margin: 0 auto; max-width: 80ch; padding: clamp(24px,5vw,65px) 28px 80px; font-size: 17px; line-height: 1.65; overflow-wrap: anywhere; }
.reader-body > :first-child { margin-top: 0; }
.reader-body h1 { margin: 0 0 24px; max-width: none; font-size: clamp(29px,4vw,45px); text-align: left; line-height: 1.12; text-wrap: pretty; }
.reader-body h2 { font-size: clamp(24px,3vw,32px); margin: 42px 0 16px; }
.reader-body h3 { font-size: 22px; margin: 26px 0 12px; }
.reader-body p, .reader-body ul, .reader-body ol { margin: 0 0 16px; }
.reader-body ul, .reader-body ol { padding-left: 1.4em; }
.reader-body blockquote { margin-inline: 0; border-left: 2px solid var(--line); padding-left: 18px; }
.reader-body img { max-width: 100%; }
.reader-body code { background: #f2f2f2; border-radius: 3px; padding: .1em .25em; font-size: .88em; }
.reader-body pre { overflow: auto; background: #f5f5f5; padding: 15px; border-radius: 6px; }
.reader-body pre code { padding: 0; background: transparent; }
.reader-table { overflow: auto; margin: 20px 0 28px; }
.reader-table table { width: 100%; overflow-wrap: normal; font-size: 14px; line-height: 1.45; }
.reader-table :is(th,td) { text-align: left; white-space: normal; vertical-align: top; padding: 9px 10px; }
.reader-table table:has(th:nth-child(5)) { min-width: 640px; }
.reader-table td :is(code,a) { overflow-wrap: anywhere; }
.reader-table thead { background: #f6f6f6; }
.table-hint { margin: 6px 0 14px; color: var(--muted); font-size: 13px; }
.table-hint:not([hidden]) + :is(.reader-table, .scroll) { margin-top: 0; }
.reader-table tbody tr:last-child { font-weight: inherit; }
@media (max-width: 720px) {
  .doc-reader { width: 100%; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .reader-bar { gap: 12px; padding: max(10px,env(safe-area-inset-top)) 16px 10px; }
  .reader-body { padding: 30px 20px max(40px,env(safe-area-inset-bottom)); }
  .reader-scroll { scrollbar-gutter: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .reader-body a, .hero-links a, .rail a, .contents-toggle::after { transition: color .14s, background-color .14s, transform .14s; }
  .doc-reader[open] { animation: reader-in .16s ease-out; }
  @keyframes reader-in { from { opacity: .5; transform: translateY(4px); } }
}

/* The ruler stays fixed across prompts: 40 minutes or 200 USD. */
.chart-peaks { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 26px 0 30px; }
.chart-peaks > div { display: grid; align-content: start; gap: 7px; border-top: 1px solid var(--ink); padding-top: 12px; }
.chart-peaks span, .chart-scale, .chart-note small { color: var(--muted); font-size: 13px; }
.chart-peaks strong { font-size: clamp(24px, 3vw, 38px); line-height: 1.1; font-weight: 500; letter-spacing: -.045em; }
.chart-peaks a { font-size: 14px; line-height: 1.4; text-decoration-color: #aaa; }
.phase-chart { --bar: #26685d; }
.phase-chart:has(input[value="cost"]:checked) { --bar: #485b8b; }
.chart-controls { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.chart-switch { border: 0; margin: 0; padding: 0; }
.chart-switch legend { margin-bottom: 6px; padding: 0; color: var(--muted); font-size: 13px; }
.chart-switch label { display: inline-block; position: relative; cursor: pointer; }
.chart-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.chart-switch label span { display: block; padding: 7px 13px; border-radius: 30px; border: 1px solid var(--line); font-size: 14px; line-height: 20px; }
.chart-switch input:checked + span { background: var(--ink); color: white; border-color: var(--ink); }
.chart-switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.chart-controls .chart-scale { margin: 0 0 7px; font-size: 13px; }
.cost-scale, .phase-chart:has(input[value="cost"]:checked) .time-scale { display: none; }
.phase-chart:has(input[value="cost"]:checked) .cost-scale { display: inline; }
.chart-group { margin: 24px 0 28px; }
.chart-group h3 { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 4px 15px; font-size: 21px; padding: 0 0 12px; border-bottom: 1px solid var(--ink); }
.chart-group h3 small { color: var(--muted); font-size: 13px; letter-spacing: normal; font-weight: 400; font-variant-numeric: tabular-nums; }
.chart-group .chart-phase { border: 0; border-bottom: 1px solid var(--line); scroll-margin-top: 75px; }
.chart-phase summary { display: grid; grid-template-columns: minmax(0,1fr) auto 12px; align-items: baseline; gap: 7px 12px; padding: 12px 0; list-style: none; font-size: 15px; line-height: 1.4; font-weight: 500; }
.chart-phase summary::-webkit-details-marker { display: none; }
.chart-phase summary::after { content: ""; width: 6px; height: 6px; justify-self: center; grid-column: 3; grid-row: 1; border: solid var(--muted); border-width: 0 1px 1px 0; transform: translateY(-2px) rotate(45deg); }
.chart-phase[open] summary::after { transform: rotate(225deg); }
.chart-phase summary:hover .chart-label { text-decoration: underline; text-underline-offset: 3px; }
.chart-values { display: flex; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-values span:first-child, .phase-chart:has(input[value="cost"]:checked) .chart-values span:last-child { color: var(--ink); font-weight: 550; }
.phase-chart:has(input[value="cost"]:checked) .chart-values span:first-child { color: var(--muted); font-weight: 400; }
.chart-track { grid-column: 1/-1; height: 6px; width: 100%; overflow: hidden; border-radius: 2px; background: repeating-linear-gradient(to right,#ebece9 0, #ebece9 calc(25% - 1px), #c2c7c2 calc(25% - 1px), #c2c7c2 25%); }
.chart-track::before { content: ""; display: block; height: 100%; width: var(--time-width); background: var(--bar); }
.phase-chart:has(input[value="cost"]:checked) .chart-track::before { width: var(--cost-width); }
.chart-note { padding-bottom: 12px; }
.chart-note p, article .chart-method { margin: 5px 0 0; font-size: 15px; line-height: 1.55; }
@media (prefers-reduced-motion: no-preference) {
  .chart-track::before { transition: width .18s ease-out, background-color .18s; }
}
@media (max-width: 620px) {
  .chart-peaks { gap: 14px; margin-block: 20px 24px; }
  .chart-peaks strong { font-size: clamp(22px,5.5vw,28px); }
  .chart-phase summary { grid-template-columns: minmax(0,1fr) 16px; gap: 4px 10px; }
  .chart-phase summary::after { grid-column: 2; }
  .chart-values { grid-column: 1/-1; gap: 14px; }
  .chart-track { margin-top: 3px; }
  .chart-group h3 small { flex-basis: 100%; }
}
