@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  src: url(fonts/bricolage-grotesque-latin-ext-standard-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  src: url(fonts/bricolage-grotesque-latin-standard-normal.woff2) format("woff2");
  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;
}

:root {
  color-scheme: light dark;
  --paper: #f1f3ef;
  --paper-2: #e6e9e4;
  --ink: #17212b;
  --ink-2: #4c5864;
  --ink-3: #8a949d;
  --rule: rgba(23, 33, 43, 0.11);
  --night: rgba(23, 40, 70, 0.085);

  --warm: #dc4a26;
  --cold: #2a6fd6;
  --rain: #2a6fd6;
  --snow: #74b3da;
  --mixed: #7d5bd0;
  --ice: #c2267d;
  --hail: #3d4852;
  --wind: #0d7d70;
  --cloud: #6f7c88;
  --press: #7a5c3e;

  --ic-sun: #eeaa1e;
  --ic-moon: #8d97bd;
  --ic-cloud: #b4bdc5;
  --ic-cloud-dark: #7c8893;
  --ic-rain: var(--rain);
  --ic-snow: #5fa5d2;
  --ic-ice: var(--ice);
  --ic-hail: var(--hail);
  --ic-bolt: #e8a200;
  --ic-fog: #8a949d;

  --pad: 16px;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-optical-sizing: auto;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10161d;
    --paper-2: #1a222b;
    --ink: #e7ebee;
    --ink-2: #a9b3bc;
    --ink-3: #6f7a85;
    --rule: rgba(231, 235, 238, 0.1);
    --night: rgba(0, 0, 0, 0.36);
    --warm: #ff7a52;
    --cold: #6aa5ff;
    --rain: #5b9bff;
    --snow: #a8d6f2;
    --mixed: #a98bf0;
    --ice: #f062ad;
    --hail: #c5ced6;
    --wind: #3fc4b2;
    --cloud: #9aa6b1;
    --press: #d0a878;
    --ic-moon: #c4cbe6;
    --ic-cloud: #8f9aa5;
    --ic-cloud-dark: #5e6a76;
    --ic-snow: #cfe9f8;
    --ic-fog: #8f9aa5;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- sky: the selected hour ---------- */

.sky {
  --sky-top: #1b2748;
  --sky-bottom: #2c3b63;
  --glow: transparent;
  --glow-x: 50%;
  --glow-y: 100%;
  color: #fff;
  background:
    radial-gradient(120% 95% at var(--glow-x) var(--glow-y), var(--glow), transparent 62%),
    linear-gradient(var(--sky-top), var(--sky-bottom));
  padding: calc(env(safe-area-inset-top) + 10px) var(--pad) 14px;
  text-shadow: 0 1px 10px rgba(8, 16, 36, 0.28);
}
.sky-inner { max-width: 720px; margin: 0 auto; }

.place-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.place {
  display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px;
  text-shadow: inherit;
}
.place-name {
  font-size: 25px; font-weight: 650; font-stretch: 88%; letter-spacing: -0.01em; line-height: 1.1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chev { width: 13px; height: 13px; flex: none; opacity: 0.85; margin-top: 3px; }
.round {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.16);
}
.round svg { width: 21px; height: 21px; }
.round.busy svg { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.place-sub { margin: -3px 0 0; font-size: 13.5px; opacity: 0.86; min-height: 1.35em; }

.when {
  margin-top: 10px; display: flex; align-items: center; gap: 10px; min-height: 30px;
  font-size: 15px; font-weight: 550;
}
.now-btn {
  font-size: 13px; font-weight: 600; padding: 5px 11px 6px; border-radius: 99px;
  background: #fff; color: #17212b; text-shadow: none;
}

.hero { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.temp {
  font-size: clamp(80px, 25.5vw, 112px); line-height: 0.86; font-weight: 300; font-stretch: 75%;
  letter-spacing: -0.035em; font-variant-numeric: tabular-nums; margin-left: -0.04em; white-space: nowrap;
}
.feels { margin-top: 10px; font-size: 15px; opacity: 0.9; }
.hero-icon { flex: none; width: clamp(104px, 31vw, 132px); margin-right: -4px; }
.hero-icon svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 4px 14px rgba(8, 16, 36, 0.22)); }
.summary { margin: 8px 0 0; font-size: 19px; font-weight: 550; font-stretch: 92%; line-height: 1.2; min-height: 1.2em; }

.facts {
  margin: 14px 0 0; padding-top: 12px; display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}
.facts div { min-width: 0; }
.facts dt { font-size: 12.5px; opacity: 0.8; }
.facts dd { margin: 1px 0 0; font-size: 17px; font-weight: 600; font-stretch: 85%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.facts dd.minor { font-size: 12.5px; font-weight: 400; font-stretch: 90%; opacity: 0.86; min-height: 1.35em; }
.wind-arrow { display: inline-block; width: 15px; height: 15px; margin-right: 4px; vertical-align: -2px; }
.wind-arrow svg { display: block; width: 100%; height: 100%; transition: transform 0.25s; }

.mini {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; gap: 10px; color: #fff;
  padding: calc(env(safe-area-inset-top) + 8px) var(--pad) 8px; font-size: 15px; font-weight: 600; font-stretch: 90%;
  font-variant-numeric: tabular-nums; background: var(--sky-top, #1b2748); transform: translateY(-110%); transition: transform 0.18s;
}
.mini.on { transform: none; }
.mini-icon { width: 26px; margin-left: auto; }
.mini-icon svg { display: block; }

/* icons on the sky use light fills */
.sky, .mini {
  --ic-sun: #ffd45e; --ic-moon: #eef0fb; --ic-cloud: #ffffff; --ic-cloud-dark: #d5dde6; --ic-rain: #cfe3ff;
  --ic-snow: #ffffff; --ic-ice: #ff9ed2; --ic-hail: #ffffff; --ic-bolt: #ffd45e; --ic-fog: #e9eef3;
}

/* ---------- tape: 72 hours under the needle ---------- */

.tape { position: relative; flex: none; }
.scroller {
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch; cursor: grab; outline-offset: -3px;
}
.scroller::-webkit-scrollbar { display: none; }
.scroller.dragging { cursor: grabbing; }
.scroller svg { display: block; }

.overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.needle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--ink); }
.needle::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 12px; height: 8px; margin-left: -6px;
  background: var(--ink); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.row-title, .readout, .tick {
  position: absolute;
  text-shadow: 0 0 3px var(--paper), 0 0 3px var(--paper), 0 0 6px var(--paper), 0 0 6px var(--paper);
}
.row-title { left: 10px; font-size: 13px; font-weight: 650; font-stretch: 90%; }
.row-title small { font-size: 11.5px; font-weight: 400; color: var(--ink-2); margin-left: 3px; }
.readout {
  left: calc(50% + 8px); right: 4px; font-size: 13px; font-weight: 600; font-stretch: 85%;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.readout span { font-weight: 400; color: var(--ink-2); }
.tick { left: 10px; font-size: 10.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; transform: translateY(-50%); }
.legend { position: absolute; left: 10px; display: flex; gap: 9px; font-size: 11px; color: var(--ink-2);
  text-shadow: 0 0 3px var(--paper), 0 0 3px var(--paper), 0 0 6px var(--paper); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 3px; }

/* svg parts */
.t-day { font-size: 12.5px; font-weight: 650; font-stretch: 90%; fill: var(--ink); }
.t-hour { font-size: 11px; fill: var(--ink-2); text-anchor: middle; font-variant-numeric: tabular-nums; }
.t-now { font-size: 10.5px; font-weight: 650; fill: var(--paper); text-anchor: middle; }
.g-night { fill: var(--night); }
.g-rule { stroke: var(--rule); stroke-width: 1; }
.g-zero { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.g-day { stroke: var(--ink-3); stroke-width: 1; }
.g-now { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: 0.7; }
.g-past { fill: var(--paper); opacity: 0.55; }
.l-temp { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.l-dew { fill: none; stroke: var(--ink-2); stroke-width: 1.3; stroke-dasharray: 1 4; stroke-linecap: round; }
.l-wind { fill: none; stroke: var(--wind); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.a-gust { fill: var(--wind); opacity: 0.2; }
.a-cloud { fill: var(--cloud); }
.l-press { fill: none; stroke: var(--press); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.w-arrow { fill: var(--wind); }

/* weather icon parts */
.i-sun { fill: var(--ic-sun); }
.i-moon { fill: var(--ic-moon); }
.i-cl { fill: var(--ic-cloud); }
.i-cd { fill: var(--ic-cloud-dark); }
.i-rain { stroke: var(--ic-rain); stroke-width: 1.7; stroke-linecap: round; fill: none; }
.i-ice { stroke: var(--ic-ice); stroke-width: 1.7; stroke-linecap: round; fill: none; }
.i-snow { fill: var(--ic-snow); }
.i-driz { fill: var(--ic-rain); }
.i-hail { fill: none; stroke: var(--ic-hail); stroke-width: 1.2; }
.i-bolt { fill: var(--ic-bolt); }
.i-fog { stroke: var(--ic-fog); stroke-width: 1.7; stroke-linecap: round; fill: none; }

.notice {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  padding: 24px; text-align: center; background: var(--paper); font-size: 16px;
}
.notice[hidden] { display: none; }
.notice button { padding: 11px 20px; border-radius: 99px; background: var(--ink); color: var(--paper); font-weight: 600; }

/* ---------- footer ---------- */

.foot {
  padding: 14px var(--pad) calc(env(safe-area-inset-bottom) + 18px); border-top: 1px solid var(--rule);
  font-size: 12.5px; color: var(--ink-2); max-width: 752px; width: 100%; margin: 0 auto;
}
.foot p { margin: 0 0 4px; max-width: 62ch; }
.foot p:first-child { color: var(--ink); font-weight: 550; }
.foot a { color: inherit; text-underline-offset: 2px; }

/* ---------- place sheet ---------- */

.sheet {
  width: 100%; max-width: 560px; height: 100dvh; max-height: 100dvh; margin: 0 auto; padding: 0; border: 0;
  background: var(--paper); color: var(--ink); overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: rgba(10, 16, 28, 0.55); }
.sheet-head { display: flex; gap: 10px; padding: calc(env(safe-area-inset-top) + 12px) var(--pad) 10px; }
.sheet-head input {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--ink);
  background: var(--paper); color: var(--ink); font: inherit; font-size: 17px; -webkit-appearance: none; appearance: none;
}
.sheet-head input:focus-visible { outline: none; box-shadow: 0 0 0 1.5px var(--ink); }
.sheet-head input::placeholder { color: var(--ink-3); }
.sheet-close { padding: 0 6px; font-weight: 600; min-height: 48px; }
.sheet-loc {
  display: flex; align-items: center; gap: 10px; margin: 2px var(--pad) 0; padding: 0 14px; min-height: 48px;
  border-radius: 12px; background: var(--paper-2); font-weight: 600; text-align: left;
}
.sheet-loc svg { width: 20px; height: 20px; flex: none; }
.sheet-msg { margin: 10px var(--pad) 0; font-size: 14px; color: var(--ink); }
.sheet-title { margin: 18px var(--pad) 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.sheet-title[hidden] { display: none; }
.results { list-style: none; margin: 0; padding: 0 0 calc(env(safe-area-inset-bottom) + 16px); overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.results button {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; text-align: left;
  padding: 11px var(--pad); min-height: 48px; border-bottom: 1px solid var(--rule);
}
.results .r-name { font-size: 17px; font-weight: 600; font-stretch: 92%; }
.results .r-sub { display: block; font-size: 13px; color: var(--ink-2); }
.results .r-elev { flex: none; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.results .empty { padding: 14px var(--pad); color: var(--ink-2); }

@media (min-width: 760px) {
  :root { --pad: 24px; }
  .sky { padding-top: 22px; padding-bottom: 22px; }
  .facts { grid-template-columns: repeat(4, minmax(0, 150px)); }
  .sheet { height: min(640px, 90dvh); border-radius: 18px; margin: 5dvh auto 0; }
  .row-title, .tick, .legend { left: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .round.busy svg { animation: none; }
  .wind-arrow svg, .mini { transition: none; }
}
.i-ray { stroke: var(--ic-sun); stroke-width: 1.5; stroke-linecap: round; }
