/* ============================================================
   Resonance Nutra — landing page
   Design system: "Clinical Precision" (plan-design-review)
   Separate from the app's frontend/styles/variables.css by design.
   REPLACE_ME(brand): --accent + fonts get swapped for Caroline's
   supplied palette/logo when they land.
   ============================================================ */

:root {
  /* Color roles */
  --ink: #16181d;
  --paper: #f7f5f1;      /* warm off-white ground */
  --surface: #ffffff;
  --accent: #0f766e;     /* clinical teal — PLACEHOLDER */
  --accent-strong: #0b5c55;
  --accent-ink: #ffffff; /* text on accent */
  --muted: #5b6169;
  --line: #e4e0d8;       /* hairline borders */

  /* Type */
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: "Public Sans", ui-sans-serif, system-ui, sans-serif;

  /* Spacing (4-based) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-6: 24px; --sp-8: 32px; --sp-12: 48px; --sp-16: 64px; --sp-24: 96px;

  --header-h: 68px;
  --maxw: 1120px;
  --radius: 10px;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
img, svg { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* Accessibility helpers */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 600; font-size: 16px;
  padding: 14px 26px; min-height: 48px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn-sm { padding: 9px 16px; min-height: 40px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); color: #fff; transform: translateY(-1px); }
.btn-invert { background: var(--surface); color: var(--ink); }
.btn-invert:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--ink); letter-spacing: -0.02em; }
.wordmark-accent { color: var(--accent); }
.wordmark-sm { font-size: 19px; }

.site-nav { display: flex; align-items: center; }
.nav-links { list-style: none; display: flex; align-items: center; gap: 22px; margin: 0; padding: 0; }
.nav-links a { color: var(--ink); font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--accent); }
.nav-login a { color: var(--muted); }
.nav-toggle { display: none; }

/* ---------- hero ---------- */
.hero { padding-top: var(--sp-24); background:
    radial-gradient(120% 90% at 82% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    var(--paper); }
.hero-inner { max-width: 880px; padding-bottom: var(--sp-16); }
.hero-eyebrow, .section-eyebrow {
  font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: var(--sp-4);
}
.hero-title { font-size: clamp(40px, 6vw, 72px); font-weight: 700; }
.accent-underline { position: relative; white-space: nowrap; }
.accent-underline::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .08em; height: .12em;
  background: var(--accent); opacity: .35; border-radius: 2px;
}
.hero-sub { font-size: clamp(18px, 2.2vw, 22px); color: var(--muted); margin-top: var(--sp-6); max-width: 620px; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); margin-top: var(--sp-8); }

.badge-cta {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink); font-weight: 500; font-size: 15px;
}
.badge-cta:hover { border-color: var(--accent); color: var(--accent); }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }

/* ---------- trust bar ---------- */
.trust-bar { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.trust-inner { display: flex; flex-wrap: wrap; gap: var(--sp-6) var(--sp-12); padding: var(--sp-4) 24px; }
.trust-inner span {
  font-family: var(--display); font-size: 14px; font-weight: 500; color: var(--muted);
  display: inline-flex; align-items: center;
}
.trust-inner span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 10px; }

/* ---------- sections ---------- */
.section { padding: var(--sp-24) 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { font-size: clamp(28px, 3.6vw, 40px); max-width: 720px; }
.section-lead { font-size: 19px; color: var(--muted); max-width: 680px; margin-top: var(--sp-4); }

.cols-3, .cols-2 { display: grid; gap: var(--sp-8); margin-top: var(--sp-12); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 h3, .cols-2 h3 { font-size: 20px; margin-bottom: var(--sp-3); }
.cols-3 p, .cols-2 p { color: var(--muted); }
.cols-3 article, .cols-2 article { padding-top: var(--sp-4); border-top: 2px solid var(--accent); }

.feature-list { list-style: none; margin: var(--sp-12) 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4) var(--sp-12); }
.feature-list li { padding-left: 26px; position: relative; color: var(--muted); }
.feature-list li strong { color: var(--ink); font-weight: 600; }
.feature-list li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: 12px; height: 12px;
  border: 2px solid var(--accent); border-radius: 3px;
}

/* ---------- supplyside ---------- */
.section-accent { background: var(--ink); color: #fff; }
.section-accent .section-title { color: #fff; }
.section-accent .section-lead { color: color-mix(in srgb, #fff 72%, transparent); }
.section-eyebrow-invert { color: color-mix(in srgb, var(--accent) 70%, #fff); }
.supplyside-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-12); flex-wrap: wrap; }

/* ---------- contact ---------- */
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-16); align-items: start; }
.contact-direct { margin-top: var(--sp-6); color: var(--muted); }
.contact-form { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: var(--sp-8); }
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-family: var(--display); font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font-family: var(--body); font-size: 16px; color: var(--ink);
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field textarea { resize: vertical; }
.field-error { color: #b42318; font-size: 14px; margin-top: 6px; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #b42318; }
.form-status { margin-top: var(--sp-4); font-size: 15px; padding: 12px 14px; border-radius: 8px; }
.form-status.is-error { background: #fdecea; color: #912018; }
.form-success { text-align: center; padding: var(--sp-8) 0; }
.form-success h3 { font-size: 22px; margin-bottom: var(--sp-2); }
.form-success p { color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: var(--sp-16) 0 var(--sp-8); margin-top: var(--sp-8); }
.footer-inner { display: flex; justify-content: space-between; gap: var(--sp-8); flex-wrap: wrap; }
.footer-meta { color: var(--muted); font-size: 15px; margin-top: var(--sp-2); }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--ink); font-size: 15px; }
.footer-links a:hover { color: var(--accent); }
.footer-legal { display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-top: var(--sp-12); padding-top: var(--sp-6); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* ---------- motion (hero entrance) ----------
   CSS-only, fail-safe: base state is fully visible (opacity:1). The entrance
   animation only runs when motion is welcome, and `both` fill leaves the end
   (visible) state. If animations don't run, content is simply already visible.
   No JS, no scroll dependency — content can never be stranded hidden. */
@media (prefers-reduced-motion: no-preference) {
  .hero-eyebrow, .hero-title, .hero-sub, .hero-cta { animation: rn-rise .6s ease both; }
  .hero-title { animation-delay: .06s; }
  .hero-sub { animation-delay: .12s; }
  .hero-cta { animation-delay: .18s; }
}
@keyframes rn-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ============================================================ RESPONSIVE ============================================================ */
@media (max-width: 900px) {
  .cols-3 { grid-template-columns: 1fr; }
  .cols-2 { grid-template-columns: 1fr; }
  .feature-list { grid-template-columns: 1fr; }
  .contact-wrap { grid-template-columns: 1fr; gap: var(--sp-8); }
}

@media (max-width: 768px) {
  .section { padding: 56px 0; }
  .hero { padding-top: 56px; }
  .hero-inner { padding-bottom: 56px; }

  /* Header collapses to a menu button */
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; background: none; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  }
  .nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 0 auto; transition: transform .2s ease, opacity .2s ease; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav-links {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: var(--sp-2) 24px var(--sp-6); display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links li a { display: block; padding: 12px 0; }
  .nav-links .btn { width: 100%; margin-top: var(--sp-2); }

  .hero-cta .btn, .hero-cta .badge-cta { width: 100%; }
  .supplyside-inner .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .badge-cta { transition: none; }
}
