/* ==========================================================================
   HOME (/) page styles, SYSTEM v3 LIGHT LUXURY  (home.css?v=3)
   Only home-specific layout lives here. Tokens + components come from site.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. HERO: split with layered media collage
   -------------------------------------------------------------------------- */
.home-hero { overflow: visible; }
/* MAIN-01: hero H1 dialed back ~15% so the copy column no longer towers over the photo */
.home-hero h1 { max-width: 15ch; font-size: clamp(2.3rem, 1.32rem + 3.9vw, 4.35rem); }
/* MAIN-03: balance the two columns — the media stretches to the copy height instead of centering short */
.home-hero .split--75 { align-items: stretch; }
.home-hero__copy .lead { max-width: 46ch; }
.home-hero__copy .lead + .home-hero__close { margin-top: 0.9rem; }
.home-hero__sub { margin-top: 1.5rem; line-height: 1.5; color: var(--ink-soft); }

/* hero CTA chooser (MAIN-04): one button opens a compact vertical list of the 3 ways to start */
.cta-reveal.cta-reveal--hero { align-items: flex-start; margin-top: 1.5rem; } /* doubled class beats the later .cta-reveal center rule */
.cta-reveal--hero .ctaways { display: flex; flex-direction: column; gap: 0; grid-template-columns: none; margin-top: 1rem; max-width: 22rem; width: 100%; }
.cta-reveal--hero .ctaways__item { flex-direction: row; align-items: center; gap: 0.7rem; padding: 0; border-top: 1px solid var(--line); }
.cta-reveal--hero .ctaways__item:first-child { border-top: none; }
.cta-reveal--hero .ctaways__ord { font-size: 1rem; min-width: 1.5rem; }
.ctaways__hlink { display: flex; align-items: center; min-height: 2.75rem; font-family: var(--font-d); font-weight: 500; font-size: 1.05rem; letter-spacing: 0.01em; color: var(--ink); text-decoration: none; transition: color 0.2s ease; }
.ctaways__hlink:hover { color: var(--brass-deep); }

/* hero slideshow: each smile holds, then the next fades in ON TOP of it, so the
   previous photo is never gone before the next is fully in. No fade-to-white gap.
   3 slides x 6s = 18s loop. */
.home-hero__main { overflow: hidden; }
.hero-slides { position: absolute; inset: 0; background: var(--cinema); }
.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  opacity: 0;
  will-change: transform, opacity;
  animation: heroSlide 30s linear infinite;
}
.hero-slide:nth-child(1) { animation-delay: 0s; }
.hero-slide:nth-child(2) { animation-delay: 6s; }
.hero-slide:nth-child(3) { animation-delay: 12s; }
.hero-slide:nth-child(4) { animation-delay: 18s; }
.hero-slide:nth-child(5) { animation-delay: 24s; }
/* 4-slide loop (24s total, 6s per slide). Each slide fades in (~0.9s = 3.75%),
   holds at full opacity through its slot + crossfade overlap, then snaps to 0
   once fully covered by the next. Slow ambient push-in via scale while visible. */
@keyframes heroSlide {
  0%      { opacity: 0; transform: scale(1.02); }
  3%      { opacity: 1; }
  22.95%  { opacity: 1; transform: scale(1.06); }
  23%     { opacity: 0; transform: scale(1.06); }
  100%    { opacity: 0; transform: scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-slide { animation: none; opacity: 0; transform: none; }
  .hero-slide:nth-child(1) { opacity: 1; }
}

.home-hero__media { position: relative; }
.pagehero__media .home-hero__main { aspect-ratio: 4 / 5; }
/* MAIN-03: on desktop the media frame stretches to the copy column height so both
   columns bottom-align. Slides are absolutely positioned + object-fit cover, so
   rotation never shifts layout and every slide fills the same frame. */
@media (min-width: 861px) {
  .home-hero__media { display: flex; }
  .pagehero__media .home-hero__main { aspect-ratio: auto; flex: 1; min-height: 32rem; }
}

@media (max-width: 860px) {
  .home-hero__media { order: 1; }
  /* keep the taller editorial portrait crop on mobile */
  .pagehero__media .home-hero__main { aspect-ratio: 4 / 5; }
  .home-hero__copy .lead { max-width: none; }
}

/* --------------------------------------------------------------------------
   2. TICKER STRIP (kinetic marquee between hero and stats)
   -------------------------------------------------------------------------- */
.home-ticker {
  border-top: 1px solid var(--line);
  padding-block: 1.4rem;
}
.home-ticker .marquee__item { font-size: clamp(1.05rem, 1.6vw, 1.35rem); }

/* --------------------------------------------------------------------------
   3. STATS STRIP (plain panel; the page gradient belongs to the ctaband)
   -------------------------------------------------------------------------- */
.homestats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: clamp(2rem, 4vw, 4rem);
}
.homestats .stat { min-width: 9rem; }
.stat__star { color: var(--brass-deep); }
.home-stats__note { margin-top: 0.5rem; font-size: 0.72rem; }
@media (max-width: 640px) {
  .home-stats__note { text-align: left; margin-top: 1.25rem; }

  .homestats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem 1.25rem;
  }
  .homestats .stat { min-width: 0; }
}


/* --------------------------------------------------------------------------
   5. PERL vs PORCELAIN — one 50/50 comparison band (MAIN-10/13)
   PERL panel = dark cinema (left), Porcelain panel = light (right). Mirrored
   internals: eyebrow, H2, lead, one line, photo, CTA. Stacks below 1100px, PERL first.
   -------------------------------------------------------------------------- */
.home-vs__grid { display: grid; grid-template-columns: 1fr 1fr; }
.home-vs__panel { padding: clamp(2.75rem, 5vw, 5.5rem) clamp(1.5rem, 4.5vw, 4.5rem); }
.home-vs__inner { max-width: 34rem; margin: 0 auto; width: 100%; height: 100%; display: flex; flex-direction: column; }
.home-vs__panel--perl {
  background:
    radial-gradient(120% 120% at 100% 0%, var(--cinema-2) 0%, var(--cinema) 58%),
    var(--cinema);
  color: var(--milk);
}
.home-vs__panel--porc { background: var(--panel); color: var(--ink); }
/* client guide: "HOME - LOGO BIGGER PERL" */
.home-vs__logo { width: clamp(10rem, 7.5rem + 4.5vw, 13rem); height: auto; margin-bottom: 1.1rem; opacity: 0.95; }
.home-vs__eyebrow { font-family: var(--font-b); font-weight: 700; font-size: 0.74rem; letter-spacing: 0.22em; text-transform: uppercase; margin: 0 0 0.9rem; }
.home-vs__panel--perl .home-vs__eyebrow { color: var(--brass-light); }
.home-vs__panel--porc .home-vs__eyebrow { color: var(--brass-deep); }
.home-vs__panel h2 { margin-bottom: 0.6rem; }
.home-vs__inner .lead { margin-top: 0.4rem; }
.home-vs__panel--perl .lead { color: var(--milk-soft); }
.home-vs__inner .lead + p { margin-top: 0.9rem; }
.home-vs__panel--perl .lead + p { color: var(--milk-soft); }
/* photo takes the slack (margin-top:auto) so photo + CTA share one baseline on
   both panels even though only PERL has the logo block up top ("literally mimic"). */
.home-vs__photo { aspect-ratio: 3 / 2; margin: 1.6rem 0 0; margin-top: auto; }
.home-vs__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-vs__panel--perl .home-vs__photo img { object-position: 60% 50%; }
/* 58%: keeps the SMILE in frame when the tall portrait crops into the 3:2 window */
.home-vs__panel--porc .home-vs__photo img { object-position: 50% 58%; }
.home-vs__inner .ctarow { margin-top: 0; padding-top: clamp(1.5rem, 3vw, 2.25rem); }
@media (max-width: 1099px) {
  .home-vs__grid { grid-template-columns: 1fr; }
  .home-vs__photo { margin-top: 1.6rem; }
}
.home-doctor__sig {
  display: block;
  width: 238px;
  height: auto;
  margin: 1.5rem 0 1.7rem;
  opacity: 0.9;
}
/* --------------------------------------------------------------------------
   6. WHY THIS PRACTICE
   -------------------------------------------------------------------------- */
.home-why__media { max-width: 27rem; }
.home-why__copy { padding-left: clamp(0rem, 3vw, 2.5rem); }
.home-why__copy h2 { margin-bottom: 1.1rem; }
.home-why__copy .checks { margin-block: 1.5rem; }
.home-why__copy p { max-width: 52ch; }
@media (max-width: 860px) {
  .home-why__copy { padding-left: 0; }
  .home-why__media { order: 0; margin-top: 1.75rem; }
}

/* --------------------------------------------------------------------------
   7. DOCTOR INTRO
   -------------------------------------------------------------------------- */
.home-doctor h2 { margin-bottom: 1.1rem; }
.home-doctor .lead + p { margin-top: 1rem; }
.home-doctor .small { margin-block: 1.4rem; letter-spacing: 0.02em; }
.home-doctor__media { padding-left: clamp(0rem, 4vw, 3.5rem); }
.home-doctor__media .frame img { object-position: 68% 50%; }


/* --------------------------------------------------------------------------
   9. TRANSFORMATIONS: asymmetric photo grid
   -------------------------------------------------------------------------- */
.home-gallery__head { max-width: 56ch; margin-bottom: clamp(2.25rem, 4vw, 3.5rem); }
.home-gallery__head .lead { margin-top: 1rem; }

/* before / after diptych: two equal labeled panels, aligned */
.home-gallery__ba {
  margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.85rem, 1.8vw, 1.5rem);
}
.home-gallery__pane { position: relative; }
.home-gallery__ba .frame { aspect-ratio: 4 / 5; position: relative; }
.home-gallery__bacap { grid-column: 1 / -1; margin-top: 0.2rem; }
.home-gallery__tag {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 2;
  font-family: var(--font-b);
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.32em 0.8em;
  border-radius: 999px;
  background: rgb(23 23 23 / 0.62);
  color: #f5f2ec;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.home-gallery__tag--after { background: var(--brass); color: #1c1c1c; }

/* results: a tidy, aligned row of result portraits */
.home-gallery__results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.85rem, 1.8vw, 1.5rem);
}
.home-gallery__cell { margin: 0; }
.home-gallery__results .frame { aspect-ratio: 3 / 4; }
.home-gallery__more { margin-top: clamp(2rem, 4vw, 3rem); }

@media (max-width: 680px) {
  .home-gallery__results { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 430px) {
  .home-gallery__results { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   10. REVIEWS: offset editorial quotes
   -------------------------------------------------------------------------- */
.home-reviews__head { margin-bottom: clamp(2rem, 4vw, 3rem); }

/* swipeable review carousel: shared styles now live in site.css */
.home-reviews__more { margin: 0; }

/* --------------------------------------------------------------------------
   11. VISIT US
   -------------------------------------------------------------------------- */
.home-visit h2 { margin-bottom: 1.1rem; }
.home-visit__info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 2.5rem;
  margin-block: 1.9rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  max-width: 34rem;
}
.home-visit__info dt {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brass-deep);
}
.home-visit__info dd { margin: 0.3rem 0 0; color: var(--ink-soft); }
.home-visit__info dd a { color: var(--ink); text-decoration: none; }
.home-visit__info dd a:hover { color: var(--brass-deep); }
.home-visit__links { gap: 2rem; }
.home-visit__media { padding-left: clamp(0rem, 3vw, 2rem); }

/* balance the two columns: stretch the exterior photo to the full height of
   the contact ledger so both columns bottom-align (no dead gap before the
   cta band). The img is absolutely positioned so it never drives row height. */
@media (min-width: 861px) {
  .home-visit .split { align-items: stretch; }
  .home-visit__media { display: flex; }
  .home-visit__media .frame {
    flex: 1;
    aspect-ratio: auto;
    min-height: 22rem;
  }
  .home-visit__media .frame img {
    position: absolute;
    inset: 0;
    object-position: 50% 20%;
  }
}

@media (max-width: 480px) {
  .home-visit__info { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   12. COMPARISON DISPLAY (.cmp) — "X vs PERL Printed" (MAIN-11/12)
   Two clearly separated, labeled columns with persistent headers; the PERL
   column is highlighted in gold; the photo is demoted (<=34% desktop, below on mobile).
   -------------------------------------------------------------------------- */
.home-cmp__head { max-width: 56ch; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.home-cmp__head .lead { margin-top: 1rem; }
/* table wide (focal point), photo demoted to the narrow right column (.cmp--alt = photo right) */
.cmp__layout { display: grid; grid-template-columns: 1fr minmax(0, 34%); gap: clamp(1.75rem, 4vw, 3.5rem); align-items: start; }
.cmp--alt .cmp__media { order: 2; }
.cmp--alt .cmp__body  { order: 1; }
.cmp__media .frame { aspect-ratio: 4 / 5; }
.cmp__cap { margin-top: 0.6rem; }

/* the comparison IS the focal point: a bordered card of two distinct value columns */
.cmp__rows { margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cmp__head-row,
.cmp__row { display: grid; grid-template-columns: 1.15fr 1fr 1fr; align-items: stretch; }
.cmp__head-row > *,
.cmp__row > * { padding: clamp(0.7rem, 1.4vw, 1rem) clamp(0.7rem, 1.4vw, 1.15rem); border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.cmp__row:last-child > * { border-bottom: none; }
/* persistent column headers */
.cmp__head-row { font-family: var(--font-d); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); background: var(--panel); }
.cmp__head-perl { color: var(--brass-deep); }
/* two value columns as distinct vertical bands; PERL highlighted */
.cmp__head-row > span:nth-child(2),
.cmp__val--base { background: oklch(94.4% 0.009 92 / 0.55); }
.cmp__head-perl,
.cmp__val--perl { background: oklch(66.5% 0.083 78 / 0.12); border-left: 2px solid oklch(54.5% 0.080 75 / 0.4); }
.cmp__row dt { font-family: var(--font-b); font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink); }
.cmp__row dd { margin: 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.35; }
.cmp__val--perl { color: var(--brass-deep); font-weight: 600; font-variant-numeric: tabular-nums lining-nums; }
.cmp__foot { margin-top: clamp(1.75rem, 3vw, 2.5rem); display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; align-items: center; }
@media (max-width: 860px) {
  .cmp__layout { grid-template-columns: 1fr; gap: clamp(1.75rem, 5vw, 2.5rem); }
  /* photo drops BELOW the comparison, which stays the focus */
  .cmp--alt .cmp__media, .cmp__media { order: 2; }
  .cmp--alt .cmp__body,  .cmp__body  { order: 1; }
  .cmp__media .frame { aspect-ratio: 4 / 3; max-width: 30rem; }
}
@media (max-width: 560px) {
  .cmp__head-row { display: none; }
  .cmp__row { grid-template-columns: 1fr; border-bottom: 1px solid var(--line); padding-block: 0.5rem; }
  .cmp__row:last-child { border-bottom: none; }
  .cmp__row > * { display: block; border-bottom: none; background: none; border-left: none; padding: 0.15rem clamp(0.7rem, 1.4vw, 1.15rem); }
  .cmp__row dd::before { content: attr(data-col); display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brass-deep); margin-top: 0.35rem; }
  .cmp__row dd.cmp__val--base::before { color: var(--ink-soft); }
}

/* --------------------------------------------------------------------------
   13. CLOSING 1-2-3 CTA HUB (.ctaband--hub, on the warm gradient band)
   Light surface (--grad-warm): ordinals/text use light-safe tokens.
   -------------------------------------------------------------------------- */
.ctaband--hub .ctaband__head { text-align: center; max-width: 60ch; margin-inline: auto; }
.ctaband--hub .ctaband__head p { margin-top: 0.85rem; color: var(--ink-soft); font-size: 1.05rem; }
.ctaways { list-style: none; margin: clamp(2.25rem, 4vw, 3.25rem) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); }
.ctaways__item { display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem; padding-top: 1.2rem; border-top: 2px solid var(--brass); }
.ctaways__ord { font-family: var(--font-d); font-weight: 300; font-size: 1.6rem; line-height: 1; color: var(--brass-deep); font-variant-numeric: tabular-nums; }
.ctaways__title { font-family: var(--font-d); font-weight: 600; font-size: 1.2rem; text-transform: uppercase; letter-spacing: 0.01em; color: var(--ink); margin: 0.15rem 0 0; }
.ctaways__lead { margin: 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.5; flex: 1; }
.ctaways__action { margin-top: 0.7rem; }
.ctaways__tel { font-family: var(--font-d); font-weight: 600; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.ctaways__tel:hover { color: var(--brass-deep); }
@media (max-width: 760px) {
  .ctaways { grid-template-columns: 1fr; gap: 1.6rem; }
  .ctaways__item { padding-top: 1rem; }
  .ctaways__action.btn { min-height: 44px; display: inline-flex; align-items: center; }
}

/* ---- closing CTA tap-to-reveal (MAIN-01) ---- */
.cta-reveal { margin-top: clamp(2rem, 4vw, 3rem); display: flex; flex-direction: column; align-items: center; }
.cta-reveal__btn { display: inline-flex; align-items: center; gap: 0.6em; }
.cta-reveal__chev { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 0.35s ease; }
.cta-reveal.is-open .cta-reveal__chev { transform: rotate(-135deg) translateY(2px); }
.ctaways[hidden] { display: none; }
.cta-reveal .ctaways { width: 100%; }
.cta-reveal .ctaways__item { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1); }
.cta-reveal .ctaways.is-in .ctaways__item { opacity: 1; transform: none; }
.cta-reveal .ctaways.is-in .ctaways__item:nth-child(2) { transition-delay: 0.08s; }
.cta-reveal .ctaways.is-in .ctaways__item:nth-child(3) { transition-delay: 0.16s; }
@media (prefers-reduced-motion: reduce) { .cta-reveal .ctaways__item { transition: none; opacity: 1; transform: none; } }

/* audit fix: keep foreheads in frame when the portrait crops into the mobile comparison frame */
@media (max-width: 760px) { .cmp__media .frame img { object-position: center 26%; } }

/* ---- theme-dark home: gradient rhythm + one light island (client: "dark
   gradients, break it up sparingly with a light section") ---- */
body.theme-dark .home-hero { background: var(--grad-ember-soft); }
body.theme-dark .home-ticker { border-top-color: oklch(34% 0.014 85); background: #131313; }
body.theme-dark .home-stats { background: var(--grad-deep-panel); }
body.theme-dark .home-cmp { background: var(--grad-deep-a); }
body.theme-dark .home-doctor { background: var(--grad-ember-soft); }
body.theme-dark .home-gallery:not(.light-break) { background: var(--grad-deep-a); }
body.theme-dark .home-reviews { background: var(--grad-deep-panel); }
body.theme-dark .home-visit { background: var(--grad-ember-soft); }

/* client note (Amanda 07-02): transformations open black & white, hover reveals color; gallery page stays color */
@media (hover: hover) {
  .home-gallery__pane img,
  .home-gallery__cell img { filter: grayscale(1); transition: filter 0.5s ease; }
  .home-gallery__pane:hover img,
  .home-gallery__cell:hover img,
  .home-gallery__pane:focus-within img,
  .home-gallery__cell:focus-within img { filter: grayscale(0); }
}
