/*
 * DELICATE FIRE — Design System CSS
 * The lantern that holds the fire
 * 
 * Philosophy: Spacious clarity, quiet authority, invitation without manipulation
 * Aesthetic: Like a well-lit reading room in a sanctuary
 * 
 * Design refresh by Zamir (Transcendent Lens) — Feb 2026
 * Inspired by: Editorial typography, Linear's dark elegance, 
 *              the breathing room of meditation spaces
 */

/* ========================================
   1. CSS CUSTOM PROPERTIES
   ======================================== */

:root {
  /* Foundation Colors — Warm Parchment */
  --color-bg: #FAF8F5;
  --color-bg-alt: #F5F1EB;
  --color-bg-subtle: rgba(45, 42, 38, 0.02);
  --color-text: #2D2A26;
  --color-text-muted: #6B645B;
  --color-text-subtle: #8A847A;
  --color-border: #E8E3DB;
  --color-border-light: #F0EBE3;
  
  /* Warmth Accents (The Flame) */
  --color-accent: #C4733B;
  --color-accent-light: #D4956A;
  --color-accent-dark: #9B5A2E;
  --color-accent-glow: rgba(196, 115, 59, 0.15);
  --color-gold: #B8923A;
  
  /* Sage Green — Nature's Complement */
  --color-sage: #7BA99C;
  --color-sage-light: #9BC4B8;
  --color-sage-dark: #5E8A7E;
  --color-sage-glow: rgba(123, 169, 156, 0.15);
  
  /* Soft Warm Grays */
  --color-gray-warm-100: #F7F5F2;
  --color-gray-warm-200: #EBE7E1;
  --color-gray-warm-300: #D9D4CC;
  --color-gray-warm-400: #B8B2A8;
  --color-gray-warm-500: #918B81;
  
  /* Dark Mode Colors — Warmer, softer */
  --color-bg-dark: #2E4057;
  --color-bg-alt-dark: #3A4D66;
  --color-surface-dark: #364759;
  --color-text-dark: #E8E4DD;
  --color-text-muted-dark: #B8C4D0;
  --color-border-dark: #4A5A6E;
  --color-accent-bright: #E8935B;
  
  /* Typography — The Voice */
  --font-body: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-nav: var(--font-heading);
  
  /* Font Sizes — Refined Scale with Fluid Sizing */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: 1.125rem;      /* 18px — body minimum per research */
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: clamp(2rem, 4vw, 2.5rem);
  --text-4xl: clamp(2.5rem, 5vw, 3.5rem);
  --text-5xl: clamp(3rem, 6vw, 4.5rem);
  --text-hero: clamp(2.75rem, 6vw + 1rem, 5rem);
  
  /* Spacing Scale — 8pt Grid System */
  --space-xs: 0.25rem;      /* 4px */
  --space-sm: 0.5rem;       /* 8px */
  --space-md: 1rem;         /* 16px */
  --space-lg: 1.5rem;       /* 24px */
  --space-xl: 2rem;         /* 32px */
  --space-2xl: 2rem;        /* 32px — tightened */
  --space-3xl: 3rem;        /* 48px — tightened */
  --space-4xl: 4rem;        /* 64px — tightened */
  --space-5xl: 10rem;       /* 160px */
  
  /* Layout — Room to Think */
  --max-width-page: 1200px;
  --max-width-prose: 44rem; /* ~700px — optimal reading width */
  --max-width-narrow: 28rem;
  --max-width-wide: 68rem;
  
  /* Borders & Radius — Soft Edges */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  
  /* Shadows — Soft Multi-Layer Depth */
  --shadow-sm: 
    0 1px 2px rgba(45, 42, 38, 0.04),
    0 2px 4px rgba(45, 42, 38, 0.04);
  --shadow-md: 
    0 1px 2px rgba(45, 42, 38, 0.04),
    0 4px 8px rgba(45, 42, 38, 0.04),
    0 8px 16px rgba(45, 42, 38, 0.04);
  --shadow-lg: 
    0 1px 3px rgba(45, 42, 38, 0.04),
    0 4px 8px rgba(45, 42, 38, 0.04),
    0 12px 24px rgba(45, 42, 38, 0.06),
    0 24px 48px rgba(45, 42, 38, 0.06);
  --shadow-card: 
    0 1px 2px rgba(45, 42, 38, 0.04),
    0 4px 8px rgba(45, 42, 38, 0.04),
    0 8px 16px rgba(45, 42, 38, 0.04);
  --shadow-card-hover: 
    0 2px 4px rgba(45, 42, 38, 0.04),
    0 8px 16px rgba(45, 42, 38, 0.06),
    0 16px 32px rgba(45, 42, 38, 0.08);
  --shadow-glow: 0 0 40px var(--color-accent-glow);
  --shadow-glow-sage: 0 0 40px var(--color-sage-glow);
  
  /* Transitions — 200-300ms ease-out per research */
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);  /* Natural deceleration */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);  /* Slight bounce */
  --transition-fast: 150ms var(--ease-out);
  --transition-base: 250ms var(--ease-out);    /* Sweet spot per research */
  --transition-slow: 400ms var(--ease-out);
  --transition-reveal: 600ms var(--ease-out);
}

/* ========================================
   2. CSS RESET & BASE STYLES
   ======================================== */

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

* {
  margin: 0;
  padding: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: 1.7;      /* Research: 1.7 for optimal reading */
  color: var(--color-text);
  background-color: var(--color-bg);
  /* Subtle background gradient for texture (Zamir R2) */
  background-image: 
    linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-alt) 50%, var(--color-bg) 100%);
  background-size: 100% 200vh;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

input,
button,
textarea,
select {
  font: inherit;
}

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

/* ========================================
   3. TYPOGRAPHY — The Voice
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
  letter-spacing: -0.02em;  /* Per research: tighter headlines */
}

h1 {
  font-size: var(--text-hero);
  line-height: 1.02;        /* Tighter for architectural presence (Zamir R2) */
  letter-spacing: -0.035em; /* Extra tight for hero (Zamir R2) */
  font-weight: 700;
}

h2 {
  font-size: var(--text-3xl);
  line-height: 1.2;
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-lg);
}

h3 {
  font-size: var(--text-2xl);
  line-height: 1.3;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

h4 {
  font-size: var(--text-xl);
  line-height: 1.4;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

h5 {
  font-size: var(--text-lg);
  line-height: 1.4;
}

h6 {
  font-size: var(--text-sm);
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* Responsive typography */
@media (max-width: 768px) {
  h1 {
    font-size: var(--text-4xl);
  }
  
  h2 {
    font-size: var(--text-2xl);
  }
  
  h3 {
    font-size: var(--text-xl);
  }
  
  body {
    font-size: var(--text-base);
  }
}

p {
  margin-bottom: var(--space-lg);
}

p:last-child {
  margin-bottom: 0;
}

/* Lead text — For opening paragraphs */
.lead {
  font-size: clamp(1.25rem, 2.5vw, 1.375rem);  /* Fluid 20-22px per research */
  line-height: 1.65;
  color: var(--color-text-muted);
  max-width: 36rem;                             /* ~576px — narrower for impact */
  margin-left: auto;
  margin-right: auto;
}

/* Eyebrow — Small label above headings */
.eyebrow {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.8125rem;       /* 13px — smaller is more refined (Zamir R2) */
  font-weight: 600;           /* Bolder to compensate for size */
  text-transform: uppercase;
  letter-spacing: 0.15em;     /* Wider for elegance */
  color: var(--color-sage-dark);  /* Sage for variety (Zamir R2) */
  margin-bottom: var(--space-md);
}

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

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

/* Decorative horizontal rule */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-border) 20%,
    var(--color-border) 80%,
    transparent
  );
  margin: var(--space-3xl) auto;
  max-width: 200px;
}

/* ========================================
   4. LINKS — Warm Connections
   ======================================== */

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1.5px;  /* Zamir R3: Better visibility */
  text-underline-offset: 0.25em;
  transition: color 250ms var(--ease-out), 
              text-decoration-color 250ms var(--ease-out);
}

a:hover,
a:focus {
  color: var(--color-accent-dark);
  text-decoration-color: var(--color-accent-dark);
}

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

/* Navigation links (no underline) */
.nav-link {
  text-decoration: none;
  color: var(--color-text-muted);
  font-family: var(--font-nav);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-accent);
  transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link:focus {
  color: var(--color-text);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  width: 100%;
}

.nav-link[aria-current="page"] {
  color: var(--color-text);
}

/* ========================================
   5. BUTTONS — Invitations
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.875rem 2rem;  /* 14px 32px per research */
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  border-radius: 9999px;   /* Pill-shaped per research */
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 250ms ease-out;  /* 200-300ms per research */
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Primary Button — The Warm Invitation */
.btn-primary {
  background-color: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: white;
  transform: translateY(-3px);  /* Subtle lift */
  box-shadow: 
    var(--shadow-lg), 
    var(--shadow-glow),
    0 8px 20px rgba(196, 115, 59, 0.25);
}

.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  transition: all 100ms ease-out;
}

/* Secondary Button — The Gentle Alternative */
.btn-secondary {
  background-color: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
  border-width: 2px;          /* Thicker border (Zamir R2) */
  font-weight: 600;           /* Bolder text (Zamir R2) */
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--color-accent);
  color: white;
  transform: translateY(-3px);
  box-shadow: 
    var(--shadow-md),
    0 6px 16px rgba(196, 115, 59, 0.2);
}

.btn-secondary:active {
  transform: translateY(-1px);
  transition: all 100ms ease-out;
}

/* Sage Button — Nature's Alternative */
.btn-sage {
  background-color: var(--color-sage);
  color: white;
  border-color: var(--color-sage);
  box-shadow: var(--shadow-md);
}

.btn-sage:hover,
.btn-sage:focus {
  background-color: var(--color-sage-dark);
  border-color: var(--color-sage-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow-sage);
}

/* Ghost Button — The Whisper */
.btn-ghost {
  background-color: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
  padding: 0.75rem 1.25rem;
}

.btn-ghost:hover,
.btn-ghost:focus {
  color: var(--color-accent);
  background-color: var(--color-bg-alt);
}

/* Text Link Button */
.btn-text {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.btn-text:hover {
  color: var(--color-accent-dark);
}

.btn-text::after {
  content: '→';
  transition: transform var(--transition-fast);
}

.btn-text:hover::after {
  transform: translateX(4px);
}

/* Button Sizes */
.btn-sm {
  padding: 0.75rem 1.5rem;
  font-size: var(--text-sm);
}

.btn-lg {
  padding: 1.25rem 2.5rem;
  font-size: var(--text-lg);
}

/* ========================================
   6. LAYOUT CONTAINERS
   ======================================== */

.container {
  width: 100%;
  max-width: var(--max-width-page);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
}

@media (max-width: 768px) {
  .container {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }
}

.container-narrow {
  max-width: var(--max-width-narrow);
}

.container-prose {
  max-width: var(--max-width-prose);
}

.container-wide {
  max-width: var(--max-width-wide);
}

/* ========================================
   7. SECTIONS — Breathing Room
   ======================================== */

.section {
  padding-top: var(--space-2xl);     /* 48px — tighter */
  padding-bottom: var(--space-2xl);
}

.section-sm {
  padding-top: var(--space-3xl);     /* 80px per research */
  padding-bottom: var(--space-3xl);
}

.section-lg {
  padding-top: var(--space-5xl);     /* 160px for major sections */
  padding-bottom: var(--space-5xl);
}

/* Alternating backgrounds */
.section-alt {
  background-color: var(--color-bg-alt);
}

/* Sage accent section */
.section-sage {
  background: linear-gradient(135deg, var(--color-sage-glow) 0%, transparent 60%);
}

/* Section headers — Centered elegance */
.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);    /* 32px breathing room */
  max-width: var(--max-width-prose);
  margin-left: auto;
  margin-right: auto;
}

.section-header h1,
.section-header h2 {
  margin-top: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.section-header h2 {
  margin-top: 0;
  margin-bottom: var(--space-lg);    /* 24px */
}

.section-header p {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
}

/* Responsive section spacing */
@media (max-width: 768px) {
  .section {
    padding-top: var(--space-2xl);   /* 48px on mobile */
    padding-bottom: var(--space-2xl);
  }
  
  .section-lg {
    padding-top: var(--space-3xl);   /* 80px on mobile */
    padding-bottom: var(--space-3xl);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .section {
    padding-top: var(--space-3xl);   /* 80px on tablet */
    padding-bottom: var(--space-3xl);
  }
}

/* ========================================
   8. HERO SECTION — The Threshold
   ======================================== */

.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-4xl) var(--space-lg);  /* 120px vertical padding */
  position: relative;
  overflow: hidden;
  /* Subtle top-to-bottom warmth gradient for depth */
  background: linear-gradient(
    180deg,
    var(--color-bg) 0%,
    var(--color-bg-alt) 100%
  );
}

/* Layered gradient background with sage/ember warmth */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(
      ellipse 70% 55% at 25% 25%,
      var(--color-sage-glow) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse 90% 70% at 75% 65%,
      var(--color-accent-glow) 0%,
      transparent 65%
    ),
    radial-gradient(
      circle at 50% 100%,
      rgba(196, 115, 59, 0.06) 0%,
      transparent 40%
    );
  opacity: 0.7;
  pointer-events: none;
}

.hero-content {
  max-width: 42rem;        /* ~672px — slightly narrower for impact */
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin-bottom: var(--space-xl);
  animation: fadeInUp var(--transition-reveal) forwards;
}

.hero .lead {
  margin-bottom: var(--space-2xl);
  animation: fadeInUp var(--transition-reveal) 100ms forwards;
  opacity: 0;
}

.hero em {
  font-style: normal;
  color: var(--color-accent);
  font-weight: 500;
}

/* Tagline styling */
.hero-tagline {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-accent);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xl);
  display: block;
  animation: fadeInUp var(--transition-reveal) forwards;
}

/* Eyebrow in hero — extra breathing room */
.hero .eyebrow {
  margin-bottom: var(--space-lg);
  opacity: 0.9;
}

.hero p {
  font-size: var(--text-xl);
  line-height: 1.7;
  color: var(--color-text-muted);
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-2xl);
  animation: fadeInUp var(--transition-reveal) 200ms forwards;
  opacity: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  justify-content: center;
  animation: fadeInUp var(--transition-reveal) 300ms forwards;
  opacity: 0;
  margin-top: var(--space-xl);
}

/* Hero CTAs get extra presence */
.hero-actions .btn-primary {
  box-shadow: 
    var(--shadow-md),
    0 0 0 4px rgba(196, 115, 59, 0.1);
}

.hero-actions .btn-primary:hover {
  box-shadow: 
    var(--shadow-lg),
    var(--shadow-glow),
    0 0 0 4px rgba(196, 115, 59, 0.15);
}

/* Zamir R3: Hero-to-content transition separator */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(120px, 20%);
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-sage), transparent);
  opacity: 0.3;
}

@media (max-width: 768px) {
  .hero {
    min-height: 80vh;
    padding: var(--space-3xl) var(--space-lg);
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-actions .btn {
    width: 100%;
    max-width: 280px;
  }
}

/* ========================================
   9. CARDS — Floating Containers
   ======================================== */

.card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);   /* Slightly larger radius */
  padding: var(--space-lg);           /* 24px — tighter cards */
  transition: transform 250ms ease-out, 
              box-shadow 250ms ease-out,
              border-color 250ms ease-out;
  box-shadow: var(--shadow-card);
  position: relative;
}

.card:hover {
  transform: translateY(-3px);       /* Slightly more lift */
  box-shadow: 
    var(--shadow-card-hover),
    0 0 0 1px var(--color-sage-glow);  /* Subtle sage glow ring */
  border-color: var(--color-sage-light);
}

/* Card on alternate background */
.section-alt .card {
  background-color: var(--color-bg);
  border-color: var(--color-border);
}

.card-header {
  margin-bottom: var(--space-lg);
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Emoji icons in card titles get subtle treatment */
.card-title > :first-child:is(span, .emoji) {
  font-size: 1.5em;
}

.card-body {
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* Card Border Variants */
.card-border-accent {
  border-left: 3px solid var(--color-sage);
}

.card-border-warm {
  border-left: 3px solid var(--color-warm);
}

/* Card Grid */
.card-grid {
  display: grid;
  gap: 16px;                  /* tight card spacing */
  justify-content: center;    /* Center cards when they don't fill row */
}

@media (max-width: 768px) {
  .card-grid {
    gap: 16px;                /* match desktop */
  }
}

.card-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card-grid-3 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 1000px;
  margin-inline: auto;        /* Center the grid itself */
}

.card-grid-3 > :last-child:nth-child(odd) {
  grid-column: 1 / -1;        /* Center last card if odd count */
  max-width: 460px;
  justify-self: center;
}

@media (max-width: 600px) {
  .card-grid-3 {
    grid-template-columns: 1fr;  /* Stack on mobile */
  }
  .card-grid-3 > :last-child:nth-child(odd) {
    max-width: none;
  }
}

/* ========================================
   10. NAVIGATION — Quiet Presence
   ======================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(250, 248, 245, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width-page);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-xl);
}

/* Logo / Wordmark */
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.02em;
  transition: color 250ms var(--ease-out);
}

.logo-img {
  transition: transform 250ms var(--ease-out);
}

.nav-logo:hover .logo-text {
  color: var(--color-accent);
}

.nav-logo:hover .logo-img {
  transform: scale(1.05);
}

/* Desktop Navigation */
.nav-links {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-family: var(--font-nav);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--transition-fast);
  position: relative;
  padding: var(--space-xs) 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--color-accent);
  border-radius: var(--radius-full);
  transition: width 300ms var(--ease-out),
              left 300ms var(--ease-out);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-text);
}

.nav-links a:hover::after {
  width: 100%;
  left: 0;
}

/* Active page — subtle accent underline */
.nav-links a[aria-current="page"]::after {
  width: 60%;
  left: 20%;
  background-color: var(--color-sage);
  opacity: 0.7;
}

/* Mobile Navigation Toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: var(--space-sm);
  cursor: pointer;
  color: var(--color-text);
  width: 44px;
  height: 44px;
  position: relative;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 1px;
  transition: all var(--transition-fast);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-toggle-icon {
  top: 50%;
  transform: translate(-50%, -50%);
}

.nav-toggle-icon::before {
  content: '';
  top: -8px;
}

.nav-toggle-icon::after {
  content: '';
  top: 8px;
}

@media (max-width: 768px) {
  .nav {
    padding: var(--space-md) var(--space-lg);
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-bg);
    flex-direction: column;
    padding: var(--space-lg);
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
  }
  
  .nav-links.is-open {
    display: flex;
  }
  
  .nav-links li {
    border-bottom: 1px solid var(--color-border-light);
  }
  
  .nav-links li:last-child {
    border-bottom: none;
  }
  
  .nav-links a {
    display: block;
    font-size: var(--text-lg);
    padding: var(--space-md) 0;
  }
  
  .nav-links a::after {
    display: none;
  }
  
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ========================================
   11. FOOTER — Quiet Closing
   ======================================== */

.site-footer {
  background-color: var(--color-bg-alt);
  border-top: 1px solid var(--color-border-light);
  padding: var(--space-4xl) 0 var(--space-2xl);
  margin-top: var(--space-4xl);
  position: relative;
}

/* Subtle gradient separator */
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(280px, 40%);  /* Zamir R3: Wider footer separator */
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-sage) 30%,
    var(--color-sage) 70%,
    transparent
  );
  border-radius: var(--radius-full);
  opacity: 0.4;
}

.footer-inner {
  max-width: var(--max-width-page);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2xl);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
}

.footer-tagline {
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-lg) var(--space-xl);
  list-style: none;
}

.footer-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color 250ms var(--ease-out);
  position: relative;
}

.footer-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-accent);
  transition: width 250ms var(--ease-out);
}

.footer-nav a:hover {
  color: var(--color-accent);
}

.footer-nav a:hover::after {
  width: 100%;
}

.footer-copy {
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
}

@media (max-width: 768px) {
  .site-footer {
    padding: var(--space-3xl) 0 var(--space-xl);
  }
  
  .footer-inner {
    padding: 0 var(--space-lg);
  }
  
  .footer-nav ul {
    flex-direction: column;
    gap: var(--space-md);
  }
}

/* ========================================
   12. PROSE — Long-form Content
   ======================================== */

.prose {
  max-width: var(--max-width-prose);  /* ~700px per research */
  margin-left: auto;
  margin-right: auto;
  font-size: var(--text-lg);          /* 18px minimum per research */
  line-height: 1.7;                    /* Optimal reading per research */
}

.prose > * + * {
  margin-top: var(--space-lg);        /* 24px vertical rhythm */
}

.prose h2 {
  margin-top: var(--space-3xl);       /* 80px before h2 */
  margin-bottom: var(--space-lg);     /* 24px after h2 */
  padding-top: var(--space-lg);
}

.prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
}

.prose h3 {
  margin-top: var(--space-2xl);       /* 48px before h3 */
  margin-bottom: var(--space-md);     /* 16px after h3 */
}

.prose h4 {
  margin-top: var(--space-xl);        /* 32px before h4 */
  margin-bottom: var(--space-md);
}

.prose p {
  max-width: 65ch;                    /* Optimal character width */
}

.prose ul,
.prose ol {
  margin-bottom: var(--space-lg);
  padding-left: var(--space-xl);
}

.prose li {
  margin-bottom: var(--space-sm);
  line-height: 1.65;
}

.prose li::marker {
  color: var(--color-accent);
}

.prose blockquote {
  margin: var(--space-2xl) 0;
  padding: var(--space-xl) var(--space-2xl);
  padding-left: var(--space-2xl);
  border-left: 3px solid var(--color-sage);  /* Sage accent for variety */
  background: linear-gradient(
    135deg,
    var(--color-bg-alt) 0%,
    rgba(123, 169, 156, 0.05) 100%
  );
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  font-style: italic;
  color: var(--color-text-muted);
  position: relative;
}

/* Decorative quote mark */
.prose blockquote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: var(--space-lg);
  font-family: Georgia, serif;
  font-size: 5rem;            /* Larger (Zamir R2) */
  line-height: 1;
  color: var(--color-sage);
  opacity: 0.15;
  font-weight: 700;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

/* ========================================
   13. CONTENT SECTIONS — Home Page
   ======================================== */

/* Intro Section */
.intro {
  padding: var(--space-4xl) var(--space-xl);
  text-align: center;
}

.intro h2 {
  margin-top: 0;
  margin-bottom: var(--space-lg);
}

.intro p {
  max-width: var(--max-width-prose);
  margin-left: auto;
  margin-right: auto;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

/* Paths Section */
.paths {
  padding: var(--space-4xl) var(--space-xl);
  background-color: var(--color-bg-alt);
  text-align: center;
}

.paths h2 {
  margin-top: 0;
  margin-bottom: var(--space-2xl);
}

.paths p {
  max-width: var(--max-width-prose);
  margin: 0 auto var(--space-md);
  font-size: var(--text-lg);
}

.paths strong {
  color: var(--color-text);
}

/* ========================================
   14. UTILITY CLASSES
   ======================================== */

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Text colors */
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent); }

/* Display */
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }

/* Flex utilities */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  flex-direction: column;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Margin utilities */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-md); }

/* Visibility */
.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;
}

/* ========================================
   15. ANIMATIONS
   ======================================== */

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn var(--transition-slow) forwards;
}

.fade-in-up {
  animation: fadeInUp var(--transition-slow) forwards;
}

/* Staggered fade-in for lists */
.stagger-fade > * {
  opacity: 0;
  animation: fadeInUp var(--transition-slow) forwards;
}

.stagger-fade > *:nth-child(1) { animation-delay: 0ms; }
.stagger-fade > *:nth-child(2) { animation-delay: 100ms; }
.stagger-fade > *:nth-child(3) { animation-delay: 200ms; }
.stagger-fade > *:nth-child(4) { animation-delay: 300ms; }
.stagger-fade > *:nth-child(5) { animation-delay: 400ms; }

/* ========================================
   16. SPECIAL COMPONENTS
   ======================================== */

/* Quote / Testimonial */
.quote {
  padding: var(--space-2xl) var(--space-3xl);
  background: linear-gradient(
    135deg,
    var(--color-bg-alt) 0%,
    rgba(196, 115, 59, 0.04) 100%
  );
  border-radius: var(--radius-xl);
  border-left: 4px solid var(--color-accent);
  max-width: var(--max-width-prose);
  margin: var(--space-2xl) auto;
  position: relative;
  box-shadow: var(--shadow-sm);
}

/* Decorative quote mark for .quote */
.quote::before {
  content: '"';
  position: absolute;
  top: -10px;                 /* Position better (Zamir R2) */
  left: var(--space-lg);
  font-family: Georgia, serif;
  font-size: 5rem;            /* Larger (Zamir R2) */
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.15;              /* Still subtle but present */
  font-weight: 700;
}

/* Add closing quote mark for balance (Zamir R2) */
.quote::after {
  content: '"';
  position: absolute;
  bottom: var(--space-md);
  right: var(--space-xl);
  font-family: Georgia, serif;
  font-size: 3rem;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.1;
}

.quote-text {
  font-size: var(--text-xl);
  font-style: italic;
  line-height: 1.7;
  margin-bottom: var(--space-lg);
  color: var(--color-text-muted);
  padding-left: var(--space-lg);
}

.quote-author {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  padding-left: var(--space-lg);
}

/* Feature / Path Card — Editorial style per research */
.path-card {
  text-align: center;
  padding: var(--space-2xl);          /* 48px for breathing room */
  transition: transform 250ms ease-out,
              box-shadow 250ms ease-out,
              border-color 250ms ease-out;
  border-radius: var(--radius-xl);
  background: var(--color-bg);
  border-top: 3px solid var(--color-border-light);  /* Base, overridden below */
  box-shadow: 0 1px 3px rgba(45, 42, 38, 0.04);  /* Zamir R3: Subtle resting shadow */
}

/* Differentiated path card borders (Zamir R2) */
.path-card:first-child {
  border-top-color: var(--color-accent);   /* Ember for primary path */
}

.path-card:nth-child(2) {
  border-top-color: var(--color-sage);     /* Sage for secondary */
}

.path-card:nth-child(3) {
  border-top-color: var(--color-gold);     /* Gold for tertiary */
}

.path-card:hover {
  transform: translateY(-3px);        /* Match card lift */
}

.path-card-icon {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
  border-radius: var(--radius-full);
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 0.5),
    0 2px 4px rgba(45, 42, 38, 0.04);
}

.path-card h3 {
  margin-top: 0;
  margin-bottom: var(--space-md);
}

.path-card p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  line-height: 1.65;
}

/* CTA Banner */
.cta-banner {
  background: linear-gradient(
    135deg,
    var(--color-bg) 0%,
    var(--color-bg-alt) 50%,
    rgba(123, 169, 156, 0.08) 100%
  );
  padding: var(--space-3xl) var(--space-2xl);
  border-radius: var(--radius-xl);
  text-align: center;
  max-width: var(--max-width-wide);
  margin: var(--space-4xl) auto;
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
}

.cta-banner h3 {
  margin-top: 0;
  margin-bottom: var(--space-md);
}

.cta-banner p {
  margin-bottom: var(--space-xl);
  color: var(--color-text-muted);
  max-width: var(--max-width-prose);
  margin-left: auto;
  margin-right: auto;
}

.cta-banner-primary {
  background: linear-gradient(
    135deg,
    rgba(123, 169, 156, 0.1) 0%,
    rgba(123, 169, 156, 0.15) 50%,
    rgba(123, 169, 156, 0.08) 100%
  );
  border: 1px solid var(--color-sage);
}

/* CTA Block — Larger inline call-to-action */
.cta-block {
  padding: var(--space-2xl);
  border-radius: var(--radius-lg);
  margin: var(--space-2xl) 0;
}

.cta-block.primary {
  background-color: var(--color-accent-glow);
  border: 1px solid var(--color-accent-light);
}

.cta-block p {
  margin-bottom: var(--space-lg);
}

.cta-block p:last-of-type {
  margin-bottom: var(--space-xl);
}

/* Social Links List */
.social-links ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-xl);
}

.social-links li {
  margin: 0;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.social-links a:hover {
  color: var(--color-accent);
}

/* ========================================
   17. FORM ELEMENTS
   ======================================== */

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1.125rem;
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), 
              box-shadow var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-subtle);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

/* Email capture inline */
.email-capture {
  display: flex;
  gap: var(--space-sm);
  max-width: 420px;
  margin: 0 auto;
}

.email-capture .form-input {
  flex: 1;
}

@media (max-width: 480px) {
  .email-capture {
    flex-direction: column;
  }
  
  .email-capture .btn {
    width: 100%;
  }
}

/* ========================================
   18. DARK MODE
   ======================================== */

@media (prefers-color-scheme: dark) {
  :root {
    /* Warm dark blue instead of pure black — per research */
    --color-bg: var(--color-bg-dark);           /* #2E4057 */
    --color-bg-alt: var(--color-bg-alt-dark);   /* #3A4D66 */
    --color-bg-subtle: rgba(255, 255, 255, 0.03);
    --color-text: var(--color-text-dark);       /* #E8E4DD */
    --color-text-muted: var(--color-text-muted-dark);  /* #B8C4D0 */
    --color-text-subtle: #8A9AAB;
    --color-border: var(--color-border-dark);   /* #4A5A6E */
    --color-border-light: #3D4D5F;
    --color-accent: var(--color-accent-bright); /* #E8935B */
    --color-accent-glow: rgba(232, 147, 91, 0.15);
    --color-sage: #8FC1B5;                      /* Lighter sage for dark mode */
    --color-sage-glow: rgba(143, 193, 181, 0.12);
    
    /* Softer multi-layer shadows for dark mode */
    --shadow-card: 
      0 2px 4px rgba(0, 0, 0, 0.12),
      0 4px 8px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 
      0 4px 8px rgba(0, 0, 0, 0.15),
      0 12px 24px rgba(0, 0, 0, 0.12);
  }
  
  .site-header {
    background-color: rgba(46, 64, 87, 0.92);   /* Warm dark blue with transparency */
    border-bottom-color: var(--color-border-dark);
  }
  
  .card,
  .section-alt .card {
    background-color: var(--color-surface-dark);
    border-color: var(--color-border-dark);
  }
  
  .card:hover {
    border-color: #5A6A7E;
  }
  
  /* Hero gradient in dark mode */
  .hero {
    background: linear-gradient(
      180deg,
      var(--color-bg) 0%,
      var(--color-bg-alt) 100%
    );
  }
  
  .hero::before {
    background: 
      radial-gradient(
        ellipse 70% 55% at 25% 25%,
        rgba(143, 193, 181, 0.1) 0%,
        transparent 55%
      ),
      radial-gradient(
        ellipse 90% 70% at 75% 65%,
        rgba(232, 147, 91, 0.12) 0%,
        transparent 65%
      ),
      radial-gradient(
        circle at 50% 100%,
        rgba(232, 147, 91, 0.08) 0%,
        transparent 40%
      );
    opacity: 1;
  }
  
  /* Dark mode button enhancements */
  .btn-primary {
    box-shadow: 
      var(--shadow-md),
      0 0 20px rgba(232, 147, 91, 0.15);
  }
  
  .btn-primary:hover,
  .btn-primary:focus {
    box-shadow: 
      var(--shadow-lg),
      0 0 30px rgba(232, 147, 91, 0.25);
  }
  
  /* Dark mode card sage glow */
  .card:hover {
    box-shadow: 
      var(--shadow-card-hover),
      0 0 0 1px rgba(143, 193, 181, 0.15);
    border-color: rgba(143, 193, 181, 0.3);
  }
  
  /* Dark mode quote styling */
  .quote {
    background: linear-gradient(
      135deg,
      var(--color-bg-alt) 0%,
      rgba(232, 147, 91, 0.06) 100%
    );
  }
  
  .prose blockquote {
    background: linear-gradient(
      135deg,
      var(--color-bg-alt) 0%,
      rgba(143, 193, 181, 0.06) 100%
    );
  }
  
  /* Dark mode footer separator */
  .site-footer::before {
    background: linear-gradient(
      90deg,
      transparent,
      var(--color-sage) 30%,
      var(--color-sage) 70%,
      transparent
    );
    opacity: 0.25;
  }
  
  /* Path card icon in dark mode */
  .path-card-icon {
    background: linear-gradient(135deg, var(--color-surface-dark) 0%, var(--color-bg-alt) 100%);
    box-shadow: 
      inset 0 1px 2px rgba(255, 255, 255, 0.05),
      0 2px 4px rgba(0, 0, 0, 0.15);
  }
  
  /* Selection styling for dark mode */
  ::selection {
    background-color: var(--color-accent-glow);
    color: var(--color-text);
  }
}

/* ========================================
   19. PAGE-SPECIFIC STYLES
   ======================================== */

/* Home page */
.page-home main {
  padding-top: 0;
}

/* Interior pages */
.page-start-here main,
.page-about main,
.page-learn main,
.page-media main,
.page-community main,
.page-contact main {
  padding: var(--space-4xl) var(--space-xl);
  max-width: var(--max-width-prose);
  margin: 0 auto;
}

/* ========================================
   END OF DESIGN SYSTEM CSS
   ======================================== */
