/* ============================================================================
   base.css — reset, typography, buttons, form controls, utilities.
   No section layout here; that lives in home.css.
   ========================================================================== */

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

/* ⚠ [hidden] IS A UA RULE, AND AUTHOR CSS BEATS IT REGARDLESS OF SPECIFICITY.
   `.fc__selects { display: grid }` silently defeated `hidden=true` and left the
   region listbox and spot filter on screen throughout Weather mode — while a
   test asserting `.hidden` (the property) reported it hidden. Anything that
   sets display must not be able to win this argument. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The nav is sticky, so anything scrolled to by anchor or by
     scrollIntoView lands UNDER it without this. */
  scroll-padding-top: calc(var(--nav-h) + var(--sp-4));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3, h4 {
  color: var(--text);
  font-weight: var(--fw-display);
  line-height: 1.12;
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-label); letter-spacing: -0.01em; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  margin: 0;
  /* padding:0 matters — the UA default is ~1px 6px, which is invisible until a
     bare button sits in a column beside <a>s and lands 6px further right. */
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

/* ── Focus: visible, brand-colored, never removed ─────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* ── Screen-reader-only ───────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: 200;
  padding: var(--sp-3) var(--sp-5);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: var(--fw-label);
  border-radius: var(--r-md);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

/* ── Layout helper ────────────────────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}
@media (max-width: 560px) { .wrap { padding-inline: var(--sp-4); } }

/* ── Eyebrow ──────────────────────────────────────────────────────────────── */
.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-label);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--accent-text);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
/* Height is set by --btn-pad-y + min-height, NOT by padding alone, so that a
   bordered variant cannot come out taller than a filled one sitting next to it.
   Before this, hero Sign in measured 57.2px against Sign up's 55.2px once they
   stacked at 390px — the 1.5px border top and bottom. Desktop hid it, because
   .hero__cta is a flex row and stretch equalised them. */
.btn {
  --btn-pad-y: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--btn-pad-y) var(--sp-5);
  min-height: 38px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: var(--fw-label);
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:active { background: var(--accent-pressed); }

/* The seam: the BORDER is decoration (--accent), the LABEL is text
   (--accent-text). They are different values on purpose. */
.btn--outline {
  background: transparent;
  color: var(--accent-text);
  border: 1.5px solid var(--line-strong);
  /* absorb the border into the padding so the box matches an unbordered one */
  padding-block: calc(var(--btn-pad-y) - 1.5px);
}
.btn--outline:hover { border-color: var(--accent); background: var(--accent-tint); }

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn--ghost:hover { color: var(--text); background: var(--surface-sunken); }

.btn--lg {
  --btn-pad-y: 8px;
  padding: var(--btn-pad-y) var(--sp-8);
  min-height: 46px;
  font-size: var(--fs-body-lg);
}
.btn--outline.btn--lg { padding-block: calc(var(--btn-pad-y) - 1.5px); }

/* ⚠ TAP TARGET FLOOR. At <=900px every button holds 44px regardless of how
   thin the padding gets — the trim is taken on desktop only. Without this the
   nav Fetch+ button lands at 38px and the hero pair at 43.2px, both under the
   44px minimum, on exactly the viewports where the pointer is a thumb. */
@media (max-width: 900px) {
  .btn,
  .btn--lg { min-height: 44px; }
}
.btn--block { width: 100%; }

/* ── Native controls ──────────────────────────────────────────────────────── */
.field {
  display: block;
  width: 100%;
  padding: 12px var(--sp-4);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-body);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.field:hover:not(:disabled) { border-color: var(--text-muted); }
.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.field:disabled {
  background: var(--surface-sunken);
  color: var(--text-muted);
  cursor: not-allowed;
}

select.field {
  appearance: none;
  padding-right: var(--sp-10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2344555E' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-4) center;
  cursor: pointer;
}
select.field:disabled { cursor: not-allowed; }

.field-label {
  display: block;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Segmented control ────────────────────────────────────────────────────── */
.segmented {
  display: inline-flex;
  padding: 4px;
  background: var(--surface-sunken);
  border-radius: var(--r-pill);
  gap: 2px;
}
.segmented__btn {
  padding: 9px var(--sp-5);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: var(--fw-label);
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.segmented__btn:hover { color: var(--text); }
.segmented__btn[aria-selected="true"] {
  background: var(--bg);
  color: var(--accent-text);
  box-shadow: var(--shadow-sm);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
