/* ==========================================================================
   MAIN.CSS — variables, reset, typography, layout primitives
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..700;1,9..144,300..600&family=Karla:ital,wght@0,300..800;1,300..800&family=Caveat:wght@500;700&display=swap');

/* --- Elegant / Cozy / Playful alt font imports (loaded once, switched via CSS var) --- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=Quicksand:wght@400;600;700&family=Nunito:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  /* ---- Color: light mode (default) ---- */
  --cream:        #faf6ef;
  --cream-soft:   #f3ede1;
  --sage:         #a9bfa0;
  --sage-soft:    #c7d9be;
  --moss:         #5c6b4e;
  --forest:       #2b3a2a;
  --forest-deep:  #1c2a1b;
  --olive:        #6b7050;
  --clay:         #c98a5e;   /* single warm accent, used sparingly */

  --bg:           var(--cream);
  --bg-elevated:  #ffffff;
  --surface:      var(--cream-soft);
  --surface-alt:  var(--sage-soft);
  --text:         var(--forest-deep);
  --text-muted:   var(--moss);
  --accent:       var(--moss);
  --accent-strong:var(--forest);
  --border:       rgba(43, 58, 42, 0.14);
  --shadow-color: rgba(43, 58, 42, 0.16);

  /* ---- Type ---- */
  --font-heading: 'Fraunces', serif;
  --font-body:    'Karla', sans-serif;
  --font-hand:    'Caveat', cursive;

  /* ---- Organic shape recipe, reused everywhere for cohesion ---- */
  --blob: 40% 60% 55% 45% / 45% 40% 60% 55%;
  --blob-alt: 60% 40% 45% 55% / 55% 60% 40% 45%;

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 180ms;
  --dur-mid: 380ms;

  color-scheme: light;
}

/* ---- Dark mode: a real second theme, not an inversion ---- */
body.dark-mode {
  --bg:           #10160f;
  --bg-elevated:  #171f15;
  --surface:      #1b241a;
  --surface-alt:  #24301f;
  --text:         #ede8dc;
  --text-muted:   #a9bfa0;
  --accent:       #8fae83;
  --accent-strong:#c7d9be;
  --border:       rgba(199, 217, 190, 0.14);
  --shadow-color: rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

/* ---- Font-theme switcher: swaps the pairing, not just weight ---- */
body[data-fonttheme="cozy"] {
  --font-heading: 'Cormorant Garamond', serif;
  --font-body: 'Nunito', sans-serif;
}
body[data-fonttheme="playful"] {
  --font-heading: 'Quicksand', sans-serif;
  --font-body: 'Nunito', sans-serif;
}

/* ---- Reset ---- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  transition: background var(--dur-mid) var(--ease), color var(--dur-mid) var(--ease);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--accent-strong);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 600;
}

h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 500; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.3rem; }

p { max-width: 68ch; margin: 0 0 1em; }

a { color: var(--accent-strong); }

img { max-width: 100%; display: block; }

.hand {
  font-family: var(--font-hand);
  color: var(--clay);
  font-size: 1.35em;
  line-height: 1;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.section {
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Focus visibility (accessibility floor) ---- */
:focus-visible {
  outline: 2.5px solid var(--clay);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Shared blob card shape ---- */
.blob {
  border-radius: var(--blob);
}
