/*
  Paperweather: weather app (Screenery template)
  Papercraft: cream card stock with a fine grain, every shape a cut sheet with a soft shadow under it, a sun-yellow
  action colour and a terracotta accent. Fredoka only, its width axis wide for display. A full night palette.

  Contents
   1. Tokens (day, then night)
   2. Base and browser surfaces
   3. Buttons, chips, fields
   4. Site header
   5. Hero grid: copy, sky chips, features, phone column
   6. The phone and the app: top bar, scene, now, hourly, rain chart, tiles, week
   7. App states: loading veil, offline, town sheet and search
   8. Widgets
   9. How the scenes are made
  10. Pricing
  11. Download
  12. Footer
  13. Motion (only with prefers-reduced-motion: no-preference)
  14. Tablet and phone layouts
*/

/* ---------- 1. Tokens ---------- */
:root {
  --paper: #f3eadb;        /* the page: cream card */
  --paper-2: #e8dbc4;      /* a darker card for wells and tracks */
  --sheet: #fbf6ec;        /* raised sheets */
  --ink: #2c2840;          /* 12.9:1 on paper */
  --ink-2: #554f6b;        /* secondary, 7.0:1 on paper */
  --ink-3: #686281;        /* tertiary, 5.2:1 on paper, 5.6:1 on sheet */
  --line: rgb(44 40 64 / 0.14);
  --line-2: rgb(44 40 64 / 0.26);

  --sun: #f4b23f;          /* actions: ink text on it, 8.6:1 */
  --sun-2: #f7cf6a;
  --rust: #a5432a;         /* accent text, 5.6:1 on paper */
  --accent: #d6774f;       /* terracotta roofs, the wind arrow */
  --wet: #2d6893;          /* rain chances as text, 5.6:1 on sheet */
  --wet-bar: #a9cbe0;
  --sky: #a8d5e2;
  --hill-far: #b8d6a3;
  --hill-mid: #90bd7c;
  --hill-near: #5f9767;
  --error: #a3341f;        /* 6.2:1 on sheet */
  --ok: #2f6b45;

  --shadow-1: 0 1px 1px rgb(42 35 64 / 0.10), 0 2px 6px rgb(42 35 64 / 0.10);
  --shadow-2: 0 2px 3px rgb(42 35 64 / 0.12), 0 8px 20px rgb(42 35 64 / 0.14);
  --shadow-3: 0 4px 8px rgb(42 35 64 / 0.14), 0 22px 48px rgb(42 35 64 / 0.22);

  --font: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-h3: 1.375rem;
  --fs-h2: clamp(1.9rem, 1.3rem + 2vw, 2.9rem);
  --fs-h1: clamp(2.7rem, 1.5rem + 3.8vw, 4.7rem);

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 72px; --s-9: 112px;
  --r-1: 10px; --r-2: 16px; --r-3: 22px; --r-4: 30px; --r-pill: 999px;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --page: 1240px;

  /* paper grain as a tiny SVG noise tile */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .17 0 0 0 0 .14 0 0 0 0 .22 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: light;
}

/* Night: ink-blue card, lamp-lit cream text */
:root[data-night="true"] {
  --paper: #1d2244;
  --paper-2: #363f74;
  --sheet: #262c57;
  --ink: #f4ecd9;          /* 13.6:1 on paper */
  --ink-2: #cfc9dc;        /* 10:1 */
  --ink-3: #b3adc6;        /* 7.3:1 */
  --line: rgb(244 236 217 / 0.14);
  --line-2: rgb(244 236 217 / 0.28);
  --rust: #f3a588;
  --accent: #f0a07a;
  --wet: #9ccbf0;
  --wet-bar: #4d6d9a;
  --sky: #27305a;
  --hill-far: #3b4f6b;
  --hill-mid: #2f4560;
  --hill-near: #243a4f;
  --error: #ffab95;
  --ok: #9fdcb0;
  --shadow-1: 0 1px 1px rgb(5 6 20 / 0.3), 0 2px 6px rgb(5 6 20 / 0.3);
  --shadow-2: 0 2px 3px rgb(5 6 20 / 0.35), 0 8px 20px rgb(5 6 20 / 0.4);
  --shadow-3: 0 4px 8px rgb(5 6 20 / 0.4), 0 22px 48px rgb(5 6 20 / 0.5);
  color-scheme: dark;
}

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
  background: var(--grain), var(--paper);
  transition: background-color .6s var(--ease), color .6s var(--ease);
  overflow-x: clip;
  caret-color: var(--rust);
  accent-color: var(--rust);
  scrollbar-color: var(--line-2) transparent;
}
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.08; text-wrap: balance; font-stretch: 112%; letter-spacing: -0.01em; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1.5px; }
a:not(.btn):not(.skip):hover { color: var(--rust); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--sun); color: #2c2840; }
:focus-visible { outline: 3px solid var(--rust); outline-offset: 3px; border-radius: 6px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r-pill); }
.skip:focus { top: 12px; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }
.fine { font-size: var(--fs-xs); color: var(--ink-3); }
[data-num], .tile-big, .now-temp, .hour, .week, .price, .tr-temp, .w-temp, .w-hours, .w-days { font-variant-numeric: tabular-nums; }

/* ---------- 3. Buttons, chips, fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: var(--r-pill); border: 0;
  font-weight: 600; font-size: var(--fs-md); text-decoration: none; letter-spacing: .01em;
  box-shadow: var(--shadow-1);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); color: inherit; }
.btn:active { transform: translateY(1px); box-shadow: var(--shadow-1); }
.btn:disabled { cursor: progress; opacity: .75; transform: none; }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: var(--fs-sm); }
.btn-sun { background: var(--sun); color: #2c2840; }
.btn-sun:hover { background: var(--sun-2); color: #2c2840; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { color: var(--paper); }
.btn-paper { background: var(--sheet); color: var(--ink); }
.link { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: .2em; font-weight: 600; color: inherit; min-height: 44px; }

.skies { border: 0; margin: 0; padding: 0; min-width: 0; }
.skies legend { font-weight: 600; font-size: var(--fs-lg); padding: 0; margin-bottom: var(--s-3); }
.sky-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: var(--s-3); }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; z-index: 1; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--r-pill);
  background: var(--paper-2); color: var(--ink); font-weight: 500; font-size: var(--fs-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .3s;
}
.chip:hover span { transform: translateY(-2px); }
.chip input:checked + span { background: var(--sheet); box-shadow: var(--shadow-2); transform: translateY(-3px) rotate(-1.5deg); font-weight: 600; }
.chip input:focus-visible + span { outline: 3px solid var(--rust); outline-offset: 3px; }

.field-error { color: var(--error); font-size: var(--fs-sm); font-weight: 500; min-height: 0; }
.field-error:empty { display: none; }

/* ---------- 4. Site header ---------- */
.site {
  max-width: var(--page); margin: 0 auto; padding: var(--s-4) var(--s-5);
  display: flex; align-items: center; gap: var(--s-5);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 1.35rem; font-stretch: 118%; }
.site nav { margin-left: auto; }
.site nav ul { display: flex; gap: var(--s-2); }
.site nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; font-weight: 500; border-radius: var(--r-pill); }
.site nav a:hover { background: var(--paper-2); color: var(--ink); }

/* ---------- 5. Hero grid ---------- */
.hero {
  max-width: var(--page); margin: 0 auto; padding: var(--s-5) var(--s-5) var(--s-8);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: clamp(32px, 6vw, 96px);
  grid-template-areas: "copy phone" "skies phone" "feat phone";
  grid-template-rows: auto auto 1fr;
}
.hero-copy { grid-area: copy; padding-top: clamp(24px, 6vh, 80px); }
.hero h1 { font-size: var(--fs-h1); font-stretch: 125%; font-weight: 600; max-width: 12ch; letter-spacing: -0.02em; }
.lede { margin-top: var(--s-5); font-size: var(--fs-lg); max-width: 50ch; color: var(--ink-2); }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s-3); margin: var(--s-6) 0 var(--s-3); }
.skies { grid-area: skies; margin-top: var(--s-7); max-width: 560px; }
.skies .fine { max-width: 52ch; }

.features { grid-area: feat; margin-top: var(--s-8); padding-bottom: var(--s-6); }
.features h2 { font-size: var(--fs-h2); max-width: 18ch; margin-bottom: var(--s-6); }
.feat-list { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6) var(--s-6); max-width: 620px; }
.feat { padding-top: var(--s-4); border-top: 2px dashed var(--line-2); }
.feat h3 { font-size: var(--fs-lg); margin-bottom: var(--s-2); }
.feat p { color: var(--ink-2); font-size: var(--fs-sm); }
.feat-lead { grid-column: 1 / -1; padding: var(--s-5) var(--s-5) var(--s-5); border: 0; background: var(--grain), var(--sheet); border-radius: var(--r-3); box-shadow: var(--shadow-2); transform: rotate(-.6deg); }
.feat-lead h3 { font-size: var(--fs-h3); }
.feat-lead p { font-size: var(--fs-md); max-width: 56ch; }

/* ---------- 6. Phone and app ---------- */
.phone-col { grid-area: phone; }
.phone {
  position: sticky; top: 16px;
  width: 404px; height: clamp(660px, calc(100svh - 32px), 868px);
  padding: 12px; border-radius: 58px;
  background: #2c2840;
  /* stacked card edges, then the soft shadow on the desk */
  box-shadow: 0 0 0 5px #e6d6bc, 0 0 0 7px rgb(42 35 64 / .16), 0 6px 10px rgb(42 35 64 / .18), 0 30px 60px rgb(42 35 64 / .28);
}
:root[data-night="true"] .phone { box-shadow: 0 0 0 5px #3a4274, 0 0 0 7px rgb(0 0 0 / .25), 0 6px 10px rgb(0 0 0 / .3), 0 30px 60px rgb(0 0 0 / .45); background: #11132a; }
.phone-btn { position: absolute; left: -9px; width: 4px; border-radius: 4px; background: #2c2840; }
.phone-btn-a { top: 150px; height: 56px; }
.phone-btn-b { top: 220px; height: 56px; }
.screen { position: relative; height: 100%; border-radius: 46px; overflow: hidden; overflow: clip; background: var(--grain), var(--paper); isolation: isolate; }
.status { position: absolute; z-index: 3; top: 0; left: 0; right: 0; height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px 0 34px; font-size: 14px; font-weight: 600; pointer-events: none; }
.notch { width: 104px; height: 28px; border-radius: 20px; background: #2c2840; }
:root[data-night="true"] .notch { background: #11132a; }
.status-r { display: flex; gap: 3px; align-items: flex-end; }
.status-r i { width: 4px; background: currentColor; border-radius: 2px; }
.status-r i:nth-child(1) { height: 6px; } .status-r i:nth-child(2) { height: 9px; } .status-r i:nth-child(3) { height: 12px; }

.app { position: absolute; inset: 44px 0 0; }
.app-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 0 14px 28px; scrollbar-width: thin; }
.app-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: 6px 2px 10px; }
.town-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px 14px 4px 10px; border: 0; border-radius: var(--r-pill);
  background: var(--sheet); box-shadow: var(--shadow-1); text-align: left; transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.town-btn:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.town-txt { display: flex; flex-direction: column; line-height: 1.1; }
.town-txt span { font-weight: 600; font-size: var(--fs-md); }
.town-txt small { font-size: 12px; color: var(--ink-3); }
.dn-btn { position: relative; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--sheet); box-shadow: var(--shadow-1); display: grid; place-items: center; }
.dn-btn .i { grid-area: 1 / 1; transition: transform .5s var(--ease), opacity .3s; }
.dn-moon { opacity: 0; transform: rotate(-90deg) scale(.6); }
.dn-btn[aria-pressed="true"] .dn-sun { opacity: 0; transform: rotate(90deg) scale(.6); }
.dn-btn[aria-pressed="true"] .dn-moon { opacity: 1; transform: none; }

/* The scene: stacked SVG sheets. Several SVGs overlap only during a swap. */
.scene { position: relative; margin: 0 -14px; aspect-ratio: 400 / 260; overflow: hidden; background: var(--sky); transition: filter .5s; }
.scene-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-svg .ly { transform-box: view-box; }
.grain { mix-blend-mode: multiply; opacity: .3; pointer-events: none; }
:root[data-night="true"] .grain { mix-blend-mode: soft-light; opacity: .7; }

.now {
  position: relative; z-index: 1; margin: -30px -14px 0; padding: 22px 22px 18px;
  background: var(--grain), var(--paper); border-radius: 26px 26px 0 0;
  box-shadow: 0 -6px 14px rgb(42 35 64 / .16);
  display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 16px;
}
.now-temp { font-size: 5rem; line-height: .9; font-weight: 500; font-stretch: 100%; letter-spacing: -0.04em; display: flex; }
.now-temp .deg { font-size: .5em; margin-top: .15em; color: var(--rust); }
.now-cond { font-size: var(--fs-h3); font-weight: 600; font-stretch: 112%; line-height: 1.1; }
.now-hilo { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: var(--fs-sm); color: var(--ink-2); margin-top: 4px; }
.now-summary { grid-column: 1 / -1; margin-top: 14px; font-size: var(--fs-sm); line-height: 1.45; }
.now-sun { grid-column: 1 / -1; margin-top: 6px; font-size: var(--fs-xs); color: var(--ink-3); }

.card {
  margin-top: 12px; padding: 14px 14px 14px; border-radius: var(--r-3);
  background: var(--grain), var(--sheet); box-shadow: var(--shadow-1);
}
.card-h { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; font-stretch: 100%; letter-spacing: .01em; color: var(--ink-2); margin-bottom: 8px; }
.card-note { font-size: var(--fs-xs); color: var(--ink-2); margin-top: 6px; }

.hourly { display: flex; gap: 4px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -8px; padding: 4px 8px 8px; scrollbar-width: thin; }
.hourly li { scroll-snap-align: start; flex: none; }
.hour {
  display: flex; flex-direction: column; align-items: center; gap: 3px; width: 54px; min-height: 108px; padding: 8px 0;
  border: 0; border-radius: 16px; background: transparent; transition: background-color .2s, box-shadow .25s var(--ease), transform .25s var(--ease);
}
.hour:hover { background: var(--paper); }
.hour[aria-pressed="true"] { background: var(--paper); box-shadow: var(--shadow-1); transform: translateY(-2px); }
.hour-t { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.hour-temp { font-weight: 600; }
.hour-pop { font-size: 12px; color: var(--ink-3); }
.hour-pop.wet, .day-pop.wet { color: var(--wet); font-weight: 600; }
.hour-readout { font-size: var(--fs-xs); color: var(--ink-2); min-height: 1.5em; }

.rain-chart { display: block; width: 100%; height: auto; overflow: visible; }
.rc-bar { fill: var(--wet-bar); }
.rc-bar.hi { fill: var(--wet); }
.rc-grid { stroke: var(--line-2); stroke-dasharray: 3 4; stroke-width: 1; }
.rc-val { font-size: 10px; fill: var(--ink-2); font-weight: 500; font-family: var(--font); }
.rc-axis { font-size: 10px; fill: var(--ink-3); font-family: var(--font); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { display: flex; flex-direction: column; }
.compass { position: relative; width: 66px; height: 66px; margin: 2px 0 8px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 1px 3px rgb(42 35 64 / .18); }
.compass::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 1.5px dashed var(--line-2); }
.cmp-n { position: absolute; top: 1px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 600; color: var(--ink-2); }
.cmp-arrow { position: absolute; inset: 13px; width: 40px; height: 40px; transform: rotate(var(--deg, 0deg)); transition: transform .9s var(--ease); }
.tile-big { font-size: 1.75rem; font-weight: 600; line-height: 1.05; }
.tile-big small { font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); }
.tile-note { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.35; }
.uv-scale { position: relative; display: flex; gap: 3px; height: 14px; margin: 18px 0 14px; }
.uv-scale i { flex: 1; border-radius: 4px; box-shadow: 0 1px 2px rgb(42 35 64 / .2); }
.uv-scale i:nth-child(1) { background: #7bb26a; flex: 3; } .uv-scale i:nth-child(2) { background: #f2c14e; flex: 3; } .uv-scale i:nth-child(3) { background: #ec8b3e; flex: 2; } .uv-scale i:nth-child(4) { background: #d9573f; flex: 3; } .uv-scale i:nth-child(5) { background: #9b6bb5; flex: 1; }
.uv-scale b { position: absolute; top: -9px; left: calc(var(--uv, .2) * 100%); width: 14px; height: 30px; margin-left: -7px; border-radius: 7px; background: var(--sheet); box-shadow: var(--shadow-2); border: 2px solid var(--ink); transition: left .9s var(--ease); }

.week { display: flex; flex-direction: column; }
.day { display: grid; grid-template-columns: 3.4em 30px 2.6em 2.1em 1fr 2.1em; align-items: center; gap: 6px; min-height: 44px; border-top: 1px dashed var(--line); font-size: var(--fs-sm); }
.day:first-child { border-top: 0; }
.day-n { font-weight: 600; }
.day-pop { font-size: 12px; }
.day-lo { color: var(--ink-3); text-align: right; }
.day-hi { font-weight: 600; }
.range { position: relative; height: 8px; border-radius: 8px; background: var(--paper-2); }
.range i { position: absolute; top: 0; bottom: 0; left: calc(var(--a) * 100%); width: max(8px, calc((var(--b) - var(--a)) * 100%)); border-radius: 8px; background: linear-gradient(90deg, #8fbfd6, #f2b84b); box-shadow: 0 1px 2px rgb(42 35 64 / .25); }
.updated { margin: 18px 4px 0; font-size: 12px; color: var(--ink-3); text-align: center; }

/* ---------- 7. App states ---------- */
.veil { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--grain), var(--paper); opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility 0s .35s; }
.veil p { font-weight: 500; color: var(--ink-2); padding: 0 24px; text-align: center; }
.app.is-loading .veil { opacity: 1; visibility: visible; transition: opacity .25s var(--ease); }
.fold { position: relative; display: inline-block; width: 22px; height: 22px; vertical-align: middle; margin-right: 10px; }
.fold i { position: absolute; inset: 0; border-radius: 4px; background: var(--sun); box-shadow: 0 2px 4px rgb(42 35 64 / .25); transform-origin: bottom center; }
.fold i:nth-child(2) { background: var(--accent); }
.fold i:nth-child(3) { background: var(--hill-mid); }
.fold-lg { width: 64px; height: 64px; margin: 0; }
.fold-lg i { border-radius: 10px; }

.offline { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; margin: 0 0 10px; padding: 10px 12px; border-radius: var(--r-2); background: var(--paper-2); font-size: var(--fs-xs); line-height: 1.35; }
.offline[hidden] { display: none; }
.offline .mini-btn { grid-column: 2; justify-self: start; }
.mini-btn { min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: var(--ink); color: var(--paper); font-weight: 600; font-size: var(--fs-xs); }
.app.is-offline .scene { filter: saturate(.35) brightness(.96); }

.sheet-scrim { position: absolute; inset: 0; z-index: 6; background: rgb(29 25 48 / .38); opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
.app.sheet-open .sheet-scrim { opacity: 1; visibility: visible; transition: opacity .3s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; top: 34px; z-index: 7; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 16px 24px; border-radius: 28px 28px 0 0; background: var(--grain), var(--sheet); box-shadow: var(--shadow-3);
  transform: translateY(104%); transition: transform .45s var(--ease);
}
.sheet.open { transform: none; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-top h2 { font-size: var(--fs-h3); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--paper); }
.search { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.search .field-error { grid-column: 1 / -1; }
.search-field, .field { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: var(--r-pill); background: var(--paper); box-shadow: inset 0 1px 3px rgb(42 35 64 / .16); border: 2px solid transparent; transition: border-color .2s; }
.search-field:focus-within, .field:focus-within { border-color: var(--rust); }
.has-error .search-field, .has-error .field { border-color: var(--error); }
.search-field input, .field input { flex: 1; min-width: 0; border: 0; background: none; outline: none; min-height: 44px; font-size: 16px; }
input::placeholder { color: var(--ink-3); opacity: 1; }
input[type="search"]::-webkit-search-cancel-button { display: none; }
.results { margin-top: 12px; }
.res-loading, .res-count { display: flex; align-items: center; font-size: var(--fs-sm); color: var(--ink-2); padding: 8px 4px; }
.res-none { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 12px 6px 4px; font-size: var(--fs-sm); }
.res-none strong { display: block; font-weight: 600; margin-bottom: 2px; }
.sugg { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; color: var(--ink-2); }
.sugg button { min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: var(--paper-2); font-weight: 500; }
.saved-h { margin: 18px 4px 6px; font-size: var(--fs-sm); font-weight: 600; font-stretch: 100%; color: var(--ink-2); }
.towns { display: flex; flex-direction: column; gap: 6px; }
.town-row { width: 100%; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 12px; min-height: 56px; padding: 6px 14px; border: 0; border-radius: var(--r-2); background: var(--paper); text-align: left; transition: transform .25s var(--ease), box-shadow .25s; }
.town-row:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.town-row[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--rust); }
.tr-name { display: flex; flex-direction: column; font-weight: 600; line-height: 1.2; }
.tr-name small { font-weight: 400; font-size: 12px; color: var(--ink-3); }
.tr-name mark { background: var(--sun-2); color: #2c2840; border-radius: 3px; padding: 0 1px; }
.tr-temp { font-size: var(--fs-lg); font-weight: 600; }

/* ---------- 8. Widgets ---------- */
.widgets, .scenes, .pricing { max-width: var(--page); margin: 0 auto; padding: var(--s-9) var(--s-5) 0; }
.sec-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--s-6); align-items: end; margin-bottom: var(--s-7); }
.sec-head h2 { font-size: var(--fs-h2); max-width: 16ch; }
.sec-head p { color: var(--ink-2); max-width: 52ch; }
.home {
  display: grid; grid-template-columns: 180px 372px 372px; grid-template-rows: auto; gap: var(--s-6); align-items: end; justify-content: center;
  padding: clamp(28px, 5vw, 64px); border-radius: var(--r-4); background: var(--grain), var(--paper-2);
  box-shadow: inset 0 2px 8px rgb(42 35 64 / .12);
}
.w-fig { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.w-fig figcaption { font-size: var(--fs-sm); color: var(--ink-2); max-width: 30ch; }
.w-fig figcaption strong { display: block; color: var(--ink); font-weight: 600; }
.widget { position: relative; overflow: hidden; border-radius: 28px; background: var(--sheet); box-shadow: var(--shadow-2); color: var(--ink); }
.w-scene { position: absolute; inset: 0 0 auto 0; }
.mini-svg { display: block; width: 100%; height: 100%; }
.w-body { position: relative; background: var(--grain), var(--sheet); }
.w-town { font-weight: 600; font-size: var(--fs-sm); line-height: 1.2; }
.w-temp { font-size: 2.4rem; font-weight: 500; line-height: 1; letter-spacing: -0.03em; }
.w-sub { font-size: 12.5px; color: var(--ink-2); }
.w-small { width: 180px; height: 180px; }
.w-small .w-scene { height: 92px; }
.w-small .w-body { position: absolute; left: 0; right: 0; bottom: 0; height: 104px; padding: 12px 14px; border-radius: 20px 20px 0 0; }
.w-medium { width: 372px; height: 180px; }
.w-medium .w-scene { inset: 0 auto 0 0; width: 132px; height: 100%; }
.w-medium .w-body { position: absolute; inset: 0 0 0 118px; padding: 14px 16px; border-radius: 22px 0 0 22px; display: grid; grid-template-rows: auto 1fr; gap: 6px; }
.w-hours { display: grid; grid-template-columns: repeat(4, 1fr); align-items: end; text-align: center; font-size: 12px; color: var(--ink-2); }
.w-hours li, .w-days li { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.w-hours b, .w-days b { color: var(--ink); font-weight: 600; font-size: 13px; }
.w-large { width: 372px; height: 372px; }
.w-large .w-scene { height: 200px; }
.w-large .w-body { position: absolute; left: 0; right: 0; bottom: 0; height: 196px; padding: 16px 18px; border-radius: 24px 24px 0 0; display: grid; grid-template-rows: auto 1fr; gap: 10px; }
.w-head { display: flex; align-items: center; justify-content: space-between; }
.w-days { display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; text-align: center; font-size: 12.5px; color: var(--ink-2); padding-top: 10px; border-top: 1px dashed var(--line-2); }

/* ---------- 9. How the scenes are made ---------- */
.scenes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s-7); align-items: center; }
.scenes-copy h2 { font-size: var(--fs-h2); margin-bottom: var(--s-5); max-width: 14ch; }
.scenes-copy > p { color: var(--ink-2); max-width: 58ch; margin-bottom: var(--s-4); }
.scenes-copy strong { color: var(--ink); font-weight: 600; }
.spread-ctl { display: grid; grid-template-columns: 1fr; gap: 6px; margin: var(--s-5) 0 var(--s-4); max-width: 420px; font-size: var(--fs-sm); font-weight: 500; }
.spread-ctl output { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 400; }
input[type="range"] { width: 100%; height: 44px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; }
input[type="range"]::-webkit-slider-runnable-track { height: 10px; border-radius: 10px; background: var(--paper-2); box-shadow: inset 0 1px 2px rgb(42 35 64 / .2); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -9px; border-radius: 50%; background: var(--sun); border: 3px solid var(--sheet); box-shadow: var(--shadow-2); }
input[type="range"]::-moz-range-track { height: 10px; border-radius: 10px; background: var(--paper-2); }
input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--sun); border: 3px solid var(--sheet); box-shadow: var(--shadow-2); }
.layer-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-width: 460px; }
.layer-list button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 12px 4px 6px; border: 0; border-radius: var(--r-pill); background: transparent; text-align: left; font-size: var(--fs-sm); transition: background-color .2s; }
.layer-list button:hover { background: var(--paper-2); }
.layer-list button[aria-pressed="true"] { background: var(--sheet); box-shadow: var(--shadow-1); font-weight: 600; }
.ln { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--paper-2); font-size: 13px; font-weight: 600; flex: none; }
.layer-list button[aria-pressed="true"] .ln { background: var(--sun); color: #2c2840; }

.stack-wrap { perspective: 1800px; display: grid; place-items: center; padding: 180px 0 40px; }
.stack { position: relative; width: min(100%, 480px); aspect-ratio: 400 / 260; transform-style: preserve-3d; transform: rotateX(56deg) rotateZ(-30deg); }
.sheet-l { position: absolute; inset: 0; border-radius: 8px; overflow: hidden; transform: translateZ(calc(var(--i) * var(--spread) * 40px)); transition: transform .6s var(--ease), opacity .35s; box-shadow: 0 0 0 1px rgb(42 35 64 / .14); background: rgb(255 255 255 / .05); }
.sheet-l svg { display: block; width: 100%; height: 100%; }
.sheet-l.dim { opacity: .14; }
.craft { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); padding-top: var(--s-6); border-top: 2px dashed var(--line-2); }
.craft h3 { font-size: var(--fs-h3); margin-bottom: var(--s-2); }
.craft p { color: var(--ink-2); font-size: var(--fs-sm); max-width: 40ch; }

/* ---------- 10. Pricing ---------- */
.bill { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 var(--s-6); border: 0; border-radius: var(--r-pill); background: var(--paper-2); }
.bill label { position: relative; }
.bill input { position: absolute; inset: 0; z-index: 1; opacity: 0; margin: 0; cursor: pointer; }
.bill span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: var(--r-pill); font-weight: 500; transition: background-color .25s, box-shadow .25s; }
.bill input:checked + span { background: var(--sheet); box-shadow: var(--shadow-1); font-weight: 600; }
.bill input:focus-visible + span { outline: 3px solid var(--rust); outline-offset: 2px; }
.plans { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: var(--s-6); max-width: 920px; }
.plan { position: relative; display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-6); border-radius: var(--r-4); background: var(--grain), var(--sheet); box-shadow: var(--shadow-2); }
.plan h3 { font-size: var(--fs-h3); }
.price span { font-size: 3rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.price small { font-size: var(--fs-md); color: var(--ink-2); }
.plan-note { font-size: var(--fs-sm); color: var(--ink-2); margin-top: -8px; min-height: 1.5em; }
.plan-list { display: flex; flex-direction: column; gap: 10px; flex: 1; font-size: var(--fs-sm); }
.plan-list li { display: flex; gap: 10px; align-items: flex-start; }
.plan-list .i { margin-top: 3px; color: var(--ok); }
.plan .btn { align-self: flex-start; }
/* the Supporter plan sits on two more cut sheets */
.plan-sup { transform: rotate(.6deg); }
.plan-sup::before, .plan-sup::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; box-shadow: var(--shadow-1); }
.plan-sup::before { background: var(--sun); transform: rotate(-3deg) translate(-6px, 6px); }
.plan-sup::after { background: var(--accent); transform: rotate(-6deg) translate(-12px, 14px); z-index: -2; }
.plans { isolation: isolate; }

/* ---------- 11. Download ---------- */
.download { position: relative; margin-top: var(--s-9); padding: var(--s-8) var(--s-5) 200px; overflow: hidden; background: var(--sky); transition: background-color .6s; }
.dl-scene { position: absolute; left: 0; right: 0; bottom: 0; height: 240px; }
.dl-scene svg { width: 100%; height: 100%; display: block; }
.dl-card { position: relative; max-width: 640px; margin: 0 auto; padding: var(--s-6); border-radius: var(--r-4); background: var(--grain), var(--sheet); box-shadow: var(--shadow-3); }
.dl-card h2 { font-size: var(--fs-h2); margin-bottom: var(--s-3); max-width: 16ch; }
.dl-card > p { color: var(--ink-2); margin-bottom: var(--s-5); max-width: 52ch; }
.dl-form > label { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: 6px; }
.dl-row { display: flex; gap: 10px; flex-wrap: wrap; }
.dl-row .field { flex: 1 1 240px; }
.dl-form .field-error { margin-top: 8px; }
.dl-status { margin-top: 8px; font-size: var(--fs-sm); color: var(--error); font-weight: 500; }
.dl-status:empty { display: none; }
.dl-form .fine { margin-top: 10px; }
.dl-done { outline: none; display: grid; gap: 10px; justify-items: start; }
.dl-done[hidden] { display: none; }
.dl-done-h { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: var(--fs-lg); }
.dl-done-h .i { color: var(--ok); width: 26px; height: 26px; }
.dl-done p:not(.dl-done-h) { color: var(--ink-2); }

/* ---------- 12. Footer ---------- */
.foot { background: var(--hill-near); color: #fbf6ec; padding: var(--s-7) var(--s-5) var(--s-6); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s-6); transition: background-color .6s; }
.foot { --foot-max: var(--page); padding-left: max(var(--s-5), calc((100vw - var(--page)) / 2 + var(--s-5))); padding-right: max(var(--s-5), calc((100vw - var(--page)) / 2 + var(--s-5))); }
:root:not([data-night="true"]) .foot { background: #3f6e4b; }
.foot-name { font-weight: 600; font-size: 1.6rem; font-stretch: 120%; margin-bottom: 8px; }
.foot-brand p:not(.foot-name) { max-width: 46ch; color: #e7efe2; font-size: var(--fs-sm); margin-bottom: 8px; }
.foot nav ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s-5); }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; color: #fbf6ec; }
.foot a:hover { color: var(--sun-2); }
.foot :focus-visible { outline-color: var(--sun); }
.foot-fine { grid-column: 1 / -1; font-size: var(--fs-xs); color: #dde8d8; padding-top: var(--s-4); border-top: 1px dashed rgb(251 246 236 / .3); }

/* ---------- 13. Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .drop { transform-box: fill-box; transform-origin: center; animation: fall var(--fall, .9s) linear var(--d, 0s) infinite; }
  @keyframes fall {
    0% { transform: translate(0, -30px) rotate(12deg); opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translate(-16px, 70px) rotate(12deg); opacity: 0; }
  }
  .flake { transform-box: fill-box; transform-origin: center; animation: snowfall var(--fall, 6s) linear var(--d, 0s) infinite; }
  @keyframes snowfall {
    0% { transform: translate(0, -24px) rotate(0); opacity: 0; }
    15% { opacity: 1; }
    50% { transform: translate(8px, 14px) rotate(90deg); }
    85% { opacity: 1; }
    100% { transform: translate(-4px, 54px) rotate(180deg); opacity: 0; }
  }
  .star { animation: twinkle 3.4s ease-in-out var(--tw, 0s) infinite; }
  @keyframes twinkle { 50% { opacity: .35; } }
  .sun-ring { animation: spin 70s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .drift { animation: drift var(--dr, 40s) ease-in-out infinite alternate; }
  @keyframes drift { from { transform: translateX(-12px); } to { transform: translateX(14px); } }
  .mist { animation: drift 22s ease-in-out infinite alternate; }
  .mist-b { animation-duration: 28s; animation-direction: alternate-reverse; }
  .bolt { animation: flash 5.2s steps(1, end) infinite; opacity: 0; }
  @keyframes flash { 0%, 61% { opacity: 0; } 62% { opacity: 1; } 64% { opacity: 0; } 66% { opacity: 1; } 72% { opacity: 0; } }
  .fold i { animation: fold 1.4s var(--ease) infinite; }
  .fold i:nth-child(2) { animation-delay: .18s; }
  .fold i:nth-child(3) { animation-delay: .36s; }
  @keyframes fold { 0% { transform: rotateX(0); } 40%, 60% { transform: rotateX(180deg); } 100% { transform: rotateX(360deg); } }
  .rc-bar { transform-box: fill-box; transform-origin: bottom; animation: grow .7s var(--ease) both; animation-delay: calc(var(--i) * 35ms); }
  @keyframes grow { from { transform: scaleY(.15); } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
  .bolt { opacity: 1; }
}

/* ---------- 14. Tablet and phone layouts ---------- */
@media (max-width: 1240px) {
  .home { grid-template-columns: 180px 372px; }
  .w-fig-l { grid-column: 1 / -1; justify-self: center; }
}
@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "phone" "skies" "feat"; grid-template-rows: none; justify-items: center; text-align: left; }
  .hero-copy, .skies, .features { width: 100%; max-width: 680px; }
  .hero-copy { padding-top: var(--s-4); }
  .phone-col { margin-top: var(--s-7); }
  .phone { position: relative; top: 0; height: 820px; }
  .skies { margin-top: var(--s-6); }
  .sky-chips { justify-content: flex-start; }
  .features { margin-top: var(--s-8); }
  .scenes { grid-template-columns: minmax(0, 1fr); }
  .stack-wrap { padding-top: 150px; }
  .site nav { display: none; }
  .site .btn { margin-left: auto; }
}
@media (max-width: 820px) {
  .sec-head { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
  .home { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .w-fig { align-items: center; text-align: center; }
  .plans { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
  .craft { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
  .foot { grid-template-columns: minmax(0, 1fr); }
}
/* Phones: no frame, the app takes the width of the screen */
@media (max-width: 600px) {
  .site { padding: 12px 16px; }
  .hero { grid-template-areas: "phone" "skies" "copy" "feat"; padding: 0 0 var(--s-7); }
  .hero-copy, .skies, .features { padding-left: 16px; padding-right: 16px; }
  .phone-col { width: 100%; margin-top: 0; }
  .phone { width: 100%; height: auto; padding: 0; border-radius: 0; background: none; box-shadow: none; }
  :root[data-night="true"] .phone { background: none; box-shadow: none; }
  .phone-btn, .status { display: none; }
  .screen { border-radius: 0; overflow: visible; background: none; }
  .app { position: relative; inset: auto; }
  .app-scroll { height: auto; overflow: visible; padding: 0 12px 20px; }
  .scene { margin: 0 -12px; }
  .now { margin: -30px -12px 0; }
  .veil { justify-content: flex-start; padding-top: 120px; }
  .sheet-scrim { position: fixed; z-index: 40; }
  .sheet { position: fixed; top: 8vh; z-index: 41; }
  .skies { margin-top: var(--s-5); }
  .hero-copy { padding-top: var(--s-7); border-top: 2px dashed var(--line-2); margin-top: var(--s-5); }
  .feat-list { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
  .widgets, .scenes, .pricing { padding: var(--s-8) 16px 0; }
  .site { gap: 12px; }
  .brand { font-size: 1.15rem; gap: 8px; }
  .home { padding: 24px 12px; }
  .w-fig { width: 100%; }
  .w-medium, .w-large { width: 100%; max-width: 340px; }
  .w-medium .w-scene { width: 104px; }
  .w-medium .w-body { left: 92px; padding: 12px 12px; }
  .w-large { height: 340px; }
  .w-large .w-scene { height: 170px; }
  .stack { width: 76%; }
  .stack-wrap { padding: 110px 0 10px; }
  .plan { padding: var(--s-5); }
  .plan-sup { transform: none; }
  .download { padding: var(--s-7) 16px 170px; }
  .dl-card { padding: var(--s-5); }
  .foot { padding: var(--s-7) 16px var(--s-6); }
}
