/* ============================================================
   HerdLab Nutrition — coming-soon site
   Premium off-white / black / muted teal. Mobile-first.
   ============================================================ */

/* ---- Fonts (self-hosted, variable, zero external requests) ---- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/fraunces.woff2') format('woff2');
}

/* ---- Design tokens ---- */
:root {
  --bg: #faf8f3;          /* warm off-white / champagne */
  --bg-alt: #ffffff;      /* pure white for lift */
  --bg-deep: #f2eee5;     /* slightly deeper band */
  --ink: #141414;         /* near-black text */
  --ink-soft: #4a4842;    /* muted body text */
  --ink-faint: #8c887e;   /* captions / notes */
  --teal: #2f6f5e;        /* muted brand accent */
  --teal-deep: #275a4c;
  --line: #e5e0d4;        /* hairlines on off-white */
  --line-soft: #ece7db;

  /* product colour cues (muted) */
  --cue-electrolyte: #e6dcc2;
  --cue-joint: #a9c6dd;
  --cue-calm: #e2bcc8;
  --cue-digestive: #b2ccae;

  --maxw: 1120px;
  --pad: clamp(1.25rem, 5vw, 2.5rem);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }

.visually-hidden, .skip-link {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; top: 12px; left: 12px; width: auto; height: auto;
  clip: auto; margin: 0; padding: 10px 16px; background: var(--ink); color: #fff;
  border-radius: 8px; z-index: 100;
}

/* ---- Shared type helpers ---- */
.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1rem;
}
.section-title {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(1.7rem, 4.4vw, 2.6rem);
  line-height: 1.14;
  letter-spacing: -0.015em;
}

/* ---- Wordmark ---- */
.wordmark {
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 0.02em;
}
.wordmark-herd { font-weight: 400; }
.wordmark-lab { font-weight: 700; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 0.85rem 1.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), transform 0.15s var(--ease),
              box-shadow 0.25s var(--ease), color 0.25s var(--ease);
}
.btn-primary {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.12);
}
.btn-primary:hover { background: var(--teal-deep); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(39, 90, 76, 0.22); }
.btn-primary:active { transform: translateY(0); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 243, 0.82);
  backdrop-filter: saturate(1.1) blur(10px);
  -webkit-backdrop-filter: saturate(1.1) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.header-link {
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  padding: 0.4rem 0;
  position: relative;
}
.header-link::after {
  content: '';
  position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px; background: var(--teal);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.header-link:hover::after { transform: scaleX(1); }

/* ---- Hero ---- */
.hero {
  padding: clamp(3rem, 9vw, 6rem) 0 clamp(3rem, 8vw, 5.5rem);
  text-align: center;
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 760px;
}
/* In a centered flex column, text children otherwise take their max-content
   width and overflow the viewport — cap them so they wrap. */
.hero-inner > *,
.footer-inner > * { max-width: 100%; }
.hero-logo {
  width: clamp(230px, 52vw, 400px);
  height: auto;
  margin: 0.4rem 0 1.7rem;
  /* Transparent PNG (white knocked out) — sits cleanly on the off-white page */
}
.hero-title {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-weight: 300;
  font-size: clamp(2.5rem, 8vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.hero-sub {
  margin: 1.4rem auto 2.2rem;
  max-width: 33ch;
  font-size: clamp(1.02rem, 2.4vw, 1.2rem);
  color: var(--ink-soft);
}

/* ---- Sections ---- */
.section { padding: clamp(3.5rem, 9vw, 6.5rem) 0; }

/* What we do */
.what { background: var(--bg-alt); border-block: 1px solid var(--line-soft); }
.what-inner {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  grid-template-columns: 1fr;
}
.what-body p { color: var(--ink-soft); font-size: 1.06rem; max-width: 60ch; }
.pillars {
  margin-top: 2rem;
  display: grid;
  gap: 1.4rem;
}
.pillars li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--teal);
}
.pillar-title { font-weight: 600; font-size: 0.98rem; }
.pillar-desc { color: var(--ink-faint); font-size: 0.92rem; }

/* Range */
.range { background: var(--bg-deep); }
.range-head { max-width: 640px; margin-bottom: clamp(2rem, 5vw, 3rem); }
.range-note { margin-top: 0.7rem; color: var(--ink-faint); font-size: 0.95rem; }
.range-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.range-card {
  position: relative;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.7rem;
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.range-card::before { /* top colour-cue bar */
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--cue, var(--line));
}
.range-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(20, 20, 20, 0.08);
  border-color: var(--line-soft);
}
.range-card[data-cue="electrolyte"] { --cue: var(--cue-electrolyte); }
.range-card[data-cue="joint"] { --cue: var(--cue-joint); }
.range-card[data-cue="calm"] { --cue: var(--cue-calm); }
.range-card[data-cue="digestive"] { --cue: var(--cue-digestive); }
.cue {
  display: block;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--cue);
  margin-bottom: 1.1rem;
  box-shadow: inset 0 0 0 1px rgba(20, 20, 20, 0.06);
}
.range-tag {
  position: absolute; top: 1.3rem; right: 1.4rem;
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint);
}
.range-name { font-size: 1.16rem; font-weight: 600; margin-bottom: 0.35rem; }
.range-desc { color: var(--ink-soft); font-size: 0.95rem; }

/* Register */
.register { text-align: center; }
.register-inner { max-width: 560px; margin-inline: auto; }
.register-sub { margin: 1rem auto 2rem; color: var(--ink-soft); max-width: 42ch; }
.signup-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-width: 420px;
  margin-inline: auto;
}
.field input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  padding: 0.9rem 1.1rem;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field input::placeholder { color: var(--ink-faint); }
.field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(47, 111, 94, 0.14); }
.field input[aria-invalid="true"] { border-color: #b4462f; box-shadow: 0 0 0 3px rgba(180, 70, 47, 0.12); }
.signup-form .btn { margin-top: 0.2rem; }
.hp { position: absolute; left: -9999px; opacity: 0; }
.form-status {
  min-height: 1.2em;
  font-size: 0.92rem;
  font-weight: 500;
  margin-top: 0.3rem;
}
.form-status.is-error { color: #b4462f; }
.form-status.is-success { color: var(--teal); }
.form-note { color: var(--ink-faint); font-size: 0.82rem; }
.signup-form.sent .field, .signup-form.sent .btn, .signup-form.sent .form-note { display: none; }

.mailto-fallback { margin-top: 1.8rem; color: var(--ink-faint); font-size: 0.92rem; }
.mailto-fallback a { color: var(--teal); text-decoration: none; border-bottom: 1px solid rgba(47, 111, 94, 0.3); }
.mailto-fallback a:hover { border-bottom-color: var(--teal); }

/* ---- Footer ---- */
.site-footer {
  background: var(--ink);
  color: #cfccc4;
  padding: clamp(2.5rem, 6vw, 3.5rem) 0;
  text-align: center;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.footer-wordmark { color: #fff; font-size: 1.05rem; flex-wrap: wrap; justify-content: center; }
.footer-wordmark .footer-ltd { color: #cfccc4; font-weight: 400; margin-left: 0.35rem; letter-spacing: 0.01em; }
.footer-contact a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.3); }
.footer-contact a:hover { border-bottom-color: #fff; }
.footer-legal { color: #a5a199; font-size: 0.9rem; max-width: 46ch; }
.footer-copy { color: #7d7a72; font-size: 0.8rem; margin-top: 0.4rem; }

/* ---- Scroll reveal ---- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.range-card.reveal { transition-delay: var(--d, 0s); }

/* ============================================================
   Responsive — tablet & desktop
   ============================================================ */
@media (min-width: 620px) {
  .range-grid { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
  .signup-form { flex-direction: row; flex-wrap: wrap; }
  .signup-form .field { flex: 1 1 100%; }
  .signup-form #email { }
}

@media (min-width: 900px) {
  body { font-size: 18px; }
  .what-inner { grid-template-columns: 0.9fr 1.1fr; align-items: start; }
  .what-lead { position: sticky; top: 96px; }
  .range-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Honour reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
