:root {
  --navy: #15273D; --maroon: #431615; --tan: #C1AA8F; --cream: #F2ECE7; --white: #FFFFFF;
  --bar: 56px; --ring: 12px; --gut: 16px; --lift: 0px;
  --ease-in: cubic-bezier(.55, 0, .9, .45);
  --ease-out: cubic-bezier(.1, .55, .45, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--navy); font: 400 18px/1.55 "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, p, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
img { display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
b { font-weight: 800; }
:focus-visible { outline: 3px solid var(--maroon); outline-offset: 3px; border-radius: 6px; }

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 30; height: var(--bar);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 max(var(--gut), (100% - 1248px) / 2); background: var(--cream); border-bottom: 1px solid rgba(193, 170, 143, .7);
}
.brand { display: block; border-radius: 4px; max-height: 52px; overflow: hidden; font-size: 14px; font-weight: 800; }
.bar img { width: 150px; height: auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 22px;
  background: var(--navy); color: var(--cream); border: 2px solid var(--navy); border-radius: 10px;
  font-weight: 800; font-size: 17px; letter-spacing: .01em; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--maroon); border-color: var(--maroon); }
.btn-line { background: transparent; color: var(--navy); }
.btn-line:hover { background: var(--navy); border-color: var(--navy); color: var(--cream); }
.btn-sm { min-height: 40px; padding: 0 20px; font-size: 16px; }

/* First screen */
.story { --pic-max: 30rem; --pic: min(100vw - 2 * var(--gut), var(--pic-max)); --col: var(--pic); padding: 0 var(--gut); }
.intro { width: min(100%, var(--col)); margin: 0 auto; padding: 12px 0 12px; }
.ta { font: 600 18px/1.3 "Anek Tamil", "Nunito Sans", sans-serif; color: var(--maroon); margin-bottom: 4px; }
h1 { font-weight: 800; font-size: clamp(26px, calc(var(--col) * .0916), 68px); line-height: 1.06; letter-spacing: -.024em; max-width: 17ch; text-wrap: balance; }
.lead { margin-top: 8px; font-size: clamp(17px, calc(var(--col) * .0365), 21px); line-height: 1.45; max-width: 32ch; }
.facts { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--tan); display: grid; row-gap: 1px; font-size: clamp(16px, calc(var(--col) * .0313), 18px); line-height: 1.45; }
.facts li { display: grid; grid-template-columns: 18px 1fr; column-gap: 10px; align-items: center; }
.facts img { width: 18px; height: 18px; }
.ctas { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 389px) { .ctas .btn { padding: 0 16px; } }
@media (max-width: 359px) {
  .ctas { flex-direction: column; }
  .ctas .btn { width: 100%; }
}

/* Pictures */
.scene { position: relative; width: var(--pic); aspect-ratio: 1; margin: 0 auto; border-radius: 18px; background: var(--tan); }
.frame { position: absolute; inset: 0; overflow: clip; border-radius: 18px; }
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; }
.mark { position: absolute; left: 70.55%; top: 37%; width: 16.39%; height: 25%; min-height: 64px; }
.mark svg { display: block; width: 100%; height: 100%; overflow: visible; }

.cue {
  width: min(100%, var(--col)); margin: 0 auto; padding: 6px 0 0;
  display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 800; color: var(--maroon);
}
.cue::after { content: ""; width: 9px; height: 9px; margin-top: -5px; border: solid var(--maroon); border-width: 0 2px 2px 0; rotate: 45deg; }

/* Beats (plain page) */
.s1 { margin-top: 48px; }
.scene + .beat { padding: 12px 0 8px; }
.beat + .scene { margin-top: 48px; }
.words { width: min(100%, var(--col)); margin: 0 auto; }
.card { background: var(--white); border: 1px solid rgba(193, 170, 143, .75); border-radius: 16px; padding: 18px 20px 20px; }
.card h2::before { content: ""; display: block; width: 32px; height: 3px; border-radius: 2px; background: var(--tan); margin-bottom: 12px; }
.words h2 { font-size: clamp(24px, min(calc(var(--col) * .0763), 5.2svh), 46px); font-weight: 800; line-height: 1.1; letter-spacing: -.016em; color: var(--maroon); text-wrap: balance; }
.words p { margin-top: 8px; font-size: clamp(17px, calc(var(--col) * .0501), 20px); line-height: 1.48; }

/* Tagline */
.tagline { min-height: 64svh; display: grid; place-items: center; padding: 64px var(--gut); text-align: center; }
.tagline p { font-weight: 800; font-size: clamp(40px, 11.5vw, 108px); line-height: 1.02; letter-spacing: -.03em; color: var(--navy); max-width: 11ch; text-wrap: balance; }
.stop { display: inline-block; color: var(--maroon); transform-origin: 30% 80%; }

/* Good to know */
.wrap { width: min(1248px, 100% - 2 * var(--gut)); margin: 0 auto; }
.know .wrap { padding: 56px 0; border-top: 1px solid var(--tan); }
.know h2, .visit h2, .foot h2 { font-size: clamp(26px, 6.6vw, 40px); font-weight: 800; line-height: 1.1; letter-spacing: -.016em; color: var(--maroon); margin-bottom: 24px; }
.list li { display: grid; grid-template-columns: 36px 1fr; gap: 16px; align-items: start; padding: 18px 0; border-top: 1px solid rgba(193, 170, 143, .6); }
.list li:last-child { border-bottom: 1px solid rgba(193, 170, 143, .6); }
.list img { width: 36px; height: 36px; }
.list p { max-width: 52ch; }

/* Visit: the close, on navy */
.visit { background: var(--navy); color: var(--cream); }
.visit .wrap { padding: 56px 0 64px; }
.visit h2 { color: var(--cream); }
.visit :focus-visible { outline-color: var(--cream); }
.visit-pic { --pic: 100%; width: 100%; max-width: 30rem; margin: 0; background: rgba(193, 170, 143, .35); }
.visit-line { font-size: clamp(21px, 5.4vw, 28px); font-weight: 800; line-height: 1.25; margin: 28px 0 8px; max-width: 24ch; }
.details li { display: grid; grid-template-columns: 28px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid rgba(242, 236, 231, .22); }
.details img { width: 26px; height: 26px; margin-top: 1px; filter: brightness(0) invert(1); opacity: .92; }
.phones a { display: inline-block; padding: 4px 0; font-weight: 800; }
.visit .ctas { margin-top: 20px; }
.visit .btn { background: var(--cream); color: var(--navy); border-color: var(--cream); }
.visit .btn:hover { background: var(--white); border-color: var(--white); }
.visit .btn-line { background: transparent; color: var(--cream); border-color: var(--cream); }
.visit .btn-line:hover { background: var(--cream); color: var(--navy); }

/* Sister concerns and footer, on cream */
.foot .wrap { padding: 48px 0 40px; }
.foot h2 { color: var(--navy); margin-bottom: 14px; font-size: clamp(22px, 5.4vw, 28px); }
.sister li + li { margin-top: 4px; }
.sister a { display: inline-block; padding: 6px 0; font-weight: 800; }
.fine { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--tan); font-size: 15px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; }

/* Tablets and wide small windows: a bigger picture, never taller than the screen; the words keep their width when the picture is limited by height. */
@media (min-width: 600px) {
  .story {
    --pic-max: 36rem;
    --pic: min(100vw - 2 * var(--gut), var(--pic-max), max(100svh - var(--bar) - 32px, 16rem));
    --col: max(var(--pic), 30rem);
  }
}

/* Desktop, plain page */
@media (min-width: 1000px) {
  :root { --bar: 64px; --gut: 48px; --gap: 72px; }
  html { scroll-padding-top: 88px; }
  .brand { max-height: 60px; }
  .bar img { width: 180px; }
  .story {
    --pic: min(34rem, 44vw);
    --col: calc(min(1344px, 100vw) - 2 * var(--gut) - var(--gap) - var(--pic));   /* the words' column beside the picture */
    display: grid; grid-template-columns: minmax(0, 1fr) var(--pic); column-gap: var(--gap); row-gap: 72px;
    grid-auto-flow: row dense; align-items: center; width: min(1344px, 100%); margin: 0 auto; padding: 48px var(--gut) 0;
  }
  .open { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; grid-template-rows: 1fr auto; }
  .intro { grid-column: 1; grid-row: 1; width: 100%; align-self: center; padding: 0; }
  .s0 { grid-column: 2; grid-row: 1 / 3; }
  .cue { grid-column: 1; grid-row: 2; width: 100%; }
  /* First-screen type follows the words' column and the screen height, so it fits a short laptop window and a large monitor alike. */
  h1 { font-size: clamp(34px, min(calc(var(--col) * .149), 7.6svh), 68px); }
  .ta { font-size: clamp(18px, 2.5svh, 22px); margin-bottom: clamp(6px, 1.6svh, 14px); }
  .lead { font-size: clamp(17px, 2.35svh, 21px); margin-top: clamp(8px, 2.2svh, 20px); }
  .facts { margin-top: clamp(12px, 2.9svh, 26px); padding-top: clamp(9px, 2svh, 18px); font-size: clamp(16px, 2svh, 18px); row-gap: 2px; }
  .ctas { margin-top: clamp(14px, 3.1svh, 28px); gap: 12px; }
  .story .scene { grid-column: 2; margin: 0; }
  .story > .beat { grid-column: 1; padding: 0; }
  .story .scene + .beat, .story > .beat + .scene, .s1 { margin-top: 0; padding: 0; }
  .words { width: 100%; max-width: 460px; }
  .words h2 { font-size: clamp(26px, min(calc(var(--col) * .1), 6.2svh), 46px); }
  .card { padding: 30px 32px 34px; }
  .card h2::before { margin-bottom: 18px; width: 40px; }
  .words p { margin-top: 14px; }
  .know .wrap { padding: 96px 0; }
  .visit .wrap { padding: 96px 0; }
  .list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; }
  .list li:nth-last-child(2) { border-bottom: 1px solid rgba(193, 170, 143, .6); }
  .visit-grid { display: grid; grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); gap: 64px; align-items: center; }
  .visit-line { margin-top: 0; }
  .fine { font-size: 16px; }
}
@media (min-width: 1000px) and (max-width: 1199px) { :root { --gut: 32px; --gap: 40px; } }

/* Motion: the stage. One sticky frame; one thing changes at a time. */
@keyframes out { from { opacity: 1; } to { opacity: 0; } }
@keyframes in { from { opacity: 0; } to { opacity: 1; } }
@keyframes leave-left { from { opacity: 1; translate: 0 0; } to { opacity: 0; translate: -8% 0; } }
@keyframes arrive-right { from { translate: 8% 0; } to { translate: 0 0; } }
@keyframes walk-on { from { translate: 0 0; } to { translate: 6% 0; } }
@keyframes to-counter { from { translate: 0 0; } to { translate: 59.7% -4.2%; } }
@keyframes ahead { from { opacity: 1; translate: 0 0; } to { opacity: 0; translate: 46px 0; } }
@keyframes settle { from { opacity: 0; scale: 2.4; } to { opacity: 1; scale: 1; } }

@supports (animation-timeline: view()) and (timeline-scope: --x) and (animation-range: entry 0% cover 50%) {
  @media (prefers-reduced-motion: no-preference) and (min-height: 560px) {
    .story {
      timeline-scope: --b1, --b2, --b3, --b4, --b5;
      --pic: min(100vw - 2 * var(--gut), var(--pic-max), 100svh - 300px);
      display: grid; grid-template-columns: minmax(0, 1fr);
      grid-template-rows: auto calc(var(--pic) + 2 * var(--ring)) auto repeat(5, auto);
    }
    .open { display: contents; }
    .intro { grid-row: 1; grid-column: 1; }
    .cue { grid-row: 3; grid-column: 1; width: min(100%, var(--pic)); }   /* no wider than the picture it passes behind */
    .story .scene {
      grid-row: 2 / 9; grid-column: 1; align-self: start; justify-self: center;
      position: sticky; top: calc(var(--bar) + var(--ring) + var(--lift)); margin: var(--ring) auto 0;
      background: none; pointer-events: none;
    }
    /* A cream backdrop from the bar down to the ring under the picture, so passing words never show around it. */
    .story .scene::before, .story .scene::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
    .story .scene::before {
      inset: calc(-1 * (var(--ring) + var(--lift))) calc((var(--pic) - var(--col)) / 2 - var(--ring) - 4px) calc(-1 * var(--ring));   /* as wide as the words */
      background: var(--cream);
    }
    .story .scene::after { inset: 0; border-radius: 18px; background: var(--tan); }
    .story .s0::before, .story .s0::after { content: none; }
    .story .s0 { z-index: 6; }
    .s1 { z-index: 1; } .s2 { z-index: 2; } .s3 { z-index: 3; } .s4 { z-index: 4; } .s5 { z-index: 5; }
    .story > .beat {
      grid-column: 1; min-height: 100svh;
      padding: calc(var(--bar) + 2 * var(--ring) + var(--lift) + var(--pic)) 0 0;
    }
    [data-beat="1"] { grid-row: 4; view-timeline-name: --b1; }
    [data-beat="2"] { grid-row: 5; view-timeline-name: --b2; }
    [data-beat="3"] { grid-row: 6; view-timeline-name: --b3; }
    [data-beat="4"] { grid-row: 7; view-timeline-name: --b4; }
    [data-beat="5"] { grid-row: 8; view-timeline-name: --b5; }

    /* Walk in: the approach slides away to the left as the counter arrives from the right; the mark goes forward with the father. */
    .s0 .frame > img {
      animation-name: leave-left; animation-timing-function: var(--ease-in); animation-fill-mode: both;
      animation-timeline: --b1; animation-range: entry 42% entry 60%;
    }
    .s0 .mark {
      animation-name: to-counter; animation-timing-function: cubic-bezier(.45, 0, .25, 1); animation-fill-mode: both;
      animation-timeline: --b1; animation-range: entry 42% entry 60%;
    }
    .s1 {
      animation-name: in, out; animation-timing-function: var(--ease-out), linear; animation-fill-mode: both, forwards;
      animation-timeline: --b1, --b2; animation-range: entry 42% entry 60%, entry 61% entry 62%;
    }
    .s1 img, .s5 img {
      animation-name: arrive-right; animation-timing-function: var(--ease-out); animation-fill-mode: both;
      animation-range: entry 42% entry 60%;
    }
    .s1 img { animation-timeline: --b1; }
    .s5 img { animation-timeline: --b5; }
    /* At the counter nothing slides: only the pharmacist changes. The new frame fades in over the old, then the old is set aside. */
    .s2, .s3, .s4 {
      animation-name: in, out; animation-timing-function: var(--ease-out), linear; animation-fill-mode: both, forwards;
      animation-range: entry 42% entry 60%, entry 61% entry 62%;
    }
    .s2 { animation-timeline: --b2, --b3; }
    .s3 { animation-timeline: --b3, --b4; }
    .s4 { animation-timeline: --b4, --b5; }
    /* Walk on: the counter slides away to the left as the street arrives from the right. */
    .s4 img {
      animation-name: leave-left; animation-timing-function: var(--ease-in); animation-fill-mode: forwards;
      animation-timeline: --b5; animation-range: entry 42% entry 60%;
    }
    .s5 {
      animation-name: in; animation-timing-function: var(--ease-out); animation-fill-mode: both;
      animation-timeline: --b5; animation-range: entry 42% entry 60%;
    }
    /* ...and the two keep walking, then stop. */
    .s5 [data-layer="pair-walk-bag"] {
      animation-name: arrive-right, walk-on; animation-timing-function: var(--ease-out), cubic-bezier(.25, .2, .45, 1);
      animation-fill-mode: both, forwards; animation-timeline: --b5, --b5;
      animation-range: entry 42% entry 60%, entry 62% entry 96%;
    }
    /* Once her action is fully shown, one piece of the question goes. */
    #m-s1, #m-s2, #m-s3, #m-s4 {
      animation-name: out; animation-timing-function: var(--ease-in); animation-fill-mode: both;
      animation-range: entry 64% entry 88%;
    }
    #m-s1 { animation-timeline: --b1; }
    #m-s2 { animation-timeline: --b2; }
    #m-s3 { animation-timeline: --b3; }
    #m-s4 { animation-timeline: --b4; }
    #m-d {
      animation-name: ahead; animation-timing-function: var(--ease-in); animation-fill-mode: both;
      animation-timeline: --b5; animation-range: entry 64% entry 90%;
    }
    /* The full stop arrives and settles. */
    .tagline { view-timeline-name: --tg; }
    .stop {
      animation-name: settle; animation-timing-function: var(--ease-out); animation-fill-mode: both;
      animation-timeline: --tg; animation-range: entry 35% cover 46%;
    }

    /* Tall phones: centre the picture and its card in the space under the bar. */
    @media (min-height: 740px) {
      .story { --lift: max(0px, (100svh - var(--bar) - var(--pic) - 230px) / 2 - var(--ring)); }
    }

    @media (min-width: 1000px) {
      .story {
        --lift: 0px; --cue: clamp(3rem, 8svh, 5rem);
        --pic: min(100svh - var(--bar) - 64px, 50vw, 45rem);
        grid-template-columns: minmax(0, 1fr) var(--pic); row-gap: 0;
        grid-template-rows: minmax(calc(var(--pic) - var(--cue)), auto) var(--cue) repeat(5, auto);
        padding-top: calc((100svh - var(--bar) - var(--pic)) / 2);
      }
      .intro { grid-row: 1; align-self: center; }
      .cue { grid-row: 2; align-self: center; padding: 0; width: 100%; }
      .story .scene {
        grid-column: 2; grid-row: 1 / 8; margin: 0;
        top: calc(var(--bar) + (100svh - var(--bar) - var(--pic)) / 2);
      }
      .story .scene::before { content: none; }
      .story > .beat { min-height: 100svh; padding: 0; display: flex; align-items: center; }
      [data-beat="1"] { grid-row: 3; } [data-beat="2"] { grid-row: 4; } [data-beat="3"] { grid-row: 5; }
      [data-beat="4"] { grid-row: 6; } [data-beat="5"] { grid-row: 7; }
    }
  }
}
