/* Marshfield Weather */

:root {
  --ground: #EDF1F3;
  --surface: #FAFBFC;
  --accent-surface: #E5EDF3;
  --ink: #16232E;
  --muted: #4E5D69;
  --rule: #D5DDE3;
  --rule-strong: #CBD5DC;
  --border: #BFCAD3;
  --control: #DCE3E9;
  --band: #C6D3DC;
  --band-soft: #D3DEE6;
  --bar: #2E3F4D;
  --bar-past: #5D6F7D;
  --bar-fc: #9FB1BF;
  --cold: #2B5F9E;
  --warm: #A84A16;
  --precip: #3E79BE;
  --link: #2B5F9E;
  --night: #E0E7EC;
  --sky-day: #B9CCDA;
  --sky-night: #22304F;
  --sky-twilight: #D7A483;
  --sky-day-ink: #16232E;
  --sky-night-ink: #FFFFFF;
  --moon-lit: #E2E8ED;
  --moon-dark: #2E3F4D;
  --alert-bg: #F2D9BF;
  --alert-ink: #3B1F0A;
  --warn-bg: #7A2414;
  --warn-ink: #FFFFFF;
  --foot-bg: #16232E;
  --icon-fill: var(--surface);
  --font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #101B24;
    --surface: #16232E;
    --accent-surface: #1B2D3B;
    --ink: #E7EEF3;
    --muted: #9DAEBB;
    --rule: #263744;
    --rule-strong: #2F4252;
    --border: #3A4D5C;
    --control: #22323F;
    --band: #34495A;
    --band-soft: #2A3C4A;
    --bar: #D5E0E8;
    --bar-past: #8FA2B1;
    --bar-fc: #5B6F7F;
    --cold: #79A9E6;
    --warm: #EE9A63;
    --precip: #5E95D6;
    --link: #8DB8EE;
    --night: #15222C;
    --sky-day: #3E5468;
    --sky-night: #0A1119;
    --sky-twilight: #8A5C45;
    --sky-day-ink: #E7EEF3;
    --moon-lit: #DDE6EC;
    --moon-dark: #0B131A;
    --alert-bg: #4A2C12;
    --alert-ink: #FBE3C4;
    --warn-bg: #8E2B18;
    --foot-bg: #0A1218;
  }
}

/* The sky band follows the real time of day in Marshfield */
body.sky-day { --sky-top: #86AAC6; --sky-mid: #AFC8DA; --sky-bot: #D3E1EA; --sky-ink: #0F1D29; --sky-muted: #23374A; }
body.sky-twilight { --sky-top: #232E4C; --sky-mid: #4A4A6E; --sky-bot: #7D6377; --sky-ink: #FFFFFF; --sky-muted: rgba(255, 255, 255, 0.86); }
body.sky-night { --sky-top: #0B1424; --sky-mid: #132442; --sky-bot: #1D3457; --sky-ink: #FFFFFF; --sky-muted: rgba(255, 255, 255, 0.82); }
@media (prefers-color-scheme: dark) {
  body.sky-day { --sky-top: #24415A; --sky-mid: #2F5169; --sky-bot: #3A5D75; --sky-ink: #FFFFFF; --sky-muted: rgba(255, 255, 255, 0.84); }
}

/* Simple view: everything takes the temperature color */
body.simple {
  --ground: var(--temp-ground);
  --surface: rgba(255, 255, 255, 0.08);
  --accent-surface: rgba(255, 255, 255, 0.08);
  --ink: #FFFFFF;
  --muted: rgba(255, 255, 255, 0.82);
  --rule: rgba(255, 255, 255, 0.25);
  --border: rgba(255, 255, 255, 0.5);
  --control: rgba(255, 255, 255, 0.16);
  --link: #FFFFFF;
  --sky-ink: #FFFFFF;
  --sky-muted: rgba(255, 255, 255, 0.85);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
h2 { font-size: 18px; font-weight: 650; margin-bottom: 14px; }
h3 { font-size: 15px; font-weight: 650; }
button { font-family: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; padding: 8px 12px; border-radius: 8px; background: var(--ink); color: var(--ground); }

/* ---------- sky band: header, alerts, hero, skyline ---------- */
.skyband {
  position: relative; overflow: hidden; color: var(--sky-ink);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 58%, var(--sky-bot) 100%);
  padding-top: env(safe-area-inset-top);
  --icon-fill: var(--sky-mid);
}
.skyband :focus-visible { outline-color: var(--sky-ink); }
body.simple .skyband { background: var(--temp-ground); }
body.simple #skyline, body.simple .sky-deco { display: none; }
.sky-deco { position: absolute; inset: 0; pointer-events: none; }
.stars { position: absolute; inset: 0; }
.stars circle { fill: #FFFFFF; }
.sky-moon-big {
  position: absolute; top: 84px; left: 54%; transform: translateX(-50%); line-height: 0;
  --ink: rgba(255, 255, 255, 0.45); --moon-dark: #10203A; --moon-lit: #EEF2F5;
  filter: drop-shadow(0 0 22px rgba(238, 242, 245, 0.35));
}

.top { position: relative; z-index: 2; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding-top: 18px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.brand-mark { flex: none; border-radius: 9px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 23px; font-weight: 700; font-stretch: 78%; letter-spacing: -0.01em; line-height: 1.05; white-space: nowrap; }
.brand-sub { font-size: 13px; color: var(--sky-muted); white-space: nowrap; }
.tabs { display: flex; gap: 4px; justify-self: center; }
.tabs a {
  display: flex; align-items: center; min-height: 42px; padding: 0 18px; border-radius: 999px;
  color: var(--sky-ink); text-decoration: none; font-size: 15px; font-weight: 550;
}
.tabs a:hover { background: color-mix(in srgb, var(--sky-ink) 8%, transparent); }
.tabs a[aria-current="page"] { background: color-mix(in srgb, var(--sky-ink) 15%, transparent); font-weight: 650; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.pill, .icon-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--sky-ink) 35%, transparent); border-radius: 22px;
  background: color-mix(in srgb, var(--sky-ink) 6%, transparent); color: var(--sky-ink);
}
.pill { padding: 0 16px; font-size: 14px; font-weight: 600; }
.icon-btn { width: 44px; padding: 0; }
body.busy #refreshBtn svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  body.busy #refreshBtn svg { animation: none; opacity: 0.5; }
}

.alerts { position: relative; z-index: 2; }
.alerts:empty { display: none; }
details.alert { margin-top: 12px; border-radius: 14px; background: var(--alert-bg); color: var(--alert-ink); overflow: hidden; }
details.alert-warning { background: var(--warn-bg); color: var(--warn-ink); }
details.alert summary { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; }
details.alert summary::-webkit-details-marker { display: none; }
.alert-icon { flex: none; margin-top: 1px; }
.alert-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.alert-text strong { font-size: 16px; font-weight: 700; }
.alert-text span { font-size: 14px; line-height: 1.4; }
.alert-chevron { flex: none; margin-top: 2px; transition: transform 0.15s; }
details.alert[open] .alert-chevron { transform: rotate(90deg); }
.alert-body { padding: 0 18px 16px 52px; font-size: 15px; line-height: 1.5; max-width: 80ch; }
.alert-body p { white-space: pre-line; }
.alert-body p + p { margin-top: 10px; }

.hero { position: relative; z-index: 2; padding-top: 26px; padding-bottom: 156px; }
body.simple .hero { padding-bottom: 24px; }
.hero-wait { padding: 40px 0; font-size: 18px; color: var(--sky-muted); }
#skyline .skyline { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 140px; display: block; z-index: 1; }
.skyline-near { fill: var(--ground); }
.skyline-far { fill: var(--ground); opacity: 0.4; }

/* weather hero */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.now-when { font-size: 15px; color: var(--sky-muted); margin-bottom: 10px; }
.now-row { display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap; }
.big-temp {
  font-size: clamp(120px, 15vw, 224px); line-height: 0.8; font-weight: 600; font-stretch: 62%;
  letter-spacing: -0.035em; font-variant-numeric: tabular-nums;
}
.now-side { display: flex; flex-direction: column; gap: 6px; padding-bottom: 10px; font-size: 17px; }
.hero-desc { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 650; line-height: 1.1; }
.hero-desc .wx-icon { flex: none; }
.sky-muted { color: var(--sky-muted); }
.hero-sentence { margin-top: 22px; font-size: 20px; line-height: 1.4; max-width: 34ch; text-wrap: pretty; }
.now-stats { display: flex; flex-wrap: wrap; gap: 14px 34px; margin: 26px 0 0; }
.now-stats div { display: flex; flex-direction: column; gap: 2px; }
.now-stats dt { font-size: 13px; color: var(--sky-muted); }
.now-stats dd { margin: 0; font-size: 24px; font-weight: 650; font-stretch: 78%; }

/* page heroes (History, Marshfield) */
.page-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; padding-top: 20px; }
.page-title { font-size: clamp(46px, 6.4vw, 84px); line-height: 0.9; font-weight: 650; font-stretch: 66%; letter-spacing: -0.01em; text-wrap: balance; }
.lead { margin-top: 14px; font-size: 18px; line-height: 1.5; max-width: 54ch; color: var(--sky-muted); text-wrap: pretty; }
.town-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); align-items: center; }
.hub { display: block; width: 100%; height: auto; }
.hub-ties path { fill: none; stroke: color-mix(in srgb, var(--sky-ink) 16%, transparent); stroke-width: 9; stroke-dasharray: 2 6; }
.hub-rails path { fill: none; stroke: var(--sky-muted); stroke-width: 2; }
.hub-dot { fill: var(--sky-ink); stroke: var(--sky-mid); stroke-width: 4; }
.hub text { font-family: var(--font); font-size: 12px; fill: var(--sky-muted); }

/* segmented controls */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--control); flex: none; }
.seg button {
  min-height: 40px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent;
  font-size: 14px; font-weight: 650; color: var(--ink); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.seg-sky { background: color-mix(in srgb, var(--sky-ink) 14%, transparent); }
.seg-sky button { color: var(--sky-ink); min-height: 44px; padding: 0 22px; font-size: 15px; }
.seg-sky button[aria-pressed="true"] { background: var(--sky-ink); color: var(--sky-top); }
body.simple .seg-sky button[aria-pressed="true"] { color: var(--temp-ground); }

/* ---------- page body ---------- */
.notice.container { max-width: 1176px; margin: 18px auto 0; padding: 12px 16px; border-radius: 12px; background: var(--control); font-size: 14px; line-height: 1.45; }
main.container { padding-top: 8px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: start; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 24px; min-width: 0; }
.panel.accent { background: var(--accent-surface); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.foot-note { margin-top: 20px; }

/* almanac card (sits in the hero) */
.panel.almanac {
  color: var(--ink); border-radius: 20px; padding: 26px 28px;
  border-color: color-mix(in srgb, var(--ink) 8%, transparent);
  box-shadow: 0 30px 60px -36px rgba(8, 22, 36, 0.55);
}
.almanac-title { font-size: 22px; line-height: 1.25; margin-bottom: 22px; text-wrap: balance; }
.scale { position: relative; height: 54px; margin-bottom: 20px; }
.scale-now-label { position: absolute; top: 0; transform: translateX(-50%); font-size: 13px; font-weight: 650; white-space: nowrap; }
.scale-track { position: absolute; left: 0; right: 0; top: 37px; height: 2px; background: var(--rule-strong); }
.scale-cap { position: absolute; top: 30px; width: 4px; height: 16px; border-radius: 2px; transform: translateX(-50%); }
.scale-cap.cold { background: var(--cold); }
.scale-cap.warm { background: var(--warm); }
.scale-band { position: absolute; top: 31px; height: 14px; border-radius: 7px; background: var(--band); }
.scale-bar { position: absolute; top: 35px; height: 6px; border-radius: 3px; background: var(--bar); }
.scale-dot { position: absolute; top: 30px; width: 16px; height: 16px; border-radius: 8px; background: var(--ink); border: 3px solid var(--surface); transform: translateX(-50%); }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lg { display: flex; gap: 10px; align-items: flex-start; }
.sw { flex: 0 0 22px; height: 22px; position: relative; }
.sw::after { content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.sw-cap.cold::after { width: 4px; height: 16px; border-radius: 2px; background: var(--cold); }
.sw-cap.warm::after { width: 4px; height: 16px; border-radius: 2px; background: var(--warm); }
.sw-band::after { width: 22px; height: 12px; border-radius: 6px; background: var(--band); }
.sw-bar::after { width: 22px; height: 6px; border-radius: 3px; background: var(--bar); }
.lg-v { display: block; font-size: 25px; font-weight: 650; font-stretch: 75%; line-height: 1.15; }
.lg-l { display: block; font-size: 13px; color: var(--muted); }
.cold-t { color: var(--cold); }
.warm-t { color: var(--warm); }
.almanac-ly { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 15px; line-height: 1.45; }
.almanac-ly a { font-weight: 600; }

/* hours */
.hours { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(46px, 1fr); gap: 0; overflow-x: auto; scrollbar-width: thin; padding-bottom: 6px; }
.hour { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0; border-radius: 10px; }
.hour:first-child { background: var(--accent-surface); }
.hour-t { font-size: 13px; color: var(--muted); white-space: nowrap; }
.hour-temp { font-size: 18px; font-weight: 650; }
.pop { font-size: 13px; font-weight: 650; color: var(--cold); min-height: 1.2em; }

.chart24 .sky { position: relative; height: 44px; border-radius: 10px; }
.sky-l { position: absolute; top: 13px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.sky-l.on-day { color: var(--sky-day-ink); }
.sky-l.on-night { color: var(--sky-night-ink); }
.sky-moon { position: absolute; top: 14px; line-height: 0; }
.sky-under { position: relative; height: 24px; font-size: 12px; color: var(--muted); }
.sky-under span { position: absolute; top: 5px; white-space: nowrap; }
.chart24 .key { margin: 8px 0 0; }

svg.chart { display: block; max-width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); }
.chart .axis { stroke: var(--rule-strong); stroke-width: 1; }
.chart .bars rect { fill: var(--precip); }
.chart .tline, .chart .tyline { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .tdots circle, .chart .obs-dot { fill: var(--ink); }
.chart .fc-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.chart .tlabels text, .chart .vlabels text { font-size: 13px; font-weight: 650; fill: var(--ink); text-anchor: middle; }
.chart .plabels text { font-size: 11px; font-weight: 650; fill: var(--cold); text-anchor: middle; }
.chart .xlabels text { font-size: 12px; fill: var(--muted); text-anchor: middle; }
.chart .nband { fill: var(--band-soft); }
.chart .hiline, .chart .lyline { fill: none; stroke: var(--warm); stroke-width: 2.5; stroke-linejoin: round; }
.chart .hiline-dots circle, .chart .lyline-dots circle { fill: var(--warm); }
.chart .loline { fill: none; stroke: var(--cold); stroke-width: 2.5; stroke-linejoin: round; }
.chart .loline-dots circle { fill: var(--cold); }
.chart .grid line { stroke: var(--rule); stroke-width: 1; }
.chart .grid-labels text { font-size: 11px; fill: var(--muted); text-anchor: end; }
.chart .today-line { stroke: var(--border); stroke-width: 1; }
.chart .today-label { font-size: 11px; font-weight: 650; fill: var(--ink); text-anchor: middle; }
.chart .nline { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .nline-strong { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .mbar { fill: var(--bar); }
.chart .mbar-fc { fill: var(--bar-fc); }

.key { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.key-sw { display: inline-block; flex: none; }
.key-sw.precip { width: 10px; height: 10px; border-radius: 2px; background: var(--precip); }
.key-sw.key-band { width: 22px; height: 10px; border-radius: 5px; background: var(--band-soft); }
.keys { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.keys > span { display: flex; align-items: center; gap: 6px; }
.key-line { display: inline-block; width: 16px; height: 3px; border-radius: 2px; }
.key-line.warm { background: var(--warm); }
.key-line.cold { background: var(--cold); }
.key-line.ink { background: var(--ink); }
.key-line.dashed { height: 0; border-top: 2px dashed var(--muted); background: none; border-radius: 0; }
.key-line.dashed.ink { border-top-color: var(--ink); }
.key-ring { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink); }
.key-block { display: inline-block; width: 8px; height: 12px; border-radius: 2px; background: var(--bar); }
.key-block.fc { background: var(--bar-fc); }

/* day rows */
.days { list-style: none; margin: 0; padding: 0; }
.day { display: grid; grid-template-columns: 64px 28px 38px minmax(0, 1fr) 38px; gap: 10px; align-items: center; min-height: 56px; border-bottom: 1px solid var(--rule); }
.day:last-child { border-bottom: 0; }
.day-name { display: flex; flex-direction: column; gap: 1px; font-size: 16px; font-weight: 650; }
.day-name .pop { font-size: 12px; min-height: 0; }
.day-icon { display: flex; align-items: center; }
.day-lo { font-size: 16px; color: var(--muted); text-align: right; }
.day-hi { font-size: 16px; font-weight: 650; }
.range { position: relative; height: 14px; }
.range-band { position: absolute; top: 0; bottom: 0; border-radius: 7px; background: var(--band-soft); }
.range-bar { position: absolute; top: 4px; height: 6px; border-radius: 3px; background: var(--bar); }
.range-bar.past { background: var(--bar-past); }
.years .day { grid-template-columns: 78px 38px minmax(0, 1fr) 38px; min-height: 44px; }
.yr { font-size: 15px; }
.is-now .yr { font-weight: 650; }

.week-chart .wc-days, .week-chart .wc-pops { display: grid; }
.wc-days > div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; font-weight: 650; }
.wc-pops .pop { text-align: center; }

.fc + .fc { margin-top: 14px; }
.fc h3 { margin-bottom: 4px; }
.fc p { font-size: 16px; line-height: 1.5; }

.sunmoon { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.sunmoon p { margin-bottom: 6px; }
.moon-row { display: flex; align-items: center; gap: 12px; }
.moon-row p { margin-bottom: 2px; }

.fact-row { display: grid; grid-template-columns: minmax(64px, auto) minmax(0, 1fr); gap: 16px; align-items: start; }
.fact-row + .fact-row { margin-top: 18px; }
.fact-year { font-size: 42px; line-height: 0.9; font-weight: 650; font-stretch: 64%; color: var(--warm); }
.fact-row p { font-size: 16px; line-height: 1.5; margin-bottom: 4px; }
.row-link {
  display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin-top: 16px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 650;
}
.row-link:hover { background: var(--accent-surface); }

/* stats and tables */
.stats { display: grid; gap: 18px 16px; margin-bottom: 12px; }
.stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats.facts { margin-bottom: 0; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-v { font-size: 32px; font-weight: 650; font-stretch: 72%; line-height: 1.05; }
.stats-3 .stat-v, .stats-4 .stat-v { font-size: 30px; }
.facts .stat-v { font-size: 38px; }
.stat-l { font-size: 13px; line-height: 1.35; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 11px 0; border-bottom: 1px solid var(--rule); text-align: left; font-weight: 500; }
.table tbody tr:last-child th, .table tbody tr:last-child td { border-bottom: 0; }
.table tbody th { font-weight: 650; }
.table thead th { padding: 0 0 8px; font-size: 13px; color: var(--muted); }
.table .num { text-align: right; }
.table strong { font-weight: 650; }

/* Marshfield */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.timeline li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; }
.tl-year { font-size: 28px; line-height: 1.05; font-weight: 650; font-stretch: 68%; color: var(--warm); }
.timeline p { font-size: 16px; line-height: 1.55; max-width: 70ch; }
.timeline p + p { margin-top: 10px; }
.tl-date { font-weight: 650; }
.places { list-style: none; margin: 0; padding: 0; }
.places li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.places li:first-child { padding-top: 0; }
.places li:last-child { border-bottom: 0; padding-bottom: 0; }
.places h3 { font-size: 17px; margin-bottom: 3px; }
.places p { font-size: 15px; line-height: 1.45; }
.sources { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.4; }
.sources li + li { margin-top: 6px; }

/* Simple view */
.s-hero { padding-top: 10px; }
.s-hero .big-temp { font-size: clamp(150px, 20vw, 280px); }
.s-sentence { margin-top: 18px; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.3; font-weight: 450; max-width: 30ch; text-wrap: pretty; }
.simple-body { max-width: 820px; }
.s-section { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--rule); }
.s-section h2 { font-size: 20px; }
.s-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 16px; }
.s-label { display: block; font-size: 15px; color: var(--muted); }
.s-value { display: block; font-size: 34px; font-weight: 650; font-stretch: 78%; line-height: 1.15; }
.s-later { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.s-later span:last-child { display: block; font-size: 15px; }
.s-day { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 56px; border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
.s-dname { font-size: 17px; font-weight: 650; }
.s-sky { font-size: 15px; line-height: 1.3; color: var(--muted); }
.s-temps { font-size: 17px; white-space: nowrap; }
.s-temps strong { font-weight: 700; }
.s-lo { color: var(--muted); }
.s-text { font-size: 18px; line-height: 1.45; }
.s-text + .s-text { margin-top: 6px; }
.s-note { margin-top: 28px; font-size: 14px; line-height: 1.45; color: var(--muted); }

/* footer */
.site-foot { margin-top: 56px; padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); background: var(--foot-bg); color: rgba(255, 255, 255, 0.78); font-size: 13px; line-height: 1.55; }
body.simple .site-foot { background: rgba(0, 0, 0, 0.18); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; }
.foot-text p + p { margin-top: 4px; }
.foot-nav { display: flex; gap: 22px; }
.foot-nav a { color: #FFFFFF; font-weight: 600; text-decoration: none; font-size: 14px; }
.foot-nav a:hover { text-decoration: underline; }

/* ---------- tablet ---------- */
@media (max-width: 1080px) {
  .hero-grid { gap: 32px; }
  .now-stats { gap: 12px 26px; }
}

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .grid > * { grid-column: 1 / -1; }
  .stack { gap: 16px; }
  .town-hero { grid-template-columns: minmax(0, 1fr); }
  .town-hero .hub-wrap { max-width: 480px; }
  .sky-moon-big { display: none; }
}

/* ---------- phone ---------- */
@media (max-width: 720px) {
  .container { padding: 0 18px; }
  .top { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding-top: 14px; }
  .tabs { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .tabs a { flex: 1; justify-content: center; padding: 0 10px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 21px; }
  .pill .mode-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pill { width: 44px; padding: 0; }
  .hero { padding-top: 18px; padding-bottom: 104px; }
  #skyline .skyline { height: 96px; }
  .big-temp { font-size: clamp(110px, 34vw, 150px); }
  .now-row { gap: 18px; }
  .hero-desc { font-size: 22px; }
  .hero-sentence { font-size: 18px; margin-top: 18px; }
  .now-stats { gap: 12px 22px; margin-top: 20px; }
  .now-stats dd { font-size: 21px; }
  .panel { padding: 20px; border-radius: 14px; }
  .panel.almanac { padding: 22px 20px; }
  .almanac-title { font-size: 20px; }
  .lg-v { font-size: 23px; }
  .page-hero { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 12px; }
  .seg-sky { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .lead { font-size: 17px; }
  .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-4.facts .stat-v { font-size: 32px; }
  .day { grid-template-columns: 56px 26px 34px minmax(0, 1fr) 34px; gap: 8px; }
  .years .day { grid-template-columns: 76px 34px minmax(0, 1fr) 34px; }
  .s-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-day { grid-template-columns: 100px minmax(0, 1fr) auto; }
  .timeline li { grid-template-columns: 60px minmax(0, 1fr); gap: 12px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .notice.container { margin: 14px 18px 0; width: auto; }
}

@media (max-width: 380px) {
  .brand-sub { display: none; }
  .stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
