/* ===================================================================
   Per Beining — v4 design system
   Shared across all pages. Page-specific styles live in each page's
   own <style> block.
   =================================================================== */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; border: none; background: none; cursor: pointer; }

/* === TOKENS === */
:root {
  --cream:        #F5F1EC;
  --cream-dark:   #EDE8E1;
  --white:        #FEFDFB;
  --teal:         #0C8093;
  --teal-dark:    #0A6E7F;
  --teal-light:   #D6EAED;
  --sage:         #859E91;
  --sage-light:   #C8D5CD;
  --warm-gray:    #DCD9D0;
  --text:         #1A1A1A;
  --text-light:   #5A5A5A;
  --text-on-dark: #F0EDE8;
  --text-muted:   #8A8580;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Sans 3', 'Source Sans Pro', system-ui, sans-serif;
  --section-pad:  120px;
  --container:    1100px;
}

/* === BASE === */
body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-light);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-heading); color: var(--text); line-height: 1.15; }
h1 { font-size: clamp(2.4rem, 4.2vw, 3.6rem); font-weight: 300; letter-spacing: 0.02em; }
h2 { font-size: clamp(2rem, 3.5vw, 3rem); font-weight: 300; letter-spacing: 0.02em; }
h3 { font-size: 1.4rem; font-weight: 400; }

.label {
  font-family: var(--font-body); font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.2em; color: var(--teal);
}
.container { max-width: var(--container); margin: 0 auto; padding: 0 2rem; }

[id] { scroll-margin-top: 100px; }

/* === BUTTONS === */
.btn {
  display: inline-block; font-family: var(--font-body); font-size: 0.8rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em;
  padding: 16px 36px; transition: all 0.4s ease; cursor: pointer;
}
.btn-primary { background: var(--teal); color: var(--white); }
.btn-primary:hover { background: var(--teal-dark); }
.btn-subtle { background: var(--cream-dark); color: var(--text); }
.btn-subtle:hover { background: var(--warm-gray); }
.btn-outline-dark { background: transparent; color: var(--teal); border: 1px solid var(--teal); }
.btn-outline-dark:hover { background: var(--teal); color: white; }
.btn-outline-light { background: transparent; color: white; border: 1px solid rgba(255,255,255,0.4); }
.btn-outline-light:hover { background: rgba(255,255,255,0.1); border-color: white; }

/* === HEADER === */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.25rem 0;
  background: rgba(245, 241, 236, 0.95);
  backdrop-filter: blur(10px);
  transition: all 0.4s ease;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.header.is-scrolled { padding: 0.8rem 0; box-shadow: 0 2px 20px rgba(0,0,0,0.06); }
.header-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 2rem;
  display: flex; justify-content: space-between; align-items: center;
}
.logo { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 400; color: var(--text); }
.header .logo { display: inline-flex; align-items: center; gap: 0.55rem; }
.header .logo::before {
  content: '';
  width: 17px; height: 17px; flex-shrink: 0; margin-top: -2px;
  background-color: var(--teal);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.2 12 3l9 7.2'/%3E%3Cpath d='M5.4 8.6V21h13.2V8.6'/%3E%3Cpath d='M9.8 21v-6h4.4v6'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.2 12 3l9 7.2'/%3E%3Cpath d='M5.4 8.6V21h13.2V8.6'/%3E%3Cpath d='M9.8 21v-6h4.4v6'/%3E%3C/svg%3E") no-repeat center / contain;
  transition: background-color 0.3s;
}
.header .logo:hover::before { background-color: var(--teal-dark); }
.nav-links { display: flex; align-items: center; gap: 2.5rem; }
.nav-link {
  font-size: 0.78rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-muted); transition: color 0.3s;
}
.nav-link:hover, .nav-link.is-active { color: var(--text); }
.nav-cta {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; padding: 10px 24px; background: var(--teal); color: white;
}
.nav-cta:hover { background: var(--teal-dark); }

/* === MOBILE BURGER (injected by main.js) === */
.nav-burger {
  display: none;
  width: 40px; height: 40px; padding: 9px 8px;
  flex-direction: column; justify-content: space-between;
  cursor: pointer;
}
.nav-burger span {
  display: block; height: 2px; width: 100%;
  background: var(--text); transition: transform 0.3s ease, opacity 0.3s ease;
}
body.nav-open .nav-burger span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
body.nav-open .nav-burger span:nth-child(2) { opacity: 0; }
body.nav-open .nav-burger span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-burger { display: flex; }
  body.nav-open .nav-links {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--cream);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 16px 30px rgba(0,0,0,0.08);
    padding: 0.5rem 0 1rem;
  }
  body.nav-open .nav-links .nav-link,
  body.nav-open .nav-links .nav-cta {
    display: block; width: 100%;
    padding: 0.9rem 2rem; font-size: 0.85rem;
  }
  body.nav-open .nav-links .nav-cta {
    background: none; color: var(--teal); font-weight: 600;
  }
}

/* === LANGUAGE TOGGLE === */
.header-right { display: flex; align-items: center; gap: 2.2rem; }
.lang-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-muted); transition: color 0.3s;
}
.lang-toggle:hover { color: var(--text); }
.lang-toggle svg { width: 18px; height: 14px; display: block; outline: 0.5px solid rgba(0,0,0,0.12); }

/* === SUBPAGE HERO (bold statement + catchy picture) === */
.page-hero { padding: 180px 0 80px; position: relative; overflow: hidden; }
.page-hero::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 320px;
  background: linear-gradient(180deg, var(--teal-light) 0%, var(--cream) 100%);
  z-index: 0;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 4rem; align-items: center; }
.page-hero .label { display: block; margin-bottom: 1rem; }
.page-hero h1 { margin-bottom: 1.2rem; }
.page-hero-lede { font-size: 1.15rem; max-width: 540px; }
.page-hero-photo img {
  width: 100%; max-width: 420px;
  aspect-ratio: 4/5; object-fit: cover;
  border-radius: 200px 200px 20px 20px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.12);
}

/* === GENERIC SECTIONS === */
.section { padding: var(--section-pad) 0; }
.section-white { background: var(--white); }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-header .label { margin-bottom: 1rem; display: block; }

/* === TEAL SPLIT BLOCK (photo + teal text) === */
.split-block { display: grid; grid-template-columns: 1fr 1.2fr; min-height: 500px; overflow: hidden; }
.split-photo { position: relative; z-index: 2; }
.split-photo img { width: 100%; height: 100%; object-fit: cover; min-height: 500px; }
.split-text {
  background: var(--teal); color: var(--text-on-dark);
  padding: 80px 60px;
  display: flex; flex-direction: column; justify-content: center;
}
.split-text .label { color: rgba(255,255,255,0.5); margin-bottom: 1rem; }
.split-text h2 { color: white; margin-bottom: 1.5rem; }
.split-text p { color: rgba(255,255,255,0.8); margin-bottom: 1rem; max-width: 480px; }
.split-text .btn { margin-top: 1rem; align-self: flex-start; }

/* === CARDS (teal-light, Cristeta-style) === */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.card {
  background: var(--teal-light); padding: 2.5rem 2rem; text-align: center;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
  display: flex; flex-direction: column; align-items: center;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 12px 30px rgba(0,0,0,0.08); }
.card h3 { color: var(--teal-dark); margin-bottom: 0.5rem; }
.card .card-meta { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--teal); margin-bottom: 1rem; }
.card p { font-size: 0.95rem; color: var(--text-light); }
.card .btn { margin-top: auto; }
.card p + .btn { margin-top: 1.5rem; }

/* === SAGE BAND with wavy edges (Kelsey-style) === */
.sage-band { position: relative; background: var(--sage); padding: var(--section-pad) 0; overflow: hidden; }
.sage-band h2 { color: white; }
.wave-top, .wave-bottom { position: absolute; left: 0; right: 0; height: 60px; pointer-events: none; }
.wave-top { top: -1px; }
.wave-bottom { bottom: -1px; transform: rotate(180deg); }
.wave-top svg, .wave-bottom svg { width: 100%; height: 100%; }

/* === QUOTE / TESTIMONIAL === */
.quote-mark {
  font-family: var(--font-heading); font-size: 8rem; line-height: 1;
  color: rgba(255,255,255,0.35); user-select: none;
}
.testimonial-quote {
  font-family: var(--font-heading); font-size: 1.6rem; font-weight: 300;
  font-style: italic; color: white; line-height: 1.4; margin-bottom: 1.5rem;
}
.testimonial-author { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15em; color: rgba(255,255,255,0.7); }

/* === STATS === */
.stats-row { display: flex; justify-content: center; gap: 5rem; flex-wrap: wrap; text-align: center; }
.stat-number { font-family: var(--font-heading); font-size: clamp(2.5rem, 4vw, 3.5rem); font-weight: 300; color: var(--text); line-height: 1; }
.stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-muted); margin-top: 0.5rem; max-width: 220px; margin-left: auto; margin-right: auto; }

/* === CTA SPLIT === */
.cta-section { display: grid; grid-template-columns: 1fr 1fr; min-height: 500px; overflow: hidden; }
.cta-text {
  background: var(--teal); color: white; padding: 80px 60px;
  display: flex; flex-direction: column; justify-content: center;
}
.cta-text h2 { color: white; margin-bottom: 1rem; }
.cta-text p { color: rgba(255,255,255,0.8); margin-bottom: 2rem; max-width: 440px; }
.cta-text .btn { align-self: flex-start; }
.cta-photo img { width: 100%; height: 100%; object-fit: cover; }

/* === FOOTER === */
.footer { background: var(--text); color: rgba(255,255,255,0.5); padding: 4rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer .logo { color: white; margin-bottom: 1rem; display: inline-block; }
.footer h4 { font-family: var(--font-body); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em; color: rgba(255,255,255,0.3); margin-bottom: 1rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-links a { font-size: 0.95rem; color: rgba(255,255,255,0.5); transition: color 0.3s; }
.footer-links a:hover { color: white; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 1.5rem; font-size: 0.8rem; text-align: center; }

/* === PRIVACY NOTICE (discreet, bottom — per Per's design notes) === */
.privacy-notice {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 300;
  width: calc(100% - 32px); max-width: 560px;
  background: var(--text); color: var(--text-on-dark);
  padding: 1.1rem 1.4rem;
  display: flex; align-items: center; gap: 1.4rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  font-size: 0.88rem; line-height: 1.55;
}
.privacy-notice a { color: white; border-bottom: 1px solid rgba(255,255,255,0.4); transition: border-color 0.3s; }
.privacy-notice a:hover { border-color: white; }
.privacy-notice strong { color: white; }
.privacy-notice button {
  flex-shrink: 0; font-family: var(--font-body); font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; padding: 10px 20px;
  background: var(--teal); color: white; transition: background 0.3s; cursor: pointer;
}
.privacy-notice button:hover { background: var(--teal-dark); }
@media (max-width: 600px) {
  .privacy-notice { bottom: 60px; flex-direction: column; align-items: stretch; text-align: center; gap: 0.9rem; }
}

/* === ANIMATIONS (one-time, slow) === */
[data-animate] { opacity: 0; transition: opacity 1s ease, transform 1s ease; }
[data-animate="fade-up"] { transform: translateY(50px); }
[data-animate="fade-right"] { transform: translateX(-50px); }
[data-animate="fade-left"] { transform: translateX(50px); }
[data-animate="scale-in"] { transform: scale(0.9); }
[data-animate].is-visible { opacity: 1; transform: none; }
[data-delay="200"] { transition-delay: 200ms; }
[data-delay="400"] { transition-delay: 400ms; }
[data-delay="600"] { transition-delay: 600ms; }
@keyframes heroFadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heroScaleIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes scrollOrgs { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* === RESPONSIVE (shared) === */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .page-hero { padding: 140px 0 60px; }
  .page-hero-inner { grid-template-columns: 1fr; text-align: center; }
  .page-hero-photo { display: flex; justify-content: center; order: -1; }
  .page-hero-photo img { max-width: 280px; }
  .page-hero-lede { max-width: none; }
  .split-block { grid-template-columns: 1fr; }
  .split-photo img { min-height: 300px; height: 440px; object-position: 50% 18%; }
  .split-text { padding: 50px 30px; }
  .card-grid { grid-template-columns: 1fr; }
  .cta-section { grid-template-columns: 1fr; }
  .cta-photo { height: 300px; }
  .footer-grid { grid-template-columns: 1fr; }
  .stats-row { gap: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  [data-animate] { opacity: 1; transform: none; transition: none; }
  .orgs-track { animation: none !important; }
}
