/* ============================================================
   Somaya Fit — base.css
   Reset, design tokens, typography primitives, utilities.
   Palette and type mirror the branded PDFs (somaya_brand.py):
   ivory #FBF7F0 · olive #3F4634 · blush #F6E5DC · gold #B08A45
   Cormorant (display) + Manrope (body), self-hosted woff2.
   ============================================================ */

/* ---------- fonts ---------- */
@font-face {
  font-family: 'Cormorant';
  src: url('assets/fonts/Cormorant-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant';
  src: url('assets/fonts/Cormorant-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('assets/fonts/Manrope-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('assets/fonts/Manrope-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('assets/fonts/Manrope-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  /* light (default) */
  --ivory: #FBF7F0;
  --ivory-deep: #F3EBE0;
  --blush: #F6E5DC;
  --blush-deep: #E7C6B8;
  --olive: #3F4634;
  --olive-mid: #5E6650;
  --olive-faint: #7C8369;
  --gold: #B08A45;
  --gold-soft: #D9C39A;

  --bg: var(--ivory);
  --bg-alt: #F7F1E6;
  --surface: #FFFCF6;
  --band: var(--ivory-deep);
  --text: var(--olive);
  --text-muted: var(--olive-mid);
  --text-faint: var(--olive-faint);
  --line: #E0D5C3;
  --line-strong: #CFC1AA;
  --accent: var(--gold);
  --accent-ink: #7E6027;      /* gold dark enough for small text on ivory */
  --accent-soft: var(--gold-soft);
  --petal: var(--blush);
  --petal-deep: var(--blush-deep);
  --on-accent: #FFFDF8;
  --shadow-soft: 0 1px 2px rgba(63, 70, 52, .04), 0 12px 32px -18px rgba(63, 70, 52, .22);
  --shadow-lift: 0 2px 4px rgba(63, 70, 52, .05), 0 22px 48px -24px rgba(63, 70, 52, .3);

  /* type scale */
  --text-xs: .8125rem;
  --text-sm: .9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.5rem, 1.2rem + 1.3vw, 2.1rem);
  --text-2xl: clamp(2rem, 1.5rem + 2.4vw, 3.1rem);
  --text-hero: clamp(2.6rem, 1.7rem + 4.2vw, 5rem);

  /* spacing */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --radius-sm: 6px;
  --radius: 14px;
  --radius-lg: 26px;
  --radius-arch: 240px 240px 20px 20px;

  --measure: 62ch;
  --shell: 1180px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

:root[data-theme='dark'] {
  --bg: #1C1F18;
  --bg-alt: #21251D;
  --surface: #262B21;
  --band: #2C3127;
  --text: #EDE8DB;
  --text-muted: #C0C6B1;
  --text-faint: #979E88;
  --line: #3A4033;
  --line-strong: #4C5342;
  --accent: #DCBB7C;
  --accent-ink: #E6CC97;
  --accent-soft: #8C7444;
  --petal: #43352E;
  --petal-deep: #5A4438;
  --on-accent: #1C1F18;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -20px rgba(0, 0, 0, .7);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .35), 0 24px 52px -26px rgba(0, 0, 0, .8);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  font-size: var(--text-base);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: 'Cormorant', 'Georgia', serif;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.005em;
  margin: 0 0 var(--space-4);
  color: var(--text);
  text-wrap: balance;
}

h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); font-family: 'Manrope', sans-serif; font-weight: 600; letter-spacing: 0; }

p { margin: 0 0 var(--space-4); max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 var(--space-4); padding-left: 1.15rem; }
li { margin-bottom: .4rem; }
li:last-child { margin-bottom: 0; }

a {
  color: inherit;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: .22em;
  text-decoration-thickness: 1px;
  transition: color .2s var(--ease), text-decoration-color .2s var(--ease);
}
a:hover { color: var(--accent-ink); text-decoration-color: var(--accent); }

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: 3px;
}

::selection { background: var(--petal); color: var(--text); }

/* ---------- primitives ---------- */
.shell {
  width: min(100% - 2.5rem, var(--shell));
  margin-inline: auto;
}

.section {
  padding-block: clamp(2.75rem, 5.5vw, 5rem);
  position: relative;
}

.eyebrow {
  font-size: var(--text-xs);
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-faint);
  margin: 0 0 var(--space-4);
}

.lede {
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--text-muted);
}

.muted { color: var(--text-muted); }
.small { font-size: var(--text-sm); }
.xs { font-size: var(--text-xs); }

.rule {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: .85rem 1.2rem;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 1rem; }

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

/* ---------- buttons (44px min targets) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 48px;
  padding: .75rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  background: none;
  transition: background-color .22s var(--ease), color .22s var(--ease),
              border-color .22s var(--ease), transform .22s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--olive);
  color: #FBF7F0;
  border-color: var(--olive);
}
:root[data-theme='dark'] .btn--primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn--primary:hover { background: #333A2A; color: #FBF7F0; }
:root[data-theme='dark'] .btn--primary:hover { background: #E9CE97; color: var(--on-accent); }

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--text);
  background: transparent;
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 7%, transparent); }

.btn--quiet {
  padding-inline: 0;
  min-height: 44px;
  font-weight: 600;
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
}
.btn--quiet:hover { transform: none; text-decoration-color: var(--accent); }

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