/* =============================================================
   BASE.CSS — Reset, CSS Custom Properties, Typography
   Sophrologie Laëtitia Joachim
   ============================================================= */

/* ── Google Fonts are imported via <link> in HTML for performance ── */

/* ── CSS Custom Properties (Design Tokens) ── */
:root {
  /* --- Colors: Light Mode (pastel & warm) --- */
  --c-bg:         #FDFAF5;   /* warm cream white */
  --c-surface:    #F6F0E6;   /* honey cream */
  --c-surface-2:  #EDE5D4;   /* warm sand */
  --c-border:     #E3D9C8;   /* warm sand border */

  --c-primary:    #7CAE84;   /* pastel sage green */
  --c-primary-dk: #5E9166;   /* deeper sage for hover */
  --c-secondary:  #C8A87E;   /* warm honey taupe */
  --c-accent:     #D4C6AF;   /* warm sandy accent */

  --c-text:       #3A3530;   /* warm near-black */
  --c-text-2:     #6A6158;   /* secondary text */
  --c-muted:      #9A9088;   /* muted / placeholder */

  --c-white:      #FFFFFF;
  --c-overlay:    rgba(58, 53, 48, 0.45);

  /* --- Spacing Scale (8px base) --- */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  24px;
  --sp-6:  32px;
  --sp-7:  48px;
  --sp-8:  64px;
  --sp-9:  96px;
  --sp-10: 128px;

  /* --- Typography --- */
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;

  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg:   1.125rem;  /* 18px */
  --text-xl:   1.25rem;   /* 20px */
  --text-2xl:  1.5rem;    /* 24px */
  --text-3xl:  1.875rem;  /* 30px */
  --text-4xl:  2.25rem;   /* 36px */
  --text-5xl:  3rem;      /* 48px */
  --text-6xl:  3.75rem;   /* 60px */

  --leading-tight:  1.2;
  --leading-snug:   1.4;
  --leading-normal: 1.6;
  --leading-relaxed:1.8;

  --weight-light:   300;
  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semibold:600;

  /* --- Radius --- */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   32px;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-xs: 0 1px 3px rgba(58,53,48,0.06);
  --shadow-sm: 0 2px 8px rgba(58,53,48,0.08);
  --shadow-md: 0 4px 20px rgba(58,53,48,0.10);
  --shadow-lg: 0 8px 40px rgba(58,53,48,0.12);

  /* --- Transitions --- */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;
  --transition-slower: 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* --- Layout --- */
  --max-width:       1160px;
  --header-height:   72px;
  --section-padding: var(--sp-9) var(--sp-5);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Reserve space for scrollbar to prevent layout shift */
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--c-text);
  background-color: var(--c-bg);
  transition: background-color var(--transition-slow), color var(--transition-slow);
  overflow-x: hidden;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-light);
  line-height: var(--leading-tight);
  color: var(--c-text);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(var(--text-4xl), 6vw, var(--text-6xl)); }
h2 { font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl)); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); font-family: var(--font-body); font-weight: var(--weight-medium); }
h6 { font-size: var(--text-lg);  font-family: var(--font-body); font-weight: var(--weight-medium); }

p {
  line-height: var(--leading-relaxed);
  max-width: 68ch;
}

p + p { margin-top: var(--sp-4); }

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover { color: var(--c-primary-dk); }

a:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

ul, ol {
  padding-left: var(--sp-5);
}

ul li, ol li {
  line-height: var(--leading-relaxed);
  margin-bottom: var(--sp-2);
}

strong { font-weight: var(--weight-semibold); }
em     { font-style: italic; }

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

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--text-base);
}

/* ── Scrollbar Styling ── */
::-webkit-scrollbar         { width: 6px; }
::-webkit-scrollbar-track   { background: var(--c-surface); }
::-webkit-scrollbar-thumb   { background: var(--c-accent); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--c-primary); }

/* ── Selection ── */
::selection {
  background: var(--c-accent);
  color: var(--c-text);
}

/* ── Screen-reader only utility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}
