:root {
  color-scheme: light;
  --ink: #111418;
  --muted: #2A3038;
  --link: #1F5FBF;
  --link-hover: #123D80;
  /* Scene colors, set from app.js by local time of day. */
  --sky-top: #6FA6D8;
  --sky-bot: #D3E7F4;
  --ridge: #8EA8BB;
  --trees: #2E4829;
  --shade: 0;
  --scene-ink: #111418;
  /* Wind sock mount point and size. */
  --pole-x: 58%;
  --mount-y: 202px;
  --sock-scale: 1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #FFFFFF;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- Scene ---------- */

.scene {
  position: relative;
  height: 840px;   /* 700 px of scene + 140 px more grass, so the chart sits below the pole base */
  overflow: hidden;
  background: linear-gradient(to bottom, var(--sky-top) 0%, var(--sky-bot) 62%);
  transition: background 0.6s ease;
}
.land { position: absolute; left: 0; top: 0; width: 100%; height: 700px; }
.land .ridge { fill: var(--ridge); opacity: 0.85; }
.land .trees { fill: var(--trees); }
.field {
  position: absolute; left: 0; right: 0; bottom: 0; height: 360px;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.05) 0 18px, rgba(0,0,0,0) 18px 36px),
    linear-gradient(to bottom, #6E9A4C 0%, #567F38 35%, #436A2B 100%);
}
.night { position: absolute; inset: 0; background: #0A1024; opacity: var(--shade); transition: opacity 0.6s ease; }

.pole {
  position: absolute; left: var(--pole-x); top: calc(var(--mount-y) - 6px);
  width: 10px; height: calc(606px - var(--mount-y)); margin-left: -5px; border-radius: 3px;
  background: linear-gradient(to right, #6C7279 0%, #C9CED3 35%, #F4F6F7 50%, #A5ABB1 70%, #5E646B 100%);
}
.pole-shadow {
  position: absolute; left: var(--pole-x); top: 598px; width: 70px; height: 14px; margin-left: -35px;
  border-radius: 50%; background: rgba(0,0,0,0.28);
}
.swivel {
  position: absolute; left: var(--pole-x); top: calc(var(--mount-y) - 20px);
  width: 18px; height: 26px; margin-left: -9px; border-radius: 4px;
  background: linear-gradient(to right, #3B4046, #8E949A 45%, #3B4046);
}
.sock-mount {
  position: absolute; left: var(--pole-x); top: var(--mount-y); width: 0; height: 0;
  transform: scale(var(--sock-scale)); transform-origin: 0 0;
}
.sock { position: absolute; left: -420px; top: -120px; width: 840px; height: 560px; overflow: visible; }

/* ---------- Text over the scene ---------- */

.overlay { position: absolute; inset: 0; pointer-events: none; }
.overlay .wrap { position: relative; height: 100%; }
.top {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  padding-top: 24px; pointer-events: auto;
}
.brand { font-size: 20px; font-weight: 700; color: var(--scene-ink); }
.brand span { font-weight: 400; opacity: 0.8; }
.pill {
  font-size: 15px; font-weight: 600; padding: 10px 16px; min-height: 44px;
  display: inline-flex; align-items: center; border-radius: 999px;
  background: rgba(255,255,255,0.88); color: var(--ink); text-decoration: none;
}
.pill:hover { background: #FFFFFF; color: var(--ink); }

.readout { margin-top: 72px; display: flex; flex-direction: column; gap: 8px; color: var(--scene-ink); max-width: 46%; }
.speed { display: flex; align-items: baseline; gap: 12px; }
.speed #spd { font-size: 120px; font-weight: 700; line-height: 0.9; letter-spacing: -0.045em; }
.speed #spd.calm { margin-left: -0.038em; }   /* the C's side bearing at this size; lines its ink up with the header */
.speed .unit { font-size: 32px; font-weight: 600; }
.gust { font-size: 30px; font-weight: 600; }
.from { display: flex; align-items: center; gap: 10px; font-size: 19px; line-height: 1.4; }
.from svg { flex: none; }
.from.calm svg { display: none; }       /* calm: no direction */
.from.calm #from { margin-left: 10px; }
.from svg.ready { transition: transform 0.6s ease; }

.controls {
  position: absolute; left: 16px; right: 16px; bottom: 28px;
  display: flex; flex-direction: column; gap: 8px; color: #FFFFFF; pointer-events: auto;
}
.when { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 12px; }
.when label { font-size: 14px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.time { font-size: 26px; font-weight: 700; }
.time small { font-size: 16px; font-weight: 500; }
/* The slider has a fixed-size thumb so the chart above it (app.js drawChart) can put each
   step exactly over its thumb position: thumb centers run from --thumb/2 to width - --thumb/2. */
.controls { --thumb: 22px; }
#lead {
  -webkit-appearance: none; appearance: none; background: transparent;
  width: 100%; height: 36px; margin: 0; cursor: pointer;
}
#lead::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.45); }
#lead::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.45); }
#lead::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: var(--thumb); height: var(--thumb); margin-top: -9px;
  border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
#lead::-moz-range-thumb {
  width: var(--thumb); height: var(--thumb); border: 0; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
#lead:focus { outline: none; }
#lead:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(255,255,255,0.45), 0 1px 4px rgba(0,0,0,0.4); }
#lead:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(255,255,255,0.45), 0 1px 4px rgba(0,0,0,0.4); }
.ticks { position: relative; height: 18px; margin: 0 calc(var(--thumb) / 2); font-size: 13px; font-weight: 500; user-select: none; -webkit-user-select: none; }

/* Wind chart over the slider: direction per step, sustained speed line, gust band. */
.chart { display: block; width: 100%; height: 76px; overflow: visible; cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart text { font-family: inherit; fill: #FFFFFF; }
.chart .lbl { opacity: 0.72; }
.chart .lbl.on { opacity: 1; }
.chart .lbl path { fill: #FFFFFF; }
.chart .kt { font-size: 11px; font-weight: 600; }
.chart .gf { font-size: 9.5px; font-weight: 500; }
.chart .calm { font-size: 9.5px; font-weight: 500; text-anchor: middle; }
.chart .lbl.on .calm { font-weight: 700; }
.chart .lbl.on .kt { font-weight: 700; }
/* color by each step's peak wind (gust, or sustained when no gust): <=10 kt white, 11-15 kt amber, >15 kt orange-red */
.chart .lbl.g-mid, .chart .lbl.g-hi { opacity: 1; }   /* colored steps at full strength, for contrast on the grass */
.chart .lbl.g-mid path, .chart .lbl.g-mid text { fill: #FFD27F; }
.chart .lbl.g-hi path, .chart .lbl.g-hi text { fill: #E79C79; }
.chart .lbl.g-hi .kt { font-weight: 700; }
.chart .grid { stroke: #FFFFFF; stroke-opacity: 0.18; stroke-width: 1; }
.chart .band { fill: #FFFFFF; fill-opacity: 0.16; }
.chart .line { fill: none; stroke: #FFFFFF; stroke-opacity: 0.75; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: #FFFFFF; fill-opacity: 0.75; }
.chart .dot.on { fill-opacity: 1; }
.chart .guide { stroke: #FFFFFF; stroke-opacity: 0.35; stroke-width: 1; stroke-dasharray: 2 3; }
.ticks span { position: absolute; top: 0; white-space: nowrap; }

/* ---------- Below the scene ---------- */

.below .wrap { padding-top: 36px; padding-bottom: 56px; }
.status { margin: 0 0 24px; font-size: 14px; color: #5A636D; }
.about-short { display: flex; flex-wrap: wrap; gap: 32px; font-size: 17px; line-height: 1.6; color: var(--muted); }
.about-short > div:first-child { flex: 1 1 460px; }
.about-short > div:last-child { flex: 1 1 320px; }
.about-short h2 { margin: 0 0 8px; font-size: 24px; color: var(--ink); }
.about-short p { margin: 0 0 10px; }

/* ---------- Phones ---------- */

@media (max-width: 760px) {
  :root { --pole-x: 50%; --mount-y: 330px; --sock-scale: 0.5; }
  .readout { margin-top: 40px; max-width: 100%; }
  .speed #spd { font-size: 88px; }
  .speed .unit { font-size: 26px; }
  .gust { font-size: 24px; }
  .from { font-size: 17px; }
  .time { font-size: 22px; }
  .chart { height: 72px; }
  .brand span { display: block; font-size: 15px; }
}

/* ---------- About page ---------- */

.page-header { border-bottom: 1px solid #E3E6EA; }
.page-header .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.page-header .brand { color: var(--ink); text-decoration: none; }
.prose { max-width: 720px; margin: 0 auto; padding: 40px 16px 72px; font-size: 17px; line-height: 1.65; color: var(--muted); }
.prose h1 { font-size: 40px; line-height: 1.15; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 16px; }
.prose h2 { font-size: 24px; color: var(--ink); margin: 40px 0 8px; }
.prose ul { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose .note { border: 1px solid #E3E6EA; border-radius: 10px; padding: 16px 20px; background: #F7F9FB; }

/* ---------- About page: score tables ---------- */
.prose .table-wrap { overflow-x: auto; margin: 16px 0 8px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
.prose th, .prose td { padding: 7px 10px; text-align: right; border-bottom: 1px solid #E3E6EA; white-space: nowrap; }
.prose th:first-child, .prose td:first-child { text-align: left; white-space: normal; }
.prose thead th { color: var(--ink); font-weight: 600; border-bottom: 2px solid #C9CED4; }
.prose tr.us td { color: var(--ink); font-weight: 600; background: #FFF4EC; }
.prose .caption { font-size: 14px; color: #5A626B; margin: 4px 0 20px; }
.prose dl { margin: 12px 0; }
.prose dt { font-weight: 600; color: var(--ink); margin-top: 12px; }
.prose dd { margin: 2px 0 0; }
