/* Home: the Dedham Vale hero, the ceremonies, the pinned "how it comes together" scene with its travelling feather,
   the include list, the mini planner, about and funeral directors. */

/* ---------------- hero ---------------- */
.hero { position: relative; height: calc(100svh - var(--head-h)); min-height: 600px; color: var(--linen); overflow: clip; isolation: isolate; background: #3d4a3a url("../img/hero-poster-sm.webp") center / cover no-repeat; }
.hero__media { position: absolute; inset: -12% 0 0; z-index: -3; }
.hero__video { width: 100%; height: 100%; object-fit: cover; }
.hero__veil { position: absolute; inset: 0; z-index: -2; background:
  linear-gradient(180deg, rgba(36,48,38,0) 28%, rgba(36,48,38,.38) 58%, rgba(28,36,29,.86) 100%),
  radial-gradient(120% 90% at 12% 100%, rgba(28,36,29,.55), rgba(28,36,29,0) 60%); }
.hero__feathers { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: clip; }
.hero__copy { position: absolute; left: 0; right: 0; bottom: 0; padding-bottom: clamp(40px, 8vh, 96px); }
.hero__h { font-size: clamp(2.9rem, 6.3vw, 6.6rem); line-height: 1.02; letter-spacing: -.015em; margin-bottom: 22px; text-shadow: 0 2px 30px rgba(20,26,20,.35); }
.hero__h em { color: #F3E6D3; }
.hero__lede { font-size: clamp(1.1rem, 1.3vw, 1.25rem); line-height: 1.6; color: #F3EEE4; margin-bottom: 30px; text-shadow: 0 1px 16px rgba(20,26,20,.5); }
.hero__trust { display: flex; align-items: center; gap: 12px; margin: 26px 0 0; font-size: 1rem; font-weight: 500; color: #E9E3D6; }
.hero__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--robin); box-shadow: 0 0 0 4px rgba(201,97,31,.25); flex: none; }
.hero__cue { position: absolute; right: var(--gutter); bottom: clamp(40px, 8vh, 96px); width: 44px; height: 84px; display: flex; justify-content: center; }
.hero__cue span { position: relative; width: 1.5px; height: 100%; background: rgba(246,240,231,.35); overflow: clip; }
.hero__cue span::after { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 40%; background: var(--linen); transform: translateY(-100%); animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { to { transform: translateY(250%); } }
.js .hero [data-hero-rise] { opacity: 0; }
.js .hero__h { clip-path: inset(0 0 100% 0); }
.no-motion .hero__h, .rm .hero__h { clip-path: none !important; }
.no-motion .hero [data-hero-rise], .rm .hero [data-hero-rise] { opacity: 1 !important; }
@media (max-width: 700px) {
  .hero__veil { background: linear-gradient(180deg, rgba(36,48,38,.05) 0%, rgba(36,48,38,.5) 30%, rgba(28,36,29,.82) 55%, rgba(28,36,29,.92) 100%); }
  .hero { min-height: 560px; }
  .hero__cue { display: none; }
  .hero .btns .btn { flex: 1 1 100%; }
}

/* ---------------- ceremonies ---------------- */
.cer__head .h2 { margin-bottom: 16px; }
.cer__head .lede a { color: var(--bronze-deep); }
.cer__cards { list-style: none; margin: clamp(32px, 4vw, 52px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2vw, 32px); }
.ccard { display: block; text-decoration: none; color: inherit; }
.ccard__img { display: block; position: relative; height: min(50vh, 520px); min-height: 300px; border-radius: var(--r); overflow: clip; background: var(--vellum); }
.ccard__img img { position: absolute; left: 0; top: -6%; width: 100%; height: 112%; object-fit: cover; }
.ccard__img::after { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(246,240,231,.0); border-radius: 20px 0 0 0; transition: border-color .6s var(--ease), inset .6s var(--ease); pointer-events: none; }
.ccard__img { transition: filter .8s var(--ease); }
.ccard:hover .ccard__img, .ccard:focus-visible .ccard__img { filter: brightness(1.05) saturate(1.08); }
.ccard:hover .ccard__img::after, .ccard:focus-visible .ccard__img::after { border-color: rgba(246,240,231,.8); inset: 16px; }
.ccard__body { display: grid; gap: 6px; padding: 22px 2px 0; }
.ccard__title { font-family: var(--serif); font-size: clamp(1.45rem, 1.8vw, 1.85rem); line-height: 1.2; }
.ccard__line { color: var(--umber-soft); }
.ccard__more { display: inline-flex; align-items: center; gap: 12px; margin-top: 6px; font-weight: 600; color: var(--bronze-deep); }
.ccard__more .i-arrow { width: 22px; height: 12px; transition: transform .5s var(--ease); }
.ccard:hover .ccard__more .i-arrow { transform: translateX(6px); }
.cer__also { list-style: none; margin: clamp(28px, 3vw, 40px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 32px); }
.also { display: flex; align-items: center; gap: 20px; padding: 14px 22px 14px 14px; text-decoration: none; background: rgba(236,227,213,.6); border-radius: var(--r); transition: background-color .45s var(--ease); }
.also:hover { background: var(--vellum); }
.also__img { width: 84px; height: 84px; flex: none; border-radius: var(--r); overflow: clip; }
.also__img img { width: 100%; height: 100%; object-fit: cover; }
.also__txt { display: grid; gap: 2px; flex: 1; }
.also__txt strong { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; line-height: 1.25; }
.also__txt span { color: var(--umber-soft); font-size: 1rem; line-height: 1.45; }
.also > .i-arrow { width: 22px; height: 12px; flex: none; color: var(--bronze); transition: transform .5s var(--ease); }
.also:hover > .i-arrow { transform: translateX(6px); }
@media (max-width: 600px) { .also > .i-arrow { display: none; } .also { padding-right: 14px; } }
@media (max-width: 900px) {
  .cer__cards { grid-template-columns: 1fr; }
  .ccard__img { height: min(62vh, 480px); }
  .cer__also { grid-template-columns: 1fr; }
}

/* ---------------- tailored ---------------- */
.tailored { padding-block: clamp(72px, 7vw, 112px); overflow: clip; }
.tailored__grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(40px, 6vw, 100px); align-items: center; }
.tailored__big { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 2.35vw, 2.55rem); line-height: 1.32; margin: 0 0 clamp(28px, 3vw, 44px); letter-spacing: -.005em; }
.tailored__big .w { display: inline !important; opacity: .2; }
.no-motion .tailored__big .w, .rm .tailored__big .w { opacity: 1; }
.tailored__points { list-style: none; margin: 0; padding: 22px 0 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.tailored__points strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.22rem; line-height: 1.3; margin-bottom: 4px; }
.tailored__points span { color: var(--umber-soft); font-size: 1rem; line-height: 1.5; }
.tailored__pics { position: relative; padding-bottom: 12%; }
.tailored__a { aspect-ratio: 3 / 2; width: calc(100% - 14px); margin-left: auto; }
.tailored__b { position: absolute; left: -6%; bottom: 0; width: 52%; margin: 0; }
.tailored__b-in { display: block; aspect-ratio: 3 / 2; border-radius: var(--r); overflow: clip; border: 8px solid var(--linen); box-shadow: 0 30px 60px -30px rgba(58,50,42,.55); }
.tailored__b-in img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1000px) {
  .tailored__grid { grid-template-columns: 1fr; }
  .tailored__pics { max-width: 720px; }
  .tailored__b { left: 0; }
}
@media (max-width: 640px) { .tailored__points { grid-template-columns: 1fr; gap: 16px; } }

/* ---------------- steps: pinned on desktop, a feather travels down the line ---------------- */
.steps { position: relative; background: var(--linen); }
.steps__pin { padding-block: clamp(72px, 8vw, 120px); }
.steps__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 110px); align-items: center; }
.steps__h { margin-bottom: clamp(24px, 3.4vh, 44px); }
.steps__track { position: relative; padding-left: 78px; }
.steps__line { position: absolute; left: 0; top: 6px; bottom: 6px; width: 60px; height: calc(100% - 12px); overflow: visible; }
.steps__path-bg { fill: none; stroke: var(--rule); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.steps__path { fill: none; stroke: var(--bronze); stroke-width: 2; vector-effect: non-scaling-stroke; }
.steps__feather { position: absolute; left: 0; top: 0; width: 64px; height: auto; pointer-events: none; opacity: 0; z-index: 2; }
.steps__list { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(14px, 2.2vh, 26px); }
.step { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 4px 16px; align-items: start; }
.step__n { font-family: var(--serif); font-size: 2rem; line-height: 1; color: var(--bronze); padding-top: 2px; }
.step__title { font-size: clamp(1.4rem, 1.8vw, 1.85rem); line-height: 1.25; margin-bottom: 6px; }
.step__txt p { margin: 0; color: var(--umber-soft); }
.step__pic { display: none; }
.steps__stage { justify-self: end; width: 100%; }
.steps__frame { height: min(calc(100svh - var(--head-h) - 250px), 620px); width: min(100% - 14px, calc(min(calc(100svh - var(--head-h) - 250px), 620px) * 1.1)); margin-left: auto; }
.steps__clip { position: relative; height: 100%; background: var(--vellum); }
.steps__img { position: absolute; inset: 0; z-index: 0; }
.steps__img.is-on { z-index: 2; }
.steps__img img { width: 100%; height: 100%; object-fit: cover; }
.steps__count { position: absolute; right: 0; bottom: 0; z-index: 3; margin: 0; padding: 10px 18px; background: var(--linen); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--bronze-deep); }
/* pinned mode (set by home.js on wide screens with motion): one open step at a time */
.steps.is-pinned .steps__pin { height: calc(100svh - var(--head-h)); display: flex; align-items: center; padding-block: 0; }
.steps.is-pinned .steps__pin > .wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.steps.is-pinned .step { opacity: .38; transition: opacity .6s var(--ease); }
.steps.is-pinned .step.is-on { opacity: 1; }
.steps.is-pinned .step__txt p { display: grid; grid-template-rows: 0fr; overflow: clip; transition: grid-template-rows .7s var(--ease), opacity .6s var(--ease); opacity: 0; }
.steps.is-pinned .step__txt p > span { min-height: 0; }
.steps.is-pinned .step.is-on .step__txt p { grid-template-rows: 1fr; opacity: 1; }
.steps.is-pinned .step__title { margin-bottom: 0; }
.steps.is-pinned .step.is-on .step__title { margin-bottom: 8px; }
/* stacked (mobile, reduced motion, no JS): each step carries its own photo */
.steps:not(.is-pinned) .steps__stage { display: none; }
.steps:not(.is-pinned) .steps__grid { grid-template-columns: 1fr; }
.steps:not(.is-pinned) .step__pic { display: block; grid-column: 2; aspect-ratio: 3 / 2; width: min(100% - 14px, 620px); margin: 18px 14px 14px 0; }
.steps:not(.is-pinned) .steps__list { gap: 40px; }
@media (max-width: 560px) {
  .steps__track { padding-left: 46px; }
  .steps__line { width: 36px; }
  .step { grid-template-columns: 34px minmax(0, 1fr); gap: 4px 10px; }
  .step__n { font-size: 1.6rem; }
}

/* ---------------- what we can include (yew band) ---------------- */
.incl { padding-block: clamp(64px, 7vw, 110px); overflow: clip; }
.incl__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px clamp(40px, 6vw, 110px); align-items: end; margin-bottom: clamp(28px, 3.5vw, 48px); }
.incl__head .lede { margin: 0; color: #E6E0D4; }
.incl__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 110px); align-items: start; }
.incl__pane { height: min(58vh, 560px); width: calc(100% - 14px); }
.incl__pane .frame__clip { position: relative; height: 100%; background: var(--yew-deep); }
.incl__img { position: absolute; inset: 0; z-index: 0; }
.incl__img.was-on { z-index: 1; }
.incl__img.is-on { z-index: 2; animation: incl-in 1.1s var(--ease) both; }
@keyframes incl-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
.rm .incl__img.is-on, .no-motion .incl__img.is-on { animation: none; }
.incl__img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.6s var(--ease); }
.incl__img.is-on img { transform: none; }
.incl__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(205,212,192,.25); }
.incl__item { position: relative; display: grid; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid rgba(205,212,192,.25); padding: 16px 0 16px 0; cursor: pointer; color: var(--linen); transition: padding-left .6s var(--ease); }
.incl__t { font-family: var(--serif); font-size: clamp(1.25rem, 1.6vw, 1.6rem); line-height: 1.3; }
.incl__d { display: grid; grid-template-rows: 0fr; opacity: 0; color: var(--sage-light); font-size: 1rem; line-height: 1.55; transition: grid-template-rows .6s var(--ease), opacity .5s var(--ease), margin .6s var(--ease); }
.incl__item.is-on { padding-left: 18px; }
.incl__item.is-on .incl__d { grid-template-rows: 1fr; opacity: 1; margin-top: 6px; }
.incl__item::before { content: ""; position: absolute; left: 0; top: 22px; width: 6px; height: 6px; border-radius: 50%; background: var(--robin); transform: scale(0); transition: transform .5s var(--ease); }
.incl__item.is-on::before { transform: scale(1); }
.incl__item:hover .incl__t { color: #fff; }
.incl__bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px; overflow: clip; }
.incl__bar span { display: block; height: 100%; background: var(--sage); transform: scaleX(0); transform-origin: left; }
.no-js .incl__d, .no-motion .incl__d { grid-template-rows: 1fr; opacity: 1; margin-top: 4px; }
@media (max-width: 900px) {
  .incl__head, .incl__grid { grid-template-columns: 1fr; }
  .incl__pane { height: min(52vh, 440px); }
}

/* ---------------- mini planner ---------------- */
.teaser__grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(40px, 6vw, 110px); align-items: center; }
.teaser .h2 { margin-bottom: 20px; }
.teaser .lede { margin-bottom: 30px; }
.mini__card { position: relative; background: #FBF8F2; border-radius: var(--r); padding: clamp(24px, 3vw, 40px); box-shadow: 0 0 0 1px var(--rule), 0 40px 80px -50px rgba(58,50,42,.6); }
.mini__card::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--rule); border-radius: 24px 0 0 0; pointer-events: none; }
.mini__top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.mini__title { font-family: var(--serif); font-size: 1.5rem; margin: 0; }
.mini__total { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--bronze-deep); }
.mini__total.is-over { color: #93391F; }
.mini__bar { position: relative; height: 16px; background: var(--vellum); margin-bottom: 22px; }
.mini__fill { position: absolute; left: 0; top: 0; bottom: 0; display: flex; width: 100%; transform-origin: left; }
.mini__seg { height: 100%; flex: none; border-right: 2px solid #FBF8F2; transition: width .7s var(--ease); }
.mini__seg--music { background: var(--yew); }
.mini__seg--words { background: var(--bronze); }
.mini__seg--quiet { background: var(--sage); }
.mini__limit { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--robin); left: calc(100% * 45 / 60); }
.mini__parts { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.mini__part { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 4px; background: none; border: 0; border-bottom: 1px solid var(--rule); text-align: left; cursor: pointer; font-size: 1rem; transition: opacity .4s var(--ease); }
.mini__part:not(.is-on) { opacity: .55; }
.mini__tick { width: 18px; height: 18px; flex: none; border: 1.5px solid var(--umber-soft); position: relative; }
.mini__part.is-on .mini__tick { background: var(--yew); border-color: var(--yew); }
.mini__part.is-on .mini__tick::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid var(--linen); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.mini__part--words.is-on .mini__tick { background: var(--bronze); border-color: var(--bronze); }
.mini__part--quiet.is-on .mini__tick { background: var(--sage); border-color: var(--sage); }
.mini__name { flex: 1; }
.mini__min { font-variant-numeric: tabular-nums; color: var(--umber-soft); font-size: .95rem; }
.mini__note { margin: 0; font-size: .95rem; color: var(--umber-soft); }
@media (max-width: 1000px) { .teaser__grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .mini__parts { grid-template-columns: 1fr; } }

/* ---------------- about ---------------- */
.about { overflow: clip; }
.about__feather { position: absolute; right: 4%; top: 12%; width: clamp(160px, 18vw, 280px); opacity: .28; transform: rotate(-24deg); pointer-events: none; }
.about__grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(40px, 6vw, 110px); align-items: center; }
.about__pic { aspect-ratio: 4 / 5; width: min(100% - 14px, calc(var(--media-cap) * .8)); }
.about .h2 { margin-bottom: 22px; }
.about__marks { display: flex; align-items: center; gap: 20px; margin: 6px 0 12px; padding: 18px 0; border-block: 1px solid var(--rule); }
.about__marks img { width: 92px; height: 92px; flex: none; }
.about__marks p { margin: 0; font-size: 1rem; color: var(--umber-soft); }
@media (max-width: 900px) { .about__grid { grid-template-columns: 1fr; } }

/* ---------------- funeral directors ---------------- */
.fd { position: relative; min-height: min(84svh, 820px); display: flex; align-items: center; overflow: clip; isolation: isolate; padding-block: clamp(64px, 8vw, 110px); }
.fd__media { position: absolute; inset: 0; z-index: -1; }
.fd__img { position: absolute; inset: -10% 0; }
.fd__img img { width: 100%; height: 100%; object-fit: cover; }
.fd__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(36,48,38,.05), rgba(36,48,38,.45)); }
.fd__wrap { display: flex; justify-content: flex-end; }
.fd__card { position: relative; width: min(640px, 100%); background: var(--linen); border-radius: var(--r); padding: clamp(30px, 4vw, 56px); box-shadow: 0 50px 90px -50px rgba(20,26,20,.7); }
.fd__card::before { content: ""; position: absolute; inset: 10px; border: 1px solid var(--rule); border-radius: 22px 0 0 0; pointer-events: none; }
.fd__card .h2 { margin-bottom: 18px; }
.fd__card .lede { margin-bottom: 28px; }
@media (max-width: 700px) { .fd { min-height: 0; padding-top: 44vh; } }
.step__txt p > span, .incl__d > span { display: block; min-height: 0; }
.incl__d { overflow: clip; }
