/* ==========================================================================
   base.css — reset, document defaults, shared primitives
   ========================================================================== */

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

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

html, body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
button:disabled { cursor: not-allowed; }

h1, h2, h3, h4 { line-height: 1.15; font-weight: 600; }
.serif { font-family: var(--font-serif); }

ul { list-style: none; }

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

/* Visually hidden but accessible */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Focus ring for keyboard users only */
:focus-visible {
  outline: 3px solid var(--apricot);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Shared button shapes ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-pill);
  padding: 13px 30px;
  font-size: 0.95rem; font-weight: 600;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast), box-shadow var(--t-fast);
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--navy); color: var(--text-on-dark); }
.btn--primary:hover { background: var(--navy-light); }
.btn--light { background: var(--white); color: var(--navy); box-shadow: 0 4px 20px rgba(0,0,0,0.18); }
.btn--ghost {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.btn--ghost:hover { border-color: var(--navy-light); }
.btn--ghost:disabled { opacity: 0.45; box-shadow: none; }

/* ---- Icon button (circular) ---- */
.icon-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--text-on-dark);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--navy-light); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .badge[hidden] { display: none; }
.icon-btn .badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--apricot); color: var(--white);
  font-size: 0.66rem; font-weight: 700;
  border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--cream);
}

/* ---- Toggle switch ---- */
.toggle {
  width: 46px; height: 26px; flex-shrink: 0;
  background: var(--toggle-off);
  border-radius: var(--r-pill);
  position: relative;
  transition: background var(--t-base) var(--ease);
}
.toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  transition: transform var(--t-base) var(--ease);
}
/* role="switch" → aria-checked carries the state (aria-pressed kept for
   any plain toggle button that might still use it) */
.toggle[aria-checked="true"],
.toggle[aria-pressed="true"] { background: var(--green); }
.toggle[aria-checked="true"]::after,
.toggle[aria-pressed="true"]::after { transform: translateX(20px); }

/* ---- Pill badge ---- */
.badge-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--apricot); color: var(--white);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 11px; border-radius: var(--r-pill);
  white-space: nowrap;
}
.badge-pill svg { width: 11px; height: 11px; }

/* ---- Utility ---- */
.eyebrow {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
