/* Homepage motion layer (index.html only), second edition for the 晴空診間 design.
   Concept: "a clear morning" — the page arrives like light coming up: the headline comes into
   focus, the marker stroke lands on 聽得懂, the portrait clears, the brush name is written
   top to bottom and the seal is stamped last. Further down, stitches are sewn under each
   title, numbers and cards settle, icons are drawn, and the wave edges keep a slow swell.

   Safety rules, enforced by scripts/validate-site.mjs:
   - Everything visual lives inside one screen + no-preference block, so reduced motion and
     print render the page exactly as the static design.
   - Content is only hidden through [data-home-state="armed"], which home-motion.js sets on
     elements that are still below the fold and removes on entry, print, focus or page exit.
   - The switch in the footer (html[data-home-motion="off"]) stops every animation here. */
:root {--home-motion-enabled:1}

/* The reading-progress bar and the motion switch are created by home-motion.js. */
[data-home-progress] {
  position:fixed;z-index:70;top:0;left:0;width:100%;height:3px;pointer-events:none;
  background:linear-gradient(90deg,#C9A24A,#F3E3B0);transform-origin:0 50%;
  transform:scaleX(var(--home-progress,0));
}
html[data-home-motion="off"] [data-home-progress] {display:none}
.home-motion-toggle {
  appearance:none;display:inline-flex;align-items:center;gap:8px;min-height:44px;margin-top:16px;
  padding:8px 16px;border:1px solid rgb(217 232 245 / 50%);border-radius:999px;
  background:transparent;color:inherit;font:inherit;font-size:.875rem;line-height:1.4;cursor:pointer;
}
.home-motion-toggle:hover {background:rgb(255 255 255 / 10%);border-color:rgb(243 227 176 / 80%)}
.home-motion-toggle:focus-visible {outline:3px solid #F3E3B0;outline-offset:3px}
.home-motion-toggle::before {
  content:"";width:10px;height:10px;border-radius:50%;background:#F3E3B0;
}
.home-motion-toggle[aria-checked="false"]::before {background:transparent;box-shadow:inset 0 0 0 2px rgb(217 232 245 / 70%)}
.home-motion-toggle[hidden] {display:none}
@media print {
  .home-motion-toggle, [data-home-progress] {display:none}
}

@media screen and (prefers-reduced-motion:no-preference) {
  body.brand-home {
    --home-ease-out:cubic-bezier(.22,1,.36,1);
    --home-ease-spring:cubic-bezier(.34,1.4,.64,1);
    --home-ease-inout:cubic-bezier(.65,0,.35,1);
  }

  /* ---------- Keyframes. Hidden starts live only here; every ending is the normal style. ---------- */
  @keyframes home-fade {from {opacity:0} to {opacity:1}}
  @keyframes home-rise {from {opacity:0;transform:translate3d(0,30px,0)} to {opacity:1;transform:none}}
  @keyframes home-drop {from {opacity:0;transform:translate3d(0,-14px,0)} to {opacity:1;transform:none}}
  @keyframes home-left {from {opacity:0;transform:translate3d(-44px,0,0)} to {opacity:1;transform:none}}
  @keyframes home-right {from {opacity:0;transform:translate3d(44px,0,0)} to {opacity:1;transform:none}}
  @keyframes home-row {from {opacity:0;transform:translate3d(-18px,0,0)} to {opacity:1;transform:none}}
  @keyframes home-card {from {opacity:0;transform:translate3d(0,38px,0) scale(.955)} to {opacity:1;transform:none}}
  @keyframes home-zoom {from {opacity:0;transform:scale(.93)} to {opacity:1;transform:none}}
  @keyframes home-pop {from {opacity:0;transform:scale(.6)} to {opacity:1;transform:none}}
  @keyframes home-number {from {opacity:0;transform:scale(.3) rotate(-18deg)} to {opacity:1;transform:none}}
  @keyframes home-wipe {from {opacity:1;clip-path:inset(0 100% 0 0)} to {opacity:1;clip-path:inset(0 0 0 0)}}
  @keyframes home-stitch {from {clip-path:inset(0 100% 0 0)} to {clip-path:inset(0 0 0 0)}}
  @keyframes home-brush {from {opacity:1;clip-path:inset(0 0 100% 0)} to {opacity:1;clip-path:inset(0 0 0 0)}}
  @keyframes home-stamp {
    0% {opacity:0;transform:scale(1.8) rotate(-16deg)}
    55% {opacity:1;transform:scale(.92) rotate(3deg)}
    100% {opacity:1;transform:none}
  }
  @keyframes home-ink {
    0% {opacity:0;transform:scale(1)}
    12% {opacity:.7}
    100% {opacity:0;transform:scale(2)}
  }
  @keyframes home-strip {from {transform:translate3d(0,-100%,0)} to {transform:none}}
  /* The largest elements start at 1% opacity so the first paint still counts for LCP. */
  @keyframes home-focus {
    from {opacity:.01;filter:blur(16px);transform:translate3d(0,16px,0) scale(1.03)}
    50% {opacity:1}
    to {opacity:1;filter:blur(0);transform:none}
  }
  @keyframes home-portrait {
    from {opacity:.01;filter:blur(14px);transform:scale(1.08)}
    45% {opacity:1}
    to {opacity:1;filter:blur(0);transform:none}
  }
  @keyframes home-title-focus {from {filter:blur(10px)} to {filter:blur(0)}}
  /* Phones: the first screen simply clears; no blur, scale or slide on elements as wide as the screen. */
  @keyframes home-soft {from {opacity:.01} to {opacity:1}}
  @keyframes home-mark {from {background-size:0% 34%} to {background-size:100% 34%}}
  @keyframes home-mark-wide {from {background-size:0% 30%} to {background-size:100% 30%}}
  @keyframes home-draw {from {stroke-dasharray:130;stroke-dashoffset:130} to {stroke-dasharray:130;stroke-dashoffset:0}}
  @keyframes home-aurora-a {from {transform:none} to {transform:translate3d(16vmax,10vmax,0) scale(1.15)}}
  @keyframes home-aurora-b {from {transform:none} to {transform:translate3d(-14vmax,-8vmax,0) scale(.9)}}
  /* The sparkle arrives on the `scale` property and twinkles on opacity/transform: two loops on the same
     property would keep the browser from running either on the compositor. */
  @keyframes home-sparkle {from {scale:.001} to {scale:1}}
  @keyframes home-twinkle {from {opacity:1;transform:none} to {opacity:.35;transform:scale(.82) rotate(-10deg)}}
  @keyframes home-wave {from {transform:translate3d(0,0,0)} to {transform:translate3d(-680px,0,0)}}
  @keyframes home-wave-small {from {transform:translate3d(0,0,0)} to {transform:translate3d(-480px,0,0)}}
  @keyframes home-sheen {
    0% {transform:translate3d(-160%,0,0) skewX(-18deg)}
    22%,100% {transform:translate3d(440%,0,0) skewX(-18deg)}
  }
  @keyframes home-sweep {from {transform:translate3d(-170%,0,0) skewX(-14deg)} to {transform:translate3d(440%,0,0) skewX(-14deg)}}
  @keyframes home-cue {
    0%,100% {transform:translate3d(0,0,0) rotate(45deg)}
    50% {transform:translate3d(0,9px,0) rotate(45deg)}
  }
  @keyframes home-float {from {transform:translate3d(0,-3px,0)} to {transform:translate3d(0,4px,0)}}
  @keyframes home-ring {
    0% {opacity:.9;transform:scale(1)}
    60%,100% {opacity:0;transform:scale(1.26,1.5)}
  }
  @keyframes home-slide-next {from {opacity:0;transform:translate3d(44px,0,0) scale(.98)} to {opacity:1;transform:none}}
  @keyframes home-slide-prev {from {opacity:0;transform:translate3d(-44px,0,0) scale(.98)} to {opacity:1;transform:none}}
  @keyframes sky-vt-out {to {opacity:0}}
  @keyframes sky-vt-in {from {opacity:0;transform:translate3d(0,6px,0)}}

  /* Moving between pages (pointer devices only): an even cross-fade, the new page settling by a few
     pixels. Old and new fade over the same span so the screen never dips toward white. The opt-in itself
     (@view-transition) is a one-line inline style in each page head, limited to hover/fine-pointer
     devices: on phones a whole-screen transition reads as the page shaking, and Safari on iOS adds its
     own swipe animation. The script declines the transition whenever motion is off. */
  ::view-transition-old(root) {animation:240ms ease both sky-vt-out}
  ::view-transition-new(root) {animation:240ms ease both sky-vt-in}

  /* ---------- 1. Arrival: strip, header, then the hero clears ---------- */
  body.brand-home::before {animation:home-strip 520ms var(--home-ease-out) backwards}
  body.brand-home .site-header .brand {animation:home-left 760ms var(--home-ease-out) 120ms backwards}
  body.brand-home .site-header nav li {
    animation:home-drop 560ms var(--home-ease-out) backwards;
    animation-delay:calc(var(--home-n,0) * 45ms + var(--home-base,220ms));
  }
  body.brand-home .site-header .nav-links {--home-base:370ms}
  body.brand-home .site-header nav li:nth-child(2) {--home-n:1}
  body.brand-home .site-header nav li:nth-child(3) {--home-n:2}
  body.brand-home .site-header nav li:nth-child(4) {--home-n:3}
  body.brand-home .site-header nav li:nth-child(5) {--home-n:4}
  body.brand-home .site-header nav li:nth-child(6) {--home-n:5}
  body.brand-home .site-header nav li:nth-child(n+7) {--home-n:6}

  body.brand-home .hero {position:relative;overflow:hidden}
  body.brand-home .hero-inner {position:relative;z-index:1}
  body.brand-home .hero::before,
  body.brand-home .hero::after {
    content:"";position:absolute;z-index:0;border-radius:50%;pointer-events:none;will-change:transform;
  }
  body.brand-home .hero::before {
    right:-18vmax;top:-22vmax;width:62vmax;height:62vmax;
    background:radial-gradient(closest-side,rgb(207 227 244 / 85%),rgb(207 227 244 / 0%));
    animation:home-fade 1600ms ease-out backwards,home-aurora-b 26s ease-in-out infinite alternate;
  }
  body.brand-home .hero::after {
    left:-12vmax;bottom:-30vmax;width:46vmax;height:46vmax;
    background:radial-gradient(closest-side,rgb(243 227 176 / 60%),rgb(243 227 176 / 0%));
    animation:home-fade 2200ms ease-out backwards,home-aurora-a 32s ease-in-out infinite alternate;
  }

  body.brand-home .hero-text > h1 {
    transform-origin:0 60%;
    animation:home-focus 1150ms var(--home-ease-out) 60ms backwards;
  }
  body.brand-home .hero-text > :not(h1) {animation-delay:calc(var(--site-order,0) * 115ms + 180ms)}
  body.brand-home .hero h1 .hl {
    -webkit-box-decoration-break:clone;box-decoration-break:clone;
    animation:home-mark 760ms var(--home-ease-inout) 940ms backwards;
  }
  body.brand-home .hero .credentials li {
    animation:home-pop 520ms var(--home-ease-spring) backwards;
    animation-delay:calc(620ms + (var(--home-n,0) + var(--home-offset,0)) * 75ms);
  }
  body.brand-home .hero .credentials li:nth-child(2) {--home-n:1}
  body.brand-home .hero .credential-secondary {--home-offset:2}

  body.brand-home .hero .btn-primary,
  body.brand-home .site-header .nav-cta {position:relative;overflow:hidden}
  body.brand-home .hero .btn-primary::after,
  body.brand-home .site-header .nav-cta::after {
    content:"";position:absolute;top:-20%;bottom:-20%;left:0;width:38%;pointer-events:none;
    background:linear-gradient(100deg,rgb(255 255 255 / 0%),rgb(255 255 255 / 60%),rgb(255 255 255 / 0%));
    transform:translate3d(-160%,0,0) skewX(-18deg);
    animation:home-sheen 6000ms var(--home-ease-inout) 3200ms infinite;
  }
  body.brand-home .hero .btn-primary::after {
    background:linear-gradient(100deg,rgb(255 255 255 / 0%),rgb(255 255 255 / 42%),rgb(255 255 255 / 0%));
    animation-delay:2600ms;
  }

  /* Portrait, sparkles, brush name and seal: the signature of the page, in that order. */
  body.brand-home .hero [data-selective-reveal="portrait"] {
    animation:home-portrait 1400ms var(--home-ease-out) 120ms backwards;
  }
  body.brand-home .hero-photo::before {
    transform-origin:19px 21px;
    animation:home-sparkle 620ms var(--home-ease-spring) 1150ms backwards,home-twinkle 2600ms ease-in-out 1800ms infinite alternate;
  }
  body.brand-home .hero-brush {
    animation:home-brush 1200ms var(--home-ease-inout) 1250ms backwards;
  }
  body.brand-home .hero-seal {
    position:relative;
    animation:home-stamp 640ms var(--home-ease-spring) 2400ms backwards;
  }
  body.brand-home .hero-seal::after {
    content:"";position:absolute;inset:0;border-radius:50%;border:2px solid #EF3E42;pointer-events:none;opacity:0;
    animation:home-ink 760ms ease-out 2720ms both;
  }

  /* Key phrases get a marker stroke: at once in the hero, on arrival further down. */
  body.brand-home main strong[data-patient-focus] {
    -webkit-box-decoration-break:clone;box-decoration-break:clone;
    background:linear-gradient(rgb(224 198 132 / 42%),rgb(224 198 132 / 42%)) no-repeat 0 92%/100% 30%;
  }
  body.brand-home .hero strong[data-patient-focus] {
    animation:home-mark-wide 900ms var(--home-ease-inout) 1350ms backwards;
  }

  body.brand-home .floating-contact {animation:home-fade 700ms ease-out 1500ms backwards}
  body.brand-home .floating-contact-toggle {position:relative}
  body.brand-home .floating-contact-toggle::before {
    content:"";position:absolute;inset:-1px;border-radius:inherit;pointer-events:none;opacity:0;
    border:2px solid rgb(201 162 74 / 75%);
    animation:home-ring 3600ms ease-out 3200ms infinite;
  }
  body.brand-home .floating-contact-toggle[aria-expanded="true"]::before {animation:none}

  /* ---------- 2. Section furniture ---------- */
  body.brand-home .section-title-en::before {animation:home-twinkle 2800ms ease-in-out infinite alternate}
  body.brand-home .section-title[data-site-reveal-state="running"] {animation:home-title-focus 520ms ease-out both}
  body.brand-home .section-title[data-site-reveal-state="running"]::after {
    animation:home-stitch 900ms var(--home-ease-inout) 280ms both;
  }
  /* The first block under the hero joins the arrival on tall screens. */
  body.brand-home .patient-entry-heading > * {animation:home-rise 780ms var(--home-ease-out) 900ms backwards}
  body.brand-home .patient-entry-heading > :nth-child(2) {animation-delay:1000ms}
  body.brand-home .patient-entry-heading h2::after {animation:home-stitch 900ms var(--home-ease-inout) 1500ms backwards}
  body.brand-home .patient-entry-heading h2[data-home-state="in"]::after {
    animation:home-stitch 900ms var(--home-ease-inout) calc(var(--home-d,0ms) + 320ms) both;
  }
  body.brand-home .patient-entry-heading p::before {animation:home-float 3000ms ease-in-out infinite alternate}
  /* The closing line is written in while its paragraph group arrives. */
  body.brand-home .message-text[data-home-motion-state="running"] .message-quote {
    animation:home-wipe 900ms var(--home-ease-inout) 250ms both;
  }
  body.brand-home .icon-circle svg {animation:home-float 3200ms ease-in-out infinite alternate}
  body.brand-home .icon-item:nth-child(2) .icon-circle svg {animation-delay:-800ms}
  body.brand-home .icon-item:nth-child(3) .icon-circle svg {animation-delay:-1600ms}
  body.brand-home .icon-item:nth-child(4) .icon-circle svg {animation-delay:-2400ms}

  /* Wave edges keep a slow swell; neighbouring edges travel in opposite directions. Each strip is one
     tile wider than its section and slides by exactly one tile, so the loop runs on the compositor
     (no per-frame painting). Browsers that cannot clip one axis keep the still wave. */
  @supports (overflow-x:clip) {
    body.brand-home .section-alt,
    body.brand-home .site-footer {overflow-x:clip}
    body.brand-home .section-alt::before {right:-680px;animation:home-wave 22s linear infinite}
    body.brand-home .section-alt::after {right:-680px;animation:home-wave 30s linear infinite reverse}
    body.brand-home .site-footer::before {right:-680px;animation:home-wave 26s linear infinite}
  }

  /* The carousel only animates after the reader presses a button. Sideways travel needs
     room beside the card, so narrow screens use a soft zoom instead. */
  body.brand-home .carousel[data-home-dir] .car-slide.active {animation:home-zoom 480ms var(--home-ease-out) backwards}
  @media (min-width:900px) {
    body.brand-home .carousel[data-home-dir="next"] .car-slide.active {animation-name:home-slide-next}
    body.brand-home .carousel[data-home-dir="prev"] .car-slide.active {animation-name:home-slide-prev}
  }

  /* ---------- 3. Scroll choreography (states are set by home-motion.js) ---------- */
  html[data-home-ready] body.brand-home [data-home-state="armed"] {opacity:0}
  html[data-home-ready] body.brand-home [data-home-fx="mark"][data-home-state="armed"] {opacity:1;background-size:0% 30%}
  body.brand-home [data-home-state="in"] {
    animation:home-rise 780ms var(--home-ease-out) var(--home-d,0ms) both;
  }
  body.brand-home [data-home-fx="card"][data-home-state="in"] {animation-name:home-card;animation-duration:840ms}
  body.brand-home [data-home-fx="card"][data-home-state="in"] h3::before {
    animation:home-number 640ms var(--home-ease-spring) calc(var(--home-d,0ms) + 340ms) both;
  }
  body.brand-home [data-home-fx="left"][data-home-state="in"] {animation-name:home-left}
  body.brand-home [data-home-fx="right"][data-home-state="in"] {animation-name:home-right}
  body.brand-home [data-home-fx="row"][data-home-state="in"] {animation-name:home-row;animation-duration:560ms}
  body.brand-home [data-home-fx="zoom"][data-home-state="in"] {animation-name:home-zoom;animation-duration:900ms}
  body.brand-home [data-home-fx="pop"][data-home-state="in"] {
    animation-name:home-pop;animation-duration:520ms;animation-timing-function:var(--home-ease-spring);
  }
  body.brand-home [data-home-fx="wipe"][data-home-state="in"] {
    animation-name:home-wipe;animation-duration:1000ms;animation-timing-function:var(--home-ease-inout);
  }
  body.brand-home [data-home-fx="mark"][data-home-state="in"] {
    animation-name:home-mark-wide;animation-duration:900ms;animation-timing-function:var(--home-ease-inout);
  }
  body.brand-home [data-home-fx="eyebrow"][data-home-state="in"] {animation-name:home-left;animation-duration:700ms}
  body.brand-home [data-home-fx="eyebrow"][data-home-state="in"]::before {
    animation:home-pop 520ms var(--home-ease-spring) calc(var(--home-d,0ms) + 180ms) both;
  }
  body.brand-home [data-home-fx="icon"][data-home-state="in"] .icon-circle svg * {
    animation:home-draw 1200ms var(--home-ease-inout) calc(var(--home-d,0ms) + 200ms) both;
  }
  body.brand-home [data-home-fx="icon"][data-home-state="in"] .icon-circle::after {
    animation:home-pop 460ms var(--home-ease-spring) calc(var(--home-d,0ms) + 760ms) both;
  }
  /* The footer's brush line is written once the footer text has arrived. */
  body.brand-home .footer-inner:has(> [data-home-state="armed"])::after {opacity:0}
  body.brand-home .footer-inner:has(> [data-home-state="in"])::after {
    animation:home-wipe 1100ms var(--home-ease-inout) 520ms both;
  }

  /* ---------- 4. Pointer feedback ---------- */
  body.brand-home .faq-item {
    transition:transform 320ms var(--home-ease-out),border-color 200ms,background-color 200ms;
  }
  body.brand-home .compare-next-actions a {
    transition:transform 260ms var(--home-ease-out),background-color 200ms,color 200ms,border-color 200ms;
  }
  body.brand-home .compare-next-actions a::after {transition:transform 260ms var(--home-ease-out)}
  body.brand-home .patient-entry-links a {transition:transform 260ms var(--home-ease-out),background-color 200ms}
  body.brand-home .patient-entry-links a::after {transition:transform 260ms var(--home-ease-out)}
  body.brand-home .icon-item {transition:transform 420ms var(--home-ease-out),box-shadow 420ms var(--home-ease-out)}
  body.brand-home .icon-circle {
    transition:transform 420ms var(--home-ease-spring),box-shadow 420ms var(--home-ease-out);
  }
  body.brand-home .car-btn {transition:background-color 200ms,color 200ms,border-color 200ms,box-shadow 300ms}
  body.brand-home .hero .btn::before,
  body.brand-home .campus-card .btn::before {transition:transform 300ms var(--home-ease-spring)}

  @media (hover:hover) and (pointer:fine) {
    body.brand-home .hero-grid {position:relative}
    body.brand-home .hero-grid::before {
      content:"";position:absolute;z-index:0;top:0;left:0;width:560px;height:560px;margin:-280px 0 0 -280px;
      border-radius:50%;pointer-events:none;opacity:var(--home-pointer,0);
      background:radial-gradient(closest-side,rgb(207 227 244 / 60%),rgb(207 227 244 / 0%));
      transform:translate3d(var(--home-px,-999px),var(--home-py,-999px),0);
      transition:transform 500ms var(--home-ease-out),opacity 400ms;
    }

    body.brand-home :is(.patient-entry-card,.treatment-choice-card,.campus-card,.campus-decision-link,.car-slide) {
      position:relative;isolation:isolate;
      transition:transform 420ms var(--home-ease-out),box-shadow 420ms var(--home-ease-out),border-color 240ms;
    }
    body.brand-home :is(.patient-entry-card,.treatment-choice-card,.campus-card,.campus-decision-link,.car-slide):hover {
      transform:translate3d(0,-6px,0);border-color:#C9A24A;box-shadow:0 18px 40px rgb(10 47 85 / 14%);
    }
    /* Cards inside the horizontal strips stay in place (the strip clips them) and only light up. */
    body.brand-home [data-home-social-card] {transition:border-color 240ms}
    body.brand-home [data-home-social-card]:hover {border-color:#C9A24A}
    body.brand-home :is(.patient-entry-card,.treatment-choice-card,.campus-card)::before {
      content:"";position:absolute;z-index:-1;inset:0;border-radius:inherit;pointer-events:none;opacity:0;
      background:radial-gradient(260px circle at var(--home-mx,50%) var(--home-my,0%),rgb(243 227 176 / 38%),rgb(243 227 176 / 0%) 72%);
      transition:opacity 320ms;
    }
    body.brand-home :is(.patient-entry-card,.treatment-choice-card,.campus-card):hover::before {opacity:1}

    body.brand-home .site-header .nav-links a:not(.nav-cta) {position:relative}
    body.brand-home .site-header .nav-links a:not(.nav-cta)::after {
      content:"";position:absolute;left:14px;right:14px;bottom:6px;height:2px;border-radius:2px;pointer-events:none;
      background:#C9A24A;transform:scaleX(0);transform-origin:0 50%;transition:transform 320ms var(--home-ease-out);
    }
    body.brand-home .site-header .nav-links a:not(.nav-cta):hover::after {transform:scaleX(1)}
    body.brand-home .patient-entry-links a:hover {transform:translate3d(0,-2px,0)}
    body.brand-home .patient-entry-links a:hover::after {transform:translate3d(5px,0,0)}
    body.brand-home .compare-next-actions a:hover::after {transform:translate3d(4px,0,0)}
    body.brand-home .hero .btn:hover::before,
    body.brand-home .campus-card .btn:hover::before {transform:translate3d(4px,0,0) scale(1.06)}
    body.brand-home .icon-item:hover {transform:translate3d(0,-6px,0);box-shadow:0 16px 34px rgb(10 47 85 / 10%)}
    body.brand-home .icon-item:hover .icon-circle {transform:rotate(-6deg) scale(1.06)}
    body.brand-home #faq-preview .faq-item:hover {transform:translate3d(5px,0,0)}
    body.brand-home .car-btn:hover {box-shadow:0 8px 20px rgb(10 47 85 / 22%)}

    body.brand-home main .btn:not(.btn-primary),
    body.brand-home .campus-card .btn {position:relative;overflow:hidden}
    body.brand-home main .btn:not(.btn-primary)::after,
    body.brand-home .campus-card .btn::after {
      content:"";position:absolute;top:-20%;bottom:-20%;left:0;width:40%;pointer-events:none;
      background:linear-gradient(100deg,rgb(255 255 255 / 0%),rgb(255 255 255 / 55%),rgb(255 255 255 / 0%));
      transform:translate3d(-170%,0,0) skewX(-18deg);transition:transform 0s;
    }
    body.brand-home main .btn:not(.btn-primary):hover::after,
    body.brand-home .campus-card .btn:hover::after {
      transform:translate3d(440%,0,0) skewX(-18deg);transition:transform 800ms var(--home-ease-inout);
    }
  }

  /* ---------- 5. Scroll-linked: cue, parallax, and loops that rest off screen ---------- */
  @media (min-width:1100px) and (min-height:640px) {
    body.brand-home .hero-inner::after {
      content:"";position:absolute;left:50%;bottom:24px;width:14px;height:14px;margin-left:-7px;pointer-events:none;
      border-right:2px solid rgb(0 90 156 / 60%);border-bottom:2px solid rgb(0 90 156 / 60%);
      transform:rotate(45deg);transition:opacity 400ms;
      animation:home-fade 600ms ease-out 2900ms backwards,home-cue 1800ms var(--home-ease-inout) 3500ms infinite;
    }
    body.brand-home[data-home-scrolled] .hero-inner::after {opacity:0;animation-play-state:paused}
    body.brand-home .hero-photo {transform:translate3d(0,calc(var(--home-hero,0) * 46px),0)}
    body.brand-home .hero-text {
      transform:translate3d(0,calc(var(--home-hero,0) * -22px),0);
      opacity:calc(1 - var(--home-hero,0) * .55);
    }
  }
  body.brand-home[data-home-hero="out"] .hero::before,
  body.brand-home[data-home-hero="out"] .hero::after,
  body.brand-home[data-home-hero="out"] .hero-photo::before,
  body.brand-home[data-home-hero="out"] .hero .btn-primary::after {animation-play-state:paused}

  @media (max-width:1099px) {
    /* Below 1100px the menu sits behind its button and replays this cascade each time it opens, so it must
       be quick: the first link appears at once and the last within about half a second. */
    body.brand-home .site-header nav li {
      animation-duration:360ms;
      animation-delay:calc(var(--home-n,0) * 28ms + var(--home-base,0ms));
    }
    body.brand-home .site-header .nav-links {--home-base:84ms}
  }
  @media (max-width:640px) {
    /* On a phone every one of these spans the whole screen, so moving them reads as the page shaking:
       the strip and the name are simply there, the headline and portrait clear without blur or scale,
       and section titles arrive without the focus pull. */
    body.brand-home::before,
    body.brand-home .site-header .brand {animation:none}
    body.brand-home .hero-text > h1 {animation:home-soft 700ms ease-out 40ms backwards}
    body.brand-home .hero [data-selective-reveal="portrait"] {animation:home-soft 900ms ease-out 100ms backwards}
    body.brand-home .section-title[data-site-reveal-state="running"] {animation:none}
    body.brand-home .hero::before {right:-40vmax;top:-30vmax;width:90vmax;height:90vmax}
    body.brand-home .hero::after {left:-30vmax;bottom:-46vmax;width:80vmax;height:80vmax}
    body.brand-home .section-alt::before,
    body.brand-home .section-alt::after,
    body.brand-home .site-footer::before {animation-name:home-wave-small}
  }

  /* ---------- The page arrives once ----------
     home-motion.js marks the root when the arrival is over (a few seconds after loading, or the moment the
     window crosses a layout breakpoint or goes to print). From then on the arrival of the strip, the name, the
     headline, the portrait and the full-width menu no longer applies, so rotating a phone, resizing the window
     or coming back from the print dialog does not replay it. The slow loops keep running; the menu behind its
     button still cascades each time it opens. */
  html[data-home-arrived] body.brand-home::before,
  html[data-home-arrived] body.brand-home .site-header .brand,
  html[data-home-arrived] body.brand-home .hero-text > *,
  html[data-home-arrived] body.brand-home .hero h1 .hl,
  html[data-home-arrived] body.brand-home .hero .credentials li,
  html[data-home-arrived] body.brand-home .hero strong[data-patient-focus],
  html[data-home-arrived] body.brand-home .hero [data-selective-reveal="portrait"],
  html[data-home-arrived] body.brand-home .hero-brush,
  html[data-home-arrived] body.brand-home .hero-seal,
  html[data-home-arrived] body.brand-home .hero-seal::after {animation:none}
  @media (min-width:1100px) {
    html[data-home-arrived] body.brand-home .site-header nav li {animation:none}
  }

  /* ---------- The footer switch stops everything in this layer ---------- */
  html[data-home-motion="off"] body.brand-home *,
  html[data-home-motion="off"] body.brand-home *::before,
  html[data-home-motion="off"] body.brand-home *::after {animation:none!important;transition:none!important}
  html[data-home-motion="off"] body.brand-home::before {animation:none!important}
  html[data-home-motion="off"] body.brand-home [data-home-state] {opacity:1!important;transform:none!important;clip-path:none!important}
  html[data-home-motion="off"] body.brand-home :is(.hero-photo,.hero-text) {transform:none!important;opacity:1!important}
  html[data-home-motion="off"] body.brand-home .footer-inner::after {opacity:1!important}
  html[data-home-motion="off"] body.brand-home .hero-inner::after,
  html[data-home-motion="off"] body.brand-home .hero-grid::before {display:none}
  html[data-home-motion="off"]::view-transition-group(*),
  html[data-home-motion="off"]::view-transition-old(*),
  html[data-home-motion="off"]::view-transition-new(*) {animation:none!important}
}
