/* =========================================================
   Pure Metabolics — Site CSS
   Palette: Verdant (BRAND-PALETTES-2026)
   Type:    Fraunces (display) + Inter (body)
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Verdant palette */
  --hero:        #007373;   /* Transformative Teal — used sparingly */
  --moss:        #5B7A3A;   /* Living Moss — primary brand color */
  --moss-deep:   #455E2B;
  --moss-soft:   #8AA46B;
  --accent:      #E8590C;   /* Mandarin Heat — CTA only */
  --gold:        #B8956A;

  --surface:     #FBF8F1;   /* Cream — page background */
  --surface-alt: #F0EBE0;   /* Warm beige — alt sections */
  --surface-dark:#15201D;   /* Deep ink — footer / dark sections */

  --ink:         #15201D;   /* Primary text */
  --ink-2:       #3D5650;   /* Secondary text */
  --ink-mute:    #6F7D78;   /* Muted text / captions */
  --rule:        #D9D2C2;   /* Hairlines / dividers */

  /* Type — Comfortaa is the brand font (display + body) */
  --serif: "Comfortaa", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --sans:  "Comfortaa", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  /* Spacing */
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 10vw, 8rem);
  --max:    72rem;       /* 1152px */
  --max-narrow: 44rem;   /* 704px — long-form prose */

  --radius: 4px;
  --shadow-soft: 0 1px 2px rgba(21,32,29,.04), 0 8px 24px rgba(21,32,29,.06);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--moss-deep); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent); }
button { font: inherit; cursor: pointer; }

/* Selection */
::selection { background: var(--moss); color: var(--surface); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 .5em;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-weight: 600;
}
h2 {
  font-size: clamp(1.75rem, 3.25vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 600;
}
h3 {
  font-size: clamp(1.1875rem, 1.9vw, 1.4375rem);
  line-height: 1.35;
  font-weight: 600;
}
h4 {
  font-size: 1rem;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--moss-deep);
}

p { margin: 0 0 1.25em; }
.lede {
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.5;
  color: var(--ink-2);
  font-weight: 400;
}

.eyebrow {
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--moss-deep);
  margin: 0 0 1.25rem;
}

blockquote, .pullquote {
  font-family: var(--serif);
  font-size: clamp(1.375rem, 2.6vw, 2rem);
  line-height: 1.3;
  font-weight: 400;
  color: var(--ink);
  margin: 0;
  padding: 0;
  letter-spacing: -0.005em;
}

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.container.narrow { max-width: var(--max-narrow); }

section { padding-block: var(--section-y); }
.section-tight { padding-block: clamp(2.5rem, 6vw, 5rem); }

.divider {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  background: rgba(251, 248, 241, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.125rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  text-decoration: none;
  position: relative;
  z-index: 65;
}
.logo img { height: 48px; width: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav a:not(.btn) {
  font-size: .9375rem;
  color: var(--ink-2);
  font-weight: 500;
  letter-spacing: 0.005em;
}
.nav a:not(.btn):hover,
.nav a:not(.btn)[aria-current="page"] { color: var(--moss-deep); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: .5rem;
  margin: -.5rem;
  color: var(--ink);
  position: relative;
  z-index: 65;
}

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; padding: .625rem; margin: -.625rem; }
  .nav {
    position: fixed;
    inset: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 60;
    background: var(--surface);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 5rem var(--gutter) 2rem;
    transform: translateY(-100%);
    transition: transform .3s ease, visibility .3s;
    overflow-y: auto;
    visibility: hidden;
  }
  .nav.is-open {
    transform: translateY(0);
    visibility: visible;
  }
  .nav a:not(.btn) {
    padding: 1rem 0;
    border-bottom: 1px solid var(--rule);
    font-size: 1.125rem;
  }
  .nav .btn {
    margin-top: 1.5rem;
    align-self: stretch;
    text-align: center;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .9375rem 1.625rem;
  font-family: var(--sans);
  font-size: .9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--moss-deep);
  color: var(--surface);
}
.btn-primary:hover { background: var(--ink); color: var(--surface); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--surface); }

.btn-light {
  background: var(--surface);
  color: var(--ink);
}
.btn-light:hover { background: var(--surface-alt); }

/* ---------- Hero (full-bleed video background) ---------- */
.hero {
  position: relative;
  min-height: clamp(560px, 82vh, 780px);
  padding-block: clamp(6rem, 14vw, 10rem) clamp(4rem, 8vw, 6rem);
  overflow: hidden;
  background: var(--surface-alt);
  isolation: isolate;
  display: flex;
  align-items: center;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg,
      rgba(251, 248, 241, 0.88) 0%,
      rgba(251, 248, 241, 0.62) 32%,
      rgba(251, 248, 241, 0.18) 60%,
      rgba(251, 248, 241, 0.00) 82%),
    linear-gradient(180deg,
      rgba(251, 248, 241, 0.00) 50%,
      rgba(251, 248, 241, 0.35) 100%);
  pointer-events: none;
}

@media (max-width: 820px) {
  .hero-scrim {
    background: linear-gradient(180deg,
      rgba(251, 248, 241, 0.55) 0%,
      rgba(251, 248, 241, 0.40) 45%,
      rgba(251, 248, 241, 0.85) 100%);
  }
}

.hero .container { position: relative; width: 100%; }

.hero-content { max-width: 36rem; }
.hero h1 { margin-bottom: 1.25rem; color: var(--ink); }
.hero .lede { max-width: 32ch; margin-bottom: 2.25rem; color: var(--ink-2); }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: .875rem; }

@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
}

/* ---------- Common patterns ---------- */
.surface-alt { background: var(--surface-alt); }
.surface-dark { background: var(--surface-dark); color: var(--surface); }
.surface-dark h1, .surface-dark h2, .surface-dark h3 { color: var(--surface); }
.surface-dark a { color: var(--moss-soft); }
.surface-dark .eyebrow { color: var(--moss-soft); }

.surface-moss {
  background: var(--moss-deep);
  color: var(--surface);
}
.surface-moss h1, .surface-moss h2 { color: var(--surface); }
.surface-moss .eyebrow { color: var(--moss-soft); }

/* Anchor block — short manifesto-style */
.anchor {
  text-align: center;
}
.anchor .pullquote {
  max-width: 36ch;
  margin: 0 auto;
}

/* Proof beats — 4-up */
.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}
@media (max-width: 820px) {
  .proof-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem 1.5rem; }
}
@media (max-width: 480px) {
  .proof-grid { grid-template-columns: 1fr; }
}
.proof-item h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  margin-bottom: .375rem;
}
.proof-item p {
  font-size: .9375rem;
  color: var(--ink-2);
  margin: 0;
}
.proof-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 1rem;
  color: var(--moss-deep);
}

/* Three-beat journey */
.beats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  counter-reset: beat;
}
@media (max-width: 820px) { .beats { grid-template-columns: 1fr; gap: 2rem; } }
.beat {
  counter-increment: beat;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
  position: relative;
}
.beat::before {
  content: counter(beat, decimal-leading-zero);
  position: absolute;
  top: 1rem;
  left: 0;
  font-family: var(--serif);
  font-style: italic;
  color: var(--moss-deep);
  font-size: .9375rem;
}
.beat h3 {
  font-size: 1.5rem;
  margin-bottom: .75rem;
}
.beat p {
  color: var(--ink-2);
  margin: 0;
}

/* Stand for / stand against */
.stand-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}
@media (max-width: 820px) { .stand-grid { grid-template-columns: 1fr; } }
.stand-grid ul {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}
.stand-grid li {
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  font-size: 1.0625rem;
}
.stand-grid li:last-child { border-bottom: 1px solid var(--rule); }

/* Manifesto / long-form prose */
.prose p {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink-2);
}
.prose p strong { color: var(--ink); font-weight: 600; }
.prose .pullquote {
  margin-block: 2.5rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--moss);
}

/* Differentiator three-up */
.diff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}
@media (max-width: 820px) { .diff-grid { grid-template-columns: 1fr; gap: 2rem; } }
.diff-item h3 {
  font-size: 1.375rem;
  margin-bottom: .5rem;
}
.diff-item p { color: var(--ink-2); margin: 0; }

/* Founders note */
.founders {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 820px) { .founders { grid-template-columns: 1fr; } }

/* Final CTA section */
.final-cta {
  text-align: center;
}
.final-cta h2 {
  max-width: 18ch;
  margin-inline: auto;
  margin-bottom: 1.25rem;
}
.final-cta .lede {
  max-width: 38ch;
  margin: 0 auto 2.25rem;
  color: var(--surface);
}

/* ---------- Form (Get Started) ---------- */
.form {
  max-width: 36rem;
  margin: 2.5rem auto 0;
  display: grid;
  gap: 1.25rem;
}
.form label {
  display: grid;
  gap: .375rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}
.form input, .form textarea, .form select {
  font: inherit;
  padding: .875rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s ease;
}
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none;
  border-color: var(--moss-deep);
}
.form textarea { min-height: 7rem; resize: vertical; }
.form .btn { justify-self: start; margin-top: .5rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface-dark);
  color: var(--surface);
  padding-block: 4rem 2rem;
}
.site-footer h4 { color: var(--moss-soft); margin-bottom: 1rem; }
.site-footer .grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
}
@media (max-width: 820px) {
  .site-footer .grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 480px) {
  .site-footer .grid { grid-template-columns: 1fr; }
}
.site-footer img { height: 56px; }
.site-footer a {
  color: rgba(251, 248, 241, 0.75);
  font-size: .9375rem;
  display: block;
  padding-block: .375rem;
}
.site-footer a:hover { color: var(--surface); }
.site-footer p { color: rgba(251, 248, 241, 0.6); font-size: .875rem; }
.site-footer .legal {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(251, 248, 241, 0.1);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .8125rem;
  color: rgba(251, 248, 241, 0.5);
}

/* ---------- Page hero (interior pages) ---------- */
.page-hero {
  padding-block: clamp(4rem, 8vw, 6rem) clamp(3rem, 5vw, 4rem);
  border-bottom: 1px solid var(--rule);
}
.page-hero h1 {
  max-width: 18ch;
  margin-bottom: 1rem;
}
.page-hero .lede { max-width: 44ch; margin: 0; }

/* ---------- Utilities ---------- */
.muted { color: var(--ink-mute); }
.center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.flow > * + * { margin-top: 1.25em; }

/* Subtle entrance */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .6s ease, transform .6s ease;
  }
  .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

/* Reduced-motion: hide video, show poster as hero background */
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
  .hero {
    background: var(--surface-alt) url("../assets/img/hero-droplet-poster.jpg") center / cover no-repeat;
  }
}

/* Avoid sticky-hover transform on touch devices */
@media (hover: none) {
  .btn:hover { transform: none; }
}

/* ===========================================================
   MOBILE PATCH (≤ 820px) — does not affect desktop
   =========================================================== */
@media (max-width: 820px) {
  /* Header — smaller logo, tighter padding */
  .site-header .container { padding-block: .75rem; }
  .logo img { height: 36px; }

  /* Hero — stack layout on mobile so the video shows PM in full */
  .hero {
    display: block;
    align-items: stretch;
    min-height: 0;
    padding-block: 0 clamp(2.5rem, 8vw, 4rem);
    background: var(--surface-alt);
    overflow: hidden;
  }
  .hero-video {
    position: relative;
    inset: auto;
    width: 110%;
    margin-left: -5%;
    height: auto;
    aspect-ratio: 16 / 9;
    z-index: 0;
    object-fit: cover;
  }
  .hero-scrim { display: none; }
  .hero .container {
    padding-top: clamp(2rem, 7vw, 3.5rem);
  }
  .hero-content { max-width: 100%; }

  /* Tighter typography on mobile (Comfortaa runs loose at display sizes) */
  h1 { letter-spacing: -0.015em; }
  h2 { letter-spacing: -0.005em; }

  /* Section rhythm — lighter on mobile */
  section { padding-block: clamp(3rem, 9vw, 5rem); }

  /* Hero CTAs stack full width on small screens */
  .hero .cta-row .btn { flex: 1 1 100%; }

  /* Three-beat journey — give counter and content more separation */
  .beat { padding-top: 3.25rem; }
  .beat::before { top: .875rem; }

  /* diff-grid / proof-grid get visual rhythm with hairline rules */
  .diff-item + .diff-item {
    padding-top: 2rem;
    border-top: 1px solid var(--rule);
  }

  /* stand-grid lighter line items */
  .stand-grid li { font-size: 1rem; padding: .75rem 0; }

  /* Prose pullquote — drop left padding so it doesn't crowd */
  .prose .pullquote { padding-left: 1rem; }

  /* Footer — smaller logo, no top margin on inner forms */
  .site-footer { padding-block: 3rem 1.5rem; }
  .site-footer img { height: 40px; }
  .site-footer .form { margin: .5rem 0 0; max-width: none; }
  .site-footer a { padding-block: .625rem; }

  /* Form fields — explicit width for iOS native select */
  .form input, .form select, .form textarea { width: 100%; font-size: 16px; }

  /* Page-hero tighter on mobile */
  .page-hero { padding-block: clamp(3rem, 8vw, 5rem) clamp(2rem, 6vw, 4rem); }

  /* Bottom safe area for the thumb-bar so content isn't hidden behind it */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  /* Sticky thumb-bar CTA */
  .thumb-bar {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
    height: 52px;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--moss-deep);
    color: var(--surface);
    border-radius: 6px;
    font-weight: 500;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 6px 24px rgba(21, 32, 29, .25);
    transition: transform .25s ease, opacity .25s ease;
  }
  .thumb-bar:hover { color: var(--surface); }
  .thumb-bar.is-hidden { transform: translateY(120%); opacity: 0; pointer-events: none; }

  /* Hide thumb-bar on the get-started page (already there) */
  body.page-get-started .thumb-bar { display: none; }
  body.page-get-started { padding-bottom: 0; }

  /* When mobile nav is open, hide thumb-bar */
  body.nav-open .thumb-bar { transform: translateY(120%); opacity: 0; pointer-events: none; }
}

@media (max-width: 480px) {
  /* H1 floor smaller on tiny screens */
  h1 { font-size: clamp(2rem, 8vw, 2.25rem); }

  /* Tighter hero bottom padding only — keep video flush with header */
  .hero { padding-block: 0 clamp(1.5rem, 5vw, 3rem); }
}

/* Hide thumb-bar entirely on desktop */
@media (min-width: 821px) {
  .thumb-bar { display: none !important; }
}
