/* ==========================================================================
   Bloom Women's Health — Design tokens, reset & typography
   File: assets/css/1-theme.css
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette */
  --rose-50:  #fff5f8;
  --rose-100: #ffe7ef;
  --rose-200: #ffd0e0;
  --rose-300: #ffabc7;
  --rose-400: #f97fa8;
  --rose-500: #ec5c8d;
  --rose-600: #d43e73;
  --rose-700: #ab2b5b;

  --plum-500: #6d5479;
  --plum-600: #523d5c;
  --plum-700: #3a2b42;
  --plum-800: #291d2f;
  --plum-900: #1b1220;

  --teal-300: #7fd9cf;
  --teal-400: #46bfb2;
  --teal-500: #23a094;
  --teal-600: #158075;
  --teal-700: #0e5f58;

  --gold-300: #f2d59b;
  --gold-400: #e5b769;
  --gold-500: #cf9a3d;

  --violet-400: #a48cf0;
  --violet-500: #8467e3;

  /* Semantic */
  --bg: #fff9fb;
  --bg-alt: #fdf1f5;
  --surface: #ffffff;
  --surface-2: #fff6f9;
  --ink: #2b1e2f;
  --ink-soft: #5d4a63;
  --ink-mute: #8b7a91;
  --line: rgba(43, 30, 47, .10);
  --line-strong: rgba(43, 30, 47, .18);

  --accent: var(--rose-500);
  --accent-2: var(--teal-500);
  --accent-soft: var(--rose-100);

  --grad-brand: linear-gradient(115deg, #ec5c8d 0%, #a48cf0 48%, #46bfb2 100%);
  --grad-brand-soft: linear-gradient(115deg, #ffe7ef 0%, #f0ecff 50%, #e2f7f4 100%);
  --grad-ink: linear-gradient(140deg, #3a2b42 0%, #6d5479 100%);
  --grad-glow: radial-gradient(60% 60% at 50% 40%, rgba(236, 92, 141, .45), transparent 70%);

  /* Type */
  --font-display: "Fraunces", "Playfair Display", "Georgia", "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", ui-monospace, monospace;

  /* Fluid type scale */
  --t-hero: clamp(2.6rem, 7vw, 5.4rem);
  --t-h1: clamp(2.1rem, 4.6vw, 3.5rem);
  --t-h2: clamp(1.7rem, 3.2vw, 2.6rem);
  --t-h3: clamp(1.2rem, 2vw, 1.55rem);
  --t-body: clamp(0.98rem, 1.05vw, 1.08rem);
  --t-small: 0.875rem;
  --t-tiny: 0.76rem;

  /* Space scale */
  --s-1: .25rem;
  --s-2: .5rem;
  --s-3: .75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: 8rem;

  /* Radius */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 36px;
  --r-pill: 999px;

  /* Elevation */
  --sh-1: 0 1px 2px rgba(43, 30, 47, .06), 0 4px 14px rgba(43, 30, 47, .05);
  --sh-2: 0 6px 24px rgba(43, 30, 47, .08), 0 2px 6px rgba(43, 30, 47, .05);
  --sh-3: 0 18px 50px rgba(43, 30, 47, .13), 0 4px 12px rgba(43, 30, 47, .06);
  --sh-glow: 0 18px 46px rgba(236, 92, 141, .30);
  --sh-glow-teal: 0 18px 46px rgba(35, 160, 148, .26);

  /* Layout */
  --container: 1200px;
  --container-wide: 1400px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --nav-h: 76px;

  /* Motion */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, .05, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: .18s;
  --dur: .34s;
  --dur-slow: .7s;

  --z-nav: 900;
  --z-overlay: 950;
  --z-modal: 1000;
  --z-toast: 1100;
  --z-cursor: 1200;
}

/* Dark theme */
html[data-theme="dark"] {
  --bg: #16101a;
  --bg-alt: #1d1522;
  --surface: #221a28;
  --surface-2: #2a2032;
  --ink: #f7eef6;
  --ink-soft: #cdbdd3;
  --ink-mute: #9d8da6;
  --line: rgba(255, 255, 255, .12);
  --line-strong: rgba(255, 255, 255, .22);
  --accent-soft: rgba(236, 92, 141, .18);
  --grad-brand-soft: linear-gradient(115deg, #2a1a26 0%, #241f36 50%, #16302e 100%);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 8px 26px rgba(0, 0, 0, .45);
  --sh-3: 0 20px 54px rgba(0, 0, 0, .55);
  --grad-ink: linear-gradient(140deg, #f7eef6 0%, #cdbdd3 100%);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  overflow-x: hidden;
  overflow-x: clip;
}

html.is-locked,
body.is-locked { overflow: hidden; }

body {
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.68;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-x: clip;
  min-height: 100vh;
  transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}

body::before {
  /* ambient page glow */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(70% 45% at 12% 0%, rgba(255, 208, 224, .55), transparent 60%),
    radial-gradient(55% 40% at 92% 8%, rgba(164, 140, 240, .30), transparent 62%),
    radial-gradient(65% 45% at 50% 104%, rgba(70, 191, 178, .26), transparent 65%);
}

html[data-theme="dark"] body::before {
  background:
    radial-gradient(70% 45% at 12% 0%, rgba(236, 92, 141, .22), transparent 60%),
    radial-gradient(55% 40% at 92% 8%, rgba(132, 103, 227, .20), transparent 62%),
    radial-gradient(65% 45% at 50% 104%, rgba(35, 160, 148, .18), transparent 65%);
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }

/* ------------------------------------------------------------------
   Icon sizing.
   Every inline SVG emitted by {% icon %} carries the .icon class. SVG has
   no intrinsic size, so without these rules an unsized icon expands to its
   container width. Sizing is em-based so icons track their surrounding text.
   ------------------------------------------------------------------ */
.icon {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  vertical-align: -0.16em;
}
/* Contexts whose own font-size is tiny need a proportionally larger icon. */
.topbar .icon { width: 1.35em; height: 1.35em; }
.eyebrow .icon { width: 1.5em; height: 1.5em; vertical-align: -0.3em; }
.tiny .icon, .small .icon { width: 1.3em; height: 1.3em; }
.chip .icon { width: 1.25em; height: 1.25em; }
.nav__link .icon { width: 1.1em; height: 1.1em; }
.footer__links .icon { width: 1.35em; height: 1.35em; margin-top: .12em; }
.breadcrumb .icon { width: 1.2em; height: 1.2em; }

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

:focus-visible {
  outline: 3px solid var(--teal-400);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: var(--rose-300); color: var(--plum-800); }

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--rose-400), var(--violet-400));
  border-radius: var(--r-pill);
  border: 3px solid var(--bg-alt);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(var(--rose-500), var(--violet-500)); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); line-height: 1.25; }

p { color: var(--ink-soft); text-wrap: pretty; }
p.lead { font-size: clamp(1.05rem, 1.4vw, 1.26rem); color: var(--ink-soft); }

strong { color: var(--ink); font-weight: 650; }
small { font-size: var(--t-small); }
pre { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
code { font-family: var(--font-mono); }

.grad-text {
  display: inline-block;
  background-image: var(--grad-brand);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
  gap: .55rem;
  font-family: var(--font-sans);
  font-size: var(--t-tiny);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--rose-600);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-brand);
  flex-shrink: 0;
}
.eyebrow.is-centered::after {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-brand);
  flex-shrink: 0;
}
html[data-theme="dark"] .eyebrow { color: var(--rose-300); }
@media (max-width: 560px) {
  .eyebrow {
    font-size: .7rem;
    letter-spacing: .12em;
    gap: .4rem;
  }
  .eyebrow::before, .eyebrow.is-centered::after {
    width: 18px;
  }
}

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-wide { max-width: var(--container-wide); }

.section { position: relative; padding-block: clamp(3.5rem, 8vw, 7rem); z-index: 1; overflow: hidden; }
.section-tight { position: relative; padding-block: clamp(2.5rem, 5vw, 4rem); overflow: hidden; }
.section-head { max-width: 720px; margin-bottom: clamp(2rem, 4vw, 3.2rem); }
.section-head.is-centered { margin-inline: auto; text-align: center; }
.section-head h2 { margin-top: var(--s-3); }
.section-head p { margin-top: var(--s-4); }

.stack-xs > * + * { margin-top: var(--s-2); }
.stack-sm > * + * { margin-top: var(--s-3); }
.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }

.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
@media (max-width: 560px) {
  .grid { gap: var(--s-4); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
}
@media (max-width: 350px) {
  .grid-4 { grid-template-columns: 1fr; }
}
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.gap-5 { gap: var(--s-5); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.mb-4 { margin-bottom: var(--s-4); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.muted { color: var(--ink-mute); }
.soft { color: var(--ink-soft); }
.tiny { font-size: var(--t-tiny); }
.small { font-size: var(--t-small); }
.mono { font-family: var(--font-mono); letter-spacing: -.02em; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.full { width: 100%; }
.relative { position: relative; }
.z1 { position: relative; z-index: 1; }
.divider { height: 1px; background: var(--line); border: 0; }
.sr-only {
  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 */
.skip-link {
  position: absolute; top: -100px; left: var(--s-4); z-index: var(--z-toast);
  background: var(--plum-800); color: #fff; padding: .7rem 1.1rem;
  border-radius: var(--r-sm); font-weight: 600;
  transition: top var(--dur) var(--ease-out);
}
.skip-link:focus { top: var(--s-4); }

/* ---------- Reveal-on-scroll primitives ---------- */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 32px, 0);
  transition:
    opacity .8s var(--ease-out),
    transform .95s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal="left"]  { transform: translate3d(-44px, 0, 0); }
[data-reveal="right"] { transform: translate3d(44px, 0, 0); }
[data-reveal="zoom"]  { transform: scale(.9); }
[data-reveal="blur"]  { filter: blur(14px); transform: translate3d(0, 24px, 0); }
[data-reveal="flip"]  { transform: perspective(900px) rotateX(22deg) translateY(30px); }
[data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

body[data-page="admin"] [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}
body[data-page="admin"] .fab-stack a[href*="book"] {
  display: none !important;
}

@media (max-width: 768px) {
  [data-reveal="left"],
  [data-reveal="right"] {
    transform: translate3d(0, 22px, 0);
  }
}

@media (max-width: 480px) {
  :root {
    --t-hero: clamp(2.05rem, 8vw, 2.5rem);
    --t-h1: clamp(1.7rem, 6.4vw, 2.05rem);
    --t-h2: clamp(1.35rem, 5vw, 1.65rem);
    --t-h3: clamp(1.1rem, 4vw, 1.3rem);
    --gutter: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; }
}
