/* ===========================================================================
   home.css — homepage layout sections introduced in the merged "Why Coastal
   Photo" + index redesign.

   Loaded after style.css, so it relies on the global design tokens defined in
   style.css :root (--evergreen, --white, --charcoal, --muted, --card-border,
   --color-gold, --slate-light, --cedar, --font-heading/display/body, --s-*,
   --radius-*, --shadow-*, --ease, --container-padding, --max-width,
   --section-spacing, --nav-height, --evergreen-mid/-04/-06).

   Sections:
     1. Split hero (text card left, photo right)
     2. Platform logo band + served areas
     3. Three services (open-image style)
     4. Testimonials band + auto-scrolling rail
     5. Pricing cards (ported from rates.css, margin reset for the homepage)
     6. Gallery collage (one large image + 2x2 grid, then a caption link)
     7. "What's next" trio
=========================================================================== */

/* ---------------------------------------------------------------------------
   1. SPLIT HERO
   A photo fills the stage; a white card floats over its left edge on desktop
   and stacks beneath it on smaller screens.
--------------------------------------------------------------------------- */
.home-hero {
  background: var(--slate-light);
  padding: calc(var(--nav-height) + clamp(var(--s-6), 4vw, var(--s-10))) 0 clamp(var(--s-10), 5vw, var(--s-16));
}
.home-hero__stage {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}
.home-hero__media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 20px;
  display: block;
  box-shadow: 0 24px 60px rgba(16, 38, 50, 0.18);
}
.home-hero__card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(16, 38, 50, 0.16);
  padding: clamp(1.6rem, 3.2vw, 2.75rem);
}
.home-hero__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 3rem);
  line-height: 1.06;
  letter-spacing: 0;
  color: var(--evergreen);
  margin: 0 0 0.85rem;
}
.home-hero__sub {
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.0625rem);
  line-height: 1.6;
  margin: 0 0 1.5rem;
  max-width: 42ch;
}
.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0;
}
@media (min-width: 901px) {
  .home-hero__media img {
    aspect-ratio: 2 / 1;
    min-height: 540px;
  }
  /* Float the card over the photo, fully inside it (vertically centered, with
     a comfortable inset from the left edge). The taller image above keeps the
     card from ever spilling past the photo or up under the fixed nav. */
  .home-hero__card {
    position: absolute;
    top: 50%;
    left: calc(var(--container-padding) + clamp(1.25rem, 3vw, 3rem));
    transform: translateY(-50%);
    width: min(420px, 42%);
    z-index: 2;
  }
}
@media (max-width: 900px) {
  .home-hero__card {
    position: relative;
    z-index: 2;
    margin: -2.75rem var(--s-2) 0;
  }
}
/* Phones: give the hero photo real presence, closer to the immersive desktop
   hero, instead of a short banner strip. A square crop keeps the primary CTA
   above the fold while the photo fills the screen. Scoped to phone widths so
   tablets (641-900px) keep the wider strip instead of an oversized square. */
@media (max-width: 640px) {
  .home-hero__media img {
    aspect-ratio: 1 / 1;
  }
}

/* ---------------------------------------------------------------------------
   2. PLATFORM LOGO BAND + SERVED AREAS
   Dark band so the white-knockout platform logos read clearly.
--------------------------------------------------------------------------- */
.home-logos {
  background: linear-gradient(165deg, #0e2531, #0a1c26);
  color: var(--white);
  padding: clamp(var(--s-8), 4vw, var(--s-12)) 0;
}
.home-logos__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}
.home-logos__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(1.75rem, 5vw, 3.5rem);
}
.home-logos__row img {
  height: 28px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
  filter: brightness(0) invert(1);
  opacity: 0.72;
  transition: opacity var(--ease), transform var(--ease);
}
.home-logos__row a:hover img,
.home-logos__row a:focus-visible img {
  opacity: 1;
  transform: translateY(-2px);
}
.home-logos__areas {
  margin: clamp(1.85rem, 4vw, 2.6rem) 0 0;
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center;
}
.home-logos__areas-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 0.9rem;
}
.home-logos__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.home-logos__chips a {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--ease), border-color var(--ease);
}
.home-logos__chips a:hover,
.home-logos__chips a:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* ---------------------------------------------------------------------------
   3. THREE SERVICES — open-image style
--------------------------------------------------------------------------- */
.home-svc {
  background: var(--slate-light);
  padding: var(--section-spacing) 0;
}
.home-svc__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}
.home-svc__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3.5vw, 2.75rem);
  margin-top: clamp(var(--s-8), 4vw, var(--s-12));
}
.home-svc__item {
  text-align: center;
}
.home-svc__media {
  display: block;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 1.25rem;
  box-shadow: 0 16px 34px rgba(16, 38, 50, 0.12);
}
.home-svc__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.home-svc__item:hover .home-svc__media img {
  transform: scale(1.05);
}
.home-svc__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  line-height: 1.15;
  color: var(--evergreen);
  margin: 0 0 var(--s-2);
}
.home-svc__desc {
  color: var(--muted);
  font-size: 0.975rem;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 34ch;
}
.home-svc__actions {
  display: flex;
  justify-content: center;
  margin-top: clamp(var(--s-8), 4vw, var(--s-12));
}

/* ---------------------------------------------------------------------------
   4. TESTIMONIALS BAND + AUTO-SCROLLING RAIL
   Rail markup/animation ported from portfolio.html so the loop is seamless
   (a second aria-hidden set of cards is duplicated in the markup).
--------------------------------------------------------------------------- */
.home-testi {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 88% 0%, rgba(201, 166, 107, 0.2), rgba(201, 166, 107, 0) 55%),
    linear-gradient(165deg, #143240, var(--evergreen) 55%, #0a1c26);
  color: var(--white);
  padding: var(--section-spacing) 0;
}
.home-testi__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.home-testi__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: 0;
  color: var(--white);
  margin: 0 0 var(--s-3);
}
.home-testi__sub {
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1rem, 1.4vw, 1.0625rem);
  line-height: 1.6;
  max-width: 46ch;
  margin: 0 0 1.75rem;
}
.home-testi__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.home-testi__actions .btn--outline {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}
.home-testi__actions .btn--outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--white);
  color: var(--white);
}

/* Right column: testimonials auto-scrolling up */
.port-hero__rail {
  position: relative;
  height: clamp(360px, 50vh, 500px);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 11%, #000 89%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 11%, #000 89%, transparent);
}
.port-hero__track {
  display: flex;
  flex-direction: column;
  animation: portHeroScroll 36s linear infinite;
}
.port-hero__rail:hover .port-hero__track,
.port-hero__rail:focus-within .port-hero__track {
  animation-play-state: paused;
}
@keyframes portHeroScroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
.port-hero__card {
  margin-bottom: 1rem;
  padding: 1.4rem 1.5rem;
  background: var(--white);
  color: var(--charcoal);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(7, 18, 25, 0.35);
}
.port-hero__card p {
  margin: 0 0 1rem;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.0625rem;
  line-height: 1.4;
  color: var(--charcoal);
}
.port-quote__by {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.port-quote__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--evergreen);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.port-quote__avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--cedar);
}
.port-quote__meta {
  text-align: left;
  line-height: 1.3;
}
.port-quote__name {
  display: block;
  color: var(--charcoal);
  font-size: 0.9375rem;
  font-weight: 700;
}
.port-quote__role {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
}

/* ---------------------------------------------------------------------------
   5. PRICING CARDS — ported from css/rates.css (section 2), with the hero
   pull-up margin reset since there is no rates hero above them here.
--------------------------------------------------------------------------- */
.home-pricing {
  background: var(--white);
  padding: var(--section-spacing) 0 0;
}
.rt-cards {
  --rt-card-radius: 10px;
  background: var(--white);
  padding: clamp(var(--s-6), 3vw, var(--s-10)) var(--container-padding) var(--section-spacing);
}
.rt-cards__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
  align-items: stretch;
  max-width: var(--max-width);
  margin: 0 auto;
}
.rt-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: var(--rt-card-radius);
  box-shadow: var(--shadow-sm);
  padding: var(--s-7) var(--s-6) var(--s-6);
  transition: transform var(--ease) ease, box-shadow var(--ease) ease;
}
.rt-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.rt-card--featured {
  border: 2px solid var(--evergreen);
  background: var(--evergreen-04);
  box-shadow: var(--shadow-lg);
  z-index: 1;
}
.rt-card__badge {
  position: absolute;
  top: calc(-1 * var(--s-3));
  right: var(--s-5);
  display: inline-flex;
  align-items: center;
  margin: 0;
  background: var(--evergreen);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.rt-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--evergreen);
  margin: 0 0 var(--s-3);
}
.rt-card__price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 3.2rem);
  line-height: 1;
  color: var(--charcoal);
  margin: 0 0 var(--s-2);
}
.rt-card__save {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--white);
  background: var(--color-gold);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  margin: 0 0 var(--s-5);
}
.rt-card__save--placeholder {
  visibility: hidden;
}
.rt-card__cta {
  width: 100%;
  justify-content: center;
  margin: 0 0 var(--s-3);
}
.rt-card__trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0 0 var(--s-5);
  padding: 0.55rem 0.75rem;
  background: var(--evergreen-06);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--evergreen);
}
.rt-card__trust svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--evergreen);
}
.rt-card__listheading {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--s-2);
  padding-top: var(--s-5);
  border-top: 1px solid var(--card-border);
}
.rt-card__feats {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rt-feat {
  border-bottom: 1px solid var(--card-border);
}
.rt-feat:last-child {
  border-bottom: none;
}
.rt-feat__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: var(--s-3) 0;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--charcoal);
  transition: color var(--ease);
}
.rt-feat__toggle:hover {
  color: var(--evergreen);
}
.rt-feat__toggle:focus-visible {
  outline: 2px solid var(--evergreen);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.rt-feat__label {
  flex: 1 1 auto;
}
.rt-feat__chev {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform var(--ease) ease;
}
.rt-feat__toggle[aria-expanded="true"] .rt-feat__chev {
  transform: rotate(180deg);
  color: var(--evergreen);
}
.rt-feat__detail {
  padding: 0 0 var(--s-3);
}
.rt-feat__detail p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------------------------------------------------------------------------
   6. GALLERY COLLAGE
   One large image on the left with a 2x2 grid of four on the right (5 total),
   then a short caption that links to the full portfolio.
--------------------------------------------------------------------------- */
.home-gallery-section {
  background: var(--white);
  padding: var(--section-spacing) 0;
}
.home-collage {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  aspect-ratio: 2 / 1;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}
.home-collage__item {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  margin: 0;
  background: color-mix(in srgb, var(--evergreen) 12%, white);
  box-shadow: 0 10px 22px rgba(33, 37, 41, 0.06);
}
.home-collage__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.home-collage__item:hover img {
  transform: scale(1.04);
}
.home-collage__item--main {
  grid-column: 1;
  grid-row: 1 / span 2;
}
.home-collage__note {
  margin: clamp(1.1rem, 2.5vw, 1.6rem) auto 0;
  max-width: 60ch;
  text-align: center;
  color: var(--muted);
  font-size: 0.975rem;
  line-height: 1.6;
}
@media (max-width: 640px) {
  .home-collage {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
    /* Size each row to its own images. With 1fr the thumbnail rows stretched
       to the tall main-image row, leaving ~90px of dead space under each. */
    grid-auto-rows: auto;
    aspect-ratio: auto;
    gap: 0.6rem;
  }
  .home-collage__item {
    aspect-ratio: 4 / 3;
  }
  .home-collage__item--main {
    grid-column: 1 / span 2;
    grid-row: auto;
    aspect-ratio: 16 / 10;
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-collage__item img {
    transition: none !important;
  }
  .home-collage__item:hover img {
    transform: none !important;
  }
}

/* ---------------------------------------------------------------------------
   7. "WHAT'S NEXT" TRIO
--------------------------------------------------------------------------- */
.home-next {
  background: var(--slate-light);
  padding: var(--section-spacing) 0;
  border-top: 1px solid var(--card-border);
}
.home-next__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}
.home-next__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5);
  margin-top: clamp(var(--s-8), 4vw, var(--s-12));
}
.home-next__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--white);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: clamp(1.6rem, 3vw, 2.25rem);
  text-decoration: none;
  transition: transform var(--ease) ease, box-shadow var(--ease) ease, border-color var(--ease) ease;
}
.home-next__card:hover,
.home-next__card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-gold);
}
.home-next__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--evergreen);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 1.1rem;
}
.home-next__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.15;
  color: var(--evergreen);
  margin: 0 0 var(--s-2);
}
.home-next__desc {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 1.1rem;
}
.home-next__cue {
  margin-top: auto;
  color: var(--charcoal);
  font-weight: 700;
  font-size: 0.9375rem;
}
.home-next__card:hover .home-next__cue {
  color: var(--evergreen);
}

/* Highlighted "Book now" card: gold-on-evergreen, slightly tilted, with a
   gentle bounce to pull the eye to the primary next step. */
.home-next__card--featured {
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(201, 166, 107, 0.4), rgba(201, 166, 107, 0) 55%),
    linear-gradient(155deg, var(--evergreen), #0a1c26);
  border-color: var(--evergreen);
  box-shadow: 0 20px 44px rgba(16, 38, 50, 0.28);
  transform: rotate(-1.6deg);
  animation: homeNextBounce 2.6s ease-in-out infinite;
}
.home-next__card--featured .home-next__title,
.home-next__card--featured .home-next__cue {
  color: var(--white);
}
.home-next__card--featured .home-next__desc {
  color: rgba(255, 255, 255, 0.82);
}
.home-next__card--featured .home-next__num {
  background: var(--color-gold);
  color: var(--charcoal);
}
.home-next__card--featured:hover,
.home-next__card--featured:focus-visible {
  animation-play-state: paused;
  transform: rotate(-1.6deg) translateY(-6px);
  box-shadow: 0 28px 56px rgba(16, 38, 50, 0.34);
}
@keyframes homeNextBounce {
  0%, 100% { transform: rotate(-1.6deg) translateY(0); }
  50% { transform: rotate(-1.6deg) translateY(-9px); }
}

/* ---------------------------------------------------------------------------
   Responsive collapses for the home sections
--------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .home-testi__inner {
    grid-template-columns: 1fr;
    gap: clamp(2rem, 5vw, 2.5rem);
  }
  .port-hero__rail {
    height: clamp(300px, 64vw, 400px);
  }
  .home-svc__grid,
  .home-next__grid {
    grid-template-columns: 1fr;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
  }
  .rt-cards__grid {
    grid-template-columns: 1fr;
    max-width: 460px;
  }
  /* Stacked on mobile, lead with the entry price (matches the "from $179"
     promise in the hero and ads) and ladder up. Desktop keeps the featured
     Plus card centered. DOM order is unchanged, so SEO/source order is intact. */
  .rt-cards__grid > .rt-card:nth-child(1) { order: 3; } /* Luxe $499 */
  .rt-cards__grid > .rt-card:nth-child(2) { order: 2; } /* Plus (Most popular) */
  .rt-cards__grid > .rt-card:nth-child(3) { order: 1; } /* Essentials $179 */
}
@media (max-width: 520px) {
  .rt-card {
    padding: var(--s-6) var(--s-5) var(--s-5);
  }
}
@media (max-width: 580px) {
  .home-hero__actions .btn,
  .home-testi__actions .btn,
  .home-svc__actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* ---------------------------------------------------------------------------
   Reduced motion
--------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .port-hero__track {
    animation: none !important;
  }
  .port-hero__rail {
    overflow-y: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .home-svc__media img,
  .home-next__card,
  .rt-card,
  .rt-feat__chev,
  .home-gallery__grid .portfolio__item {
    transition: none !important;
  }
  .home-svc__item:hover .home-svc__media img,
  .home-next__card:hover,
  .rt-card:hover {
    transform: none !important;
  }
  /* Keep the featured card's static tilt, but drop the bounce. */
  .home-next__card--featured {
    animation: none !important;
  }
  .home-next__card--featured,
  .home-next__card--featured:hover {
    transform: rotate(-1.6deg) !important;
  }
}
