/* ========== HOME HERO — FULL-BLEED CINEMATIC ==========
   Height is `100vh` deliberately (not `100dvh`). On iOS Safari, `dvh`
   recalculates as the URL bar shows/hides during scroll, which causes the
   hero to resize at scroll-end and produces a visible jolt as content below
   shifts vertically. `vh` stays fixed at the largest viewport size — the
   bottom ~60px of the hero may sit behind the URL bar when it's visible,
   but the hero content (headline + CTAs) is in the lower-left with 80px
   bottom padding so it stays in view. */
.home-hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  overflow: hidden;
  /* Theme-agnostic muted gold-brown — see `.page-hero` in components.css for rationale. */
  border-bottom: 2px solid #544a36;
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
  /* Inline-style sets --hero-bg (and optionally --hero-bg-mobile); the
     mobile variant kicks in below 768 px via the @media rule below. */
  background-image: var(--hero-bg);
}
@media (max-width: 768px) {
  .home-hero-bg {
    background-image: var(--hero-bg-mobile, var(--hero-bg));
  }
}

.home-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.65) 50%,
    rgba(0, 0, 0, 0.65) 100%
  );
}

/* Watermark sits between the dark overlay and the hero content. No z-index:
   .home-hero-content is z-index: 1, so the motif stays behind it; the bg +
   overlay are default-stacked siblings before this in DOM order. */
.home-hero-motif {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #ffffff;
  opacity: 0.03;
}

.home-hero-motif svg {
  width: 90%;
  max-width: 1400px;
  height: auto;
  display: block;
}

.home-hero-content {
  position: relative;
  z-index: 1;
  padding: 0 30px 80px;
  max-width: 800px;
}

.home-hero-content h1 {
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 24px;
  line-height: 0.95;
  text-transform: uppercase;
}

.home-hero-content .hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.3rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 40px;
  line-height: 1.8;
  max-width: 500px;
  border-left: 3px solid var(--accent);
  padding-left: 20px;
}

.home-hero-ctas {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.home-hero-scroll {
  position: absolute;
  bottom: 30px;
  right: 40px;
  z-index: 1;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  writing-mode: vertical-rl;
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-hero-scroll::after {
  content: '';
  display: block;
  width: 1px;
  height: 60px;
  background: rgba(255, 255, 255, 0.3);
}

/* ========== MARQUEE BAND ========== */
.home-marquee {
  padding: 20px 0;
  background: var(--accent);
  overflow: hidden;
  white-space: nowrap;
}

.home-marquee-inner {
  display: flex;
  gap: 60px;
  animation: marqueeScroll 20s linear infinite;
}

.home-marquee-inner span {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: #0d0d0d;
  flex-shrink: 0;
}

@keyframes marqueeScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-marquee-inner {
    animation: none;
  }
}

/* ========== INTRO STATEMENT ========== */
.home-intro {
  padding: 140px 0;
}

[data-theme='light'] .home-intro {
  position: relative;
  background: linear-gradient(to bottom, #ffffff, #fafafa);
}

/* The opaque section gradient covers body::before's site-wide paper texture
   in this section's area, so we re-apply the texture here at section scope.
   Same image, opacity, and blend mode as body::before for visual continuity. */
[data-theme='light'] .home-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: image-set(
    url('/images/textures/subtle-texture.webp') type('image/webp'),
    url('/images/textures/subtle-texture.jpg') type('image/jpeg')
  );
  background-repeat: repeat;
  background-size: 600px 600px;
  opacity: 0.1;
  mix-blend-mode: multiply;
}

.home-intro-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 60px;
  align-items: center;
}

.home-intro-text {
  max-width: 600px;
}

.home-intro-text .intro-label {
  margin-bottom: 20px;
  font-weight: bold;
}

.home-intro-text h2 {
  font-size: var(--fs-h2);
  margin-bottom: 30px;
}

.home-intro-text p {
  font-family: 'Inter', sans-serif;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.9;
}

.home-intro-image {
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 28px;
  aspect-ratio: 4 / 3;
  width: 560px;
  max-width: 100%;
  transition: all 0.3s ease;
}

.home-intro-image:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 169, 110, 0.5);
  box-shadow: 0 12px 30px rgba(201, 169, 110, 0.15);
}

.home-intro-image:active {
  transform: translateY(-4px);
  border-color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-primary));
  box-shadow: 0 12px 30px rgba(201, 169, 110, 0.25);
}

.home-intro-inner picture {
  border-radius: 28px;
}

.home-intro-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.home-intro-image:hover img {
  transform: scale(1.03);
}

/* ========== SERVICES — HORIZONTAL SCROLL CARDS ========== */
.home-services {
  padding: 120px 0;
  background: var(--bg-secondary);
  transition: background-color 0.3s ease;
}

.home-services-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 60px;
  gap: 20px;
}

.home-services-header h2 {
  font-size: var(--fs-h2);
}

/* Secondary CTA pill, same vocabulary as the filter pills + service-row-link.
   Transparent base with gold-39% border, fill on hover. */
.home-services-header a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  color: var(--accent-text);
  border: 1px solid #c9a96e63;
  border-radius: 999px;
  transition: all 0.3s ease;
}

.home-services-header a i {
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.home-services-header a:hover {
  background: var(--accent);
  color: #ffffff;
}

.home-services-header a:hover i {
  transform: translateX(5px);
}

.home-services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

.home-services-grid .service-card {
  background: var(--bg-primary);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 20px;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.home-services-grid .service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(201, 169, 110, 0.15);
  border-color: rgba(201, 169, 110, 0.5);
}

/* Press-down feedback on click — same vocabulary as the radio-cards on
   /book in their selected state. Gives the user a moment of "you've
   chosen this" before the page navigates. */
.home-services-grid .service-card:active {
  transform: translateY(-4px);
  border-color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-primary));
  box-shadow: 0 12px 30px rgba(201, 169, 110, 0.25);
}

.home-services-grid .card-image {
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.home-services-grid .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.home-services-grid .service-card:hover .card-image img {
  transform: scale(1.08);
}

.home-services-grid .card-content {
  padding: 35px;
  display: flex;
  flex-direction: column;
  position: relative;
  flex: 1;
}

/* Card content typography mirrors the .service-row treatment on /services so
   the homepage cards feel like compact previews of the editorial service rows
   (ghost numeral → icon → name → italic Playfair Display tagline → uppercase letterspaced
   link) and share the same data source via the route-level service query. */

/* Decorative chapter numeral — same italic Playfair Display / low-opacity gold treatment
   as .service-row-number on /services, scaled down for the smaller card surface.
   Sits behind the foreground content via z-index, with siblings lifted to z-index 1
   so the numeral never intercepts hover/click. */
.home-services-grid .service-card-number {
  position: absolute;
  top: 0.5rem;
  left: 1.25rem;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(3.5rem, 6vw, 5rem);
  line-height: 1;
  color: var(--accent-text);
  opacity: 0.12;
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.home-services-grid .card-content > *:not(.service-card-number) {
  position: relative;
  z-index: 1;
}

.home-services-grid .service-card-icon {
  color: var(--accent-text);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  display: block;
}

.home-services-grid .service-card-name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: var(--fs-h3);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 0.9rem;
  color: var(--text-primary);
}

.home-services-grid .service-card-tagline {
  font-family: 'Inter', sans-serif;
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 1.5rem;
}

.home-services-grid .service-card-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: auto;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  color: var(--accent-text);
  transition: all 0.3s ease;
}

.home-services-grid .service-card-link i {
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.home-services-grid .service-card-link:hover {
  color: var(--accent-hover-text);
}

.home-services-grid .service-card-link:hover i {
  transform: translateX(5px);
}

/* ========== STATS — FULL-BLEED DARK BAND ========== */
.home-stats {
  position: relative;
  padding: 4rem 0;
  overflow: hidden;
  /* `--hero-bg` / `--hero-bg-mobile` set via inline style on the view; the
     @media rule below swaps to the mobile variant if one is provided. */
  background-image: var(--hero-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
@media (max-width: 768px) {
  .home-stats {
    background-image: var(--hero-bg-mobile, var(--hero-bg));
  }
}

.home-stats-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.home-stats .container {
  position: relative;
  z-index: 1;
}

.home-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  text-align: center;
}

.home-stat-item {
  padding: 30px 0;
}

.stat-number {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--accent-text);
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 12px;
}

/* ========== TESTIMONIAL — DRAMATIC SPLIT ========== */
.home-testimonial {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 500px;
}

.home-testimonial-image {
  height: 300px;
  overflow: hidden;
}

.home-testimonial-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-testimonial-content {
  padding: 80px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg-secondary);
  transition: background-color 0.3s ease;
}

/* Hidden site-wide on the home testimonial - owner-requested. The base
   `.pullquote-mark` rule from components.css still applies elsewhere if
   used, but the home pullquote renders without the decorative " glyph. */
.home-testimonial-content .pullquote-mark {
  display: none;
}

.home-testimonial-content .pullquote-text {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(1.15rem, 2.5vw, 1.6rem);
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 30px;
  text-align: left;
}

.home-testimonial-content .pullquote-author {
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  justify-content: flex-start;
  text-align: left;
}

.home-testimonial-content .pullquote-author img {
  width: 56px;
  height: 56px;
  border-radius: 0;
  object-fit: cover;
}

.home-testimonial-content .pullquote-author strong {
  display: block;
  font-size: 1rem;
}

.home-testimonial-content .pullquote-author span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ========== RESPONSIVE: MOBILE ========== */
@media (max-width: 767px) {
  /* Mobile diverges from the `100vh` choice in the comment at the top of
     this file. On Android Chrome, `100vh` is the largest viewport (toolbars
     hidden) so flex-end content gets clipped behind the URL bar + bottom
     nav. `100svh` resolves to the always-visible viewport - keeps CTAs in
     view AND avoids the iOS jolt (svh stays fixed, no resize on scroll). */
  .home-hero {
    height: 100svh;
    min-height: 500px;
  }

  .home-hero-content {
    padding: 0 16px 40px;
  }

  .home-hero-scroll {
    display: none;
  }

  .home-marquee-inner {
    gap: 30px;
  }

  .home-marquee-inner span {
    letter-spacing: 2px;
    font-size: 0.85rem;
  }

  .home-intro {
    padding: 30px 0;
  }

  .home-intro-inner {
    gap: 30px;
  }

  /* Grid items default to min-width: auto (content-driven), which lets a
     wide intrinsic-size child (560px image declaration, long unbreakable
     word) push the track past the viewport. Force min-width: 0 so cells
     stay within the container's content area. */
  .home-intro-text,
  .home-intro-image {
    min-width: 0;
  }

  .home-intro-text {
    overflow-wrap: break-word;
  }

  /* Mobile-scoped H2 size — var(--fs-h2) clamps to a 32px min which still
     reads big on a 375px viewport with the long "The Heart of Every
     Gathering" headline. */
  .home-intro-text h2 {
    font-size: clamp(1.75rem, 7vw, 2.25rem);
    line-height: 1.15;
  }

  /* Mobile keeps the desktop border + 28px radius. The width: 100% override
     defeats the desktop's 560px declaration so the photo fills the column. */
  .home-intro-image {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .home-services {
    padding: 60px 0 30px;
  }

  .home-services-header {
    margin-bottom: 30px;
  }

  .home-services-grid .card-content {
    padding: 20px;
  }

  .home-services-grid .card-image {
    aspect-ratio: 16 / 10;
  }


  .home-stats {
    padding: 1.75rem 0;
  }

  .home-stat-item {
    padding: 8px 0;
  }

  .home-testimonial-image {
    height: 380px;
  }

  .stat-number {
    font-size: 2.75rem;
  }

  .stat-label {
    letter-spacing: 2px;
  }

  .home-testimonial-content {
    padding: 40px 16px;
  }

}


/* ========== RESPONSIVE: TABLET ========== */
@media (min-width: 768px) {
  .home-hero-content {
    padding: 0 60px 100px;
  }

  /* Full-bleed photo on tablet+: the photo flies out of the grid via
     position: absolute relative to the section, so it fills the entire
     right half of the section edge-to-edge (top, bottom, and to the
     viewport's right edge). The text stays in the .container via the
     grid's left column. .home-intro-inner is forced static here so the
     image's absolute positioning resolves to the .home-intro section,
     not the inner wrapper. The card chrome (border, radius, hover lift,
     scale-on-hover) is reset since a section-bleed photo isn't a card. */
  .home-intro {
    position: relative;
  }

  .home-intro-inner {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .home-intro-image {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50vw;
    aspect-ratio: auto;
    border: none;
    border-radius: 0;
    transition: none;
  }

  .home-intro-image:hover,
  .home-intro-image:active {
    transform: none;
    border-color: transparent;
    background: none;
    box-shadow: none;
  }

  .home-intro-image img {
    transition: none;
  }

  .home-intro-image:hover img,
  .home-intro-image:active img {
    transform: none;
  }

  .home-intro-inner picture {
    border-radius: 0;
  }

  .home-services-grid {
    grid-template-columns: 1fr 1fr;
  }

  .home-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .home-testimonial {
    grid-template-columns: 5fr 7fr;
  }

  .home-testimonial-image {
    height: auto;
  }

  .home-testimonial-content {
    padding: 80px 60px;
  }
}

/* ========== RESPONSIVE: DESKTOP ========== */
@media (min-width: 1024px) {
  .home-services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
