/* In-Home Personal Care: the signature section, "A morning, step by step".

   One arch card stays beside the text while the five moments scroll past. In the card is a
   window: the curtains open as the card arrives ("opens the curtains and says good morning"),
   and the sun climbs behind the hills as the reader moves from waking to breakfast. Under the
   window is the rail: five numbered stops that are plain links to the five moments.

   Everything the window does is driven by three numbers that pages/personal.js writes on
   .morn__side while the section is on screen:
     --c   0 to 1   how far the curtains are open
     --s   0 to 1   how far the morning has come (the sun, the sky, the light on the sill)
     --t   0 to 1   how much of the rail is filled
   Without the script, and with reduced motion, the values below stand: curtains open, full
   morning light, and the five moments are ordinary text beside a still picture.

   Only transform and opacity change. The card's own entrance is a clip-path wipe, started by
   an IntersectionObserver in the script, never by a timer.

   Sticky offsets and the card's height are worked out from var(--header-h), never a typed
   number, so the card clears whatever is pinned at the top of the window. */

.morn { z-index: 2; }
.morn__grid { --card-h: clamp(27rem, calc(100vh - var(--header-h) - 5.5rem), 37rem); display: grid; grid-template-columns: minmax(24.5rem, 4.5fr) minmax(0, 6.5fr); gap: clamp(2rem, 7vw, 8.5rem); align-items: start; }

/* ---------- the card that stays ---------- */
.morn__side { --c: 1; --s: .9; --t: 0; position: sticky; top: calc(var(--header-h) + 1.5rem); justify-self: center; width: min(100%, max(calc(var(--card-h) * .74), 24.5rem)); }
/* morning light spills from the window onto the page as the sun comes up */
.morn__side::before { content: ""; position: absolute; inset: -16% -34% -10%; z-index: -1; background: radial-gradient(closest-side, rgba(232, 181, 82, .3), rgba(232, 181, 82, 0)); opacity: var(--s); pointer-events: none; }
.morn__card { position: relative; display: flex; flex-direction: column; height: var(--card-h); padding: .95rem .95rem .65rem; border-radius: 999px 999px 1.75rem 1.75rem; background: radial-gradient(90% 62% at 50% 38%, #5C2567 0%, var(--aub-2) 52%, var(--aub) 100%); box-shadow: 0 40px 60px -40px rgba(43, 16, 48, .7); color: var(--on-dark); }

/* ---------- the window ---------- */
.mw { --sun: 30%; position: relative; flex: 1 1 auto; min-height: 0; border-radius: 999px 999px .8rem .8rem; overflow: hidden; isolation: isolate; background: linear-gradient(180deg, #14051A 0%, #24092B 52%, #3A1242 100%); }
.mw::after { content: ""; position: absolute; inset: 0; z-index: 9; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(232, 181, 82, .78), inset 0 0 46px rgba(20, 5, 26, .32); pointer-events: none; }
.mw > * { position: absolute; }
.mw__sky { inset: 0; z-index: 1; }
.mw__sky--dawn { background: linear-gradient(180deg, #2A0E30 0%, #4E1A58 28%, #8A3A63 54%, #D2804A 74%, #E8B552 90%); opacity: clamp(0, calc(.34 + var(--s) * 2.2), 1); }
.mw__sky--day { background: linear-gradient(180deg, #A97BA8 0%, #D9B4C4 32%, #F6DDB4 62%, #FBF0DC 100%); opacity: clamp(0, calc((var(--s) - .5) * 2.3), 1); }
.mw__stars { inset: 0 0 38% 0; z-index: 1; background:
    radial-gradient(circle at 18% 34%, rgba(255, 246, 220, .95) 0 1.2px, transparent 1.9px),
    radial-gradient(circle at 37% 15%, rgba(255, 246, 220, .8) 0 1px, transparent 1.7px),
    radial-gradient(circle at 62% 27%, rgba(255, 246, 220, .9) 0 1.3px, transparent 2px),
    radial-gradient(circle at 79% 46%, rgba(255, 246, 220, .7) 0 1px, transparent 1.7px),
    radial-gradient(circle at 28% 62%, rgba(255, 246, 220, .7) 0 1px, transparent 1.7px),
    radial-gradient(circle at 52% 52%, rgba(255, 246, 220, .6) 0 .9px, transparent 1.6px),
    radial-gradient(circle at 70% 74%, rgba(255, 246, 220, .75) 0 1.1px, transparent 1.8px);
  opacity: clamp(0, calc(1 - var(--s) * 3.4), 1); }
.mw__sun { --from: 64%; --to: -176%; left: 30%; top: 72%; z-index: 2; width: var(--sun); aspect-ratio: 1; margin: calc(var(--sun) / -2) 0 0 calc(var(--sun) / -2); border-radius: 50%; background: radial-gradient(circle at 50% 46%, #FFFAEB 0%, #FBE3A4 44%, #E8B552 76%, #C89030 100%); transform: translate(calc((var(--s) - .5) * 30%), calc(var(--from) + var(--s) * (var(--to) - var(--from)))); will-change: transform; }
.mw__sun::before { content: ""; position: absolute; inset: -78%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 233, 170, .6), rgba(255, 233, 170, 0)); }
.mw__hills { left: 0; right: 0; bottom: 8%; z-index: 3; width: 100%; height: 27%; }
.mw__hill--a { fill: #4A1D55; }
.mw__hill--b { fill: #34103B; }
.mw__hill--c { fill: #230A29; }
.mw__haze { left: 0; right: 0; bottom: 8%; z-index: 3; height: 36%; background: linear-gradient(180deg, rgba(251, 240, 220, 0) 0%, rgba(251, 240, 220, .46) 100%); opacity: clamp(0, calc((var(--s) - .3) * 1.3), .85); }
.mw__bars { inset: 0; z-index: 4; }
.mw__bars::before, .mw__bars::after { content: ""; position: absolute; background: #1C0920; }
.mw__bars::before { left: calc(50% - 1.5px); top: 0; bottom: 8%; width: 3px; box-shadow: 1px 0 0 rgba(232, 181, 82, .32); }
.mw__bars::after { left: 0; right: 0; top: 47%; height: 3px; box-shadow: 0 1px 0 rgba(232, 181, 82, .32); }
.mw__flowers { inset: 0; z-index: 5; }
.mw__stem { position: absolute; bottom: 3%; transform-origin: 50% 100%; }
.mw__stem img { height: 100%; width: auto; max-width: none; filter: drop-shadow(0 10px 12px rgba(18, 5, 22, .45)); }
.mw__stem--a { left: 55%; height: 63%; transform: rotate(8deg); }
.mw__stem--b { left: 69%; height: 49%; transform: rotate(19deg); }
.mw__sill { left: 0; right: 0; bottom: 0; z-index: 6; height: 8%; background: linear-gradient(180deg, #5C2567 0%, #34103B 100%); box-shadow: 0 -1px 0 rgba(232, 181, 82, .7), 0 -12px 18px rgba(20, 5, 26, .3); }
.mw__shade { inset: 0; z-index: 6; background: linear-gradient(180deg, rgba(20, 5, 26, 0) 26%, rgba(20, 5, 26, .6) 84%); opacity: clamp(0, calc(1 - var(--s) * 1.3), 1); }
.mw__curtain { --open: .77; top: 0; bottom: 0; z-index: 7; width: 50.5%; transform: scaleX(calc(1 - var(--c) * var(--open))); will-change: transform; }
.mw__curtain--l { left: 0; transform-origin: 0 50%; box-shadow: inset -2px 0 0 rgba(232, 181, 82, .6); background:
    linear-gradient(90deg, rgba(20, 5, 26, 0) 0%, rgba(20, 5, 26, .3) 100%),
    repeating-linear-gradient(90deg, rgba(255, 246, 220, 0) 0%, rgba(255, 246, 220, .1) 7%, rgba(20, 5, 26, .28) 15%, rgba(255, 246, 220, 0) 22%),
    linear-gradient(180deg, #6A2E75 0%, #4E1A58 45%, #34103B 100%); }
.mw__curtain--r { right: 0; transform-origin: 100% 50%; box-shadow: inset 2px 0 0 rgba(232, 181, 82, .6); background:
    linear-gradient(270deg, rgba(20, 5, 26, 0) 0%, rgba(20, 5, 26, .3) 100%),
    repeating-linear-gradient(270deg, rgba(255, 246, 220, 0) 0%, rgba(255, 246, 220, .1) 7%, rgba(20, 5, 26, .28) 15%, rgba(255, 246, 220, 0) 22%),
    linear-gradient(180deg, #6A2E75 0%, #4E1A58 45%, #34103B 100%); }

/* ---------- the rail: five stops, each a link to its moment ---------- */
.morn__rail { position: relative; flex: none; margin-top: .75rem; }
.morn__rail ol { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.morn__track { position: absolute; left: 10%; right: 10%; top: calc(1.375rem - 1px); height: 2px; border-radius: 2px; background: rgba(251, 244, 234, .2); }
.morn__track i { position: absolute; inset: 0; border-radius: inherit; background: var(--gold-light); transform-origin: 0 50%; transform: scaleX(var(--t)); }
.morn__dot { display: flex; flex-direction: column; align-items: center; gap: .32rem; min-height: 4.4rem; padding-bottom: .15rem; border-radius: .9rem; color: var(--cream); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.morn__dot b { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid rgba(232, 181, 82, .75); border-radius: 50%; background: var(--aub-2); font-family: var(--sans); font-size: 1.125rem; font-weight: 500; line-height: 1; color: var(--cream); transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease, transform 160ms var(--ease-out); }
.morn__dot span { font-size: .9375rem; font-weight: 500; line-height: 1.2; white-space: nowrap; color: rgba(251, 244, 234, .86); transition: color 220ms ease; }
.morn__dot.is-past b { background: #5C2567; border-color: var(--gold-light); }
.morn__dot[aria-current] b { background: var(--gold-light); border-color: var(--gold-light); color: #1D0A21; }
.morn__dot[aria-current] span { color: var(--gold-light); }
.morn__dot:active b { transform: scale(.94); }
.cream .morn__dot:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) {
  .morn__dot:not([aria-current]):hover b { border-color: var(--gold-light); background: #5C2567; }
  .morn__dot:hover span { color: var(--cream); }
}

/* ---------- the seal: the animated icon of the moment on screen ---------- */
.morn__seal { position: absolute; right: -2.2rem; top: 16%; z-index: 3; display: grid; place-items: center; width: 6.75rem; height: 6.75rem; border-radius: 50%; background: radial-gradient(circle at 50% 34%, #5C2567 0%, var(--aub-2) 72%); box-shadow: 0 0 0 1px rgba(232, 181, 82, .8), 0 0 0 .42rem var(--cream), 0 26px 30px -12px rgba(43, 16, 48, .55); pointer-events: none; }
.morn__seal .lottie { grid-area: 1 / 1; width: 64%; height: 64%; opacity: 0; transform: scale(.88); transition: opacity 240ms ease, transform 420ms var(--ease-out); }
.morn__seal .lottie.is-on { opacity: 1; transform: none; }
.no-js .morn__seal { display: none; }

/* ---------- the five moments ---------- */
.morn__step { display: grid; grid-template-columns: clamp(4.25rem, 7vw, 6.75rem) minmax(0, 1fr); column-gap: clamp(.75rem, 2vw, 2rem); align-content: start; padding: clamp(2.25rem, 3.6vw, 3.25rem) 0 clamp(2.5rem, 4vw, 3.75rem); border-top: 1px solid rgba(200, 144, 48, .6); scroll-margin-top: 1.25rem; }
html.rv .morn__step.rv-bt { --rv-rule-c: rgba(200, 144, 48, .6); }
.morn__n { grid-row: 1 / span 2; font-family: var(--sans); font-weight: 300; font-size: clamp(4rem, 6.6vw, 6.5rem); line-height: .8; letter-spacing: -.035em; font-variant-numeric: lining-nums; color: var(--gold-deep); transition: color 320ms ease; }
.morn__step h3 { grid-column: 2; font-size: clamp(1.75rem, 2.7vw, 2.375rem); border-radius: 4px; }
.morn__step h3:focus { outline: none; }
.morn__step h3:focus-visible { outline: 3px solid var(--purple); outline-offset: 6px; }
.morn__step p { grid-column: 2; max-width: 35rem; margin-top: .85rem; font-size: clamp(1.1875rem, .3vw + 1.12rem, 1.25rem); line-height: 1.65; }
.morn__step.is-on .morn__n { color: var(--purple); }
/* the last moment is given room, so the card is still whole beside it while it is read */
@media (min-width: 1024px) { .morn__step:last-child { min-height: calc(var(--card-h) + var(--header-h) + 3.5rem - 34vh); } }

/* ---------- the card's own entrance (the script adds .morn--live, then .is-in when the card is in view) ---------- */
.morn--live .morn__card { clip-path: inset(100% -4rem -4rem -4rem); }
.morn--live .morn__card.is-in { clip-path: inset(-4rem -4rem -4rem -4rem); transition: clip-path 1150ms var(--rv-ease-soft); }
.morn--live .morn__seal { opacity: 0; transform: scale(.72); }
.morn--live .morn__card.is-in + .morn__seal { opacity: 1; transform: none; transition: opacity 420ms ease 520ms, transform 720ms var(--rv-ease-settle) 520ms; }

/* ---------- tablets and phones: the card becomes a band under the header ---------- */
@media (max-width: 1023px) {
  .morn__grid { display: block; }
  .morn__side { position: sticky; top: var(--header-h); z-index: 6; justify-self: stretch; width: auto; margin: 0 calc(-1 * var(--gutter)) 1.25rem; }
  .morn__side::before { content: none; }
  .morn__card { height: auto; padding: .55rem .6rem .3rem; border-radius: 0 0 1.5rem 1.5rem; box-shadow: 0 24px 30px -24px rgba(43, 16, 48, .8); }
  .mw { --mw-h: clamp(8.25rem, 21vh, 11rem); --sun: calc(var(--mw-h) * .36); flex: none; height: var(--mw-h); border-radius: .9rem; }
  .mw__sun { --from: 78%; --to: -112%; left: 30%; top: 74%; }
  .mw__bars::before { left: calc(33.3% - 1.5px); box-shadow: 1px 0 0 rgba(232, 181, 82, .32), calc(33.3vw - 1px) 0 0 #1C0920; }
  .mw__bars::after { display: none; }
  .mw__stem--a { left: auto; right: 4.6rem; height: 88%; transform: rotate(7deg); }
  .mw__stem--b { left: auto; right: 2.1rem; height: 70%; transform: rotate(18deg); }
  .mw__curtain { --open: .84; }
  .morn__rail { width: min(100%, 34rem); margin: .45rem auto 0; }
  .morn__dot { min-height: 4.1rem; }
  .morn__seal { right: auto; left: 1.25rem; top: 1.2rem; width: 4.25rem; height: 4.25rem; box-shadow: 0 0 0 1px rgba(232, 181, 82, .8), 0 12px 18px -8px rgba(20, 5, 26, .8); }
  .morn__step { grid-template-columns: 3.4rem minmax(0, 1fr); column-gap: .6rem; padding: 1.75rem 0 2rem; scroll-margin-top: 15rem; }
  .morn__n { font-size: 3.75rem; }
  /* without scripts the shared header can be several lines tall: the band then travels with the text */
  .no-js .morn__side { position: relative; top: auto; }
  .morn--live .morn__card { clip-path: inset(100% 0 -2rem 0); }
  .morn--live .morn__card.is-in { clip-path: inset(0 0 -2rem 0); }
}
@media (max-width: 479px) {
  .morn__rail { width: auto; margin-inline: -.6rem; }
  .morn__dot span { font-weight: 400; letter-spacing: -.015em; }
}
@media (max-width: 379px) {
  .morn__dot span { letter-spacing: -.03em; }
}

@media (prefers-reduced-motion: reduce) {
  .morn__dot b, .morn__dot span, .morn__n, .morn__seal .lottie { transition: none; }
}

/* ---------- this page's photograph in "Who it helps": closer on the two people ---------- */
#who-it-helps .arch > img { transform: scale(1.22); transform-origin: 62% 100%; }
