/* Wandering Compass — the front page's paper (Day edition) and ink (Night edition). Fonts are self-hosted Go fonts. */

@font-face { font-family: Go; src: url(../fonts/Go-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Go; src: url(../fonts/Go-Italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Go Smallcaps"; src: url(../fonts/Go-Smallcaps.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Go Mono"; src: url(../fonts/Go-Mono.woff2) format("woff2"); font-display: swap; }

:root {
  --paper: #efe9dc; --paper-2: #e6dfcd; --ink: #1b1a17; --ink-2: #47433b; --muted: #736c5e;
  --rule: rgba(27, 26, 23, .82); --hair: rgba(27, 26, 23, .16); --accent: #b5361d; --sun: #e0d2ad;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", Georgia, serif;
  --sans: Go, "Segoe UI", system-ui, sans-serif;
  --caps: "Go Smallcaps", Go, system-ui, sans-serif;
  --mono: "Go Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --gutter: clamp(16px, 3.4vw, 44px);
  color-scheme: light;
}
:root[data-edition="night"] {
  --paper: #111214; --paper-2: #18191c; --ink: #e9e2d2; --ink-2: #c3bba9; --muted: #8d8778;
  --rule: rgba(233, 226, 210, .7); --hair: rgba(233, 226, 210, .13); --accent: #ff7a57; --sun: #2c2820; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--paper); }
.wrap { max-width: 1360px; margin-inline: auto; padding: 0 max(var(--gutter), env(safe-area-inset-right)) env(safe-area-inset-bottom) max(var(--gutter), env(safe-area-inset-left)); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.smallcaps, .label { font-family: var(--caps); font-weight: 400; letter-spacing: .08em; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--ink); color: var(--paper); padding: 8px 14px; }
.skip:focus { left: 8px; }
.small { font-size: 13px; color: var(--muted); }

/* ---------- Masthead, as on the front page ---------- */
.masthead { padding-top: clamp(14px, 2vw, 22px); }
.folio {
  display: flex; align-items: center; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap;
  font-family: var(--caps); font-size: 13px; letter-spacing: .08em; color: var(--ink-2);
  border-bottom: 1px solid var(--rule); padding: 0 0 9px 64px; min-height: 44px;
}
.folio__now { font-size: 12.5px; letter-spacing: 0; color: var(--ink); }
.edition { display: flex; align-items: center; gap: 6px; }
.edition span { opacity: .5; }
.edition button { background: none; border: 0; padding: 8px 2px; font: inherit; letter-spacing: inherit; color: var(--muted); }
.edition button[aria-pressed="true"] { color: var(--ink); }
.edition button:hover { color: var(--accent); }
.wordmark { margin: clamp(10px, 1.6vw, 18px) 0 0; text-align: center; font: 400 clamp(44px, 7.6vw, 108px)/.95 var(--serif); letter-spacing: -.025em; padding-bottom: .06em; }
.wordmark__in { font-style: italic; font-size: .5em; margin-left: .04em; letter-spacing: 0; color: var(--accent); }
.dek {
  display: flex; justify-content: space-between; gap: 4px 24px; flex-wrap: wrap; margin-top: clamp(10px, 1.4vw, 16px); padding: 8px 0 7px;
  border-top: 3px double var(--rule); border-bottom: 1px solid var(--rule);
  font-family: var(--caps); font-size: 13px; letter-spacing: .07em; color: var(--ink-2);
}
.dek p { margin: 0; }

/* ---------- Stage: the globe and the readout ---------- */
.stage { display: flex; flex-wrap: wrap; gap: 28px 56px; padding: clamp(22px, 3vw, 40px) 0 clamp(40px, 5vw, 64px); align-items: flex-start; }
.globe { margin: 0; flex: 5 1 360px; min-width: 0; }
.globe svg { display: block; width: 100%; max-width: 620px; margin: 0 auto; aspect-ratio: 1; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.globe svg.is-dragging { cursor: grabbing; }
.globe figcaption { margin-top: 8px; text-align: center; font-size: 13px; color: var(--ink-2); font-style: italic; }
.controls { flex: 7 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.label { font-size: 13px; color: var(--accent); margin: 0; }
.hint { font-size: 13px; color: var(--muted); }
.place { display: flex; gap: 10px; flex-wrap: wrap; }
.combo { position: relative; flex: 1 1 240px; min-width: 0; }
.combo input {
  width: 100%; min-height: 46px; padding: 8px 4px; font: 400 21px/1.2 var(--serif); background: transparent; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0;
}
.combo input::placeholder { color: var(--muted); }
.combo ul {
  position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px 0; list-style: none;
  background: var(--paper); border: 1px solid var(--rule); box-shadow: 0 16px 32px -16px rgba(0, 0, 0, .45); max-height: 320px; overflow-y: auto;
}
.combo li { padding: 9px 12px; cursor: pointer; font-size: 15px; }
.combo li small { color: var(--muted); margin-left: 6px; }
.combo li[aria-selected="true"], .combo li:hover { background: var(--paper-2); color: var(--accent); }
.btn { min-height: 46px; padding: 0 16px; background: transparent; border: 1px solid var(--rule); font-family: var(--caps); letter-spacing: .07em; font-size: 14px; }
.btn:hover { color: var(--accent); border-color: var(--accent); }
.btn[disabled] { opacity: .55; cursor: progress; }
.jumps { display: flex; gap: 4px 16px; flex-wrap: wrap; }
.link { background: none; border: 0; padding: 6px 0; font-family: var(--caps); font-size: 13px; letter-spacing: .06em; color: var(--ink-2); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.link:hover { color: var(--accent); }
.date { font: italic 400 24px/1.2 var(--serif); }
input[type=range] { width: 100%; margin: 4px 0 0; height: 30px; accent-color: var(--accent); background: transparent; }
.ruler { position: relative; height: 20px; border-top: 1px solid var(--rule); }
.ruler span { position: absolute; top: 3px; transform: translateX(-50%); font-family: var(--caps); font-size: 11.5px; letter-spacing: .06em; color: var(--muted); }
.ruler i { position: absolute; top: 0; height: 6px; border-left: 1px solid var(--rule); }

.readout { border: 1px solid var(--hair); outline: 1px solid var(--hair); outline-offset: -5px; padding: 20px 22px 18px; }
.readout__head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 20px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); padding-bottom: 10px; }
.readout__head .label { color: var(--ink-2); }
.readout__big { font: 400 clamp(40px, 4.4vw, 58px)/1 var(--serif); letter-spacing: -.02em; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; margin: 14px 0 0; }
.facts div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.facts dt { font-family: var(--caps); font-size: 12px; letter-spacing: .07em; color: var(--muted); }
.facts dd { margin: 0; font-family: var(--mono); font-size: 17px; font-variant-numeric: tabular-nums; }
.readout__note { margin: 14px 0 0; font-size: 14px; color: var(--ink-2); }

/* ---------- Plates ---------- */
.plate { padding-bottom: clamp(40px, 5vw, 60px); }
.chapter__h {
  display: flex; align-items: baseline; gap: 12px; margin: 0 0 18px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
  font: italic 400 clamp(24px, 2.4vw, 32px)/1.1 var(--serif); letter-spacing: -.01em;
}
.chapter__n { font: 400 .62em/1 var(--caps); font-style: normal; letter-spacing: .1em; color: var(--accent); }
.plate__body { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: flex-start; }
.plate__text { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; color: var(--ink-2); }
.plate__text p { margin: 0; }

.chart { position: relative; min-width: 0; }
.chart--year { flex: 999 1 600px; padding: 0 70px 24px 38px; }
.chart--world { padding: 0 0 24px 46px; }
.chart__box { position: relative; aspect-ratio: 1000 / 380; cursor: crosshair; touch-action: manipulation; }
.chart__box svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart__box .tick, .chart__box .lab, .ana__box .tick, .ana__box .lab { position: absolute; white-space: nowrap; pointer-events: none; }
.tick { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.tick--y { right: 100%; transform: translateY(-50%); padding-right: 8px; }
.tick--x { top: 100%; transform: translateX(-50%); padding-top: 4px; font-family: var(--caps); letter-spacing: .06em; }
.lab { left: 100%; transform: translateY(-50%); padding-left: 8px; font-size: 12.5px; font-style: italic; color: var(--ink-2); }
.lab--accent { color: var(--accent); font-style: normal; }
.lab--contour { transform: translate(-50%, -50%); padding: 0 3px; background: var(--paper); font: 11px var(--mono); color: var(--ink-2); left: auto; }
.dot { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: var(--accent); border: 2px solid var(--paper); pointer-events: none; }
.s-ink { stroke: var(--ink); }
.s-rule { stroke: var(--rule); }
.s-accent { stroke: var(--accent); }
.f-paper2 { fill: var(--paper-2); }
.f-paper { fill: var(--paper); }
.f-sun { fill: var(--sun); }
.f-ink { fill: var(--ink); }
.f-accent { fill: var(--accent); }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.dot--big { width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; }
.f-hatch { fill: url(#hatch); }
.hatch-line { stroke: var(--ink); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 0 6px; padding: 0; list-style: none; font-size: 13.5px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 8px; }
.key-hatch { fill: url(#hatch); stroke: var(--rule); }
.key { display: inline-block; width: 28px; flex: none; }
.legend svg { flex: none; }
.key--sun { height: 14px; background: var(--sun); border: 1px solid var(--rule); }
.key--line { border-top: 1px solid var(--ink); }
.key--accent { border-top: 2px solid var(--accent); }

.ana { margin: 0 auto; flex: 0 1 auto; min-width: 0; padding: 8px 48px 0 46px; }
.ana__box { position: relative; height: clamp(300px, 58vh, 500px); max-width: 100%; margin: 0 auto; } /* true sky proportions: its width follows */
.ana__box svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ana figcaption { margin-top: 10px; text-align: center; font-size: 12px; color: var(--muted); }
.ana .mdot { position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--ink); }
.ana .lab { left: auto; font: 11.5px var(--caps); letter-spacing: .06em; font-style: normal; padding: 0; }
.yearfacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 6px 0 0; border-top: 1px solid var(--rule); }
.yearfacts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0 8px; border-bottom: 1px solid var(--hair); }
.yearfacts dt { font-family: var(--caps); font-size: 13px; letter-spacing: .06em; color: var(--muted); }
.yearfacts dd { margin: 0; font-family: var(--mono); font-size: 14px; color: var(--ink); text-align: right; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 12px 0 40px; border-top: 3px double var(--rule); font-size: 13px; color: var(--ink-2); }
.foot p { margin: 0; max-width: 72ch; }
.noscript { text-align: center; padding: 24px; }

/* ---------- Wandering Compass: the compass card, the polar plate, the forecast ---------- */
.readout__big { display: inline-flex; align-items: center; gap: 14px; }
.rose { width: clamp(44px, 4.6vw, 58px); height: clamp(44px, 4.6vw, 58px); flex: none; overflow: visible; }
.polar { margin: 0; flex: 0 1 520px; min-width: 0; }
.polar__box svg { display: block; width: 100%; max-width: 520px; aspect-ratio: 1; margin: 0 auto; }
.polar__switch { justify-content: center; margin-top: 8px; }
.link[aria-pressed="true"] { color: var(--accent); text-decoration: none; }
.f-none { fill: none; }
.lab--iso { transform: translate(-50%, -50%); padding: 0 3px; background: var(--paper); font: 11px var(--mono); color: var(--ink-2); left: auto; }
.lab--iso.is-zero { color: var(--accent); }
.chart--world .chart__box { aspect-ratio: 1000 / 500; }
.walk { margin: 0; flex: 0 1 520px; min-width: 0; }
.walk__box svg { display: block; width: 100%; max-width: 520px; aspect-ratio: 1; margin: 0 auto; overflow: visible; }
.walk figcaption { margin-top: 8px; text-align: center; font-size: 13px; color: var(--ink-2); font-style: italic; }
.walk__true, .walk__card { font: 15px var(--caps); letter-spacing: .06em; fill: var(--ink); }
.walk__card { fill: var(--accent); font-size: 13px; }
.svgtxt.walk__acc { fill: var(--accent); }
.walk__h { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--rule); }
.gtxt { font: 15px var(--caps); letter-spacing: .05em; fill: var(--ink); paint-order: stroke; stroke: var(--paper-2); stroke-width: 4.5px; stroke-linejoin: round; pointer-events: none; }
.gtxt--acc { fill: var(--accent); }
.svgtxt { font: italic 13px var(--serif); fill: var(--ink-2); paint-order: stroke; stroke: var(--paper-2); stroke-width: 4px; stroke-linejoin: round; }

@media (max-width: 600px) {
  .folio { padding-left: 60px; font-size: 12px; }
  .folio__now { display: none; }
  .dek { justify-content: center; text-align: center; }
  .dek p + p { display: none; }
  .readout { padding: 16px 16px 14px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart--year { padding: 0 8px 24px 34px; }
  .chart--year .lab:not(.lab--accent) { display: none; }
  .chart--year .lab--accent { left: auto; right: 4px; transform: translateY(-140%); background: var(--paper); padding: 0 4px; }
  .chart--world { padding-left: 40px; }
  .chart__box { aspect-ratio: 1000 / 620; }
  .tick--x { font-size: 10.5px; }
  .yearfacts { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
