/*
  Home page layout — sits on top of tokens.css + components.css.
  Mobile-first: single column, stacked. Desktop rules widen the layout at 1025px.
*/

/* ---------- Hero ---------- */
/*
  Misty Huangshan-style peaks and pines, set the same way as /tea-ceremony's
  hero so the two pages read as one system: the photo never sits under the
  text. Mobile: photo as a banner at its native ratio, text below on Paper.
  Desktop (1025px+): text on plain Paper at left, photo in the right-hand
  columns.

  The source is small (650px wide), so it is shown no wider than ~2/3 of the
  page width and toned down — desaturated and lifted — which
  also lets the blues sit quietly beside the cream and ink type.

  Soft edges, top and bottom only (the sides stay sharp, 2026-10-21):
  ::before is a blurred copy, ::after the sharp copy fading into it, and
  the block fades into Paper over --hero-feather (5%) at the bottom and
  --hero-feather-top (10%) at the top, so the sky melts away more.
*/

.home-hero {
  --hero-feather: 5%;
  --hero-feather-top: 10%;
  display: flex;
  flex-direction: column;
  background: var(--color-paper);
}

.home-hero__figure {
  margin: 0;
}

/* Small italic credit under the photo, quiet enough not to compete with
   the hero copy */
.home-hero__caption {
  margin-top: var(--space-1);
  padding: 0 var(--space-3);
  font-size: 0.8125rem;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--color-bark);
  opacity: 0.85;
  text-align: center;
}

.home-hero__media {
  position: relative;
  width: 100%;
  overflow: hidden; /* keep the scaled blur copy from widening the page */
  aspect-ratio: 650 / 391;
  /* Top and bottom fade only; the sides stay sharp. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--hero-feather-top), #000 calc(100% - var(--hero-feather)), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--hero-feather-top), #000 calc(100% - var(--hero-feather)), transparent 100%);
}

.home-hero__media::before,
.home-hero__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hero-img) center / cover;
  /* Gently toned: colour at 0.825 (50% more than the earlier 0.55), lighter wash halved */
  filter: saturate(0.825) brightness(1.03) contrast(0.94);
}

.home-hero__media::before {
  filter: saturate(0.825) brightness(1.03) contrast(0.94) blur(10px);
  transform: scale(1.04);
}

.home-hero__media::after {
  /* Top and bottom fade only; the sides stay sharp. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--hero-feather-top), #000 calc(100% - var(--hero-feather)), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--hero-feather-top), #000 calc(100% - var(--hero-feather)), transparent 100%);
}

.home-hero__content {
  padding: var(--space-3) var(--space-3) var(--space-6);
  text-align: center;
}

.hero__eyebrow {
  color: var(--color-bark);
}

.hero__heading {
  font-family: var(--font-heading);
  font-size: var(--fs-h1);
  color: var(--color-ink);
  margin: var(--space-2) 0;
}

.hero__sub {
  color: var(--color-bark);
  max-width: 560px;
  margin: 0 auto var(--space-4);
  font-size: 1.0625rem;
}

.hero__ctas {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
}

@media (min-width: 600px) {
  .hero__ctas {
    flex-direction: row;
    justify-content: center;
  }
}

@media (min-width: 1025px) {
  .home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: center;
    padding: var(--space-4) 0;
  }

  .home-hero__figure {
    grid-area: 1 / 2;
    max-width: 990px;
  }

  .home-hero__caption {
    text-align: right;
    padding-right: var(--space-4);
  }

  .home-hero__content {
    grid-area: 1 / 1;
    max-width: 560px;
    margin: 0 0 0 auto;
    padding: var(--space-5) var(--space-4) var(--space-5) var(--space-6);
    text-align: left;
  }

  /* A caption, not a headline — sized the same as tea-ceremony's. */
  .hero__heading {
    font-size: clamp(1.875rem, 1.3vw + 1.4rem, 2.5rem);
    line-height: 1.3;
    margin: var(--space-1) 0;
  }

  .hero__sub {
    font-size: 1.0625rem;
    line-height: 1.55;
    margin: 0 0 var(--space-3);
  }

  .hero__ctas {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* Signature steam animation — three wisps rising and fading in a staggered loop */
.steam-path {
  animation: steam-rise 4.5s ease-in-out infinite;
  transform-origin: bottom center;
}

.steam-path:nth-child(2) {
  animation-delay: 1.1s;
}

.steam-path:nth-child(3) {
  animation-delay: 2.2s;
}

@keyframes steam-rise {
  0% {
    opacity: 0;
    transform: translateY(0) scaleY(0.9);
  }
  25% {
    opacity: 0.85;
  }
  85% {
    opacity: 0;
  }
  100% {
    opacity: 0;
    transform: translateY(-14px) scaleY(1.05);
  }
}

/* ---------- Image + text split blocks (About, Tea Ceremony) ---------- */

.split {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

@media (min-width: 1025px) {
  .split {
    flex-direction: row;
    align-items: center;
    gap: var(--space-6);
    text-align: left;
  }

  .split--reverse {
    flex-direction: row-reverse;
  }

  .split__visual,
  .split__text {
    flex: 1;
    min-width: 0;
  }
}

.split__text {
  text-align: center;
  max-width: 560px;
}

@media (min-width: 1025px) {
  .split__text {
    text-align: left;
  }
}

/* Sit with the Tea photo — same soft-edge treatment as /tea-ceremony's
   .tea-photo: ::before is a blurred copy (via --photo-img), the sharp <img>
   fades into it, and the block fades into the background over 5% at the
   top and bottom only; the sides stay sharp. */
.home-photo {
  --photo-feather: 5%;
  position: relative;
  overflow: hidden; /* keep the scaled blur copy from widening the page */
  width: 100%;
  max-width: 504px; /* 420px + 20% */
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  /* Top and bottom fade only; the sides stay sharp. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--photo-feather), #000 calc(100% - var(--photo-feather)), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--photo-feather), #000 calc(100% - var(--photo-feather)), transparent 100%);
}

.home-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--photo-img) center / cover;
  filter: blur(10px);
  transform: scale(1.03);
}

.home-photo img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Top and bottom fade only; the sides stay sharp. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--photo-feather), #000 calc(100% - var(--photo-feather)), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--photo-feather), #000 calc(100% - var(--photo-feather)), transparent 100%);
}

/* Mobile/tablet: hero and tea photos run edge to edge with only a 2% soft
   edge. The tea photo breaks out of the section's container padding. */
@media (max-width: 1024px) {
  .home-hero {
    --hero-feather: 2%;
    --hero-feather-top: 2%;
  }

  #ceremony .split__visual {
    width: 100%;
  }

  .home-photo {
    --photo-feather: 2%;
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
}

/* Desktop: the hero and tea photos also fade 5% at the left and right
   edges (2026-10-22). Mobile/tablet keep sharp sides. The side fade is a
   second mask layer intersected with the top/bottom fade above. */
@media (min-width: 1025px) {
  .home-hero__media,
  .home-hero__media::after {
    -webkit-mask-image:
      linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%),
      linear-gradient(to bottom, transparent 0, #000 var(--hero-feather-top), #000 calc(100% - var(--hero-feather)), transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%),
      linear-gradient(to bottom, transparent 0, #000 var(--hero-feather-top), #000 calc(100% - var(--hero-feather)), transparent 100%);
    mask-composite: intersect;
  }

  .home-photo,
  .home-photo img {
    -webkit-mask-image:
      linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%),
      linear-gradient(to bottom, transparent 0, #000 var(--photo-feather), #000 calc(100% - var(--photo-feather)), transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%),
      linear-gradient(to bottom, transparent 0, #000 var(--photo-feather), #000 calc(100% - var(--photo-feather)), transparent 100%);
    mask-composite: intersect;
  }
}

/* ---------- Alchemy cards ---------- */

.alchemy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .alchemy-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .alchemy-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* "Explore …" opens the Modal — styled as the card link, not a button */
.alchemy-card__more {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.alchemy-modal__who-heading {
  margin: var(--space-3) 0 var(--space-1);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-bark);
}

.alchemy-modal__who {
  margin: 0 0 var(--space-3);
  padding-left: 1.1em;
}

.alchemy-modal__who li + li {
  margin-top: 0.35em;
}

/* Push the link to the card's foot so links line up across a row */
.alchemy-grid .card {
  display: flex;
  flex-direction: column;
}

.alchemy-grid .card__link {
  margin-top: auto;
  padding-top: var(--space-2);
}

/* ---------- Foundation cards (same hanzi pattern as /acupuncture path cards) ---------- */

.foundation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .foundation-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .foundation-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.foundation-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--color-ink);
  padding: var(--space-4) var(--space-3);
}

.foundation-card h3 {
  font-size: var(--fs-h3);
  margin: 0;
}

.foundation-card__hanzi {
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1;
  color: var(--color-blossom);
  margin-bottom: var(--space-2);
}

.foundation-card__body {
  color: var(--color-bark);
  margin: 0;
}

/* Push the link to the card's foot so links line up across a row */
.foundation-card .card__link {
  margin-top: auto;
  padding-top: var(--space-2);
}

/* ---------- Testimonials ---------- */

.testimonial {
  height: 100%;
}

.testimonial__quote {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  line-height: 1.5;
  margin: 0 0 var(--space-3);
}

.testimonial__attribution {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.testimonial__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-blossom);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  flex-shrink: 0;
}

.testimonial__name {
  margin: 0;
  font-weight: 700;
  color: var(--color-ink);
}

.testimonial__location {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-bark);
}

/* ---------- Final CTA ---------- */

.final-cta__card {
  background: var(--color-white);
  color: var(--color-ink);
  border-radius: var(--radius-card);
  padding: var(--space-5) var(--space-3);
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  box-shadow: var(--shadow-card-hover);
}

@media (min-width: 768px) {
  .final-cta__card {
    padding: var(--space-6) var(--space-5);
  }
}

.final-cta__card .section__eyebrow {
  /* The card is White, so it gets the Paper-section eyebrow treatment: Bark
     (Blossom is decorative-only, not text-safe) */
  color: var(--color-bark);
}

/* The eyebrow is the card's only heading, so it is enlarged to heading
   scale while keeping the eyebrow's capitals and wide tracking. */
.final-cta__eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-h3);
  line-height: 1.3;
  margin: 0 0 var(--space-4);
}

/* Final CTA: two booking routes side by side (stack on narrow phones) */
.final-cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.final-cta__note {
  font-size: 0.875rem;
  color: var(--color-bark);
  margin: var(--space-3) auto 0;
  max-width: 400px;
}

.final-cta__note a {
  color: inherit;
  font-weight: 700;
  white-space: nowrap;
}
