/* home – mid (premium v2): section headings, services, why */

/* =========================================================
   1. SECTION HEADINGS (all .sec-head on the landing + why kicker)
   kicker writes itself in, h2 words rise (main.js .wsplit),
   stitches sew outward from the heart, heart pops last
   ========================================================= */
.page--home .stitch-line::before,
.page--home .stitch-line::after { width: min(140px, 25vw); transition: clip-path 1.4s .55s cubic-bezier(.65, 0, .25, 1); }

@media (prefers-reduced-motion: no-preference) {
  /* the header itself no longer slides as one block – its parts animate */
  .page--home .sec-head.reveal { opacity: 1; translate: none; }
  .page--home .why__kicker.reveal { opacity: 1; translate: none; }

  .page--home .sec-head__script,
  .page--home .why__kicker > span { /* clip the inner span: a fully clipped .reveal would never be observed */
    clip-path: inset(-45% 100% -60% -15%);
    translate: -8px 0;
    transition: clip-path 1.6s cubic-bezier(.45, .05, .2, 1), translate 1.6s var(--ease-out);
  }
  .page--home.is-loaded .sec-head.is-in .sec-head__script,
  .page--home.is-loaded .why__kicker.is-in > span { clip-path: inset(-45% -15% -60% -15%); translate: 0 0; }

  .page--home .stitch-line::before { clip-path: inset(0 0 0 100%); }
  .page--home .stitch-line::after { clip-path: inset(0 100% 0 0); }
  .page--home.is-loaded .is-in .stitch-line::before,
  .page--home.is-loaded .is-in .stitch-line::after { clip-path: inset(0 0 0 0); }

  .page--home .stitch-line svg { transform: scale(0) rotate(-25deg); opacity: 0; transition: transform .9s .45s cubic-bezier(.34, 1.6, .64, 1), opacity .4s .45s; }
  .page--home.is-loaded .is-in .stitch-line svg { transform: none; opacity: 1; animation: hmHeartBeat 1.2s 1.5s ease-in-out 1; }
}
@keyframes hmHeartBeat { 0%, 100% { transform: none; } 18% { transform: scale(1.22); } 34% { transform: scale(.96); } 50% { transform: scale(1.1); } }

/* =========================================================
   2. SERVICES – cards
   ========================================================= */
.page--home .services { padding-bottom: 130px; }
.page--home .cards .card:nth-child(1) { --cd: 0s; }
.page--home .cards .card:nth-child(2) { --cd: .1s; }
.page--home .cards .card:nth-child(3) { --cd: .2s; }
.page--home .cards .card:nth-child(4) { --cd: .3s; }

/* calm, layered surface; no 3D tilt */
.page--home .card {
  transform: translate3d(0, var(--lift, 0px), 0);
  transform-style: flat;
  box-shadow: 0 1px 2px rgba(59,32,20,.05), 0 14px 28px -20px rgba(59,32,20,.35), 0 34px 60px -38px rgba(59,32,20,.45), inset 0 2px 0 rgba(255,255,255,.7);
  transition:
    opacity 1s var(--ease-out) var(--cd, 0s), translate 1.2s var(--ease-out) var(--cd, 0s), scale 1.2s var(--ease-out) var(--cd, 0s),
    transform .8s var(--ease-out), box-shadow .8s var(--ease-out), color .6s;
}
/* cursor-following soft light */
.page--home .card::after {
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 30%), rgba(255,240,228,.20), rgba(255,240,228,.06) 45%, transparent 70%);
  transition: opacity .6s var(--ease-out);
}
/* chocolate rises a touch slower; wave only moves while hovered */
.page--home .card__fill { transition: height 1s cubic-bezier(.65, 0, .25, 1); }
.page--home .card__fill::before { animation-play-state: paused; }
.page--home .card:hover .card__fill::before { animation-play-state: running; }

.page--home .card__icon { transition: transform .8s var(--ease-out), box-shadow .6s, scale 1s cubic-bezier(.34, 1.45, .64, 1) calc(var(--cd, 0s) + .3s), opacity .7s var(--ease-out) calc(var(--cd, 0s) + .3s); }
.page--home .card:hover .card__icon {
  transform: translateY(-4px) scale(1.06);
  box-shadow: inset 0 4px 6px rgba(255,255,255,.6), inset 0 -8px 14px rgba(110,72,58,.25), 0 18px 26px -12px rgba(0,0,0,.55);
}
.page--home .card:hover .card__icon svg { animation: hmIconNod 1s var(--ease-out); }
@keyframes hmIconNod { 0%, 100% { transform: none; } 35% { transform: rotate(-7deg) scale(1.05); } 65% { transform: rotate(3deg); } }

.page--home .card__num { transition: color .6s, transform .8s var(--ease-out); }
.page--home .card:hover .card__num { transform: translateY(-3px); color: rgba(247,233,217,.16); }

.page--home .card__more { gap: 6px; transition: color .5s; }
.page--home .card__more .ico { transition: transform .5s var(--ease-out); }
.page--home .card:hover .card__more { gap: 6px; color: var(--rose-2); }
.page--home .card:hover .card__more .ico { transform: translateX(5px); }
.page--home .card:hover .card__pl { color: var(--rose-2); }

@media (hover: hover) and (pointer: fine) {
  .page--home .card:hover {
    --lift: -10px;
    box-shadow: 0 2px 4px rgba(59,32,20,.08), 0 22px 34px -20px rgba(59,32,20,.5), 0 60px 90px -42px rgba(59,32,20,.7), inset 0 2px 0 rgba(255,255,255,.12);
  }
}
@media (hover: none), (pointer: coarse) {
  .page--home .card::after { display: none; }
}

/* entrance: rise + slight scale, icon settles in after its card */
@media (prefers-reduced-motion: no-preference) {
  .page--home .card.reveal { --rv: 46px; scale: .95; }
  .page--home.is-loaded .card.reveal.is-in { scale: 1; }
  .page--home .card.reveal .card__icon { opacity: 0; scale: .72; }
  .page--home.is-loaded .card.reveal.is-in .card__icon { opacity: 1; scale: 1; }
}
@media (max-width: 560px) {
  .page--home .cards .card { --cd: 0s; }
}

/* =========================================================
   3. WHY – statement, plaque, note
   ========================================================= */
.page--home .why { padding: 110px 0 104px; }

/* the script words get a rose swash that is drawn as the reader reaches them */
.page--home .why__kicker > span { display: inline-block; }
.page--home .why__statement em { position: relative; display: inline-block; }
.page--home .why__statement em::after {
  --k: clamp(0, calc((var(--p, 1) * (var(--n, 20) + 4) - var(--ei, 0) - 2) / 4), 1);
  content: ""; position: absolute; left: 2%; right: -2%; bottom: -.14em; height: .26em; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 24' preserveAspectRatio='none'%3E%3Cpath d='M4 17 C 60 6, 140 4, 210 10 S 280 16, 296 8' fill='none' stroke='%23b98b90' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  clip-path: inset(-30% calc(100% - var(--k) * 100%) -30% 0);
}

/* plaque */
.page--home .plaque { margin-top: 96px; }
.page--home .plaque.has-stitch::before { display: none; }
.hm-stitch { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.hm-stitch__d { fill: none; stroke: rgba(247,233,217,.45); stroke-width: 2; stroke-dasharray: 7 6; }
.hm-stitch__m { fill: none; stroke: #fff; stroke-width: 10; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.page--home .fact__num { transition: transform .8s var(--ease-out); }
.page--home .fact:hover .fact__num { transform: translateY(-4px); }

@media (prefers-reduced-motion: no-preference) {
  .page--home .plaque.reveal {
    scale: .97;
    transition: opacity 1.1s var(--ease-out), translate 1.3s var(--ease-out), scale 1.3s var(--ease-out);
  }
  .page--home.is-loaded .plaque.reveal.is-in { scale: 1; }

  .page--home .plaque .hm-stitch__m { stroke-dashoffset: 1; transition: stroke-dashoffset 2.4s .55s cubic-bezier(.65, 0, .25, 1); }
  .page--home .plaque.is-in .hm-stitch__m { stroke-dashoffset: 0; }

  .page--home .plaque.reveal .plaque__bow {
    opacity: 0; transform: translateY(-30px) rotate(-12deg) scale(.82);
    transition: opacity .6s .35s, transform 1.4s .35s cubic-bezier(.34, 1.5, .64, 1);
  }
  .page--home.is-loaded .plaque.reveal.is-in .plaque__bow { opacity: 1; transform: none; }

  .page--home .plaque.reveal .fact {
    opacity: 0; translate: 0 16px;
    transition: opacity 1s var(--ease-out), translate 1.1s var(--ease-out);
    transition-delay: calc(.3s + var(--fi, 0) * .1s);
  }
  .page--home.is-loaded .plaque.reveal.is-in .fact { opacity: 1; translate: 0 0; }
  .page--home .fact:nth-child(2) { --fi: 1; }
  .page--home .fact:nth-child(3) { --fi: 2; }
  .page--home .fact:nth-child(4) { --fi: 3; }
}

/* note: one balanced line, heart inline */
.page--home .why__note { display: block; max-width: 800px; margin-top: 46px; line-height: 1.75; text-wrap: balance; }
.page--home .why__note .why__heart { display: inline-block; vertical-align: -3px; margin-right: 8px; }

@media (max-width: 900px) {
  .page--home .why { padding: 96px 0 90px; }
  .page--home .services { padding-bottom: 110px; }
}
@media (max-width: 560px) {
  .page--home .why { padding: 84px 0 76px; }
  .page--home .plaque { margin-top: 74px; }
  .page--home .why__note { margin-top: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .page--home .card, .page--home .card:hover { transform: none; }
  .page--home .card__fill::before { animation: none; }
}
