/* ============================================================
   KASANA - MOTION LAYER
   Hand-written CSS3. No frameworks, no animation library.

   HOW IT IS GATED
   An inline script in <head> puts .motion on <html> before first
   paint, and only when the visitor has NOT asked for reduced motion.
   Every "hidden until revealed" rule in this file is nested under
   html.motion, which means three things at once:

     - no reduced-motion visitor ever gets a hidden element
     - if motion.js fails to load, nothing is stuck invisible
     - there is no flash of styled-then-hidden content, because the
       class lands before the first paint rather than on DOMContentLoaded

   WHAT IT COSTS
   Everything here animates transform, opacity, clip-path or filter.
   Nothing animates width, height, top or margin, so the compositor
   does the work and the main thread stays free for scrolling.

   CONTENTS
   01  Entrance reveals            (data-reveal)
   02  Image reveals               (.img-frame, the signature effect)
   03  Parallax + Ken Burns        (data-parallax, .ken)
   04  Split headline lines        (data-split)
   05  Hero choreography
   06  Hover: cards, media, links
   07  Marquee
   08  Scroll progress + chrome
   09  Lightbox + gallery
   10  Small screens
   11  Reduced motion and print
   ============================================================ */


/* ============================================================
   01  ENTRANCE REVEALS

   One attribute drives all of them: data-reveal="<variant>". The
   observer in motion.js adds .is-in and the element travels to its
   resting state. Distances are deliberately short - 18 to 40px - so
   the page feels settled rather than bouncy, and the whole thing
   reads as one movement instead of nine separate ones.
   ============================================================ */
html.motion [data-reveal] {
  --rv-dur: 900ms;
  --rv-delay: 0ms;
  opacity: 0;
  transition:
      opacity     var(--rv-dur) var(--curve-soft) var(--rv-delay),
      transform   var(--rv-dur) var(--curve-out)  var(--rv-delay),
      clip-path   var(--rv-dur) var(--curve-out)  var(--rv-delay),
      filter      var(--rv-dur) var(--curve-soft) var(--rv-delay);
}

html.motion [data-reveal="rise"],
html.motion [data-reveal=""]        { transform: translate3d(0, 34px, 0); }
html.motion [data-reveal="rise-sm"] { transform: translate3d(0, 18px, 0); }
html.motion [data-reveal="fade"]    { transform: none; }
html.motion [data-reveal="left"]    { transform: translate3d(-40px, 0, 0); }
html.motion [data-reveal="right"]   { transform: translate3d(40px, 0, 0); }
html.motion [data-reveal="scale"]   { transform: scale(.94); }
html.motion [data-reveal="blur"]    { filter: blur(14px); transform: translate3d(0, 20px, 0); }

/* NO CLIP VARIANT HERE, ON PURPOSE.
   An element clipped to zero area reports an intersectionRatio of 0,
   so an IntersectionObserver watching it never fires and the reveal
   never plays - the effect silently disables itself. Wipes therefore
   live on .img-frame below, where the clip is applied to the child
   image and the observed box keeps its full size. */

/* Legacy hook from the first build, kept so older markup still moves. */
html.motion .reveal:not([data-reveal]) {
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  transition: opacity var(--ease-out) var(--reveal-delay, 0ms),
              transform var(--ease-out) var(--reveal-delay, 0ms);
}
html.motion .reveal.is-in:not([data-reveal]) { opacity: 1; transform: none; }

/* The resting state. One rule, every variant. */
html.motion [data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* A promoted layer costs memory whether or not anything is moving on
   it, and a long page can hold fifty of these. So the hint is only
   given to elements the arming observer says are nearly due, and it is
   handed straight back once the transition has finished. Before that
   and after it, these are ordinary unpromoted boxes. */
html.motion [data-reveal].is-armed:not(.is-done) { will-change: opacity, transform; }

/* Once it has arrived it will not move again, so hand the layer back. */
html.motion [data-reveal].is-done { will-change: auto; }

/* The sandstone rule in front of an eyebrow draws itself in. */
html.motion [data-reveal] .eyebrow::before,
html.motion .eyebrow[data-reveal]::before {
  transform: scaleX(0);
  transition: transform 700ms var(--curve-out) 180ms;
}
html.motion [data-reveal].is-in .eyebrow::before,
html.motion .eyebrow[data-reveal].is-in::before { transform: scaleX(1); }


/* ============================================================
   02  IMAGE REVEALS - the signature effect

   .img-frame is a clipping box; the <img> inside is its own layer.
   On reveal two things happen against each other: the frame's clip
   edge travels up, and the image - which starts at 1.18 scale -
   settles back to 1. The counter-motion is what makes it feel like a
   camera coming to rest rather than a div appearing, and it is the
   whole trick. Nothing else is needed.

   Every property image, banner, agent portrait and gallery tile on
   the site is wrapped in one of these.
   ============================================================ */
/* The structural defaults sit in a cascade layer, and that is
   load-bearing rather than tidiness.

   motion.css is the last stylesheet on the page, so a plain
   `.img-frame { position: relative }` here would beat an equally
   specific `.island-inset { position: absolute }` written in
   pages.css purely by source order - and it did, until this layer
   went in. Unlayered rules always beat layered ones no matter how
   specific, so wrapping these defaults means a component can override
   any of them with a single class and nothing has to fight back with
   a longer selector or an !important. */
@layer kasana-frame {
  .img-frame {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: inherit;
    background: var(--paper-2);
    isolation: isolate;
  }
}

/* The image sizing stays OUT of the layer. style.css sets a global
   `img { height: auto }` to stop unstyled images stretching, and being
   unlayered that would beat a layered `height: 100%` no matter how
   specific it was - which left every frame with its photograph sitting
   at intrinsic height in the top of an empty box. */
.img-frame > img,
.img-frame > picture > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The clip goes on the image, never on the frame.
   The frame is the element the observer watches, and a box clipped to
   zero area intersects nothing - watch a clipped element and it will
   sit there hidden forever. Clipping the child keeps the frame's
   geometry honest and looks identical, because the frame is
   overflow:hidden either way. */
html.motion .img-frame[data-img-reveal] > img,
html.motion .img-frame[data-img-reveal] > picture > img {
  clip-path: inset(0 0 100% 0);
  transform: scale(1.18);
  transform-origin: center;
  transition:
      clip-path 780ms var(--curve-out) var(--rv-delay, 0ms),
      transform 980ms var(--curve-out) var(--rv-delay, 0ms);
}
html.motion .img-frame[data-img-reveal].is-armed:not(.is-done) > img,
html.motion .img-frame[data-img-reveal].is-armed:not(.is-done) > picture > img {
  will-change: transform, clip-path;
}
html.motion .img-frame[data-img-reveal="left"]  > img { clip-path: inset(0 100% 0 0); }
html.motion .img-frame[data-img-reveal="right"] > img { clip-path: inset(0 0 0 100%); }
html.motion .img-frame[data-img-reveal="down"]  > img { clip-path: inset(100% 0 0 0); }

html.motion .img-frame[data-img-reveal].is-in > img,
html.motion .img-frame[data-img-reveal].is-in > picture > img {
  clip-path: inset(0 0 0 0);
  transform: scale(1);
}

html.motion .img-frame[data-img-reveal].is-done > img { will-change: auto; }


/* A gold panel rides the same edge as the clip, one beat ahead of
   the photograph, so the reveal has a colour in it and does not read as
   a plain wipe. It scales away to nothing once it has passed. */
html.motion .img-frame[data-img-reveal]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, var(--stone-400), var(--stone-500));
  transform-origin: bottom center;
  transform: scaleY(1);
  transition: transform 1000ms var(--curve-out) var(--rv-delay, 0ms);
  pointer-events: none;
}
html.motion .img-frame[data-img-reveal="left"]::before {
  transform-origin: right center;
  transform: scaleX(1);
}
html.motion .img-frame[data-img-reveal="right"]::before {
  transform-origin: left center;
  transform: scaleX(1);
}
html.motion .img-frame[data-img-reveal].is-in::before { transform: scaleY(0); }
html.motion .img-frame[data-img-reveal="left"].is-in::before,
html.motion .img-frame[data-img-reveal="right"].is-in::before { transform: scaleX(0); }

/* Frames that sit on the dark bands use navy for the sweep instead,
   so the panel never flashes brighter than the section around it. */
html.motion .band-navy .img-frame[data-img-reveal]::before,
html.motion .img-frame[data-img-sweep="dark"]::before {
  background: linear-gradient(180deg, var(--basalt-700), var(--basalt-900));
}


/* ============================================================
   03  PARALLAX AND KEN BURNS

   Parallax is written by motion.js into --px, a plain pixel value.
   Doing the arithmetic in JS and the painting in CSS keeps the whole
   effect to one transform per frame per element.

   Depth convention, so the page has a consistent sense of space:
     0.06 - 0.10   text blocks and cards, barely perceptible
     0.12 - 0.18   framed photography
     0.20 - 0.30   full-bleed banners and the hero
   ============================================================ */
[data-parallax] { --px: 0px; }

html.motion [data-parallax] {
  transform: translate3d(0, var(--px), 0);
  will-change: transform;
}

/* A parallaxed image has to be taller than its frame or the travel
   would drag empty space in at the edges. 122% of the box covers
   every viewport and depth we use. */
html.motion .img-frame[data-parallax-inner] > img {
  height: 122%;
  margin-top: -11%;
  transform: translate3d(0, var(--px), 0) scale(1.02);
  will-change: transform;
}

/* Ken Burns. Slow enough that a visitor notices the room feels alive
   without ever catching the loop; alternate so there is no jump cut. */
@keyframes kasana-ken {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to   { transform: scale(1.16) translate3d(1.6%, -1.8%, 0); }
}

html.motion .ken > img,
html.motion img.ken {
  animation: kasana-ken 26s var(--curve-soft) infinite alternate;
  will-change: transform;
}
html.motion .ken-slow > img { animation-duration: 40s; }


/* ============================================================
   04  SPLIT HEADLINES

   motion.js wraps every word - and only the words, never the tags -
   in a .word > .word-inner pair. The outer span clips; the inner one
   slides up from underneath it. Words are then given a delay from
   the line they were measured onto, so a whole line moves together
   and the headline reads as being written rather than assembled.

   Doing it per word instead of per line is what lets a headline
   contain <em>, <a> or a coloured span without the markup being torn
   apart when a line break lands in the middle of it.
   ============================================================ */
[data-split] .word {
  display: inline-block;
  overflow: hidden;
  /* Newsreader's descenders and the italic accent both overshoot the
     line box, so the clip is pushed clear of the letterforms and the
     extra height is pulled back out of the layout.

     The same is true sideways: an italic 'e' finishes outside its own
     advance width, and the headline's negative letter-spacing pulls
     the box in tighter still, so the last letter of a word like the
     gold "house" gets shaved off by the clip. The side padding buys
     the terminals room; the matching negative margins hand the space
     straight back, so the words sit exactly where they did. */
  padding-bottom: .14em;
  margin-bottom: -.14em;
  padding-right: .12em;
  margin-right: -.12em;
  padding-left: .04em;
  margin-left: -.04em;
  vertical-align: bottom;
}

html.motion [data-split] .word-inner {
  display: inline-block;
  transform: translate3d(0, 115%, 0);
  opacity: 0;
  transition:
      transform 1100ms var(--curve-out) var(--line-delay, 0ms),
      opacity    800ms var(--curve-soft) var(--line-delay, 0ms);
}
html.motion [data-split].is-armed:not(.is-done) .word-inner { will-change: transform; }
html.motion [data-split].is-in .word-inner { transform: none; opacity: 1; }
html.motion [data-split].is-done .word-inner { will-change: auto; }


/* ============================================================
   05  HERO CHOREOGRAPHY

   The hero does not wait for the scroll observer. motion.js adds
   .hero-ready as soon as the hero image has decoded, and a single
   cascade of delays runs the eyebrow, the headline lines, the copy,
   the buttons and the trust row in that order. The photograph itself
   is already drifting under all of it.
   ============================================================ */
html.motion .hero-inner > * {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity 1000ms var(--curve-soft) var(--hero-delay, 0ms),
              transform 1000ms var(--curve-out) var(--hero-delay, 0ms);
}
html.motion .hero.hero-ready .hero-inner > * { opacity: 1; transform: none; }

/* The headline runs its own line-by-line reveal, so it opts out of the
   block-level move above and only inherits the timing. */
html.motion .hero-inner > [data-split] { opacity: 1; transform: none; }

html.motion .hero-inner > *:nth-child(1) { --hero-delay: 120ms; }
html.motion .hero-inner > *:nth-child(2) { --hero-delay: 200ms; }
html.motion .hero-inner > *:nth-child(3) { --hero-delay: 520ms; }
html.motion .hero-inner > *:nth-child(4) { --hero-delay: 640ms; }
html.motion .hero-inner > *:nth-child(5) { --hero-delay: 760ms; }
html.motion .hero-inner > *:nth-child(6) { --hero-delay: 860ms; }

/* The search card is the heaviest object on the page, so it arrives
   last and travels furthest - it should feel like it lands. */
html.motion .hero .search-card,
html.motion .hero-aside {
  opacity: 0;
  transform: translate3d(0, 48px, 0) scale(.985);
  transition: opacity 1100ms var(--curve-soft) 700ms,
              transform 1100ms var(--curve-out) 700ms;
}
html.motion .hero.hero-ready .search-card,
html.motion .hero.hero-ready .hero-aside { opacity: 1; transform: none; }

/* Scroll response: the hero photograph sinks and dims as the page
   leaves it, so the section below appears to slide over the top.
   --hero-progress is written by motion.js, 0 at rest to 1 when the
   hero has fully scrolled past. */
.hero { --hero-progress: 0; }

html.motion .hero-media {
  transform: translate3d(0, calc(var(--hero-progress) * 14vh), 0)
             scale(calc(1 + var(--hero-progress) * .10));
  will-change: transform;
}
html.motion .hero-inner {
  opacity: calc(1 - var(--hero-progress) * 1.15);
  transform: translate3d(0, calc(var(--hero-progress) * -5vh), 0);
}

/* Scroll cue: a glass ring with a pulse leaving it and two chevrons
   cascading inside. It sits on the home hero and on all seven inner
   page heroes, which is the point - every hero on the site is a full
   screen of photograph, and every one of them says so the same way.

   It is decorative and marked aria-hidden. It is a hint that there is
   more below, which a scrollbar already says to anyone who can see
   one; making it a control would put a "scroll down" button in the
   tab order of every page on the site to duplicate the Page Down key. */
.hero-cue {
  position: absolute;
  left: 50%;
  bottom: 30px;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 9px;
  margin: 0;
  transform: translateX(-50%);
  pointer-events: none;
}

.hero-cue-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1.5px solid rgba(255, 255, 255, .34);
  border-radius: 50%;
  background: rgba(255, 255, 255, .10);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
}

/* The pulse. A second ring just outside the first, scaling out and
   fading as it goes. */
.hero-cue-ring::before {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1.5px solid rgba(240, 192, 72, .40);
  border-radius: 50%;
  opacity: 0;
}

.hero-cue-chevrons {
  display: grid;
  justify-items: center;
}
.hero-cue-chevrons svg { display: block; }
.hero-cue-chevrons svg + svg { margin-top: -5px; opacity: .5; }

.hero-cue-label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: rgba(255, 255, 255, .62);
}

/* Nothing above this line moves. Everything below it does, and only
   under the gate - so a reduced-motion visitor still gets the ring,
   the chevrons and the word, sitting still. */
html.motion .hero-cue-ring { animation: kasana-cue-float 2.6s ease-in-out infinite; }
html.motion .hero-cue-ring::before { animation: kasana-cue-pulse 2.6s ease-out infinite; }
html.motion .hero-cue-label { animation: kasana-cue-float 2.6s ease-in-out .1s infinite; }
html.motion .hero-cue-chevrons svg { animation: kasana-cue-chevron 2.6s ease-in-out infinite; }
html.motion .hero-cue-chevrons svg + svg { animation-delay: .18s; }

@keyframes kasana-cue-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(5px); }
}

@keyframes kasana-cue-pulse {
  0%   { opacity: .9; transform: scale(.88); }
  70%  { opacity: 0;  transform: scale(1.28); }
  100% { opacity: 0;  transform: scale(1.28); }
}

@keyframes kasana-cue-chevron {
  0%, 100% { transform: translateY(-2px); opacity: .45; }
  50%      { transform: translateY(2px);  opacity: 1; }
}

/* Fades out as the hero leaves, same as it always did. */
html.motion .hero-cue {
  opacity: calc(1 - var(--hero-progress) * 3);
  transition: opacity 200ms linear;
}

/* --- The footer wordmark -------------------------------------
   Six letters rising into place, 80ms apart, every time the footer
   comes into view.

   Every time, not once. The reveal engine above is one-shot by design:
   a card that has arrived has arrived, and re-playing it on the way
   back up a long page is the kind of effect that makes a site feel
   like a demo. The footer is the exception, because it is the one
   block a visitor lands on repeatedly - down to it, back up to the
   nav, down to it again - and a watermark that animated only on the
   first visit would read as broken rather than as restrained. So this
   one runs off its own observer in motion.js, which toggles .is-in in
   both directions rather than unobserving.

   The hidden state is gated under html.motion, so a reduced-motion
   visitor and a page whose JavaScript never ran both get the finished
   wordmark sitting still - not an empty footer.

   The travel is in em, so it scales with the clamp on the font size:
   .18em is 58px against a 320px letter on a desktop and 20px against
   a 112px one on a phone, which is the same gesture at both sizes
   rather than the same number of pixels. */
html.motion .footer-watermark > span {
  opacity: 0;
  transform: translate3d(0, .18em, 0);
  transition:
      opacity   1000ms var(--curve-soft) var(--fw-delay, 0ms),
      transform 1150ms var(--curve-out)  var(--fw-delay, 0ms);
}

html.motion .footer-watermark.is-in > span {
  opacity: 1;
  transform: none;
}

html.motion .footer-watermark > span:nth-child(1) { --fw-delay: 0ms; }
html.motion .footer-watermark > span:nth-child(2) { --fw-delay: 80ms; }
html.motion .footer-watermark > span:nth-child(3) { --fw-delay: 160ms; }
html.motion .footer-watermark > span:nth-child(4) { --fw-delay: 240ms; }
html.motion .footer-watermark > span:nth-child(5) { --fw-delay: 320ms; }
html.motion .footer-watermark > span:nth-child(6) { --fw-delay: 400ms; }

/* Leaving is quicker than arriving and has no stagger. A word that
   takes a full second to tidy itself away while you scroll past is
   just something moving in the corner of your eye. */
html.motion .footer-watermark:not(.is-in) > span {
  transition-duration: 320ms, 320ms;
  transition-delay: 0ms;
}

/* The letters hold their own layer only while the footer is near. */
html.motion .footer-watermark.is-near > span { will-change: opacity, transform; }


/* --- Subpage heroes ------------------------------------------
   Seven of the nine pages open on .page-hero rather than .hero.
   motion.js has always added .hero-ready to whichever of the two it
   finds and always written --hero-progress to it, but nothing here
   consumed either, so every inner page opened flat while the home
   page got a cascade. Same choreography, shorter travel and a
   tighter sequence: an inner page is somewhere you have arrived,
   not a curtain going up.

   The selector is > .container > * so it reaches the breadcrumb,
   the headline, the lede and the button row without a single class
   being added to the markup of any of those pages. */
html.motion .page-hero > .container > * {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity 860ms var(--curve-soft) var(--hero-delay, 0ms),
              transform 860ms var(--curve-out) var(--hero-delay, 0ms);
}
html.motion .page-hero.hero-ready > .container > * { opacity: 1; transform: none; }

/* The headline runs its own line-by-line reveal, so it opts out of
   the block move and only borrows a place in the sequence. */
html.motion .page-hero > .container > [data-split] { opacity: 1; transform: none; }
html.motion .page-hero [data-split] .word-inner {
  transition-delay: calc(var(--line-delay, 0ms) + 150ms);
}

html.motion .page-hero > .container > *:nth-child(1) { --hero-delay: 80ms; }
html.motion .page-hero > .container > *:nth-child(2) { --hero-delay: 150ms; }
html.motion .page-hero > .container > *:nth-child(3) { --hero-delay: 380ms; }
html.motion .page-hero > .container > *:nth-child(4) { --hero-delay: 480ms; }
html.motion .page-hero > .container > *:nth-child(n+5) { --hero-delay: 560ms; }

/* The cue arrives last and from below, on both hero types. It sits
   outside .container - it is pinned to the bottom of the hero, not
   part of the centred column - so it needs its own line here rather
   than a place in the sequence above.

   The opacity is handed straight back to the scroll response once
   .hero-ready lands, which is why this sets a transition on transform
   only: --hero-progress owns opacity from that point on, and two
   rules animating the same property would fight every frame. */
html.motion .hero-cue {
  transform: translateX(-50%) translateY(14px);
  transition: transform 800ms var(--curve-out) 900ms,
              opacity 200ms linear;
}
html.motion .hero.hero-ready .hero-cue,
html.motion .page-hero.hero-ready .hero-cue {
  transform: translateX(-50%) translateY(0);
}

/* Scroll response, matched to the home hero but at about half the
   depth. The photograph sinks behind the band that follows and the
   text lifts a little as it goes. */
.page-hero { --hero-progress: 0; }

html.motion .page-hero::before {
  transform: translate3d(0, calc(var(--hero-progress) * 8vh), 0)
             scale(calc(1 + var(--hero-progress) * .06));
}
html.motion .page-hero > .container {
  opacity: calc(1 - var(--hero-progress) * .85);
  transform: translate3d(0, calc(var(--hero-progress) * -3vh), 0);
}


/* ============================================================
   06  HOVER: CARDS, MEDIA, LINKS

   The rule for hover on this site: the photograph moves, the card
   does not do anything clever. A property card lifting 6px with its
   image pushing in 7% and a sandstone edge lighting up is enough. No
   rotation, no 3D, nothing that makes a listing hard to read.
   ============================================================ */
.property-card,
.agent-card,
.suburb-card,
.post-card {
  transition: transform 520ms var(--curve-out),
              box-shadow 520ms var(--curve-out);
}

.card-media,
.property-card .card-media,
.agent-media {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.card-media img,
.agent-media img {
  transition: transform 900ms var(--curve-out), filter 700ms var(--curve-soft);
}
.property-card:hover .card-media img,
.property-card:focus-within .card-media img,
.agent-card:hover .agent-media img { transform: scale(1.07); }

/* A sandstone wash and a slow diagonal sheen. The wash sits under the
   badges and the heart, which is why .card-media is an isolated
   stacking context - a z-index here cannot escape into the grid. */
.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
      linear-gradient(to top, rgba(6, 26, 59, .46) 0%, rgba(6, 26, 59, 0) 46%),
      linear-gradient(105deg, transparent 40%, rgba(247, 229, 142, .22) 50%, transparent 60%);
  background-size: 100% 100%, 260% 100%;
  background-position: 0 0, 160% 0;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 520ms var(--curve-soft), background-position 1100ms var(--curve-out);
  pointer-events: none;
}
.property-card:hover .card-media::after,
.property-card:focus-within .card-media::after {
  opacity: 1;
  background-position: 0 0, -60% 0;
}

/* Underline that draws from the left instead of appearing. */
.link-draw {
  position: relative;
  display: inline-block;
  color: var(--ink);
  font-weight: 600;
}
.link-draw::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1.5px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 480ms var(--curve-out);
}
.link-draw:hover::after,
.link-draw:focus-visible::after { transform: scaleX(1); transform-origin: left center; }

/* Pointer-tracked tilt, used on the two or three editorial images that
   are big enough to carry it. motion.js writes --rx / --ry in degrees;
   the ceiling is 6deg, which is a suggestion of depth, not a toy. */
[data-tilt] { --rx: 0deg; --ry: 0deg; --tz: 0px; }
html.motion [data-tilt] {
  transform: perspective(1200px) rotateX(var(--rx)) rotateY(var(--ry)) translateZ(var(--tz));
  transition: transform 600ms var(--curve-out);
  transform-style: preserve-3d;
}
html.motion [data-tilt].is-tilting { transition: transform 120ms linear; }

/* Magnetic pull on the primary call to action. 8px maximum. */
[data-magnetic] { --mx: 0px; --my: 0px; }
html.motion [data-magnetic] {
  transform: translate3d(var(--mx), var(--my), 0);
  transition: transform 500ms var(--curve-out);
}
html.motion [data-magnetic].is-pulling { transition: transform 120ms linear; }


/* ============================================================
   07  MARQUEE

   Used once, for the suburb strip. The track is duplicated in the
   markup so the loop is seamless at exactly -50%, and it pauses on
   hover and on focus-within so a keyboard user can reach the links.
   ============================================================ */
.marquee {
  position: relative;
  overflow: hidden;
  /* Fades the ends into the section ground so words do not get
     guillotined at the viewport edge. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  gap: var(--sp-7);
  align-items: center;
}
@keyframes kasana-marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
html.motion .marquee-track {
  animation: kasana-marquee var(--marquee-dur, 42s) linear infinite;
  will-change: transform;
}
.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track { animation-play-state: paused; }
.marquee-reverse .marquee-track { animation-direction: reverse; }


/* ============================================================
   08  SCROLL PROGRESS AND CHROME
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 2px;
  background: transparent;
  pointer-events: none;
}
.scroll-progress::after {
  content: "";
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--stone-700), var(--stone-500), var(--stone-300));
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: left center;
}

/* The header condenses once the page has moved. Background and shadow
   change together so the bar reads as glass settling onto the page.

   transform is in the list because this rule wins over the one in
   style.css - motion.css is the last sheet loaded - and leaving it out
   here is enough to make the bar snap out of view on the way down
   instead of riding up. border-color came out with the border. */
.site-header {
  transition: transform 420ms var(--curve-out),
              background-color 420ms var(--curve-out),
              box-shadow 420ms var(--curve-out);
}

/* The wash fades on the same curve as the bar filling in behind it, so
   one does not arrive before the other has left. */
.site-header::before { transition: opacity 420ms var(--curve-out); }

.to-top { transition: opacity 380ms var(--curve-out), transform 380ms var(--curve-out); }
html.motion .to-top:not([hidden]) { animation: kasana-pop 420ms var(--curve-out) both; }
@keyframes kasana-pop {
  from { opacity: 0; transform: translateY(14px) scale(.9); }
  to   { opacity: 1; transform: none; }
}


/* ============================================================
   09  LIGHTBOX AND GALLERY
   ============================================================ */
html.motion .lightbox { transition: opacity 320ms var(--curve-soft), visibility 320ms; }
html.motion .lightbox img,
html.motion .lightbox-figure {
  transform: scale(.94);
  opacity: 0;
  transition: transform 620ms var(--curve-out), opacity 420ms var(--curve-soft);
}
html.motion .lightbox.is-open img,
html.motion .lightbox.is-open .lightbox-figure { transform: none; opacity: 1; }

/* Gallery thumbs get the same wipe as everything else, staggered. */
html.motion .gallery-grid .img-frame { --rv-delay: calc(var(--i, 0) * 90ms); }


/* ============================================================
   10  SMALL SCREENS

   Travel that reads as considered on a 1440px canvas reads as a
   lurch on a 390px one, because the same 34px is a far larger share
   of what the eye can see. Everything below is the same choreography
   with the distances and the depth scaled back - nothing is switched
   off that a visitor would notice missing, and the two effects that
   genuinely cost a phone something (Ken Burns resampling a full
   bleed photograph every frame, and parallax fighting a thumb) are
   the two that are cut hardest.

   These are width queries, not pointer queries: a narrow window on a
   desktop has exactly the same problem.
   ============================================================ */
@media (max-width: 900px) {
  html.motion [data-reveal]           { --rv-dur: 760ms; }
  html.motion [data-reveal="rise"],
  html.motion [data-reveal=""]        { transform: translate3d(0, 22px, 0); }
  html.motion [data-reveal="rise-sm"] { transform: translate3d(0, 12px, 0); }
  html.motion [data-reveal="left"]    { transform: translate3d(-22px, 0, 0); }
  html.motion [data-reveal="right"]   { transform: translate3d(22px, 0, 0); }
  html.motion [data-reveal="scale"]   { transform: scale(.97); }
  html.motion [data-reveal="blur"]    { filter: blur(8px); transform: translate3d(0, 14px, 0); }

  /* Half depth. The sense of layering survives; the sense that the
     page is coming apart under your thumb does not appear. */
  html.motion [data-parallax] { transform: translate3d(0, calc(var(--px) * .45), 0); }
  html.motion .img-frame[data-parallax-inner] > img {
    transform: translate3d(0, calc(var(--px) * .45), 0) scale(1.02);
  }

  html.motion .hero-media {
    transform: translate3d(0, calc(var(--hero-progress) * 7vh), 0)
               scale(calc(1 + var(--hero-progress) * .05));
  }
  html.motion .page-hero::before {
    transform: translate3d(0, calc(var(--hero-progress) * 4vh), 0)
               scale(calc(1 + var(--hero-progress) * .03));
  }

  /* Ken Burns is a full-screen image being resampled every frame for
     an effect nobody on a phone is sitting still long enough to see.
     The static overscan is kept so the framing does not shift. */
  html.motion .ken > img,
  html.motion img.ken { animation: none; transform: scale(1.04); }

  /* Tilt and magnetic pull are already mouse-only in motion.js; this
     is belt and braces for a hybrid device reporting a fine pointer
     on a small screen. */
  html.motion [data-tilt]     { transform: none; }
  html.motion [data-magnetic] { transform: none; }
}

@media (max-width: 640px) {
  html.motion [data-reveal] { --rv-dur: 680ms; }

  /* The wipe keeps its sweep, but a shorter one - a 1.5s settle is a
     long time to hold a phone still for. */
  html.motion .img-frame[data-img-reveal] > img,
  html.motion .img-frame[data-img-reveal] > picture > img {
    transform: scale(1.10);
    transition-duration: 880ms, 1050ms;
  }
  html.motion .img-frame[data-img-reveal]::before { transition-duration: 780ms; }

  html.motion [data-split] .word-inner { transition-duration: 820ms, 620ms; }

  /* The hero cascade tightens so the fold is settled sooner. */
  html.motion .hero-inner > *:nth-child(3) { --hero-delay: 380ms; }
  html.motion .hero-inner > *:nth-child(4) { --hero-delay: 460ms; }
  html.motion .hero-inner > *:nth-child(5) { --hero-delay: 540ms; }
  html.motion .hero-inner > *:nth-child(6) { --hero-delay: 600ms; }
  html.motion .hero .search-card,
  html.motion .hero-aside {
    transform: translate3d(0, 28px, 0) scale(.99);
    transition-delay: 520ms;
  }
}


/* ============================================================
   11  REDUCED MOTION AND PRINT

   html.motion is never added when the visitor has asked for reduced
   motion, so the reveal rules above simply do not apply. The block
   below is the safety net for the handful of animations declared
   outside that gate, and for anyone who changes the setting
   mid-session without reloading.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal],
  [data-split] .word-inner,
  .img-frame[data-img-reveal] > img,
  .hero-inner > *,
  .hero .search-card,
  .hero-aside,
  .page-hero > .container,
  .page-hero > .container > * {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    filter: none !important;
  }

  /* Transform only. The .5 opacity on this layer is the design
     dimming the photograph behind the headline, not an animation,
     and forcing it to 1 would light the hero up. */
  .page-hero::before { transform: none !important; }

  /* Nothing is waiting on a compositor layer any more. */
  [data-reveal],
  [data-split] .word-inner,
  .img-frame[data-img-reveal] > img,
  [data-parallax] { will-change: auto !important; }
  .img-frame[data-img-reveal]::before { display: none; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee-track { flex-wrap: wrap; width: auto; justify-content: center; }
}

@media print {
  [data-reveal],
  [data-split] .word-inner,
  .img-frame[data-img-reveal] > img,
  .hero-inner > *,
  .page-hero > .container,
  .page-hero > .container > * { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .img-frame[data-img-reveal]::before { display: none !important; }
  .scroll-progress,
  .hero-cue,
  .to-top { display: none !important; }
}
