/* The document pages (/tech, /tech/<id>, /timeline/<slug>): the tree's tokens, type and
   panel components on a page that scrolls. style.css is not loaded here because it pins
   the viewport for the canvas. */
:root {
  --bg: #05060d;
  --ink: #e9e6dc;
  --ink-2: #c0bfca;
  --ink-3: #a3a2b3;
  --line: rgba(255, 255, 255, 0.09);
  --glass: rgba(10, 11, 22, 0.86);
  --glass-2: rgba(14, 15, 28, 0.96);
  --gold: #ffcf7a;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wrap: 1140px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 18px;
  line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; }

/* The sky: a faint star field and a nebula in the page's domain color, as behind the tree. */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 82% -8%, color-mix(in srgb, var(--c) 16%, transparent), transparent 70%),
    radial-gradient(700px 460px at -10% 30%, rgba(109, 141, 255, 0.07), transparent 70%),
    var(--bg); }
.sky::before, .sky::after { content: ""; position: absolute; inset: 0; opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 23px 41px, rgba(255,255,255,.75), transparent 60%),
    radial-gradient(1px 1px at 131px 97px, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1.4px 1.4px at 211px 177px, rgba(255,244,214,.8), transparent 60%),
    radial-gradient(1px 1px at 61px 223px, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1px 1px at 289px 31px, rgba(200,210,255,.6), transparent 60%),
    radial-gradient(1.2px 1.2px at 173px 281px, rgba(255,255,255,.6), transparent 60%);
  background-size: 307px 307px; }
.sky::after { background-size: 467px 467px; transform: rotate(17deg) scale(1.4); opacity: 0.35; }

/* ---------------------------------------------------------------- header */
.site { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; max-width: var(--wrap); margin: 0 auto;
  padding: 18px 22px 8px; }
.brand { flex: 1; min-width: 0; text-decoration: none; font-family: var(--serif); font-style: italic; font-size: 34px;
  line-height: 1; letter-spacing: -0.01em; white-space: nowrap;
  background: linear-gradient(100deg, #fff4d6 10%, var(--gold) 45%, #ff8fd8 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.views { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); }
.views a { padding: 8px 15px; border-radius: 999px; color: var(--ink-2); font-size: 16px; text-decoration: none; }
.views a:hover { color: var(--ink); }
.views a.on { background: rgba(255, 255, 255, 0.09); color: var(--ink); }

/* ---------------------------------------------------------------- shared */
.page { max-width: var(--wrap); margin: 0 auto; padding: 22px 22px 40px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font: 14px var(--mono); letter-spacing: 0.04em;
  color: var(--ink-3); margin: 6px 0 26px; }
.crumbs a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--line); }
.crumbs a:hover { color: var(--gold); border-color: rgba(255, 207, 122, 0.4); }
.kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 0; font: 14px var(--mono);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--d, var(--gold));
  box-shadow: 0 0 8px var(--d, var(--gold)); }
h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 6.4vw, 76px); line-height: 0.98;
  letter-spacing: -0.01em; color: #fff; margin: 14px 0 18px; text-wrap: balance; }
.lead { font-size: 22px; line-height: 1.55; color: var(--ink); margin: 0 0 16px; max-width: 40ch; text-wrap: pretty; }
.page-head .lead { max-width: 58ch; color: var(--ink-2); font-size: 20px; }
.detail { font-size: 18px; line-height: 1.75; color: var(--ink-2); margin: 0 0 16px; max-width: 62ch; }
.badge { display: inline-block; margin: 0 8px 14px 0; padding: 3px 9px; border-radius: 999px; font: 14px var(--mono);
  letter-spacing: 0.05em; text-transform: uppercase; border: 1px solid currentColor; }
.badge.graft { color: #7dffc8; }
.badge.proj { color: #b9a8ff; }
.caveat { margin: -6px 0 16px; font-size: 16px; color: #a9f5d4; max-width: 56ch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 24px 0 0; font-size: 16px; }
.actions a:not(.open-tree) { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(255, 207, 122, 0.3); }
.actions a:not(.open-tree):hover { border-color: var(--gold); }
.open-tree { display: inline-flex; align-items: center; gap: 10px; padding: 11px 20px 11px 14px; border-radius: 999px;
  text-decoration: none; color: #1a1306; font-weight: 500;
  background: linear-gradient(100deg, #fff4d6, var(--gold) 60%, #ffb98a);
  box-shadow: 0 0 0 1px rgba(255, 207, 122, 0.5), 0 10px 40px rgba(255, 207, 122, 0.18); transition: transform 0.2s, box-shadow 0.2s; }
.open-tree:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--gold), 0 14px 46px rgba(255, 207, 122, 0.3); }
.block { margin: 46px 0 0; }
.block > h2, .site-foot h2 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.1; margin: 0 0 18px;
  color: #fff; display: flex; align-items: baseline; gap: 12px; }
.block > h2 .dot { align-self: center; }
.n { font: 15px var(--mono); color: var(--ink-3); letter-spacing: 0.04em; }
.yr { font: 14px var(--mono); color: var(--ink-3); white-space: nowrap; }
.flag { font: 13px var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: #7dffc8; margin-left: 6px; }

/* ---------------------------------------------------------------- a technology */
.tech-top { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 54px; align-items: start; }
.tech-main { padding-top: 8px; }
.tech-side { display: grid; gap: 14px; }
.photo { position: relative; margin: 0; border-radius: 16px; overflow: hidden; background: #0b0c16; border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 60px color-mix(in srgb, var(--c) 10%, transparent); }
.photo img { display: block; width: 100%; height: auto; max-height: 440px; object-fit: cover; }
.photo.flat { background: #eceae2; }
.photo.flat img { object-fit: contain; padding: 18px 22px; max-height: 360px; }
.photo figcaption { position: absolute; right: 8px; bottom: 7px; max-width: calc(100% - 16px); font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo figcaption a { color: rgba(255, 255, 255, 0.78); text-decoration: none; background: rgba(0, 0, 0, 0.55); padding: 2px 8px; border-radius: 999px; }
.photo.flat figcaption a { color: #444; background: rgba(255, 255, 255, 0.75); }
.photo.og { display: block; aspect-ratio: 1.91; text-decoration: none; }
.photo.og img { height: 100%; object-fit: cover; }
.photo.og span { position: absolute; right: 8px; bottom: 7px; font-size: 14px; color: #fff; background: rgba(0, 0, 0, 0.6); padding: 2px 9px; border-radius: 999px; }
.facts { margin: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.facts div { background: rgba(8, 9, 18, 0.88); padding: 11px 16px; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.facts dt { font: 13px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.facts dd { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.facts a { color: var(--gold); text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; }
.stats div { background: rgba(8, 9, 18, 0.88); padding: 12px 14px; }
.stats b { display: block; font: 500 22px var(--mono); color: #fff; }
.stats span { display: block; font-size: 14px; line-height: 1.35; color: var(--ink-3); margin-top: 2px; }

/* The strip: the tree's log time axis, with arcs back to what it stood on and on to what it led to. */
.strip { margin: 48px 0 0; padding: 18px 20px 14px; border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(180deg, rgba(10, 11, 22, 0.7), rgba(5, 6, 13, 0.6)); }
.strip-plot { position: relative; height: 150px; }
.strip-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.strip-plot path { fill: none; stroke-width: 1.3; stroke-opacity: 0.55; }
.strip-plot .axis { stroke: rgba(255, 207, 122, 0.35); stroke-width: 1.5; }
.sd { position: absolute; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%;
  background: var(--d); box-shadow: 0 0 6px var(--d); }
.sd.me { width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; background: #fff8e6;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 70%, transparent), 0 0 24px var(--c), 0 0 48px var(--c); }
.strip-ticks { position: relative; height: 22px; margin-top: 6px; border-top: 1px solid var(--line); }
.tick { position: absolute; top: 5px; transform: translateX(-50%); font: 13px var(--mono); color: var(--ink-3); white-space: nowrap; }
.tick.l { transform: none; }
.tick.r { transform: translateX(-100%); }
.tick.now { color: var(--gold); }
.strip-whole { position: relative; height: 34px; margin-top: 14px; }
.strip-whole::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 207, 122, 0.55)); }
.w-win { position: absolute; top: 2px; height: 10px; margin-left: -1px; border-radius: 3px; border: 1px solid var(--gold);
  background: rgba(255, 207, 122, 0.16); box-sizing: content-box; padding: 0 1px; }
.w-me { position: absolute; top: 3px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #fff8e6;
  box-shadow: 0 0 10px var(--c); }
.w-l, .w-r { position: absolute; top: 16px; font: 12px var(--mono); color: var(--ink-3); white-space: nowrap; }
.w-l { left: 0; }
.w-r { transform: translateX(-100%); }
.strip figcaption { margin-top: 10px; font-size: 14px; color: var(--ink-3); }

.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 999px; font-size: 16px; line-height: 1.4;
  background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  transition: background 0.15s, border-color 0.15s; }
.chip:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.2); }
.chip .dot { width: 7px; height: 7px; box-shadow: none; }

.vids { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.vid { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; text-decoration: none;
  background: #000 center / cover no-repeat; border: 1px solid var(--line); }
.vid::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.05) 60%); }
.vid.on::before { display: none; }
.vid iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vid-play { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.92); color: #05060d; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); transition: transform 0.2s; }
.vid:hover .vid-play { transform: translate(-50%, -50%) scale(1.08); }
.vid-meta { position: absolute; left: 14px; right: 14px; bottom: 10px; font-size: 16px; line-height: 1.3; }
.vid-meta b { display: block; font-weight: 500; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vid-meta span { color: rgba(255, 255, 255, 0.68); font-size: 14px; }

.note { margin: -8px 0 18px; font-size: 15px; color: var(--ink-3); }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.chart-slot { min-width: 0; background: rgba(10, 11, 22, 0.8); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.chart-fallback { margin: 0; display: grid; gap: 6px; }
.chart-fallback b { font-weight: 400; font-size: 20px; color: var(--ink); }
.chart-fallback .v { font: 15px var(--mono); color: var(--gold); }
.chart-fallback .src { font-size: 14px; color: var(--ink-3); }
.chart { margin: 0; }
.chart-title { display: flex; flex-direction: column; gap: 8px; font-size: 20px; line-height: 1.4; color: var(--ink); margin-bottom: 14px; }
.chart-title .v { font: 15px var(--mono); color: var(--gold); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-key { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.chart-key i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.chart-src, .chart-estimate { font-size: 14px; line-height: 1.6; color: var(--ink-3); margin-top: 8px; overflow-wrap: anywhere; }
.chart-src a, .chart-fallback a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--line); }

.near { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 56px 0 0; }
.near a { display: grid; gap: 4px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none;
  background: rgba(10, 11, 22, 0.7); transition: border-color 0.2s, transform 0.2s; }
.near a:hover { border-color: color-mix(in srgb, var(--c) 50%, transparent); transform: translateY(-1px); }
.near .next { grid-column: 2; text-align: right; }
.near .k { font: 13px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.near b { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.15; color: #fff; }

/* ---------------------------------------------------------------- the index */
.page-head { margin: 10px 0 34px; }
.page-head h1 { margin-top: 12px; }
.cats { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.cats a { display: grid; gap: 3px; height: 100%; padding: 18px 18px 20px; text-decoration: none; background: rgba(8, 9, 18, 0.9);
  border-top: 2px solid var(--d); transition: background 0.2s; }
.cats a:hover { background: color-mix(in srgb, var(--d) 9%, rgba(8, 9, 18, 0.9)); }
.cats .g { font: 12px var(--mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); }
.cats b { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.1; color: #fff; margin: 4px 0 2px; }
.cats .c { font: 14px var(--mono); color: var(--d); }
.cats .s { font-size: 14px; line-height: 1.4; color: var(--ink-3); }
.domain h2 a { text-decoration: none; }
.domain h2 a:hover { color: var(--d); }
.domain h3 { font: 14px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: #b9a8ff; margin: 22px 0 10px; }
.index-list { list-style: none; padding: 0; margin: 0; columns: 3 250px; column-gap: 34px; }
.index-list li { break-inside: avoid; display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.045); font-size: 16px; line-height: 1.4; }
.index-list a { text-decoration: none; color: var(--ink); }
.index-list a:hover { color: var(--d, var(--gold)); }

/* ---------------------------------------------------------------- a timeline */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 30px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 8px var(--c); }
.timeline a { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; padding: 20px 0 20px 26px; text-decoration: none;
  border-bottom: 1px solid var(--line); transition: background 0.15s; }
.timeline a:hover { background: rgba(255, 255, 255, 0.03); }
.timeline .when { font: 14px var(--mono); color: var(--ink-2); padding-top: 4px; }
.timeline .what b { display: block; font-weight: 500; font-size: 21px; line-height: 1.35; color: var(--ink); margin-bottom: 4px; }
.timeline a:hover .what b { color: #fff; }
.timeline .what span { color: var(--ink-2); font-size: 17px; line-height: 1.6; }
.others ul, .site-foot ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.others a, .site-foot li a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px; font-size: 16px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); text-decoration: none; color: var(--ink-2); }
.others a:hover, .site-foot li a:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.2); }
.others .dot, .site-foot .dot { width: 7px; height: 7px; box-shadow: none; }

/* ---------------------------------------------------------------- footer */
.site-foot { max-width: var(--wrap); margin: 30px auto 0; padding: 30px 22px calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); color: var(--ink-3); font-size: 16px; }
.site-foot h2 { font-size: 24px; }
.site-foot p { max-width: 70ch; line-height: 1.7; margin: 22px 0 0; }
.site-foot p a { color: var(--ink-2); }
.site-foot .fine { font-size: 14px; margin-top: 10px; }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 980px) {
  .tech-top { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .tech-side { grid-template-columns: minmax(0, 1fr); }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts, .vids { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  body { font-size: 17px; }
  .site { padding: 14px 16px 4px; gap: 12px; }
  .brand { font-size: 30px; flex-basis: 100%; }
  .views { width: 100%; justify-content: space-between; }
  .views a { padding: 8px 9px; font-size: 15px; }
  .page { padding: 16px 16px 30px; }
  .crumbs { margin-bottom: 18px; }
  .lead { font-size: 20px; }
  .facts div { grid-template-columns: 78px minmax(0, 1fr); padding: 10px 14px; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stats div { display: flex; align-items: baseline; gap: 14px; }
  .strip { padding: 14px 12px 12px; }
  .strip-plot { height: 120px; }
  .tick.minor { display: none; }
  .block > h2 { font-size: 28px; }
  .chip { font-size: 15px; padding: 8px 12px; }
  .chart-slot { padding: 18px 16px; }
  .near { grid-template-columns: minmax(0, 1fr); }
  .near .next { grid-column: 1; }
  .cats { grid-template-columns: minmax(0, 1fr); }
  .cats a { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; }
  .cats .g, .cats .s { grid-column: 1 / -1; }
  .cats b { margin: 0; }
  .index-list { columns: 1; }
  .index-list li { padding: 4px 0; }
  .timeline a { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 16px 0 16px 20px; }
  .timeline li::before { top: 22px; }
  .timeline .what b { font-size: 19px; }
  .timeline .what span { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
