/* Set like ai-2027.com: EB Garamond on ivory, Inconsolata for figures and controls. */
:root {
  --bg: #fffff7;
  --fg: #111111;
  --muted: #5d5d55;
  --faint: #8c8c82;
  --rule: #dcdccf;
  --grid: #ebebdf;
  --line: #2d6a4f;
  --bend: #b07a12;
  --broken: #b3261e;
  --dot: #161616;
  --other: #b9b9ae;
  --ctx-1: #3d6fb6;
  --ctx-2: #7a52a3;
  --serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --mono: "Inconsolata", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--serif); font-size: 21px; line-height: 1.5; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; }
p { margin: 0 0 0.85em; }
h1, h2, h3 { font-weight: 400; line-height: 1.12; margin: 0; }

.wrap, main {
  max-width: 760px; margin: 0 auto; box-sizing: content-box;
  padding-left: max(22px, env(safe-area-inset-left, 0px)); padding-right: max(22px, env(safe-area-inset-right, 0px));
}

/* header */
.top { padding: 44px 0 18px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.top h1 { font-size: 52px; letter-spacing: -0.005em; }
.top h1 a { text-decoration: none; }
.about-wrap { position: relative; flex: none; padding-top: 12px; }
.about-btn { font: inherit; font-size: 19px; line-height: 1.3; color: inherit; background: transparent; border: 1px solid var(--fg); border-radius: 4px; padding: 2px 12px; cursor: pointer; }
.about-btn[aria-expanded="true"] { background: var(--fg); color: var(--bg); }
.about {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: min(360px, calc(100vw - 44px));
  background: var(--bg); border: 1px solid var(--fg); border-radius: 6px; padding: 16px 18px 4px; font-size: 18px; line-height: 1.45;
  box-shadow: 0 14px 30px -20px rgba(0, 0, 0, 0.45);
}
.about p { margin-bottom: 0.8em; }
.about .row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.button { display: inline-block; color: var(--fg); background: transparent; border: 1px solid var(--fg); border-radius: 4px; padding: 0 12px; text-decoration: none; }
.button:hover { background: var(--fg); color: var(--bg); }
.addr { font-family: var(--mono); font-size: 15px; color: var(--muted); user-select: all; }

/* navbar, sticky */
.navbar { position: sticky; top: 0; z-index: 30; background: var(--bg); border-top: 1px solid var(--fg); border-bottom: 1px solid var(--fg); }
.navbar .wrap { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; padding-top: 7px; padding-bottom: 7px; font-size: 18px; line-height: 1.4; }
.navbar .wrap::-webkit-scrollbar { display: none; }
.navbar a { text-decoration: none; }
.navbar a:hover, .navbar a.on { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }

/* body column */
main { padding-top: 26px; padding-bottom: 80px; }
.intro { font-size: 23px; line-height: 1.45; }
.key { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--line); vertical-align: middle; margin: 0 6px 4px 2px; }
.key.bend { border-top-color: var(--bend); }
.key.broken { border-top-color: var(--broken); }
h2 { font-size: 40px; margin: 1.9em 0 0.1em; scroll-margin-top: 70px; }
.line { scroll-margin-top: 58px; }
h3 { font-size: 27px; margin: 1.55em 0 0.3em; }
.tag { font-family: var(--mono); font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; vertical-align: 0.25em; margin-left: 8px; white-space: nowrap; }
.tag.broken { color: var(--broken); }
.tag.bend { color: var(--bend); }
.chart { position: relative; margin: 0.25em 0 0.1em; }

/* controls under each chart */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0.15em 0 0.35em; font-family: var(--mono); font-size: 14px; line-height: 1.3; color: var(--muted); }
.seg { display: inline-flex; }
.seg button { font: inherit; color: var(--fg); background: transparent; border: 1px solid var(--fg); padding: 2px 9px; margin-left: -1px; cursor: pointer; }
.seg button:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.seg button:last-child { border-radius: 0 4px 4px 0; }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.rng { display: inline-flex; align-items: center; gap: 7px; }
.rng .lab { text-transform: uppercase; letter-spacing: 0.06em; font-size: 12.5px; }
.rng input[type="range"] { width: 92px; accent-color: var(--fg); margin: 0; }
.rng output { color: var(--fg); min-width: 4.2em; }
.reset { font: inherit; color: var(--muted); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.reset:hover { color: var(--fg); }
.readout { font-family: var(--mono); font-size: 15px; line-height: 1.45; color: var(--fg); margin: 0 0 0.3em; }
.meta { font-family: var(--mono); font-size: 14px; line-height: 1.5; color: var(--muted); margin: 0 0 0.9em; }
.meta a { color: var(--muted); }
.meta .item { margin-right: 14px; white-space: nowrap; }
.dotkey { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); margin-right: 5px; vertical-align: 1px; }
.dotkey.other { background: var(--other); }
.dotkey.ctx-1 { background: var(--ctx-1); }
.dotkey.ctx-2 { background: var(--ctx-2); }

/* 2030, 2040, 2050 */
.future h3 { font-size: 32px; }

footer.end { border-top: 1px solid var(--fg); margin-top: 3.2em; padding-top: 1em; font-size: 18px; color: var(--muted); }

/* chart marks */
.gw-svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.gw-svg text { font-family: var(--mono); }
.gw-major { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.gw-minor, .gw-vert, .gw-future, .gw-band, .gw-now, .gw-nowlabel { display: none; }
.gw-axis { stroke: #b5b5a8; stroke-width: 1; shape-rendering: crispEdges; }
.gw-tick { font-size: 12.5px; fill: var(--muted); }
.gw-tick-2 { font-size: 11.5px; fill: var(--faint); }
.gw-ref { stroke: #c4c4b6; stroke-width: 1; stroke-dasharray: 2 3; }
.gw-reflabel { font-size: 12px; fill: var(--muted); }
.gw-event { stroke: #d8d8cc; stroke-width: 1; shape-rendering: crispEdges; }
.gw-eventlabel { font-size: 12px; fill: var(--muted); }
.gw-line { fill: none; stroke: var(--line); stroke-width: 2.4; stroke-linecap: round; }
.st-bending .gw-line { stroke: var(--bend); }
.st-broken .gw-line { stroke: var(--broken); }
.gw-extend { stroke-dasharray: 6 5; }
.gw-pt, .gw-pt-out, .gw-pt-after { fill: var(--dot); stroke: none; }
.gw-pt-other { fill: var(--other); stroke: none; }
.gw-ctx-1 { fill: var(--ctx-1); }
.gw-ctx-2 { fill: var(--ctx-2); }
.gw-ctxline { fill: none; stroke-width: 1.6; }
.gw-ctxline.gw-ctx-1 { stroke: var(--ctx-1); fill: none; }
.gw-ctxline.gw-ctx-2 { stroke: var(--ctx-2); fill: none; }
.gw-err { stroke: var(--dot); stroke-width: 1; opacity: 0.25; }
.gw-annot { font-size: 12px; fill: #3a3a35; }
.gw-annot-bg { fill: var(--bg); opacity: 0.85; }
.gw-enddot { fill: var(--line); stroke: none; }
.st-bending .gw-enddot, .st-bending .gw-crossdot { fill: var(--bend); }
.st-broken .gw-enddot, .st-broken .gw-crossdot { fill: var(--broken); }
.gw-endlabel { font-size: 13px; font-weight: 600; fill: #1a1a1a; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.gw-hit { fill: transparent; cursor: crosshair; }
.gw-cross { stroke: #9a9a90; stroke-width: 1; pointer-events: none; shape-rendering: crispEdges; }
.gw-crossdot { fill: var(--line); pointer-events: none; }
.gw-tip {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 5; max-width: 250px;
  background: var(--bg); border: 1px solid var(--fg); border-radius: 4px; padding: 5px 8px;
  font: 14px/1.4 var(--mono); color: #333;
}
.gw-tip-v { font-weight: 600; color: #111; }
.gw-tip-line { margin-top: 3px; color: #555; }

@media (max-width: 720px) {
  body { font-size: 19px; }
  .top { padding: 22px 0 12px; }
  .top h1 { font-size: 36px; }
  .about-wrap { padding-top: 4px; }
  .about-btn { font-size: 17px; padding: 1px 10px; }
  .navbar .wrap {
    gap: 18px; font-size: 17px; padding-right: 48px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
  }
  .intro { font-size: 20px; }
  h2 { font-size: 32px; }
  h3 { font-size: 23px; }
  .future h3 { font-size: 27px; }
  .controls { gap: 8px 14px; }
  .rng input[type="range"] { width: 78px; }
    }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
