/* SoleFit website — shared styles.
   Design echoes the app's "Monochrome + Spectrum" system: near-white/ink base with
   small spectrum touches. Colors are WCAG 2.2 AA contrast-checked (>= 4.5:1 for body
   text, >= 3:1 for large text, borders, and focus rings). */

:root {
  color-scheme: light dark;

  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-2: #f1f1ee;
  --ink: #16161a;           /* primary text — ~17:1 on --bg */
  --ink-2: #55555c;         /* secondary text — ~6.5:1 on --bg */
  --ink-3: #6c6c74;         /* tertiary — ~5:1 on --bg */
  --stroke: #d9d9d4;
  --stroke-strong: #b6b6af; /* >= 3:1 for non-text UI borders */
  --accent: #16161a;        /* monochrome ink accent (buttons) */
  --accent-ink: #ffffff;    /* text on accent */
  --focus: #1a47b8;         /* focus ring — ~5.6:1 on --bg, 3:1+ non-text */
  --danger: #b3261e;        /* destructive — ~5.5:1 on --bg */
  --danger-ink: #ffffff;

  /* Small decorative spectrum touches only — never the sole carrier of meaning. */
  --spectrum-1: #e5484d;
  --spectrum-2: #f76b15;
  --spectrum-3: #ffb224;
  --spectrum-4: #46a758;
  --spectrum-5: #3e63dd;
  --spectrum-6: #8e4ec6;

  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 720px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e10;
    --surface: #17171a;
    --surface-2: #1f1f23;
    --ink: #f5f5f2;         /* ~16:1 on --bg */
    --ink-2: #b6b6bd;       /* ~9:1 on --bg */
    --ink-3: #98989f;       /* ~6:1 on --bg */
    --stroke: #2c2c31;
    --stroke-strong: #45454c;
    --accent: #f5f5f2;
    --accent-ink: #0e0e10;
    --focus: #8db4ff;       /* light blue — high contrast on dark */
    --danger: #ff6b64;
    --danger-ink: #0e0e10;
  }
}

/* Reset-ish */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  /* Support user text-spacing overrides (WCAG 1.4.12) — nothing clips text. */
  overflow-wrap: break-word;
}

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

/* Skip link (WCAG 2.4.1) */
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0.5rem; }

/* Visible focus for every interactive element (WCAG 2.4.7 / 1.4.11) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Layout */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

header.site {
  border-bottom: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  position: sticky;
  top: 0;
  backdrop-filter: saturate(1.1) blur(8px);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand .mark { flex: 0 0 auto; }
nav.primary { margin-left: auto; }
nav.primary ul {
  list-style: none;
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
nav.primary a {
  display: inline-block;
  padding: 0.5rem 0.7rem;      /* >= 44px tall touch target with line-height */
  min-height: 44px;
  line-height: 1.9;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
}
nav.primary a:hover { color: var(--ink); background: var(--surface-2); }
nav.primary a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--spectrum-5);
}

main { display: block; }
.section { padding: 2.5rem 0; }
.section + .section { border-top: 1px solid var(--stroke); }

/* Hero */
.hero { padding: 3.5rem 0 2.5rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-3);
  margin: 0 0 0.75rem;
}
h1 { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 0.75rem; }
h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); line-height: 1.2; letter-spacing: -0.01em; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 1.75rem 0 0.5rem; }
.lead { font-size: 1.2rem; color: var(--ink-2); max-width: 42ch; }
.rule { height: 3px; width: 96px; border: 0; border-radius: 3px; margin: 1.25rem 0;
  background: linear-gradient(90deg, var(--spectrum-1), var(--spectrum-3), var(--spectrum-4), var(--spectrum-5), var(--spectrum-6)); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { opacity: 0.9; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--stroke-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: var(--danger-ink); }
.btn-danger:hover { opacity: 0.92; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* Links in prose — underlined so link-ness never relies on color alone (WCAG 1.4.1) */
.prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--stroke-strong); }
.prose a:hover { text-decoration-color: var(--spectrum-5); }

/* Feature list */
.features { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0.9rem; }
.features li { display: flex; gap: 0.85rem; align-items: flex-start; }
.features .dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 3px; margin-top: 0.5rem; }
.features h3 { margin: 0 0 0.15rem; font-size: 1.05rem; }
.features p { margin: 0; color: var(--ink-2); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card + .card { margin-top: 1rem; }

/* Legal / prose pages */
.prose { max-width: 68ch; }
.prose p, .prose li { color: var(--ink); }
.prose h2 { scroll-margin-top: 5rem; }
.prose .muted { color: var(--ink-2); }
.effective { color: var(--ink-2); font-size: 0.95rem; margin-top: -0.5rem; }
.callout {
  border: 1px solid var(--stroke-strong);
  border-left: 4px solid var(--spectrum-3);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  margin: 1.25rem 0;
}
.callout.warn { border-left-color: var(--spectrum-2); }

/* Forms */
form.request { margin-top: 1.5rem; }
.field { margin-bottom: 1.25rem; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.field .hint { color: var(--ink-2); font-size: 0.92rem; margin: 0 0 0.5rem; }
.req { color: var(--danger); }
input[type="email"], input[type="text"], textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
  min-height: 48px;
}
textarea { min-height: 8rem; resize: vertical; }
fieldset { border: 1px solid var(--stroke); border-radius: var(--radius-sm); padding: 0.75rem 1rem 1rem; margin: 0; }
.radio { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.4rem 0; }
.radio input { margin-top: 0.35rem; width: 20px; height: 20px; }
.radio label { font-weight: 500; margin: 0; }
.status {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke-strong);
  background: var(--surface-2);
}
.status:empty { display: none; }

/* Footer */
footer.site { border-top: 1px solid var(--stroke); margin-top: 1rem; padding: 2rem 0 3rem; color: var(--ink-2); }
footer.site .foot-inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
footer.site nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
footer.site a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
footer.site a:hover { color: var(--ink); }
.fineprint { font-size: 0.9rem; margin-top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Respect reduced-motion (WCAG 2.3.3 / user comfort) */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
