/* ============================================================
   GLOBAL.CSS — Variables, Resets, Typography, Utilities
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Source+Sans+3:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500;1,600&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Primary */
  --color-cream:            #FAF7F2;
  --color-warm-white:       #FFFDF9;
  --color-sage:             #7A9E7E;
  --color-sage-light:       #B8D4BB;
  --color-sage-dark:        #5A7E5E;

  /* Warm neutrals */
  --color-charcoal:         #2D2A26;
  --color-brown-soft:       #6B5B4E;
  --color-terracotta:       #C4704B;
  --color-terracotta-light: #E8A882;
  --color-gold-soft:        #D4A853;

  /* Functional */
  --color-border:           #E8E2D9;
  --color-shadow:           rgba(45, 42, 38, 0.08);
  --color-overlay:          rgba(45, 42, 38, 0.6);

  /* Category colors */
  --cat-inner-world:        #7A9E7E;
  --cat-education:          #5B8FA8;
  --cat-health:             #C4704B;
  --cat-modern:             #8B7EC8;
  --cat-growing:            #D4A853;

  /* Typography */
  --font-heading:  'Playfair Display', Georgia, serif;
  --font-body:     'Source Sans 3', 'Segoe UI', sans-serif;
  --font-accent:   'Cormorant Garamond', Georgia, serif;

  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.25rem;
  --text-2xl:   1.5rem;
  --text-3xl:   2rem;
  --text-4xl:   2.5rem;
  --text-5xl:   3rem;

  --leading-tight:   1.25;
  --leading-normal:  1.6;
  --leading-relaxed: 1.8;

  /* Spacing */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4rem;
  --space-4xl:  6rem;
  --space-5xl:  8rem;

  /* Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 50%;

  /* Shadows */
  --shadow-sm:    0 1px 3px var(--color-shadow);
  --shadow-md:    0 4px 12px var(--color-shadow);
  --shadow-lg:    0 8px 24px var(--color-shadow);
  --shadow-hover: 0 8px 30px rgba(45, 42, 38, 0.12);
}

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-charcoal);
  background-color: var(--color-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- Skip to Content (A11y) ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--color-sage);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  z-index: 9999;
  font-weight: 600;
}
.skip-link:focus {
  top: var(--space-md);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--color-charcoal);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

@media (min-width: 1024px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
}

p {
  margin-bottom: var(--space-md);
  line-height: var(--leading-normal);
}

.text-accent {
  font-family: var(--font-accent);
}

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media (min-width: 640px) {
  .container { padding: 0 var(--space-xl); }
}

/* ---------- Section Spacing ---------- */
.section {
  padding: var(--space-3xl) 0;
}

@media (min-width: 1024px) {
  .section { padding: var(--space-4xl) 0; }
}

/* ---------- Section Labels & Headings ---------- */
.section-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-sage);
  margin-bottom: var(--space-sm);
}

.section-heading {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-xl);
}

@media (min-width: 1024px) {
  .section-heading { font-size: var(--text-3xl); }
}

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-group .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-group .reveal:nth-child(2) { transition-delay: 100ms; }
.reveal-group .reveal:nth-child(3) { transition-delay: 200ms; }
.reveal-group .reveal:nth-child(4) { transition-delay: 300ms; }
.reveal-group .reveal:nth-child(5) { transition-delay: 400ms; }

/* ---------- Page Fade-In ---------- */
.page-content {
  animation: pageFadeIn 400ms ease both;
}

@keyframes pageFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- Selection ---------- */
::selection {
  background: var(--color-sage-light);
  color: var(--color-charcoal);
}

/* ---------- Focus visible ---------- */
:focus-visible {
  outline: 2px solid var(--color-sage);
  outline-offset: 2px;
}
