  :root {
    /* Light theme (the default, un-stamped state) */
    --bg: #EAF3F5;
    --surface: #FFFFFF;
    --surface-2: #F3FAFB;
    --ink: #0B2A2E;
    --muted: #47666B;
    --line: #C9DEE2;
    --river: #1A6B82;
    --river-deep: #0E4A52;
    --river-bright: #2E8CA8;
    --copper: #B45F20;
    --copper-soft: #E9C096;

    /* Deliberately fixed "deep water" sections — constant across viewer theme */
    --deep-bg: #06282C;
    --deep-panel: #0C363B;
    --deep-ink: #EAF4F5;
    --deep-muted: #9DBBBF;
    --deep-line: #1E4A50;
    --deep-accent: #4DB8D8;
    --deep-copper: #E5A05C;

    --sans: "Avenir Next", "Avenir", "Helvetica Neue", "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
    --maxw: 1080px;
    --radius: 14px;
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #07282C;
      --surface: #0C3338;
      --surface-2: #0E3A40;
      --ink: #E4EFF1;
      --muted: #9DB6BB;
      --line: #1E4A50;
      --river: #4DB8D8;
      --river-deep: #2E8CA8;
      --river-bright: #6BC6E4;
      --copper: #E5A05C;
      --copper-soft: #7A4A24;
    }
  }
  :root[data-theme="dark"] {
    --bg: #07282C;
    --surface: #0C3338;
    --surface-2: #0E3A40;
    --ink: #E4EFF1;
    --muted: #9DB6BB;
    --line: #1E4A50;
    --river: #4DB8D8;
    --river-deep: #2E8CA8;
    --river-bright: #6BC6E4;
    --copper: #E5A05C;
    --copper-soft: #7A4A24;
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 800; line-height: 1.05; }
  p { margin: 0; }
  a { color: inherit; }

  .wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

  /* ---------- Top bar ---------- */
  .topbar {
    position: relative;
    z-index: 5;
    background: var(--deep-bg);
    color: var(--deep-ink);
  }
  .topbar .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
  .wordmark { display: flex; align-items: baseline; gap: 8px; font-weight: 800; letter-spacing: -0.01em; font-size: 19px; }
  .wordmark .usa { color: var(--deep-accent); font-weight: 400; }
  .topbar .pill {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--deep-muted);
  }

  /* ---------- Deep sections (fixed) ---------- */
  .deep { background: var(--deep-bg); color: var(--deep-ink); }

  /* ---------- Hero ---------- */
  .hero { position: relative; overflow: hidden; padding: 72px 0 104px; }
  .hero .wrap { position: relative; z-index: 2; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; }
  .hero .eyebrow {
    font-family: var(--mono); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--deep-accent); margin-bottom: 20px; display: flex; align-items: center; gap: 12px;
  }
  .hero .eyebrow::before { content: ""; width: 34px; height: 2px; background: var(--deep-accent); }
  .hero h1 {
    font-size: clamp(38px, 5.8vw, 66px);
    color: var(--deep-ink);
    letter-spacing: -0.025em;
    margin-bottom: 22px;
  }
  .hero h1 .accent { color: var(--deep-accent); }
  .hero .sub { font-size: 19px; color: var(--deep-muted); max-width: 34em; margin-bottom: 34px; }
  .cta-row { display: flex; flex-wrap: wrap; gap: 14px; }
  .btn {
    display: inline-flex; align-items: center; gap: 9px; cursor: pointer; text-decoration: none;
    font-weight: 700; font-size: 16px; padding: 14px 24px; border-radius: 999px; border: 1px solid transparent;
  }
  .btn-primary { background: var(--deep-accent); color: #052226; }
  .btn-primary:hover { background: #6BC6E4; }
  .btn-ghost { background: transparent; color: var(--deep-ink); border-color: var(--deep-line); }
  .btn-ghost:hover { border-color: var(--deep-accent); color: var(--deep-accent); }
  .btn:focus-visible, a:focus-visible { outline: 2px solid var(--deep-copper); outline-offset: 3px; }

  /* Ambient river line behind the hero */
  .riverline {
    position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
    stroke-dasharray: 1600; stroke-dashoffset: 1600;
    animation: draw 2.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  @keyframes draw { to { stroke-dashoffset: 0; } }

  /* ---------- Floating phone ---------- */
  .hero-visual { position: relative; display: flex; justify-content: center; }
  .phone {
    position: relative;
    width: 268px;
    max-width: 80vw;
    background: #0A0E12;
    border: 3px solid #1A252B;
    border-radius: 40px;
    padding: 10px;
    box-shadow: 0 44px 90px -30px rgba(0,0,0,0.7), 0 0 0 1px rgba(77,184,216,0.16);
    opacity: 0;
    animation: phoneIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.35s forwards;
  }
  @keyframes phoneIn {
    to { opacity: 1; transform: translateY(-6px) rotate(2.5deg); }
  }
  .phone .screen {
    position: relative;
    border-radius: 32px;
    overflow: hidden;
    background: #07282C;
    aspect-ratio: 9 / 20;
  }
  .screenshot {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 30px;
  }

  /* ---------- Sections ---------- */
  .section { padding: 88px 0; }
  .section .eyebrow {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--river);
    margin-bottom: 16px; display: flex; align-items: center; gap: 12px;
  }
  .section .eyebrow::before { content: ""; width: 30px; height: 2px; background: var(--copper); }
  .section h2 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.02em; margin-bottom: 18px; }

  .problem .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
  .problem .lead { font-size: 20px; color: var(--ink); max-width: 30em; font-weight: 500; }
  .problem .lead strong { color: var(--river-deep); }
  .problem .body { font-size: 16px; color: var(--muted); }

  /* Features */
  .features { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .features .cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 12px; }
  .fcard {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px;
    display: flex; flex-direction: column; gap: 10px; transition: transform 0.18s ease, border-color 0.18s ease;
  }
  .fcard:hover { transform: translateY(-4px); border-color: var(--river); }
  .fcard .icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--river); color: #fff; margin-bottom: 4px; }
  .fcard .icon.copper { background: var(--copper); }
  .fcard h3 { font-size: 19px; }
  .fcard .reading { font-family: var(--mono); font-size: 13px; color: var(--river-deep); font-variant-numeric: tabular-nums; }
  .fcard .reading .unit { color: var(--muted); }
  .fcard p { font-size: 14px; color: var(--muted); }

  /* Weather */
  .weather .grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 44px; align-items: center; }
  .weather .body { font-size: 16px; color: var(--muted); max-width: 34em; }
  .weather .body strong { color: var(--river-deep); }
  .hourly { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin-top: 6px; }
  .hchip {
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 4px;
    text-align: center; display: flex; flex-direction: column; gap: 6px;
  }
  .hchip .t { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
  .hchip .c { font-size: 20px; line-height: 1; }
  .hchip .c.sun { color: var(--copper); }
  .hchip .c.cloud { color: var(--muted); }
  .hchip .c.rain { color: var(--river); }
  .hchip .v { font-weight: 700; font-size: 15px; }
  .hchip.now { border-color: var(--river); box-shadow: 0 0 0 1px var(--river); }
  .suntimes { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 18px; letter-spacing: 0.02em; }
  .suntimes .dot { color: var(--copper); }

  /* How it works */
  .how .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 20px; position: relative; }
  .how .steps::before {
    content: ""; position: absolute; top: 22px; left: 8%; right: 8%; height: 2px;
    background: linear-gradient(90deg, var(--river), var(--copper), var(--river));
    opacity: 0.35;
  }
  .step { position: relative; padding: 0 26px 0 0; }
  .step .tick {
    width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface); border: 2px solid var(--river); color: var(--river-deep);
    font-family: var(--mono); font-weight: 700; font-size: 15px; margin-bottom: 18px; position: relative; z-index: 1;
  }
  .step h3 { font-size: 20px; margin-bottom: 8px; }
  .step p { font-size: 15px; color: var(--muted); max-width: 26em; }

  /* Stats */
  .stats { padding: 56px 0; }
  .stats .row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
  .stat .n { font-family: var(--mono); font-size: clamp(30px, 4vw, 46px); font-weight: 700; color: var(--deep-ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .stat .n .plus { color: var(--deep-copper); }
  .stat .l { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--deep-muted); margin-top: 6px; }

  /* Footer CTA */
  .cta { padding: 96px 0; text-align: center; }
  .cta h2 { font-size: clamp(34px, 5vw, 56px); color: var(--deep-ink); letter-spacing: -0.02em; margin-bottom: 18px; }
  .cta p { color: var(--deep-muted); font-size: 18px; max-width: 42em; margin: 0 auto 34px; }
  .cta .cta-row { justify-content: center; }
  .footer { background: #041B1E; color: var(--deep-muted); padding: 28px 0; font-family: var(--mono); font-size: 12px; }
  .footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
  .footer .wm { color: var(--deep-ink); font-weight: 700; letter-spacing: -0.01em; }

  /* ---------- Motion ---------- */
  @media (prefers-reduced-motion: reduce) {
    .riverline { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
    .phone { animation: none; opacity: 1; transform: translateY(-6px) rotate(2.5deg); }
    .fcard { transition: none; }
    html { scroll-behavior: auto; }
  }

  /* ---------- Responsive ---------- */
  @media (max-width: 860px) {
    .hero .wrap { grid-template-columns: 1fr; gap: 56px; }
    .hero-visual { order: 2; }
    .features .cards { grid-template-columns: 1fr 1fr; }
    .weather .grid { grid-template-columns: 1fr; gap: 32px; }
    .problem .grid { grid-template-columns: 1fr; }
    .how .steps { grid-template-columns: 1fr; gap: 34px; }
    .how .steps::before { display: none; }
    .stats .row { grid-template-columns: 1fr 1fr; }
  }
  @media (max-width: 600px) {
    .hourly { grid-template-columns: repeat(4, 1fr); }
  }
  @media (max-width: 480px) {
    .features .cards { grid-template-columns: 1fr; }
    .stats .row { grid-template-columns: 1fr 1fr; gap: 20px; }
  }

/* ---------- Shared layout for sub-pages ---------- */
body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }
.wrap.narrow { max-width: 720px; }

/* ---------- Wordmark as a link ---------- */
a.wordmark { text-decoration: none; }
a.wordmark:hover .usa { color: #6BC6E4; }

/* ---------- Legal / support page content ---------- */
.legal { padding: 72px 0 88px; }
.legal h1 {
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  line-height: 1.05;
  font-weight: 800;
  text-wrap: balance;
}
.legal p { font-size: 17px; color: var(--muted); line-height: 1.7; max-width: 46em; }
.legal a { color: var(--river); text-decoration: none; }
.legal a:hover { text-decoration: underline; }

/* ---------- App Store / Google Play buttons ---------- */
.btn-store { color: #fff; }
.btn-store .button-icon { width: 20px; height: 20px; fill: currentColor; }
.btn-store.apple { background: #000; }
.btn-store.apple:hover { background: #1f1f1f; }
.btn-store.android { background: #01875f; }
.btn-store.android:hover { background: #016d4f; }
.btn-store:hover { transform: translateY(-1px); }

/* ---------- Footer links ---------- */
.footer .links { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.footer a { color: var(--deep-muted); text-decoration: none; }
.footer a:hover { color: var(--deep-accent); text-decoration: underline; }

/* ---------- Dual phone hero visual (map behind detail) ---------- */
.hero-visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.phone-wrap { position: relative; display: flex; }
.phone-wrap-map { margin-right: -128px; z-index: 1; animation: floaty 7s ease-in-out 1.4s infinite; }
.phone-wrap-detail { z-index: 2; animation: floaty 6s ease-in-out 2s infinite; }
.phone-map,
.phone-detail {
  position: relative;
  background: #0A0E12;
  border: 3px solid #1A252B;
  border-radius: 40px;
  padding: 10px;
  box-shadow: 0 44px 90px -30px rgba(0,0,0,0.7), 0 0 0 1px rgba(77,184,216,0.16);
  opacity: 0;
}
.phone-map { width: 232px; animation: phoneInMap 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards; }
.phone-detail { width: 268px; animation: phoneInDetail 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards; }
@keyframes phoneInMap { to { opacity: 1; transform: translateY(-14px) rotate(-4deg); } }
@keyframes phoneInDetail { to { opacity: 1; transform: translateY(-6px) rotate(2.5deg); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

@media (max-width: 600px) {
  .phone-map { width: 158px; padding: 7px; border-radius: 28px; }
  .phone-detail { width: 190px; padding: 7px; border-radius: 28px; }
  .phone-wrap-map { margin-right: -84px; }
  .phone .screen { border-radius: 22px; }
  .screenshot { border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .phone-map { animation: none; opacity: 1; transform: translateY(-14px) rotate(-4deg); }
  .phone-detail { animation: none; opacity: 1; transform: translateY(-6px) rotate(2.5deg); }
  .phone-wrap { animation: none; }
}
