/* ==========================================================================
   1. VARIABLES & COLOR PALETTE
   ========================================================================== */
:root {
  --paper: #FFFFFF;
  --paper-alt: #F9F9F9;
  --ink: #111111;
  --ink-soft: #444444;
  --brand: #FFD600; /* Primary Yellow */
  --brand-dark: #E6C200; /* Slightly darker yellow for hover states */
  --line: #E5E5E5;
  --white: #FFFFFF;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121212; --paper-alt: #1E1E1E; --ink: #F5F5F5; --ink-soft: #B0B0B0;
    --brand: #FFD600; --brand-dark: #E6C200; --line: #333333; --white: #121212;
  }
}

/* ==========================================================================
   2. GLOBAL RESET & TYPOGRAPHY
   ========================================================================== */
html { 
  scroll-padding-top: 110px; /* Accounts for taller sticky header when linking to page sections */
  -webkit-text-size-adjust: 100%; 
}
* { box-sizing: border-box; }

body {
  margin: 0; 
  background: var(--paper); 
  color: var(--ink);
  font-family: 'Karla', 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px; 
  line-height: 1.6; 
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Source Serif 4', Georgia, serif; 
  font-weight: 500;
  line-height: 1.15; 
  margin: 0; 
  color: var(--ink); 
  letter-spacing: -0.01em;
}

em { 
  font-style: italic; 
  font-family: 'Source Serif 4', serif; 
}

a { color: inherit; }
img, svg { max-width: 100%; }

.wrap { 
  max-width: 1120px; 
  margin: 0 auto; 
  padding: 0 28px; 
}
.prose { max-width: 62ch; }

/* ==========================================================================
   3. DESKTOP HEADER (PERFECT 3-POINT GRID LAYOUT)
   ========================================================================== */
header.site {
  position: sticky; 
  top: 0; 
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 95%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.navrow {
  max-width: 1320px; 
  margin: 0 auto; 
  padding: 16px 32px; 
  display: grid; 
  grid-template-columns: 1fr auto 1fr; /* 3 zones: Left, Center, Right */
  align-items: center; 
  gap: 20px;
}

/* Zone 1: Logo Anchor (Left) */
.brand { 
  justify-self: start; /* Locks to the far left */
  display: flex; 
  align-items: center; 
  text-decoration: none; 
}

.brand-logo {
  height: 95px !important; 
  max-height: 95px !important;
  width: auto !important;
  object-fit: contain;
  display: block;
}

/* Zone 2: Navigation Links (Center) */
nav.links { 
  justify-self: center; /* Locks dead-center in the screen */
  display: flex; 
  gap: 44px; 
  align-items: center; 
}

nav.links a {
  text-decoration: none; 
  font-size: 1.05rem; 
  color: var(--ink-soft);
  border-bottom: 3px solid transparent; 
  padding-bottom: 4px;
  transition: color .15s, border-color .15s;
  font-weight: 500;
}

nav.links a:hover, nav.links a:focus-visible { 
  color: var(--ink); 
  border-color: var(--brand); 
}

nav.links a.active { 
  color: var(--ink); 
  border-color: var(--brand); 
  font-weight: 700; 
}

/* Zone 3: CTA Button (Right) */
.navrow > .btn {
  justify-self: end; /* Locks to the far right */
}

/* ==========================================================================
   4. BUTTON STYLES
   ========================================================================== */
.btn {
  display: inline-block; 
  font-family: 'Karla', sans-serif; 
  font-weight: 700; 
  font-size: 1rem;
  padding: 12px 26px; 
  border-radius: 4px; 
  background: var(--brand); 
  color: #111;
  text-decoration: none; 
  border: 1px solid var(--brand); 
  white-space: nowrap;
  transition: background .15s, transform .1s;
}

.btn:hover, .btn:focus-visible { 
  background: var(--brand-dark); 
  transform: translateY(-1px); 
}

.btn.ghost { 
  background: transparent; 
  color: var(--ink); 
  border-color: var(--line); 
}

.btn.ghost:hover { 
  border-color: var(--brand); 
  background: var(--brand); 
  color: #111; 
}

/* ==========================================================================
   5. HOME PAGE & HERO SECTIONS
   ========================================================================== */
.pagehero { 
  padding: 60px 0 50px; 
  border-bottom: 1px solid var(--line); 
}
.pagehero .kicker { 
  font-family: 'Source Serif 4', serif; 
  font-style: italic; 
  color: var(--ink-soft); 
  font-size: 1.05rem; 
  margin-bottom: 12px; 
}
.pagehero h1 { 
  font-size: clamp(2rem, 4vw, 2.9rem); 
  max-width: 22ch; 
}
.pagehero p { 
  margin-top: 18px; 
  color: var(--ink-soft); 
  max-width: 56ch; 
  font-size: 1.1rem; 
}

.hero { 
  padding: 74px 0 66px; 
  display: grid; 
  grid-template-columns: 1.1fr 0.9fr; 
  gap: 56px; 
  align-items: center; 
}
.hero .eyebrow { 
  font-size: 0.95rem; 
  color: var(--ink-soft); 
  margin-bottom: 18px; 
  font-family: 'Source Serif 4', serif; 
  font-style: italic; 
  font-weight: 600; 
}
.hero h1 { 
  font-size: clamp(2.3rem, 4.4vw, 3.4rem); 
  color: var(--ink); 
}
.hero p.lede { 
  margin-top: 22px; 
  font-size: 1.15rem; 
  color: var(--ink-soft); 
  max-width: 46ch; 
}
.hero .ctas { 
  margin-top: 32px; 
  display: flex; 
  gap: 16px; 
  flex-wrap: wrap; 
}
.hero-art svg { 
  width: 100%; 
  height: auto; 
  display: block; 
}

/* ==========================================================================
   6. INNER PAGE STRUCTURES (Programs, About, Services)
   ========================================================================== */
section { 
  padding: 78px 0; 
  border-top: 1px solid var(--line); 
}
section:first-of-type { border-top: none; }

.kicker { 
  font-family: 'Source Serif 4', serif; 
  font-style: italic; 
  color: var(--ink-soft); 
  font-size: 1.05rem; 
  margin-bottom: 10px; 
}
.section-head h2 { 
  font-size: clamp(1.7rem, 3vw, 2.3rem); 
  max-width: 20ch; 
  color: var(--ink); 
}
.section-head p { 
  color: var(--ink-soft); 
  margin-top: 16px; 
  max-width: 58ch; 
  font-size: 1.05rem; 
}

/* Home Pillars */
.pillars-path { margin-top: 56px; position: relative; }
.pillars-path svg.thread { position: absolute; top: 26px; left: 0; width: 100%; height: 3px; z-index: 0; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; position: relative; z-index: 1; }
.pillar .node { width: 14px; height: 14px; border-radius: 50%; background: var(--brand); border: 3px solid var(--paper); outline: 1px solid var(--line); margin-bottom: 22px; }
.pillar h3 { font-size: 1.3rem; margin-bottom: 12px; color: var(--ink); }
.pillar p { color: var(--ink-soft); font-size: 0.98rem; }

/* Services List (Programs Page) */
.services-list { margin-top: 50px; }
.service-row { display: grid; grid-template-columns: 240px 1fr; gap: 40px; padding: 36px 0; border-top: 1px solid var(--line); }
.service-row:last-child { border-bottom: 1px solid var(--line); }
.service-row h3 { font-size: 1.4rem; color: var(--ink); }
.service-row .tag { font-size: 0.85rem; color: var(--ink-soft); font-family: 'Source Serif 4', serif; font-style: italic; margin-top: 6px; display: block; }
.service-row p { color: var(--ink-soft); margin-top: 10px; max-width: 62ch; }
.service-row ul { margin: 16px 0 0; padding-left: 20px; color: var(--ink-soft); }
.service-row li { margin-bottom: 6px; }
.service-row .modes { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.pill { font-size: 0.82rem; border: 1px solid var(--line); border-radius: 20px; padding: 5px 14px; color: var(--ink-soft); background: var(--paper-alt); }

/* Mini Cards */
.cardgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; margin-top: 44px; }
.mini-card { background: var(--white); border: 1px solid var(--line); border-radius: 4px; padding: 28px 30px; }
.mini-card h3 { font-size: 1.15rem; margin-bottom: 10px; color: var(--ink); }
.mini-card p { color: var(--ink-soft); font-size: 0.97rem; margin: 0; }
.mini-card a.more { display: inline-block; margin-top: 14px; font-size: 0.92rem; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--brand); font-weight: 700; }

/* Delivery/Format Cards */
.delivery { background: var(--paper-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.delivery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; margin-top: 44px; }
.delivery-card { background: var(--white); border: 1px solid var(--line); padding: 30px 32px; border-radius: 4px; }
.delivery-card h3 { font-size: 1.2rem; margin-bottom: 10px; color: var(--ink); }
.delivery-card p { color: var(--ink-soft); font-size: 0.98rem; }

/* About & Team */
.about-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 60px; align-items: start; }
.about-grid .prose h3 { font-size: 1.2rem; margin: 30px 0 10px; color: var(--ink); }
.about-grid .prose h3:first-child { margin-top: 0; }
.about-grid .prose p { color: var(--ink-soft); margin: 0 0 12px; }
.pull { font-family: 'Source Serif 4', serif; font-style: italic; font-size: 1.6rem; line-height: 1.35; color: var(--ink); border-left: 4px solid var(--brand); padding-left: 26px; }

.team-grid { display: grid; grid-template-columns: 1fr; max-width: 680px; margin: 48px auto 0; }
.team-card { background: var(--white); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; padding: 36px 40px; }
.team-body h3 { font-size: 1.4rem; color: var(--ink); }
.team-role { font-size: 0.95rem; color: var(--ink-soft); font-family: 'Source Serif 4', serif; font-style: italic; margin-top: 4px; font-weight: 600; }
.team-body p { color: var(--ink-soft); font-size: 1rem; margin-top: 16px; line-height: 1.65; }

/* Parent Support List */
.parent-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.parent-list { list-style: none; margin: 30px 0 0; padding: 0; }
.parent-list li { padding: 16px 0; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 1rem; }
.parent-list li:last-child { border-bottom: 1px solid var(--line); }
.parent-list strong { color: var(--ink); font-weight: 600; }

/* ==========================================================================
   7. CONTACT FORMS & FOOTER
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
form { display: flex; flex-direction: column; gap: 18px; margin-top: 40px; }
.field { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 0.9rem; color: var(--ink-soft); font-weight: 500; }
input, select, textarea {
  font-family: 'Karla', sans-serif; font-size: 1rem; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 3px; background: var(--white); color: var(--ink);
}
input:focus, select:focus, textarea:focus, a:focus-visible, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
textarea { min-height: 110px; resize: vertical; }
.radio-row { display: flex; gap: 22px; flex-wrap: wrap; }
.radio-row label { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 0.98rem; }
.radio-row input { width: auto; padding: 0; }
.submit-btn {
  align-self: flex-start; margin-top: 6px; font-family: 'Karla', sans-serif; font-weight: 700; font-size: 1rem;
  padding: 13px 26px; border-radius: 3px; background: var(--brand); color: #111;
  border: 1px solid var(--brand); cursor: pointer; transition: background .15s, transform .1s;
}
.submit-btn:hover { background: var(--brand-dark); transform: translateY(-1px); }
.form-note { font-size: 0.88rem; color: var(--ink-soft); margin-top: 14px; }
.contact-info { padding-top: 10px; }
.contact-info dl { margin-top: 28px; }
.contact-info dt { font-size: 0.85rem; color: var(--ink-soft); margin-top: 18px; text-transform: uppercase; letter-spacing: 0.05em; }
.contact-info dd { margin: 4px 0 0; font-size: 1.05rem; color: var(--ink); font-weight: 500; }

footer { 
  border-top: 1px solid var(--line); 
  padding: 40px 0; 
  color: var(--ink-soft); 
  font-size: 0.9rem; 
  display: flex; 
  justify-content: space-between; 
  flex-wrap: wrap; 
  gap: 12px; 
}
footer .wrap { 
  display: flex; 
  justify-content: space-between; 
  flex-wrap: wrap; 
  gap: 12px; 
  width: 100%; 
}

/* ==========================================================================
   8. MOBILE RESPONSIVE LAYOUT (UI/UX Optimized)
   ========================================================================== */
@media (max-width: 980px) {
  /* Switches Header back from Grid to Flex for vertical stacking */
  .navrow { 
    display: flex;
    flex-direction: column; 
    padding: 24px 16px;
    gap: 20px; 
  }
  
  .brand {
    justify-content: center;
    width: 100%;
    margin: 0;
  }

  .brand-logo {
    height: 110px !important; 
    max-height: 110px !important;
    margin: 0 auto; 
  }

  /* Touches targets enlarged for thumbs */
  nav.links { 
    justify-content: center;
    gap: 16px 20px; 
    flex-wrap: wrap;
    text-align: center;
    width: 100%;
  }
  
  nav.links a {
    padding: 8px 12px; 
    font-size: 1.1rem; 
  }
  
  /* Full-width gradient buttons for Mobile CTA */
  .navrow > .btn, .hero .ctas .btn {
    width: 100%; 
    text-align: center;
    padding: 16px 24px; 
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); 
  }

  /* Stacked Page Sections */
  .hero { 
    grid-template-columns: 1fr; 
    padding: 40px 20px 50px; 
    text-align: center; 
    background: linear-gradient(180deg, var(--paper-alt) 0%, var(--paper) 100%); 
  }
  .hero h1 { line-height: 1.25; margin-bottom: 16px; }
  .hero p.lede { font-size: 1.15rem; margin: 0 auto 32px; }
  .hero .ctas { justify-content: center; flex-direction: column; width: 100%; gap: 16px; }
  .hero-art { order: -1; max-width: 240px; margin: 0 auto 32px; }

  /* Optimized Breathing Room */
  .pillars { grid-template-columns: 1fr; gap: 48px; } 
  .pillars-path svg.thread { display: none; }
  .service-row { grid-template-columns: 1fr; gap: 16px; padding: 24px 0; }
  .delivery-grid { grid-template-columns: 1fr; gap: 24px; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .parent-wrap { grid-template-columns: 1fr; gap: 36px; }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .cardgrid { grid-template-columns: 1fr; gap: 20px; }
  .mini-card { padding: 24px 20px; } 
  .team-card { padding: 28px 24px; }
}

/* ==========================================================================
   9. HOME HERO CAROUSEL, FLOATING ELEMENTS & THEMED BACKDROP PHOTO
   ========================================================================== */

/* The palette only defined yellow (--brand). Adding an orange accent so the
   hero backdrop reads as "yellow → orange", matching the logo's sunburst. */
:root {
  --accent-orange: #F2871F;
  --accent-orange-dark: #D9720E;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --accent-orange: #FFA352; --accent-orange-dark: #E88A3C; }
}
:root[data-theme="dark"] { --accent-orange: #FFA352; --accent-orange-dark: #E88A3C; }

.hero-carousel {
  position: relative;
  overflow: hidden;
  padding: 64px 0 60px;
  background: linear-gradient(180deg, var(--paper-alt) 0%, var(--paper) 100%);
  isolation: isolate; /* keeps the duotone blend contained to this section */
}

/* Static, centered, theme-toned backdrop photo — does NOT animate */
.hero-bg-photo {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, 60vw);
  aspect-ratio: 1 / 1.15;
  z-index: 0;
  opacity: 0.92;
  -webkit-mask-image: radial-gradient(ellipse closest-side, black 45%, transparent 100%);
  mask-image: radial-gradient(ellipse closest-side, black 45%, transparent 100%);
  pointer-events: none;
}
.hero-bg-photo img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  filter: grayscale(1) contrast(1.05) brightness(1.18);
}
.hero-bg-photo::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(145deg, var(--brand) 0%, var(--accent-orange) 100%);
  mix-blend-mode: color; /* tints the grayscale photo yellow -> orange */
}

/* Floating decorative elements — big, bobbing forever, purely decorative */
.float-item {
  position: absolute;
  z-index: 1;
  animation: heroBob 6s ease-in-out infinite;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.12));
  pointer-events: none;
  line-height: 1;
}
.float-item.slow { animation-duration: 8.5s; }
.float-item.rev { animation-direction: alternate-reverse; }
@keyframes heroBob {
  0%   { transform: translateY(0) rotate(-5deg); }
  50%  { transform: translateY(-22px) rotate(5deg); }
  100% { transform: translateY(0) rotate(-5deg); }
}
.hero-carousel .f1 { top: 6%;  left: 5%;  font-size: 3.4rem; }
.hero-carousel .f2 { top: 8%;  right: 6%; font-size: 2.9rem; }
.hero-carousel .f3 { bottom: 10%; left: 7%; font-size: 3.1rem; }
.hero-carousel .f4 { bottom: 8%;  right: 5%; font-size: 3.4rem; }
.hero-carousel .f5 { top: 42%; left: 2%;  font-size: 2.6rem; }
.hero-carousel .f6 { top: 44%; right: 2%; font-size: 2.6rem; }

@media (prefers-reduced-motion: reduce) {
  .float-item { animation: none; }
}

/* Auto-rotating slide carousel */
.hero-carousel-inner { position: relative; z-index: 2; }
.stage {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  min-height: 410px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--white) 92%, transparent);
  backdrop-filter: blur(6px);
  box-shadow: 0 24px 60px -24px rgba(0,0,0,.18);
  overflow: hidden;
  border: 1px solid var(--line);
}
.hslide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 44px 60px 64px; gap: 14px;
  transition: transform .6s cubic-bezier(.22,.8,.25,1);
  will-change: transform;
}
.hslide .eyebrow { font-size: .95rem; color: var(--ink-soft); font-family: 'Source Serif 4', serif; font-style: italic; font-weight: 600; margin-bottom: 4px; }
.hslide h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); max-width: 26ch; }
.hslide p { margin: 0; color: var(--ink-soft); max-width: 46ch; font-size: 1.05rem; }
.hslide .ctas { margin-top: 10px; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hslide .tag-icon { font-size: 2.5rem; margin-bottom: 2px; }

.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--white); color: var(--ink); font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px -8px rgba(0,0,0,.25);
  transition: background .15s, transform .15s;
}
.hero-arrow:hover { background: var(--brand); transform: translateY(-50%) scale(1.06); }
.hero-arrow.left { left: 16px; }
.hero-arrow.right { right: 16px; }

.hero-dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 5; }
.hero-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); border: none; padding: 0; cursor: pointer; transition: background .15s, transform .15s; }
.hero-dot.active { background: var(--accent-orange); transform: scale(1.25); }

.hero-progress { position: absolute; top: 0; left: 0; height: 3px; background: var(--accent-orange); width: 0%; z-index: 6; }
.hero-progress.animate { transition: width linear; }

@media (max-width: 720px) {
  .hero-carousel { padding: 44px 0 46px; }
  .stage { min-height: 500px; margin: 0 16px; }
  .hslide { padding: 36px 24px 68px; }
  .hero-arrow { top: auto; bottom: 10px; transform: none; width: 38px; height: 38px; font-size: 1rem; }
  .hero-arrow:hover { transform: scale(1.06); }
  .hero-arrow.left { left: 12px; }
  .hero-arrow.right { right: 12px; }
  .hero-bg-photo { width: 70vw; }
  .float-item { font-size: 2.2rem !important; }
}
