/* ============================================
   MesoCareGuide.com — Shared Stylesheet
   Design tokens, typography, nav, footer, buttons,
   and reusable utility classes
   ============================================ */

:root {
  --ink:         #1a2219;
  --ink-soft:    #2d3830;
  --ink-mute:    #4a5a4d;
  --bone:        #f5efe4;
  --bone-deep:   #ece4d1;
  --parchment:   #e6dcc3;
  --pine:        #2a4a3e;
  --pine-deep:   #152721;
  --pine-light:  #3d5e50;
  --moss:        #5d7561;
  --ember:       #b8642a;
  --ember-deep:  #8f4d20;
  --ember-soft:  #d9936a;
  --stone:       #8b8478;
  --line:        rgba(26, 34, 25, 0.14);
  --line-soft:   rgba(26, 34, 25, 0.08);

  --container:   1280px;
  --gutter:      clamp(20px, 4vw, 56px);

  --radius-sm:   4px;
  --radius-md:   10px;
  --radius-lg:   24px;

  --t-fast:      180ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-med:       360ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow:      640ms cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
*:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 2px; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Instrument Sans', -apple-system, system-ui, sans-serif;
  background: var(--bone);
  color: var(--ink);
  line-height: 1.58;
  font-size: 17px;
  font-feature-settings: "ss01", "ss02";
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.11 0 0 0 0 0.08 0 0 0 0.12 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

main, nav, footer { position: relative; z-index: 2; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
.display {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
  font-weight: 420;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.display em {
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  color: var(--pine);
}

.eyebrow {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember-deep);
}

.section-title {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 72, 'SOFT' 50;
  font-weight: 420;
  font-size: clamp(38px, 5.6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.024em;
  color: var(--ink);
}

.lede {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 36;
  font-weight: 360;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.42;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
}

.body-prose { font-size: 17px; line-height: 1.72; color: var(--ink-soft); }
.body-prose p + p { margin-top: 1.05em; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section-marker {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-weight: 300;
  font-style: italic;
  font-size: 14px;
  color: var(--moss);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.section-marker::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--moss);
  display: block;
}

/* ============================================
   NAV
   ============================================ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  transition: background var(--t-med), backdrop-filter var(--t-med), border-color var(--t-med);
  border-bottom: 1px solid transparent;
}
nav.scrolled {
  background: rgba(245, 239, 228, 0.82);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom-color: var(--line-soft);
}
.wordmark {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 36, 'SOFT' 80;
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.015em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.wordmark .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ember);
  display: inline-block;
  transform: translateY(-5px);
}
.wordmark .sub {
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.82em;
}
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  font-size: 14px;
  color: var(--ink-soft);
  transition: color var(--t-fast);
  position: relative;
}
.nav-links a:hover { color: var(--pine); }
.nav-links a::after {
  content: ''; position: absolute; bottom: -5px; left: 0;
  width: 0; height: 1px; background: var(--pine);
  transition: width var(--t-med);
}
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--pine); font-weight: 500; }
.nav-links a.active::after { width: 100%; }
.nav-cta {
  padding: 10px 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all var(--t-fast);
}
.nav-cta:hover { background: var(--ink); color: var(--bone); }
.nav-links a.nav-cta::after { display: none; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: all var(--t-fast);
}
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after  { top: 7px; }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(340px, 85vw);
    background: var(--bone);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 100px 40px 40px;
    transform: translateX(100%);
    transition: transform var(--t-med);
    box-shadow: -20px 0 60px -20px rgba(26, 34, 25, 0.3);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a {
    font-size: 18px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line-soft);
    width: 100%;
  }
  .nav-links a.nav-cta {
    border: 1px solid var(--ink);
    margin-top: 20px;
    padding: 14px 20px;
    text-align: center;
    font-size: 14px;
    width: 100%;
  }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.005em;
  border-radius: 999px;
  transition: all var(--t-fast);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.btn-primary {
  background: var(--pine);
  color: var(--bone);
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 8px 20px -8px rgba(42,74,62,0.5);
}
.btn-primary:hover { background: var(--pine-deep); transform: translateY(-1px); box-shadow: 0 12px 28px -10px rgba(42,74,62,0.55); }
.btn-primary:active { transform: translateY(0); }

.btn-ember {
  background: var(--ember);
  color: var(--bone);
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 8px 20px -8px rgba(184,100,42,0.5);
}
.btn-ember:hover { background: var(--ember-deep); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-outline:hover { background: var(--ink); color: var(--bone); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  padding: 16px 4px;
}
.btn-ghost:hover { color: var(--pine); }

.btn .arrow {
  transition: transform var(--t-fast);
}
.btn:hover .arrow { transform: translateX(4px); }

.btn[disabled], .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================
   GENERIC INTERIOR-PAGE HERO
   ============================================ */
.page-hero {
  padding: 160px var(--gutter) 80px;
  position: relative;
  overflow: hidden;
}
.page-hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  position: relative;
}
.page-hero .section-marker { margin-bottom: 28px; }
.page-hero h1 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
  font-weight: 420;
  font-size: clamp(44px, 6.5vw, 84px);
  line-height: 1.04;
  letter-spacing: -0.024em;
  color: var(--ink);
  max-width: 960px;
  margin-bottom: 32px;
}
.page-hero h1 em {
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  color: var(--pine);
}
.page-hero .lede {
  max-width: 760px;
  margin-bottom: 40px;
}
.page-hero-ornament {
  position: absolute;
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-style: italic;
  font-size: 340px;
  color: var(--ember);
  opacity: 0.055;
  line-height: 1;
  top: 80px;
  right: -40px;
  z-index: -1;
  pointer-events: none;
  user-select: none;
}
@media (max-width: 900px) {
  .page-hero { padding-top: 130px; }
  .page-hero-ornament { display: none; }
}

/* ============================================
   EDITORIAL CONTENT SECTIONS
   ============================================ */
.editorial {
  padding: 80px var(--gutter) 100px;
}
.editorial-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(30px, 5vw, 80px);
}
.editorial-nav {
  position: sticky;
  top: 120px;
  align-self: start;
}
.editorial-nav .eyebrow { margin-bottom: 18px; display: block; }
.editorial-nav ol {
  list-style: none;
  counter-reset: chap;
}
.editorial-nav ol li {
  counter-increment: chap;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.editorial-nav ol li::before {
  content: counter(chap, decimal-leading-zero) ' · ';
  color: var(--ember);
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 13px;
  margin-right: 4px;
}
.editorial-nav a {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
  transition: color var(--t-fast);
}
.editorial-nav a:hover { color: var(--pine); }

.editorial-body h2 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 72, 'SOFT' 50;
  font-weight: 420;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 80px 0 24px;
  max-width: 700px;
  scroll-margin-top: 100px;
}
.editorial-body h2:first-child { margin-top: 0; }
.editorial-body h2 em { font-style: italic; color: var(--pine); font-variation-settings: 'opsz' 72, 'SOFT' 100; }

.editorial-body h3 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 36, 'SOFT' 50;
  font-weight: 500;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 40px 0 14px;
}

.editorial-body p {
  font-size: 17.5px;
  line-height: 1.72;
  color: var(--ink-soft);
  margin-bottom: 1.2em;
  max-width: 680px;
}
.editorial-body p.dropcap::first-letter {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 80;
  font-weight: 500;
  float: left;
  font-size: 4.2em;
  line-height: 0.84;
  padding: 8px 14px 0 0;
  color: var(--pine);
}

.editorial-body .lede {
  margin-bottom: 2em;
  color: var(--ink);
  max-width: 720px;
}

.editorial-body a {
  color: var(--pine);
  border-bottom: 1px solid var(--pine);
  transition: color var(--t-fast), border-color var(--t-fast);
}
.editorial-body a:hover { color: var(--ember); border-color: var(--ember); }

.editorial-body strong { color: var(--ink); font-weight: 600; }
.editorial-body em { font-style: italic; }

.editorial-body blockquote {
  border-left: 3px solid var(--ember);
  padding: 12px 0 12px 28px;
  margin: 32px 0;
  max-width: 680px;
}
.editorial-body blockquote p {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 36;
  font-weight: 380;
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink);
  letter-spacing: -0.01em;
  max-width: none;
}
.editorial-body blockquote cite {
  font-style: normal;
  font-size: 13px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
  display: block;
  margin-top: 8px;
}

.editorial-body ul, .editorial-body ol {
  margin: 0 0 1.5em 0;
  padding-left: 0;
  max-width: 680px;
  list-style: none;
}
.editorial-body ul li, .editorial-body ol li {
  font-size: 17px;
  line-height: 1.64;
  color: var(--ink-soft);
  padding-left: 28px;
  position: relative;
  margin-bottom: 10px;
}
.editorial-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 14px;
  height: 1px;
  background: var(--ember);
}
.editorial-body ol {
  counter-reset: ol-num;
}
.editorial-body ol li {
  counter-increment: ol-num;
}
.editorial-body ol li::before {
  content: counter(ol-num, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 15px;
  color: var(--ember);
}

/* Callout boxes */
.callout {
  background: var(--bone-deep);
  border-left: 3px solid var(--pine);
  padding: 28px 32px;
  margin: 36px 0;
  border-radius: 0 8px 8px 0;
}
.callout .eyebrow { margin-bottom: 10px; display: block; color: var(--pine); }
.callout p { margin-bottom: 0; }
.callout.ember { border-left-color: var(--ember); background: rgba(216, 147, 106, 0.1); }
.callout.ember .eyebrow { color: var(--ember-deep); }

@media (max-width: 900px) {
  .editorial-inner { grid-template-columns: 1fr; }
  .editorial-nav { position: static; padding-bottom: 40px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
  .editorial-body h2 { margin-top: 60px; }
}

/* ============================================
   SHARED CTA STRIP (bottom of every page)
   ============================================ */
.cta-strip {
  padding: 88px var(--gutter);
  background: var(--bone);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cta-strip-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
}
.cta-strip-copy h3 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 72, 'SOFT' 50;
  font-weight: 420;
  font-size: clamp(28px, 3.4vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 10px;
  max-width: 720px;
}
.cta-strip-copy p {
  font-size: 16px;
  color: var(--ink-mute);
  max-width: 640px;
}
@media (max-width: 780px) {
  .cta-strip-inner { grid-template-columns: 1fr; }
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  background: var(--ink);
  color: rgba(245,239,228,0.7);
  padding: 80px var(--gutter) 40px;
  font-size: 14px;
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(245,239,228,0.12);
}
.footer-brand .wordmark { color: var(--bone); font-size: 34px; }
.footer-brand .wordmark .sub { color: rgba(245,239,228,0.6); }
.footer-brand p {
  margin-top: 20px;
  max-width: 320px;
  line-height: 1.6;
  color: rgba(245,239,228,0.6);
  font-size: 14px;
}
.footer-col h4 {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 24, 'SOFT' 50;
  font-weight: 500;
  font-size: 15px;
  color: var(--bone);
  margin-bottom: 18px;
  letter-spacing: 0.01em;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a {
  color: rgba(245,239,228,0.6);
  transition: color var(--t-fast);
}
.footer-col ul a:hover { color: var(--ember-soft); }
.footer-bottom {
  padding-top: 36px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: rgba(245,239,228,0.45);
  line-height: 1.65;
}
.footer-disclaimer { max-width: 780px; }
.footer-disclaimer strong { color: rgba(245,239,228,0.7); font-weight: 600; }

@media (max-width: 900px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-top { grid-template-columns: 1fr; gap: 32px; } }

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 900ms cubic-bezier(0.22, 1, 0.36, 1), transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal.delay-1 { transition-delay: 100ms; }
.reveal.delay-2 { transition-delay: 200ms; }
.reveal.delay-3 { transition-delay: 300ms; }
.reveal.delay-4 { transition-delay: 400ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
