/* ============================================================
   BendTheBody — global.css
   Shared across all pages. Page-specific styles live in
   a <style> block on each page.
   ============================================================ */

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

/* ── TOKENS ── */
:root {
  --cream:      #F6F5F0;
  --white:      #FFFFFF;
  --ink:        #1C1E19;
  --ink-soft:   #383D32;
  --ink-dim:    #717568;
  --moss:       #4A6741;
  --moss-lt:    #7A9E70;
  --moss-pale:  #E6EDE4;
  --sage:       #6B8C6E;
  --sage-pale:  #E8F0E6;
  --rule:       rgba(28,30,25,0.10);
  --rule-lt:    rgba(28,30,25,0.05);
  --rule-dark:  rgba(255,255,255,0.08);

  /* on-dark text scale — all pass WCAG AA on #1C1E19 */
  --on-dark-primary:   rgba(255,255,255,0.95);  /* headings   */
  --on-dark-body:      rgba(255,255,255,0.80);  /* body text  */
  --on-dark-secondary: rgba(255,255,255,0.60);  /* notes/meta */
  --on-dark-muted:     rgba(255,255,255,0.42);  /* dividers   */
}

/* ── BASE ── */
html { scroll-behavior: smooth; }
:focus-visible { outline: 2px solid var(--moss); outline-offset: 3px; }

body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
}

/* body variants — set on each page */
body.bg-cream  { background: var(--cream); color: var(--ink); }
body.bg-dark   { background: var(--ink);   color: var(--white); }

/* ── FONT IMPORT — add to each page <head> ──
   <link rel="preconnect" href="https://fonts.googleapis.com" />
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
   <link href="https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;1,400&family=DM+Sans:wght@300;400;500&display=swap" rel="stylesheet" />
──────────────────────────────────────────────────── */

/* ── LAYOUT UTILITY ── */
.page-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.page-content { flex: 1; }
.inner        { max-width: 860px; margin: 0 auto; }
.inner-sm     { max-width: 480px; margin: 0 auto; }

/* ── NAV — LIGHT (cream background pages) ── */
nav.nav-light {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246,245,240,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  padding: 0 clamp(24px,5vw,64px);
  display: flex; align-items: center;
  justify-content: space-between;
  height: 64px; flex-shrink: 0;
}
nav.nav-light .nav-brand {
  font-family: 'Lora', serif; font-size: 17px;
  font-weight: 400; color: var(--ink);
  letter-spacing: -0.01em; text-decoration: none;
}
nav.nav-light .nav-brand span { color: var(--moss); }
nav.nav-light .nav-links {
  display: flex; gap: 28px; align-items: center;
}
nav.nav-light .nav-link {
  font-size: 13px; font-weight: 400;
  color: var(--ink-dim); text-decoration: none;
  transition: color 0.2s;
}
nav.nav-light .nav-link:hover  { color: var(--ink); }
nav.nav-light .nav-link.active { color: var(--ink); font-weight: 500; }

/* ── NAV — DARK (ink background pages) ── */
nav.nav-dark {
  padding: 0 clamp(24px,5vw,64px);
  display: flex; align-items: center;
  justify-content: space-between;
  height: 64px; flex-shrink: 0;
  border-bottom: 1px solid var(--rule-dark);
}
nav.nav-dark .nav-brand {
  font-family: 'Lora', serif; font-size: 17px;
  font-weight: 400; color: var(--on-dark-body);
  letter-spacing: -0.01em; text-decoration: none;
}
nav.nav-dark .nav-brand span { color: var(--moss-lt); }
nav.nav-dark .nav-back {
  font-size: 12px; font-weight: 400;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--on-dark-secondary); text-decoration: none;
  transition: color 0.2s;
}
nav.nav-dark .nav-back:hover { color: var(--on-dark-body); }

/* ── CARD (white card on dark background) ── */
.card {
  background: var(--white);
  border-radius: 6px;
  padding: clamp(36px,5vw,56px) clamp(32px,5vw,52px);
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.45);
  position: relative; overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--moss);
}
.card-wide { max-width: 460px; }

.card-eyebrow {
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--moss); margin-bottom: 14px;
}
.card-title {
  font-family: 'Lora', serif; font-weight: 400;
  font-size: clamp(26px,4vw,34px);
  line-height: 1.15; letter-spacing: -0.02em;
  color: var(--ink); margin-bottom: 10px;
}
.card-title em { font-style: italic; color: var(--moss); }
.card-title-lg { font-size: clamp(26px,4vw,36px); }
.card-desc {
  font-size: 14px; font-weight: 300;
  line-height: 1.7; color: var(--ink-dim);
  margin-bottom: 28px;
}
.card-body {
  font-size: 15px; font-weight: 300;
  line-height: 1.75; color: var(--ink-soft);
  margin-bottom: 14px;
}

/* ── EYEBROW / LABEL ── */
.eyebrow {
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--moss); margin-bottom: 16px;
}
.eyebrow-dim { color: var(--ink-dim); }

/* ── FORM ── */
.field {
  width: 100%;
  background: var(--cream);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; font-weight: 300;
  padding: 15px 18px;
  outline: none; border-radius: 3px;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
}
.field:focus     { border-color: var(--moss); background: var(--white); }
.field::placeholder { color: var(--ink-dim); }
.hp { display: none !important; }

/* ── BUTTONS ── */
.btn {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 500;
  letter-spacing: 0.04em;
  padding: 13px 24px; border-radius: 3px;
  text-decoration: none; white-space: nowrap;
  border: none; cursor: pointer;
  text-align: center;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-moss {
  background: var(--moss); color: #fff;
  box-shadow: 0 4px 16px rgba(74,103,65,0.28);
}
.btn-moss:hover  { background: var(--moss-lt); transform: translateY(-1px); box-shadow: 0 6px 22px rgba(74,103,65,0.38); }
.btn-ink  { background: var(--ink);  color: #fff; }
.btn-ink:hover   { background: #2d312a; transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--rule);
}
.btn-outline:hover { border-color: var(--moss); color: var(--moss); }
/* outline button for use on dark backgrounds */
.btn-outline-dk {
  background: transparent;
  color: var(--on-dark-body);
  border: 1px solid rgba(255,255,255,0.25);
}
.btn-outline-dk:hover { border-color: rgba(255,255,255,0.6); color: #fff; }
.btn-full { width: 100%; display: block; padding-left: 0; padding-right: 0; }
.btn-lg   { font-size: 15px; padding: 16px 32px; }

/* ── SUCCESS STATE ── */
.success-state {
  display: none;
  padding: 28px 20px;
  background: var(--sage-pale);
  border: 1px solid rgba(107,140,110,0.25);
  border-radius: 4px;
  text-align: center;
}
.success-state.show { display: block; }
.success-state p {
  font-family: 'Lora', serif; font-style: italic;
  font-size: 19px; font-weight: 400;
  color: var(--ink); line-height: 1.6;
  margin-bottom: 8px;
}
.success-state span {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--sage);
}

/* ── FOOTER — LIGHT (cream pages) ── */
footer.footer-light {
  border-top: 1px solid var(--rule);
  padding: 20px clamp(24px,5vw,64px);
  display: flex; justify-content: space-between;
  align-items: center; gap: 16px; flex-wrap: wrap;
  flex-shrink: 0;
}
footer.footer-light .footer-copy {
  font-size: 11px; color: var(--ink-dim);
}
footer.footer-light .footer-link {
  font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-dim);
  text-decoration: none; transition: color 0.2s;
}
footer.footer-light .footer-link:hover { color: var(--moss); }

/* ── FOOTER — DARK (ink background pages) ── */
footer.footer-dark {
  background: var(--ink);
  padding: 28px clamp(24px,5vw,64px);
  display: flex; justify-content: space-between;
  align-items: center; gap: 16px; flex-wrap: wrap;
  flex-shrink: 0;
}
footer.footer-dark .footer-brand {
  font-family: 'Lora', serif; font-size: 15px;
  font-weight: 400; color: var(--on-dark-muted);
}
footer.footer-dark .footer-brand span { color: var(--moss-lt); }
footer.footer-dark .footer-links {
  display: flex; gap: 24px; flex-wrap: wrap;
}
footer.footer-dark .footer-link {
  font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-secondary); text-decoration: none;
  transition: color 0.2s;
}
footer.footer-dark .footer-link:hover { color: var(--moss-lt); }

/* ── FOOTER — MINIMAL (dark bg, single line) ── */
footer.footer-minimal {
  padding: 20px clamp(24px,5vw,64px);
  border-top: 1px solid var(--rule-dark);
  display: flex; justify-content: space-between;
  align-items: center; gap: 16px; flex-wrap: wrap;
  flex-shrink: 0;
}
footer.footer-minimal .footer-copy {
  font-size: 11px; color: var(--on-dark-muted);
}
footer.footer-minimal .footer-link {
  font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-secondary); text-decoration: none;
  transition: color 0.2s;
}
footer.footer-minimal .footer-link:hover { color: var(--on-dark-body); }
footer.footer-minimal .footer-links {
  display: flex; gap: 20px;
}

/* ── LEGAL BAR ── */
.legal-bar {
  background: #111310;
  padding: 14px clamp(24px,5vw,64px);
  font-size: 11px; font-weight: 300;
  color: rgba(255,255,255,0.18); line-height: 1.7;
}
.legal-bar a { color: rgba(255,255,255,0.28); text-decoration: none; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim { opacity: 0; }
.anim-1 { animation: fadeUp 0.6s ease 0.10s forwards; }
.anim-2 { animation: fadeUp 0.6s ease 0.20s forwards; }
.anim-3 { animation: fadeUp 0.6s ease 0.30s forwards; }
.anim-4 { animation: fadeUp 0.6s ease 0.40s forwards; }

@media (prefers-reduced-motion: reduce) {
  .anim, .anim-1, .anim-2, .anim-3, .anim-4 {
    opacity: 1 !important; animation: none !important;
  }
  * { transition-duration: 0.01ms !important; }
}

/* ── RESPONSIVE NAV ── */
@media (max-width: 680px) {
  nav.nav-light .nav-links { display: none; }
}

/* ── MOBILE NAV ── */
.nav-menu-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 8px; margin-right: -8px;
  flex-direction: column; gap: 5px; align-items: flex-end;
}
.nav-menu-btn span {
  display: block; height: 1.5px; background: var(--ink);
  transition: width 0.2s, opacity 0.2s, transform 0.2s;
  transform-origin: center;
}
.nav-menu-btn span:nth-child(1) { width: 20px; }
.nav-menu-btn span:nth-child(2) { width: 14px; }
.nav-menu-btn span:nth-child(3) { width: 20px; }
.nav-menu-btn.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); width: 20px; }
.nav-menu-btn.open span:nth-child(2) { opacity: 0; }
.nav-menu-btn.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); width: 20px; }
nav.nav-dark .nav-menu-btn span { background: var(--on-dark-body); }

.mobile-nav {
  display: none;
  position: fixed; inset: 0; top: 64px; z-index: 99;
  background: rgba(246,245,240,0.98);
  backdrop-filter: blur(16px);
  padding: 32px clamp(24px,5vw,40px);
  flex-direction: column; gap: 0;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-family: 'Lora', serif; font-weight: 400;
  font-size: clamp(22px,6vw,28px);
  letter-spacing: -0.01em; color: var(--ink);
  text-decoration: none; line-height: 1;
  padding: 16px 0; border-bottom: 1px solid var(--rule);
  transition: color 0.2s;
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover, .mobile-nav a.active { color: var(--moss); }
.mobile-nav-dark { background: rgba(28,30,25,0.98); }
.mobile-nav-dark a { color: var(--on-dark-primary); border-color: var(--rule-dark); }
.mobile-nav-dark a:hover, .mobile-nav-dark a.active { color: var(--moss-lt); }

/* inline form error */
.form-error {
  display: none;
  padding: 12px 16px;
  background: #fdf1f1;
  border: 1px solid #e8a0a0;
  border-radius: 3px;
  font-size: 13px; font-weight: 400;
  color: #c0392b; line-height: 1.5;
}
.form-error.show { display: block; }

@media (max-width: 680px) {
  nav.nav-light .nav-links,
  nav.nav-dark  .nav-links { display: none; }
  .nav-menu-btn { display: flex; }
}
