/* ---------- Theme ---------- */
/* Accents come from the app's own brand: #2B54A6 is the adaptive-icon blue and
   #0A1937 the splash navy. The UV ramp is reused verbatim from
   src/common/theme/colors.ts so the site and the app agree on what a UV
   number looks like. */
:root {
  --bg: #fcfcfd;
  --fg: #16181d;
  --muted: #5e636e;
  --card: #ffffff;
  --border: #e4e6eb;
  --accent: #2b54a6;
  --brand-navy: #0a1937;
  --uv-low: #7bc67e;
  --uv-moderate: #e8d44d;
  --uv-high: #f5a623;
  --uv-very-high: #e85d4c;
  --radius: 12px;
  --measure: 42rem; /* ~700px reading column */
}

html.dark {
  --bg: #0f1116;
  --fg: #f3f4f7;
  --muted: #9aa0ad;
  --card: #171a21;
  --border: #272b35;
  --accent: #8fb3ef;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
}

p {
  margin: 0 0 1rem;
  max-width: var(--measure);
}

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

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

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

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1.5rem;
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ---------- Layout ---------- */
.page {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
}

/* Wordmark in the toolbar, so every page has a way back to the landing page. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

#theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

#theme-toggle:hover {
  color: var(--fg);
  background: var(--border);
}

#theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The sun shows in light mode (click for dark) and the moon in dark mode. */
.icon-moon {
  display: none;
}

html.dark .icon-sun {
  display: none;
}

html.dark .icon-moon {
  display: inline;
}

/* ---------- Hero ---------- */
.hero {
  padding: 3rem 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 48rem) {
  .hero {
    grid-template-columns: 1.15fr 0.85fr;
    padding-top: 4rem;
  }
}

.hero h1 {
  font-size: clamp(2.25rem, 6vw, 3rem);
  font-weight: 700;
}

.hero .lede {
  font-size: 1.125rem;
  color: var(--muted);
  margin-top: 1rem;
}

.hero-art img {
  width: min(100%, 320px);
  margin: 0 auto;
  border-radius: 22px;
  border: 1px solid var(--border);
}

/* ---------- Content ---------- */
main {
  padding-top: 1rem;
}

section {
  margin-top: 3.5rem;
}

section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 0;
  list-style: none;
}

.features li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.features h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.features p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

/* The UV ramp, shown as the swatches the app actually uses. */
.uv-ramp {
  display: flex;
  gap: 0.35rem;
  margin-top: 1rem;
}

.uv-ramp span {
  height: 6px;
  flex: 1;
  border-radius: 3px;
}

.uv-ramp span:nth-child(1) {
  background: var(--uv-low);
}
.uv-ramp span:nth-child(2) {
  background: var(--uv-moderate);
}
.uv-ramp span:nth-child(3) {
  background: var(--uv-high);
}
.uv-ramp span:nth-child(4) {
  background: var(--uv-very-high);
}

/* ---------- Policy pages ---------- */
.policy {
  padding-top: 2.5rem;
}

.policy h1 {
  font-size: clamp(1.9rem, 5vw, 2.4rem);
  font-weight: 700;
}

.policy .updated {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.policy h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
}

.policy ul {
  max-width: var(--measure);
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}

.policy li {
  margin-bottom: 0.4rem;
}

/* ---------- Footer ---------- */
footer {
  margin-top: 4rem;
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--border);
}

.footer-note {
  color: var(--muted);
  margin: 0;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.95rem;
  margin-top: 0.75rem;
}

.copyright {
  margin: 2rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}
