/* Hygrometer — site styles.
   Palette, radii and hairlines are lifted from the app's Theme.swift so the
   page and the product are visibly the same object. See DESIGN.md. */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5f8fb;
  --bg-elevated: #fbfdff;
  --card: #ffffff;
  --stroke: #e0e5e9;
  --stroke-strong: #cfd7de;
  --ink: #16202c;
  --ink-soft: #56626f;
  --ink-faint: #7a8592;
  --accent: #1382e3;
  --accent-ink: #0c5fa8;

  /* Comfort bands — semantic, from ComfortBand.color. */
  --band-dry: #e07b1c;
  --band-comfortable: #25a35a;
  --band-moderate: #4a99af;
  --band-humid: #1373cb;
  --band-damp: #5a3daa;

  --radius: 18px;
  --radius-sm: 12px;
  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-gap: clamp(4.5rem, 10vw, 8rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0d13;
    --bg-elevated: #0f131b;
    --card: #151921;
    --stroke: #272d37;
    --stroke-strong: #333b47;
    --ink: #edf1f6;
    --ink-soft: #a3adba;
    --ink-faint: #7f8996;
    --accent: #4ba6f9;
    --accent-ink: #8cc6ff;

    --band-dry: #f29d38;
    --band-comfortable: #4cc97a;
    --band-moderate: #73bdd3;
    --band-humid: #51a3f2;
    --band-damp: #9c82e6;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-ink); text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 640;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 6.2vw, 3.9rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.15rem; font-weight: 620; letter-spacing: -0.01em; }

p { margin: 0; }

.wrap {
  width: min(72rem, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 640;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card);
  color: var(--ink);
  padding: 0.75rem 1rem;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  z-index: 10;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--stroke);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 660;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.brand img { width: 30px; height: 30px; border-radius: 7px; }

.site-nav { display: flex; gap: 1.25rem; font-size: 0.95rem; align-items: center; }
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--ink); }

/* ---------- narrow-viewport navigation ---------- */

.nav-menu { display: none; position: relative; }

.nav-menu summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  gap: 5px;
  padding: 0.5rem;
  user-select: none;
}

.nav-menu summary::-webkit-details-marker { display: none; }

.nav-menu summary span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 1px;
}

.nav-menu__sheet {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 60;
  display: grid;
  min-width: 12rem;
  padding: 0.5rem;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.nav-menu__sheet a {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.nav-menu__sheet a:hover,
.nav-menu__sheet a[aria-current="page"] {
  background: var(--bg-elevated);
  color: var(--ink);
}

@media (max-width: 800px) {
  .site-nav { display: none; }
  .nav-menu { display: block; }
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(3rem, 8vw, 5.5rem) 0;
}

.hero__grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}

@media (min-width: 62rem) {
  .hero__grid {
    grid-template-columns: 1fr minmax(0, 21rem);
    gap: 4.5rem;
  }
}

.hero__copy > * + * { margin-top: 1.25rem; }

.hero h1 { margin-top: 0.75rem; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem;
  padding-top: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.875rem;
  font-weight: 560;
  color: var(--ink-soft);
}
.chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--band-comfortable);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 620;
  text-decoration: none;
  border: 1px solid transparent;
}
.button:hover { background: var(--accent-ink); color: #fff; }
.button svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}
.button--small {
  padding: 0.45rem 0.95rem;
  font-size: 0.88rem;
}

.store-qr {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.75rem 0.4rem 0.4rem;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1.3;
}
.store-qr img {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  background: #fff;
  padding: 2px;
  display: block;
}
.store-qr small {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.store-qr strong {
  display: block;
  font-weight: 640;
  color: var(--ink);
}

@media (max-width: 640px) {
  .store-qr { display: none; }
}

.meta-line {
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.screen {
  border-radius: 26px;
  border: 1px solid var(--stroke);
  overflow: hidden;
  background: var(--card);
}
.screen img { width: 100%; }

.screen--widget {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.screen--widget img {
  filter: drop-shadow(0 18px 36px rgba(15, 23, 42, 0.14)) drop-shadow(0 4px 12px rgba(15, 23, 42, 0.08));
}

@media (prefers-color-scheme: dark) {
  .screen--widget img {
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.25)) drop-shadow(0 20px 40px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 45px rgba(56, 163, 245, 0.12));
  }
}

.hero__screen { max-width: 21rem; margin-inline: auto; }

/* ---------- band scale ---------- */

.bands {
  margin-top: clamp(3rem, 7vw, 5rem);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--card);
  padding: 1.25rem 1.25rem 1rem;
}

.bands__track {
  display: grid;
  grid-template-columns: 30fr 20fr 10fr 10fr 30fr;
  gap: 3px;
}
.bands__track span {
  height: 8px;
  border-radius: 999px;
}
.bands__track span:nth-child(1) { background: var(--band-dry); }
.bands__track span:nth-child(2) { background: var(--band-comfortable); }
.bands__track span:nth-child(3) { background: var(--band-moderate); }
.bands__track span:nth-child(4) { background: var(--band-humid); }
.bands__track span:nth-child(5) { background: var(--band-damp); }

/* Below the breakpoint the five labels cannot align to their bands: "Moderate"
   and "Humid" own 10% of the track each and their min-content width overflows
   the viewport. So narrow screens get a wrapping legend with the band colour
   carried by a dot, and only wide ones get the aligned columns. */
.bands__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.bands__labels span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.bands__labels span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  flex: none;
}
.bands__labels span:nth-child(1)::before { background: var(--band-dry); }
.bands__labels span:nth-child(2)::before { background: var(--band-comfortable); }
.bands__labels span:nth-child(3)::before { background: var(--band-moderate); }
.bands__labels span:nth-child(4)::before { background: var(--band-humid); }
.bands__labels span:nth-child(5)::before { background: var(--band-damp); }

@media (min-width: 46rem) {
  .bands__labels {
    display: grid;
    grid-template-columns: 30fr 20fr 10fr 10fr 30fr;
    gap: 3px;
  }
  .bands__labels span::before { display: none; }
}
.bands__note {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  max-width: 46rem;
}

/* ---------- sections ---------- */

 /* Half the gap on each side, so the space BETWEEN two sections is one
    --section-gap rather than two stacked ones. */
.section { padding-block: calc(var(--section-gap) / 2); }
.section:last-of-type { padding-bottom: var(--section-gap); }
.section__head { max-width: 44rem; }
.section__head > * + * { margin-top: 0.9rem; }
.section__body { margin-top: clamp(2rem, 4vw, 3rem); }

.split {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
@media (min-width: 56rem) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); }
  .split--reverse > :first-child { order: 2; }
}

/* ---------- proof block: the comparison the product is built on ---------- */

.compare {
  display: grid;
  gap: 1rem;
  margin-block: 1.75rem;
}
@media (min-width: 40rem) {
  .compare { grid-template-columns: 1fr auto 1fr; align-items: stretch; }
}

.compare__card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--card);
  padding: 1.25rem;
}
.compare__rh {
  font-size: 2.75rem;
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1;
}
.compare__at { color: var(--ink-faint); font-size: 0.95rem; margin-top: 0.35rem; }
.compare__water {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--stroke);
  font-size: 1.35rem;
  font-weight: 640;
}
.compare__water span { font-size: 0.85rem; font-weight: 520; color: var(--ink-faint); display: block; }
.compare__vs,
.compare__badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  text-align: center;
}

.compare__symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.compare__symbol svg {
  width: 1.25rem;
  height: 1.25rem;
}

.compare__text {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

@media (max-width: 39.99rem) {
  .compare__symbol {
    transform: rotate(90deg);
  }
}

/* ---------- metric list ---------- */

.metrics {
  display: grid;
  gap: 1px;
  background: var(--stroke);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (min-width: 46rem) { .metrics { grid-template-columns: 1fr 1fr; } }

.metric {
  background: var(--card);
  padding: 1.4rem 1.35rem;
}
.metric h3 { display: flex; align-items: baseline; gap: 0.6rem; }
.metric h3::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--dot, var(--accent));
  flex: none;
  transform: translateY(-1px);
}
.metric p { margin-top: 0.55rem; color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- widgets ---------- */

.widgets {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
}
@media (min-width: 46rem) { .widgets { grid-template-columns: 1fr 1fr; } }

.widgets figcaption {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- note ---------- */

.note {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--card);
  padding: 1.6rem 1.7rem;
}
.note h3 {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--stroke);
}
.note p { color: var(--ink-soft); }
.note p + p { margin-top: 0.75rem; }

/* ---------- specs ---------- */

.specs {
  display: grid;
  gap: 1px;
  background: var(--stroke);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.95rem;
}
@media (min-width: 40rem) { .specs { grid-template-columns: 1fr 1fr; } }
.spec {
  background: var(--card);
  padding: 1rem 1.25rem;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}
.spec dt { color: var(--ink-faint); }
.spec dd { margin: 0; font-weight: 580; text-align: right; }

/* ---------- prose (privacy, support) ---------- */

.prose { max-width: 42rem; }
.prose > * + * { margin-top: 1.15rem; }
.prose h2 { margin-top: 2.75rem; font-size: 1.5rem; }
.prose h3 { margin-top: 2rem; }
.prose ul { padding-left: 1.15rem; color: var(--ink-soft); }
.prose li + li { margin-top: 0.45rem; }
.prose p { color: var(--ink-soft); }
.prose strong { color: var(--ink); font-weight: 620; }

.page-head { padding-block: clamp(3rem, 7vw, 4.5rem) 0; }
.page-head > * + * { margin-top: 0.9rem; }

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

.site-footer {
  margin-top: var(--section-gap);
  border-top: 1px solid var(--stroke);
  padding-block: 2.5rem 3.5rem;
  font-size: 0.9rem;
  color: var(--ink-faint);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  align-items: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-left: auto; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.site-footer__locales {
  width: 100%;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--stroke);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-faint);
}
.site-footer__locales a { color: var(--ink-soft); text-decoration: none; }
.site-footer__locales a:hover,
.site-footer__locales a[aria-current="true"] { color: var(--ink); font-weight: 580; }
.site-footer__locales-label { margin-right: 0.4rem; color: var(--ink-faint); }
.site-footer__siblings {
  width: 100%;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-faint);
}
.site-footer__siblings a { color: var(--ink-soft); text-decoration: none; }
.site-footer__siblings a:hover { color: var(--ink); text-decoration: underline; }
.site-footer__siblings-label { margin-right: 0.4rem; color: var(--ink-faint); }
.site-footer__legal { width: 100%; margin-top: 0.75rem; line-height: 1.5; font-size: 0.8rem; }

/* ---------- motion ---------- */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
