/* ============================================================
   Kindspring — styles.css
   1. CSS Custom Properties
   2. Reset & Base
   3. Typography
   4. Layout utilities
   5. Header & Navigation
   6. Hero sections
   7. Spring mechanic
   8. Content sections (intro, why, how, quote)
   9. Resource hub (find-your-light)
  10. Footer
  11. Animations
  12. Responsive / Mobile
   ============================================================ */

/* 1. CSS Custom Properties */
:root {
  /* Core */
  --color-bg: #FFFBF5;
  --color-bg-alt: #FFF4E6;
  --color-text: #2C1A0E;
  --color-text-secondary: #6B4C35;
  --color-text-muted: #9E7B62;

  /* Spring palette */
  --color-spring: #FF8C42;
  --color-spring-light: #FFB347;
  --color-spring-glow: #FFE0B2;

  /* Resource category colors */
  --color-crisis: #E53935;
  --color-therapist: #FB8C00;
  --color-community: #F9A825;
  --color-learn: #43A047;
  --color-wellness: #00ACC1;
  --color-meditation: #5E35B1;
  --color-understand: #1E88E5;
  --color-specialized: #D81B60;
  --color-quickwins: #00897B;

  /* UI */
  --color-border: #F0DCC8;
  --color-link: #D4621A;
  --font-display: 'Lora', Georgia, serif;
  --font-body: 'Inter', sans-serif;
  --container-max: 960px;
  --header-height: 64px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
}

/* 3. Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--color-text);
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.35rem); }

p {
  color: var(--color-text-secondary);
  max-width: 65ch;
}

a {
  color: var(--color-link);
  text-decoration: underline;
}

a:hover {
  color: var(--color-spring);
}

/* 4. Layout utilities */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}

.section--alt {
  background: var(--color-bg-alt);
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 5. Header & Navigation */
.header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.nav {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-text);
  text-decoration: none;
}

.nav__logo:hover {
  color: var(--color-spring);
}

.nav__logo-orb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFE0B2 0%, #FFB347 40%, #FF8C42 100%);
  box-shadow: 0 0 8px rgba(255, 140, 66, 0.5);
  flex-shrink: 0;
  display: inline-block;
}

.nav__menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav__menu a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav__menu a:hover,
.nav__menu a.is-active {
  color: var(--color-spring);
}

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-spring);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  text-decoration: none;
  z-index: 200;
}

.skip-link:focus {
  top: 0;
}

/* 6. Hero sections */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__tagline {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-style: italic;
  color: var(--color-text);
  margin-bottom: 0.15rem;
}

.hero__subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2.25rem);
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
  max-width: none;
}

.page-hero {
  background: var(--color-bg-alt);
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.page-hero h1 {
  margin-bottom: 0.6rem;
}

.page-hero p {
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  margin: 0 auto;
}

/* 7. Spring mechanic */
.spring {
  width: 300px;
  max-width: 80vw;
  aspect-ratio: 1;
  margin: 2rem auto;
  position: relative;
  cursor: pointer;
  outline: none;
}

.spring:focus-visible .spring__orb {
  box-shadow:
    0 0 40px rgba(255, 140, 66, 0.4),
    0 0 80px rgba(255, 180, 71, 0.2),
    0 0 0 4px rgba(255, 140, 66, 0.4);
}

.spring__orb {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle,
    #FFE0B2 0%,
    #FFB347 30%,
    #FF8C42 55%,
    rgba(255, 140, 66, 0.6) 70%,
    rgba(255, 140, 66, 0.2) 85%,
    transparent 100%
  );
  animation: spring-breathe 4s ease-in-out infinite;
  box-shadow:
    0 0 40px rgba(255, 140, 66, 0.4),
    0 0 80px rgba(255, 180, 71, 0.2),
    0 0 120px rgba(255, 224, 178, 0.1);
}

.spring__orb.is-bursting {
  animation: spring-burst 0.6s ease-out forwards;
}

.particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-spring-light);
  animation: particle-radiate 1.5s ease-out forwards;
  animation-delay: var(--delay, 0ms);
  pointer-events: none;
}

.spring__affirmation {
  position: absolute;
  bottom: calc(100% + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: white;
  border-radius: 12px;
  padding: 12px 20px;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-text);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  max-width: 280px;
  white-space: normal;
  text-align: center;
  z-index: 10;
  pointer-events: none;
}

.spring__affirmation.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.spring__hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
  font-style: italic;
}

/* 8. Content sections */
.intro {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--color-bg-alt);
}

.intro__title {
  margin-bottom: 0.75rem;
}

.intro__text {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  max-width: 55ch;
  margin: 0 auto;
  line-height: 1.75;
}

.cta-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.cta-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.cta-card h3 {
  margin-bottom: 0.75rem;
  color: var(--color-spring);
}

.cta-card p {
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.cta-section {
  padding: 4rem 1.5rem;
  text-align: center;
}

.cta-section h2 {
  margin-bottom: 0.75rem;
}

.cta-section p {
  margin: 0 auto 1.75rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease, color 0.2s ease;
  cursor: pointer;
  border: 2px solid transparent;
  font-family: var(--font-body);
}

.btn--primary {
  background: var(--color-spring);
  color: white;
  border-color: var(--color-spring);
}

.btn--primary:hover {
  background: #e07030;
  border-color: #e07030;
  transform: translateY(-1px);
  color: white;
}

.btn--outline {
  background: transparent;
  color: var(--color-spring);
  border-color: var(--color-spring);
}

.btn--outline:hover {
  background: var(--color-spring);
  color: white;
  transform: translateY(-1px);
}

.btn--large {
  padding: 0.9rem 2.25rem;
  font-size: 1rem;
  border-radius: 10px;
}

/* Why page */
.why-section {
  padding: 3.5rem 0;
}

.why-section h2 {
  margin-bottom: 1rem;
}

.why-section p + p {
  margin-top: 0.9rem;
}

.why-section + .why-section {
  border-top: 1px solid var(--color-border);
}

.quote-block {
  background: var(--color-bg-alt);
  border-left: 4px solid var(--color-spring);
  border-radius: 0 12px 12px 0;
  padding: 2rem 2.5rem;
  margin: 2rem 0 3rem;
}

.quote-block blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--color-text);
  line-height: 1.6;
  max-width: none;
}

.quote-block cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: normal;
}

/* How page */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.mode-card {
  background: white;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  text-align: center;
}

.mode-card__number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-spring-glow), var(--color-spring-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--color-text);
  margin: 0 auto 1rem;
}

.mode-card h3 {
  margin-bottom: 0.6rem;
  color: var(--color-spring);
}

.mode-card p {
  font-size: 0.95rem;
  margin: 0 auto;
}

.questions-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.questions-list li {
  background: white;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  border: 1px solid var(--color-border);
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.4;
}

.how-guide-list {
  list-style: none;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.how-guide-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.how-guide-list li span.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.crisis-callout {
  background: #FFF5F5;
  border: 2px solid var(--color-crisis);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin: 2.5rem 0;
}

.crisis-callout h3 {
  color: var(--color-crisis);
  margin-bottom: 0.5rem;
}

.crisis-callout p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  max-width: none;
}

.crisis-callout a {
  color: var(--color-crisis);
  font-weight: 600;
}

/* 9. Resource hub */
.find-help-hero {
  background: var(--color-bg-alt);
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.find-help-hero h1 {
  margin-bottom: 0.5rem;
}

.find-help-hero p {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  margin: 0 auto;
}

.resources-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.resources-section {
  padding: 1rem 0 2rem;
}

.resources-section + .resources-section {
  border-top: 1px solid var(--color-border);
  padding-top: 2rem;
}

.resources-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  padding: 1.5rem 0 1rem;
  border-bottom: 2px solid var(--category-color, var(--color-spring));
  margin-bottom: 1.5rem;
  color: var(--color-text);
}

.resources-header::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--category-color, var(--color-spring));
  flex-shrink: 0;
}

.resources-section--crisis {
  background: #FFFAFA;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(229, 57, 53, 0.15);
}

.resources-section--crisis .resources-header {
  padding-top: 0.5rem;
}

.resources-section--crisis .resource-item {
  border-left-width: 5px;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.resource-item {
  display: block;
  background: white;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  border: 2px solid transparent;
  border-left: 4px solid var(--category-color, var(--color-spring));
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.resource-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--category-color, var(--color-spring));
  text-decoration: none;
  color: inherit;
}

.resource-item__name {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.resource-item__desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
  max-width: none;
  line-height: 1.45;
}

.resource-item__phone {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--category-color, var(--color-spring));
}

.subcategory-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 2rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border);
}

.section-intro {
  font-style: italic;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  max-width: 60ch;
}

/* Quick wins */
.quickwins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.quickwin-card {
  background: white;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  border: 2px solid transparent;
  border-left: 4px solid var(--color-quickwins);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
  background: white;
}

.quickwin-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--color-quickwins);
}

.quickwin-card__title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.quickwin-card__body {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
  display: none;
  margin-top: 0.5rem;
  max-width: none;
}

.quickwin-card.is-open .quickwin-card__body {
  display: block;
}

.quickwin-card__toggle {
  font-size: 0.8rem;
  color: var(--color-quickwins);
  font-weight: 600;
  margin-top: 0.5rem;
  display: block;
}

/* 10. Footer */
.footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.footer__tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.footer__social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}

.footer__social a:hover {
  background: var(--color-spring);
  color: white;
  border-color: var(--color-spring);
}

.footer__legal {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.footer__legal a {
  color: var(--color-text-muted);
  text-decoration: none;
  margin: 0 0.25rem;
}

.footer__legal a:hover {
  color: var(--color-spring);
}

/* 11. Animations */
@keyframes spring-breathe {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50%       { transform: scale(1.06); opacity: 1; }
}

@keyframes spring-burst {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.2); box-shadow: 0 0 80px rgba(255,140,66,0.8), 0 0 160px rgba(255,180,71,0.4); }
  100% { transform: scale(1); }
}

@keyframes particle-radiate {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--tx, 100px), var(--ty, 0px)) scale(0.3);
  }
}

/* 12. Responsive / Mobile */
@media (max-width: 768px) {
  .nav__menu {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    z-index: 99;
  }

  .nav__menu.is-open {
    display: flex;
  }

  .nav__menu li a {
    display: block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .nav__hamburger {
    display: flex;
  }

  .cta-pair {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem;
  }

  .modes-grid {
    grid-template-columns: 1fr;
  }

  .questions-list {
    grid-template-columns: 1fr;
  }

  .resources-grid {
    grid-template-columns: 1fr;
  }

  .quickwins-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 3.5rem 1.5rem 3rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .spring__orb { animation: none; }
  .particle { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
