/* ANOPY HOMEPAGE STYLES */
/* Hero carousel, service overview, impact preview, CTAs */

/* ============================================
   HERO CAROUSEL SECTION
   ============================================ */

.hero {
  position: relative;
  width: 100%;
  background: var(--cream-bg);
  overflow: hidden;
}

/* Sits directly below the sticky header. min-height fills the rest of
   the viewport on a normal screen; the in-flow overlay lets the box
   grow instead of clipping when the copy is taller than the viewport
   (small screens, large text). */
.hero__carousel {
  position: relative;
  width: 100%;
  min-height: 78vh;
  min-height: calc(100vh - var(--site-header-h));
  min-height: calc(100svh - var(--site-header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  /* Extra bottom room keeps the copy clear of the slide dots. */
  padding: var(--space-lg) var(--container-pad) 88px;
}

.hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  /* Fallback wash behind the photo so the overlay copy stays legible
     even while a slide image is still loading or missing. */
  background: linear-gradient(135deg, var(--navy), var(--forest-green));
}

/* Markup ships with .active on the first slide, so with JS off the
   hero reads as a single static image. nav.js cross-fades from there. */
.hero__slide.active {
  opacity: 1;
}

.hero__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Full-bleed scrim so the white copy holds over any photo. */
.hero__carousel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.hero__overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 800px;
}

/* Soft local shadow keeps the copy legible over bright photo areas
   (windows, balloons) without dimming the whole image further. */
.hero__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
  color: var(--text-on-dark);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55), 0 0 2px rgba(0, 0, 0, 0.35);
}

.hero__logo {
  width: min(400px, 87.5vw);
  height: auto;
}

.hero__title-sub {
  display: block;
  font-size: 25px;
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Tight margin keeps this close to the logo below it, so "Welcome to"
   sits higher and leaves more room for the logo + title. Selector is
   scoped under .hero__overlay so it outweighs the generic
   `.hero__overlay p` rule below (same tag+class specificity otherwise).
   Font-family matches .hero__title-sub, as it did when both were one h1. */
.hero__overlay .hero__welcome {
  font-size: 25px;
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--text-on-dark);
  margin-bottom: var(--space-xs);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6), 0 0 2px rgba(0, 0, 0, 0.4);
}

/* Matches the Fraunces font used by "Welcome to" / "Music Therapy" above it.
   Extra margin-top nudges the tagline + CTA row down, away from the
   logo, instead of sitting right up against it. */
.hero__overlay .hero__tagline {
  font-family: var(--font-serif);
  margin-top: var(--space-sm);
}

.hero__overlay p {
  font-size: var(--size-body);
  line-height: 1.5;
  color: var(--text-on-dark);
  max-width: 680px;
  margin-bottom: var(--space-md);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6), 0 0 2px rgba(0, 0, 0, 0.4);
}

.hero__controls {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-sm);
  z-index: 2;
}

/* Minimalist prev/next arrows, mid-aligned on the carousel edges. */
.hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-on-dark);
  opacity: 0.72;
  cursor: pointer;
  transition: opacity var(--dur-hover), transform var(--dur-hover);
}

.hero__arrow svg {
  width: 39px;
  height: 39px;
}

.hero__arrow:hover,
.hero__arrow:focus-visible {
  opacity: 1;
}

.hero__arrow--prev {
  left: var(--space-xs);
}

.hero__arrow--prev:hover { transform: translate(-2px, -50%); }

.hero__arrow--next {
  right: var(--space-xs);
}

.hero__arrow--next:hover { transform: translate(2px, -50%); }

@media (max-width: 640px) {
  .hero__arrow { display: none; }
}

.hero__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 1px solid rgba(241, 242, 236, 0.9);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background var(--dur-hover), transform var(--dur-hover);
}

.hero__dot.is-current {
  background: var(--text-on-dark);
  transform: scale(1.15);
}

.hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

/* Slimmer buttons so both CTAs sit on one row and the frame stays short.
   Padding and font-size cut a further 15% from that. */
.hero__overlay .btn--large {
  padding: 13.6px 27.2px;
  font-size: 17px;
}

/* On the dark hero overlay the outline button needs a light border. */
.hero__overlay .btn--secondary {
  color: var(--text-on-dark);
  border-color: var(--text-on-dark);
}

.hero__overlay .btn--secondary:hover {
  background: var(--text-on-dark);
  color: var(--navy);
}

/* Mobile hero reads as too dominant at full scale — too much of the
   screen, too "in your face". Scale the whole section down together:
   its height, the logo, both title lines, the tagline, and both CTAs
   all come down ~30% from their (already mobile-tuned, where one
   exists) size so the hero reads as an intro, not a takeover. */
@media (max-width: 768px) {
  .hero__carousel {
    min-height: 54.6vh;
    min-height: calc((100vh - var(--site-header-h)) * 0.7);
    min-height: calc((100svh - var(--site-header-h)) * 0.7);
    padding: calc(var(--space-lg) * 0.7) var(--container-pad) 62px;
  }

  .hero__title {
    gap: calc(var(--space-xs) * 0.7);
    margin-bottom: calc(var(--space-sm) * 0.7);
  }

  .hero__logo {
    width: min(280px, 61.3vw);
  }

  .hero__overlay .hero__welcome,
  .hero__title-sub {
    font-size: 17.5px;
  }

  .hero__overlay p {
    font-size: 14px;
    margin-bottom: calc(var(--space-md) * 0.7);
  }

  .hero__cta-row {
    gap: calc(var(--space-sm) * 0.7);
  }

  /* CTAs cut a further 20% on top of the 30% above (~44% total off
     their desktop size), smaller than the rest of the hero scale. */
  .hero__overlay .btn--large {
    padding: 8.96px 17.92px;
    font-size: 11.2px;
  }
}

/* ============================================
   AT A GLANCE SECTION
   Founding belief + mission, then three parallel ideas
   (Expression / Connection / Memory) that follow from it.
   ============================================ */

.homepage__glance {
  padding: var(--space-lg) var(--container-pad);
  background: var(--cream-bg);
  max-width: 1080px;
  margin: 0 auto;
  text-align: center;
}

.homepage__glance h2 {
  font-size: var(--size-body);
  color: var(--navy);
  margin-bottom: var(--space-md);
  font-family: var(--font-serif);
}

.glance__quote {
  font-size: var(--size-quote);
  font-style: italic;
  font-family: var(--font-serif);
  color: var(--navy);
  max-width: 640px;
  margin: 0 auto var(--space-lg);
}

.glance__intro {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

/* CBMT credential mark — sits in the same row as the portrait bubble,
   vertically centered against it (align-items:center on the parent),
   flanking the lede line on the opposite side. Matches .glance__headshot's
   size so the row reads as two balanced badges either side of the text. */
.glance__badge {
  flex-shrink: 0;
  width: 112px;
  height: 112px;
  object-fit: contain;
  display: block;
}

.glance__lede {
  font-size: var(--size-body-sm);
  font-style: italic;
  font-family: var(--font-serif);
  color: var(--text-muted);
  text-align: center;
}

.glance__headshot {
  flex-shrink: 0;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  overflow: hidden;
}

.glance__headshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.homepage__glance-mission {
  max-width: 760px;
  margin: 0 auto var(--space-sm);
}

/* Desktop line breaks follow the meaning (belief / sentence / clause);
   on narrower screens they're ignored and text balances naturally. */
.br-lg { display: none; }
@media (min-width: 769px) {
  .br-lg { display: inline; }
}

.homepage__glance-mission p {
  font-size: var(--size-read-lg);
  line-height: 1.8;
  color: var(--text-dark);
  /* Even out line lengths so breaks don't strand short fragments. */
  text-wrap: balance;
}

.homepage__glance-mission p + p {
  margin-top: var(--space-sm);
}

/* Lead-in line to the tile grid below reads as its own beat: more
   room above (separating it from the mission statement), less below
   (it introduces the tiles directly). */
.homepage__glance-mission p:last-child {
  margin-top: var(--space-lg);
}

/* First paragraph is the belief; set it as the lead statement. */
.homepage__glance-mission p:first-child {
  max-width: 700px;
  margin-inline: auto;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--size-body-sm);
  line-height: 1.6;
}

.glance__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.glance__tile {
  padding: var(--space-md) var(--space-md) calc(var(--space-md) + 4px);
  background: var(--warm-beige);
  border-top: 3px solid var(--terracotta);
  border-radius: 6px;
  transition: transform var(--dur-hover) var(--ease-slow),
              box-shadow var(--dur-hover) var(--ease-slow);
}

.glance__tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.glance__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-sm);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--terracotta) 22%, transparent);
  color: var(--navy);
}

.glance__icon svg {
  width: 28px;
  height: 28px;
}

.glance__title {
  font-family: var(--font-serif);
  font-size: var(--size-body-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--navy);
  margin-bottom: var(--space-xs);
  line-height: 1.25;
}

.glance__tagline {
  font-size: var(--size-read-lg);
  font-weight: 600;
  color: var(--forest-green-ink);
  line-height: 1.4;
  margin-bottom: var(--space-xs);
}

.glance__label {
  font-size: var(--size-read);
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================
   WHY CHOOSE ANOPY SECTION
   ============================================ */

/* Same navy used at the top of the page (site-header__utility, the
   hero's text-on-dark copy) — carries that "blue" band back in
   partway down the page. */
.homepage__why {
  padding: var(--space-lg) var(--container-pad);
  background: var(--navy);
  max-width: 1080px;
  margin: 0 auto;
  text-align: center;
}

.homepage__why h2 {
  font-size: var(--size-body);
  color: var(--text-on-dark);
  text-align: center;
  margin-bottom: var(--space-md);
  font-family: var(--font-serif);
}

.why__intro {
  max-width: 700px;
  margin: 0 auto var(--space-md);
}

.why__intro p {
  font-size: var(--size-read-lg);
  line-height: 1.8;
  color: var(--text-on-dark);
  text-wrap: balance;
}

.why__intro p + p {
  margin-top: var(--space-sm);
}

.why__intro p:first-child {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--size-body-sm);
  line-height: 1.6;
}

.why__portraits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-md);
}

/* Closing line — bookends .why__intro's opening line with the same
   quiet, reflective treatment. */
.why__closing {
  max-width: 560px;
  margin: var(--space-md) auto 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--size-body-sm);
  line-height: 1.6;
  color: var(--text-on-dark);
}

.portrait-placeholder {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 4px;
  background: var(--cream-bg);
}

.portrait-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Below 768px the grid becomes a swipeable, snap-to-card carousel
   instead of stacking the three photos full-width. */
@media (max-width: 768px) {
  .why__portraits {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: calc(-1 * var(--container-pad));
    margin-right: calc(-1 * var(--container-pad));
    padding: 0 var(--container-pad);
  }

  .why__portraits::-webkit-scrollbar {
    display: none;
  }

  .portrait-placeholder {
    flex: 0 0 78%;
    scroll-snap-align: center;
  }
}

/* ============================================
   HOW TO START SECTION
   ============================================ */

.homepage__how-to-start {
  padding: var(--space-md) var(--container-pad);
  background: var(--warm-beige);
  max-width: 1080px;
  margin: 0 auto;
}

.homepage__how-to-start h2 {
  font-size: var(--size-body);
  color: var(--navy);
  text-align: center;
  margin-bottom: var(--space-sm);
  font-family: var(--font-serif);
}

.how-to__steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
}

.step__item {
  text-align: center;
  padding: var(--space-sm);
}

.step__item h3 {
  font-size: var(--size-body-sm);
  color: var(--forest-green-ink);
  margin-bottom: var(--space-sm);
  font-family: var(--font-serif);
}

.step__item p {
  font-size: var(--size-read);
  color: var(--text-dark);
  line-height: 1.6;
}

/* ============================================
   MID-PAGE PHOTO CTA
   Photo banner, contained within the page's normal column,
   with the "Ready to begin?" message on a readable dark panel.
   ============================================ */

.homepage__photo-cta {
  padding: var(--space-lg) 0;
  max-width: 1080px;
  margin: 0 auto;
}

.photo-cta__frame {
  position: relative;
  width: 100%;
  min-height: clamp(320px, 38vw, 460px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--navy);
}

.photo-cta__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-cta__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}

.photo-cta__overlay {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: var(--space-md);
  padding: var(--space-lg);
  text-align: center;
  background: rgba(20, 26, 23, 0.15);
  border-radius: 8px;
}

.photo-cta__overlay h2 {
  font-size: var(--size-body);
  color: var(--text-on-dark);
  margin-bottom: var(--space-sm);
  font-family: var(--font-serif);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.6), 0 0 2px rgba(0, 0, 0, 0.4);
}

.photo-cta__overlay p {
  font-size: var(--size-read-lg);
  color: var(--text-on-dark);
  margin-bottom: var(--space-lg);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.65), 0 0 2px rgba(0, 0, 0, 0.45);
}

.photo-cta__overlay .btn {
  white-space: nowrap;
}

.photo-cta__overlay .btn--large {
  padding: 16px 32px;
  font-size: var(--size-read);
}

/* Base .btn / .btn--primary / .btn--secondary / .btn--large now live
   in reset.css (shared across every page). The hero and photo-cta
   overrides above/below are homepage-specific and stay here. */

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .homepage__glance,
  .homepage__why,
  .homepage__how-to-start {
    padding: var(--space-md) var(--container-pad);
  }

  .glance__intro {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .glance__badge {
    width: 88px;
    height: 88px;
  }

  .glance__headshot {
    width: 88px;
    height: 88px;
  }

  .homepage__photo-cta {
    padding: var(--space-md) 0;
  }

  .photo-cta__overlay {
    margin: var(--space-xs);
    padding: var(--space-sm);
  }

  .photo-cta__overlay .btn--large {
    padding: 14px 20px;
    font-size: 15px;
  }

  .glance__tile {
    padding: var(--space-md);
  }

  .glance__grid,
  .how-to__steps {
    grid-template-columns: 1fr;
  }

  /* Stacked to one column here, so the grid gap becomes vertical
     space between steps — keep it tight to match the compact pass
     above instead of inheriting the desktop (multi-column) gap. */
  .how-to__steps {
    gap: var(--space-xs);
  }
}
