@font-face { font-family: 'Literata'; src: url('fonts/literata-latin-ext.woff2') format('woff2'); font-weight: 300 700; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Literata'; src: url('fonts/literata-latin.woff2') format('woff2'); font-weight: 300 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plex'; src: url('fonts/IBMPlexSans-latin-ext.woff2') format('woff2'); font-weight: 400 600; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Plex'; src: url('fonts/IBMPlexSans-latin.woff2') format('woff2'); font-weight: 400 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root, [data-theme="light"] {
  --bg: #E8EEF1; --ink: #111C26; --mut: #34424F; --line: #C3CFD7;
  --out: #DCE6EC; --room: #EFE9E3; --frame: #8796A3; --chillband: rgba(29, 74, 117, 0.10);
  --cold: #1D4A75; --warm: #6E3A00; --bark: #4B2C28; --lenticel: #C9B9AE; --bud: #7A3B2E; --bud-green: #5E8A4E;
  --petal: #FFFFFF; --petal-edge: #C98A9C; --blush: #E3A0B4; --stamen: #8A5A12; --blossom: #D88AA2;
  --glass: #5E7486; --glass-fill: rgba(94, 116, 134, 0.10);
  --field: #FFFFFF; --col: 680px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0D1620; --ink: #EEF3F1; --mut: #C2CED6; --line: #2A3946;
  --out: #102031; --room: #1B1A1F; --frame: #3A4A58; --chillband: rgba(157, 198, 234, 0.10);
  --cold: #9DC6EA; --warm: #F2B55C; --bark: #B48E7F; --lenticel: #6E5248; --bud: #A8695A; --bud-green: #9CC08A;
  --petal: #FBEFF3; --petal-edge: #D9A3B3; --blush: #E3A0B4; --stamen: #F2B55C; --blossom: #E3A0B4;
  --glass: #8FB0C9; --glass-fill: rgba(157, 198, 234, 0.10);
  --field: #15222E;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 19px/1.6 'Literata', Georgia, serif; font-optical-sizing: auto; }
a { color: inherit; text-decoration-color: var(--blossom); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--cold); outline-offset: 2px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(14px, 3vw, 34px); padding-top: calc(12px + var(--browser-safe-top, env(safe-area-inset-top, 0px))); font: 500 15px/1.2 'Plex', system-ui, sans-serif; }
.topbar a { text-decoration: none; }
.topbar nav { display: flex; gap: 6px; align-items: center; }
.topbar nav a, .tbtn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; min-width: 40px; padding: 0 10px; border-radius: 20px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; cursor: pointer; }

/* the windowsill */
.hero { padding: 0 clamp(14px, 3vw, 34px); }
.hero-text { max-width: 900px; margin: 6px 0 14px; }
.kicker { font: 500 15px/1.3 'Plex', system-ui, sans-serif; color: var(--mut); margin: 0 0 8px; }
h1 { font-weight: 600; font-size: clamp(27px, 3.4vw, 46px); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 12px; text-wrap: balance; }
.sub { font-size: clamp(17px, 1.5vw, 20px); color: var(--mut); margin: 0; max-width: 760px; }
.loading h1 { opacity: 0.55; }
.stage-wrap { position: relative; border-radius: 4px; overflow: hidden; }
#stage { display: block; width: 100%; height: clamp(380px, 62vh, 640px); touch-action: pan-y; cursor: ew-resize; }
#stage .lab { font: 500 13px 'Plex', system-ui, sans-serif; fill: var(--mut); }
#stage .lab.strong, svg .lab.strong { font-weight: 600; fill: var(--ink); }
svg .lab { font: 500 13px 'Plex', system-ui, sans-serif; fill: var(--mut); }
svg .lab.cold { fill: var(--cold); }
svg .lab.warm, #stage .lab.warm { fill: var(--warm); }
.src-note { font: 400 14px/1.45 'Plex', system-ui, sans-serif; color: var(--mut); margin: 8px 0 0; max-width: 900px; }
.today { margin: 14px 0 0; padding: 10px 14px; border-left: 4px solid var(--blossom); font-size: 18px; max-width: 760px; }

.controls { display: grid; grid-template-columns: minmax(260px, 1.3fr) 1fr 1fr; gap: 18px 28px; margin: 20px 0 8px; font: 400 15px/1.35 'Plex', system-ui, sans-serif; align-items: start; }
.controls label, .controls .lbl { display: block; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.search { position: relative; }
.search-row { display: flex; gap: 8px; }
#q { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--frame); border-radius: 6px; background: var(--field); color: var(--ink); font: 400 17px 'Plex', system-ui, sans-serif; }
#geo, #back-now { min-height: 44px; padding: 0 12px; border: 1px solid var(--frame); border-radius: 6px; background: transparent; color: var(--ink); font: 500 15px 'Plex', system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
#back-now { margin-top: 10px; }
#results { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--field); border: 1px solid var(--frame); border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
#results button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 8px 10px; border: 0; background: transparent; color: var(--ink); font: 500 16px 'Plex', system-ui, sans-serif; text-align: left; cursor: pointer; border-radius: 4px; }
#results button:hover, #results button:focus-visible { background: var(--out); }
#results small { color: var(--mut); font-weight: 400; font-size: 13px; }
#results .none { padding: 8px 10px; color: var(--mut); }
.quick { margin: 8px 0 0; color: var(--mut); }
.quick a { margin-right: 10px; color: var(--ink); }
.geo-msg { color: var(--mut); margin: 4px 0 0; }
.geo-msg:empty { display: none; }
input[type=range] { width: 100%; accent-color: var(--warm); min-height: 32px; }
.ends { display: flex; justify-content: space-between; color: var(--mut); font-size: 13px; }
output { font-weight: 600; }
.place-now { font-weight: 600; }

/* prose */
main section { max-width: var(--col); margin: 0 auto; padding: 0 20px; }
main section.wide { max-width: 980px; }
h2 { font-weight: 600; font-size: clamp(25px, 2.4vw, 32px); line-height: 1.2; margin: 72px 0 14px; }
h3 { font: 600 19px/1.3 'Plex', system-ui, sans-serif; margin: 34px 0 10px; }
p { margin: 0 0 16px; }
.caveat { font-size: 17px; color: var(--mut); border-left: 3px solid var(--line); padding-left: 14px; }
.chart { display: block; width: 100%; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font: 400 14px 'Plex', system-ui, sans-serif; color: var(--mut); margin: 8px 0 18px; }
.key { display: inline-block; width: 22px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: 6px; }
.ln-old { stroke: var(--mut); stroke-dasharray: 2 5; stroke-linecap: round; } .key.ln-old { border-top: 3px dotted var(--mut); }
.ln-new { stroke: var(--cold); } .key.ln-new { border-color: var(--cold); }
.ln-now { stroke: var(--warm); } .key.ln-now { border-color: var(--warm); border-top-width: 4px; }
.yr { cursor: pointer; outline: none; }
.yr:hover line, .yr:focus-visible line { stroke: var(--warm); }
.yr.sel line { stroke: var(--warm); }
.yr:focus-visible rect:first-child { fill: var(--chillband); }
ol.steps { padding-left: 1.3em; margin: 0 0 16px; }
ol.steps li { margin-bottom: 8px; padding-left: 4px; }

.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 6px; font: 500 15px 'Plex', system-ui, sans-serif; }
.share-row .ic { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--frame); background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; }
.share-row .share-label { margin-right: 6px; }
.sources { font: 400 15px/1.5 'Plex', system-ui, sans-serif; color: var(--mut); }
.sources li { margin-bottom: 4px; }
footer { max-width: var(--col); margin: 70px auto 0; padding: 22px 20px calc(40px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); font: 400 15px 'Plex', system-ui, sans-serif; color: var(--mut); }

[hidden] { display: none !important; }
svg[hidden] { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 900px) { .controls { grid-template-columns: 1fr 1fr; } .controls .search { grid-column: 1 / -1; } }
@media (max-width: 640px) {
  body { font-size: 18px; }
  #stage { height: min(40svh, 340px); min-height: 260px; }
  .controls { grid-template-columns: 1fr; gap: 16px; }
  h2 { margin-top: 56px; }
}
@media (prefers-reduced-motion: no-preference) { .twig { transition: opacity 0.3s; } }
@media (forced-colors: active) { #stage { forced-color-adjust: none; } }

/* wide screens: text and controls on the left, the windowsill full height on the right */
.hero-text { grid-area: text; } .stage-wrap { grid-area: stage; } .controls { grid-area: ctl; } .src-note { grid-area: note; } .today { grid-area: today; }
@media (min-width: 1100px) {
  .hero { display: grid; grid-template-columns: minmax(340px, 430px) 1fr; grid-template-areas: "text stage" "today stage" "ctl stage" "note stage"; grid-template-rows: auto auto auto 1fr; column-gap: clamp(24px, 3vw, 48px); align-items: start; }
  .hero-text { margin-top: 10px; }
  h1 { font-size: clamp(30px, 2.5vw, 40px); }
  .controls { grid-template-columns: 1fr; gap: 18px; margin-top: 18px; }
  #stage { height: calc(var(--vh, 1vh) * 100 - 84px); min-height: 560px; max-height: 860px; }
  .today { margin-top: 4px; }
}

#stage .halo { paint-order: stroke; stroke: var(--room); stroke-width: 5px; stroke-linejoin: round; }
