/* ============================================================================
   AMILLATI & CO, "LOCO" variant (25 Sep 2026). Site-wide additions.
   ============================================================================
   HAND-WRITTEN. Loaded after site.css (and pages.css on the content pages) on all five
   pages. Nothing in here adds a word: it is framing, choreography and grading only.

   What it carries
     1. grain + the persistent Vitruvian motif, now on every page (home had them already)
     2. the construction geometry: circle, circle, square, in hairline gold, centred by
        loco.js on a point measured in the photograph (the sun) or the clip (the head)
     3. the homepage hero choreography: photo develops in, rings arm, headline assembles
        word by word, the type dissolves upward on scroll, the page slides up over the water
     4. the content pages: masked line-rise on the h1, hairline draw-in, the horizon strip
        (the same Repulse Bay file, cropped by CSS only) and the sea under every close
     5. the About head: Palette B duotone, rings, a pause control
     6. reduced motion and print: every reveal reset to its END state. Nothing display:none.

   Easing discipline as the rest of the site: expo-out for display scale, plain ease for
   body scale. Only transform, opacity, filter and clip-path animate.
   ============================================================================ */

:root{
  --lc-expo:cubic-bezier(0.16,1,0.3,1);
  --lc-develop:cubic-bezier(0.32,0.08,0.24,1);
  --lc-rise:cubic-bezier(0.19,1,0.22,1);
  --lc-grain:.055;
  --lc-motif:.11;
  --lc-ring-blend:multiply;
  --lc-sea-blend:multiply;
  --lc-sea-o:.6;
  --lc-sea-filter:saturate(.72) brightness(1.04) contrast(.98);
  --lc-strip-o:.88;
  --lc-strip-filter:saturate(.7) brightness(1.12) contrast(.9);
  --lc-head-filter:grayscale(1) contrast(1.06) brightness(1.04);
  --lc-head-blend:multiply;
  --lc-head-tint:linear-gradient(150deg,#5d6a4c 0%,#8a7a45 42%,#b98a2e 100%);
  --lc-head-tint-o:.78;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --lc-grain:.09; --lc-motif:.10;
    --lc-ring-blend:screen;
    --lc-sea-blend:normal; --lc-sea-o:.5;
    --lc-sea-filter:saturate(.7) brightness(.62) contrast(1.04);
    --lc-strip-o:.82; --lc-strip-filter:saturate(.7) brightness(.66) contrast(1.04);
    --lc-head-filter:grayscale(1) contrast(1.12) brightness(.7);
    --lc-head-blend:screen;
    --lc-head-tint:linear-gradient(150deg,#2a3124 0%,#5b4a22 48%,#8a6320 100%);
    --lc-head-tint-o:.7;
  }
}
:root[data-theme="dark"]{
  --lc-grain:.09; --lc-motif:.10;
  --lc-ring-blend:screen;
  --lc-sea-blend:normal; --lc-sea-o:.5;
  --lc-sea-filter:saturate(.7) brightness(.62) contrast(1.04);
  --lc-strip-o:.82; --lc-strip-filter:saturate(.7) brightness(.66) contrast(1.04);
  --lc-head-filter:grayscale(1) contrast(1.12) brightness(.7);
  --lc-head-blend:screen;
  --lc-head-tint:linear-gradient(150deg,#2a3124 0%,#5b4a22 48%,#8a6320 100%);
  --lc-head-tint-o:.7;
}

/* ---- 1. grain and motif, every page ---- */
.grain{position:fixed;inset:0;z-index:60;pointer-events:none;opacity:var(--lc-grain);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");}
.motif{position:fixed;inset:0;z-index:1;pointer-events:none;display:grid;place-items:center;overflow:hidden;
  opacity:0;will-change:opacity;}
.motif i{display:block;width:min(88vh,96vw);aspect-ratio:3/4;background:var(--gold);opacity:var(--lc-motif);
  -webkit-mask:url(/site-motion/repulse-bay/assets/vitruvian-motif.webp) center/contain no-repeat;
  mask:url(/site-motion/repulse-bay/assets/vitruvian-motif.webp) center/contain no-repeat;mask-mode:luminance;
  transform:rotate(var(--motif-r,0deg));will-change:transform;}
@media (prefers-reduced-motion: reduce){ .motif i{transform:none !important;} }
@media print{ .motif,.grain{display:none;} }

/* ---- 2. the construction geometry ----
   Leonardo's figure is a body inscribed in a circle and a square. The three hairlines are
   those construction lines. loco.js sets left/top/width/height so the centre lands on the
   measured point; the rings themselves only ever animate opacity and transform.
   Ring device numbers from MotionSites `luxury-hero`: scale .75 to 1 over 1200ms, delays
   0 / 150 / 350ms. Armed 200ms after load. */
.geo{position:absolute;left:50%;top:50%;width:0;height:0;pointer-events:none;z-index:0;
  transform:translate(-50%,-50%);mix-blend-mode:var(--lc-ring-blend);
  opacity:var(--geo-o,1);}
.geo i{position:absolute;border:1px solid var(--gold);display:block;opacity:0;transform:scale(.75);
  transition:opacity 1.2s var(--lc-expo),transform 1.2s var(--lc-expo);}
.geo .c1{inset:0;border-radius:50%;}
.geo .c2{inset:11%;border-radius:50%;}
.geo .s1{inset:15%;border-radius:1px;}
.geo.in .c1{opacity:.42;transform:scale(1);transition-delay:0ms;}
.geo.in .c2{opacity:.26;transform:scale(1);transition-delay:150ms;}
.geo.in .s1{opacity:.32;transform:scale(1);transition-delay:350ms;}
/* the sun's own hairline tick marks: the two rays of the photograph are at 73.5 and 28
   degrees; the geometry does not repeat them. One centre dot only, sized by the script. */
.geo .dot{position:absolute;left:50%;top:50%;width:var(--geo-dot,6px);height:var(--geo-dot,6px);
  margin:calc(var(--geo-dot,6px) / -2) 0 0 calc(var(--geo-dot,6px) / -2);border-radius:50%;
  border:1px solid var(--gold);opacity:0;transform:scale(.4);
  transition:opacity 1s var(--lc-expo) 500ms,transform 1s var(--lc-expo) 500ms;}
.geo.in .dot{opacity:.32;transform:scale(1);}

/* ---- 3. the homepage hero ---- */
/* the pin: the hero holds under the nav while the next section slides up over the water.
   Enabled by loco.js only at 861px and up, 620px tall and up, and never under reduced
   motion (it is the one thing here a phone should not be trapped in). */
.hero-stage{position:relative;}
/* the room the pin holds for is a spacer, not padding: sticky measures its containing block's
   CONTENT box, so padding gives it nothing to stick against (measured, 25 Sep) */
.hero-stage.is-pinned::after{content:"";display:block;height:var(--pin,44vh);}
.hero-stage.is-pinned .hero-pin{position:sticky;top:var(--nav-h);z-index:0;background:var(--ground);}
.hero-stage.is-pinned + .quiet{margin-top:calc(-1 * var(--pin,44vh));position:relative;
  box-shadow:0 -40px 80px -40px rgba(20,18,16,.22);}
/* the photograph develops: the plate settles from a hair larger, the exposure comes up.
   Numbers from MotionSites `mistveil` (develop: clip-path inset(12% 0 0 0) + opacity, 1100ms)
   and `mountain-retreat` (plate-in: scale 1.06 to 1 over 2s). The scene is the transformed
   element, so the photo and its two canvases stay registered pixel for pixel. */
.js .amx-scene{animation:lc-develop 1.4s var(--lc-develop) both,lc-plate 2.2s var(--lc-expo) both;}
@keyframes lc-develop{from{opacity:0;clip-path:inset(10% 0 0 0);}to{opacity:1;clip-path:inset(0 0 0 0);}}
@keyframes lc-plate{from{transform:scale(1.045);}to{transform:none;}}
/* the headline assembles word by word. From MotionSites `vision-reveal`: 0.4s, 50ms per
   word, 10px rise, 10px blur; the duration being 8x the step is what makes it read as a
   sentence forming rather than a typewriter. One heading per site. */
.js .amx-hero h1 .w{display:inline-block;opacity:0;transform:translateY(10px);filter:blur(10px);
  transition:opacity .4s var(--ease-body),transform .4s var(--ease-body),filter .4s var(--ease-body);
  transition-delay:calc(var(--wi,0) * 50ms + 350ms);}
.js .amx-hero h1.words-in .w{opacity:1;transform:none;filter:none;}
/* the rest of the type lifts in after the words, quietly */
.js .amx-hero .amx-horizon,.js .amx-hero .amx-sub,.js .amx-hero .amx-cta{
  animation:lc-lift .9s var(--lc-rise) both;}
.js .amx-hero .amx-horizon{animation-delay:.25s;transform-origin:0 50%;animation-name:lc-draw;}
.js .amx-hero .amx-sub{animation-delay:1.05s;}
.js .amx-hero .amx-cta{animation-delay:1.25s;}
@keyframes lc-lift{from{opacity:0;transform:translateY(12px);}to{opacity:1;transform:none;}}
@keyframes lc-draw{from{transform:scaleX(0);}to{transform:none;}}
/* scroll-exit: rAF writes opacity, transform and filter into these; the class is the hint */
.hero-exit{will-change:opacity,transform,filter;}
/* the caption inside the pin */
.hero-pin .amx-caption{padding-bottom:10px;}

/* ---- 4. the content pages ---- */
/* the h1 rises from behind a clip edge (MotionSites `mountain-retreat` line-open + line-rise:
   1.15s, expo). Done on the block rather than per line so wrapping never cuts a word. */
.js .pg-hero h1{clip-path:inset(-10% -6% -14% -6%);}
.js .pg-hero h1 > .rise{display:block;animation:lc-rise 1.15s var(--lc-rise) .12s both;}
@keyframes lc-rise{from{transform:translateY(.68em);opacity:0;}40%{opacity:1;}to{transform:none;opacity:1;}}
.js .pg-hero .eyebrow{animation:lc-lift .8s var(--lc-rise) both;}
.js .pg-hero .sub{animation:lc-lift .9s var(--lc-rise) .55s both;}
/* eyebrow hairline that draws in from the left (the rail label already has none, so this is
   the hero eyebrow only): 64px, gold, 1.2s expo */
.pg-hero .eyebrow{position:relative;padding-top:18px;}
.pg-hero .eyebrow::before{content:"";position:absolute;left:0;top:0;width:64px;height:1px;background:var(--gold);
  transform-origin:0 50%;}
.js .pg-hero .eyebrow::before{animation:lc-draw 1.2s var(--lc-expo) .2s both;}
.pg-hero{border-bottom:0;padding-bottom:clamp(36px,5vw,64px);}

/* the horizon strip: the same photograph, the water under the sun, full bleed between the
   hero and the first section. Cropped by object-fit only; the file is untouched. It drifts
   a little as it crosses the viewport (loco.js, transform only, off under reduced motion). */
.horizon{position:relative;height:clamp(150px,22vw,280px);overflow:hidden;isolation:isolate;
  background:var(--ground-2);}
.horizon img{position:absolute;left:0;top:0;width:100%;height:132%;max-width:none;object-fit:cover;
  object-position:50% 92%;display:block;opacity:var(--lc-strip-o);filter:var(--lc-strip-filter);
  transform:translate3d(0,var(--drift,0px),0);will-change:transform;}
.horizon::before,.horizon::after{content:"";position:absolute;left:0;right:0;height:38%;z-index:1;pointer-events:none;}
.horizon::before{top:0;background:linear-gradient(to bottom,var(--ground) 0%,transparent 100%);}
.horizon::after{bottom:0;background:linear-gradient(to top,var(--ground) 0%,transparent 100%);}
/* the gold horizon line the homepage hero carries, here across the whole strip */
.horizon i{position:absolute;left:50%;top:50%;z-index:2;height:1px;width:min(1180px,100% - 2 * clamp(22px,5vw,64px));
  transform:translate(-50%,-50%) scaleX(var(--hz,1));transform-origin:0 50%;background:var(--gold);opacity:.6;}
.js .horizon i{animation:lc-draw 1.6s var(--lc-expo) .5s both;}
.pg.pg-after{padding-top:0;}

/* the sea under every close: the lower part of the photograph, the water only, masked so it
   comes up from the foot of the band. Light: bone multiply. Dark: sits in ink. */
.cta-band,.close{position:relative;overflow:hidden;isolation:isolate;}
.cta-band > *:not(.sea),.close > *:not(.sea){position:relative;z-index:1;}
.sea{position:absolute;left:0;right:0;bottom:0;height:min(62%,420px);z-index:0;pointer-events:none;
  mix-blend-mode:var(--lc-sea-blend);opacity:var(--lc-sea-o);
  -webkit-mask-image:linear-gradient(to bottom,transparent 0%,rgba(0,0,0,.55) 45%,#000 100%);
          mask-image:linear-gradient(to bottom,transparent 0%,rgba(0,0,0,.55) 45%,#000 100%);}
.sea img{width:100%;height:100%;max-width:none;object-fit:cover;object-position:50% 100%;display:block;
  filter:var(--lc-sea-filter);}
/* the last hairline of light: a warm wash rising with the water */
.sea::after{content:"";position:absolute;inset:0;
  background:radial-gradient(60% 70% at 38% 100%,color-mix(in srgb,var(--gold) 22%,transparent) 0%,transparent 70%);}

/* ---- 5. the About head ---- */
/* Rob, 25 Sep: keep the spinning head, different style, colours consistent with the site.
   The clip is pale blue and pink; it is taken to greyscale and coloured through a bronze
   green to gold tint (mix-blend color), so it reads as a bronze on bone, an etching in ink. */
.abt-lc .bganim,.abt-lc .bgvid{filter:var(--lc-head-filter);}
.abt-lc .duo{position:absolute;inset:0;z-index:0;pointer-events:none;background:var(--lc-head-tint);
  mix-blend-mode:color;opacity:var(--lc-head-tint-o);}
.abt-lc .duo2{position:absolute;inset:0;z-index:0;pointer-events:none;background:var(--lc-head-tint);
  mix-blend-mode:var(--lc-head-blend);opacity:.28;}
.abt-lc .tint{z-index:1;}
.abt-lc .geo{z-index:2;}
/* the head is the centre of the construction. Rings sit above the clip, under the tint. */
.abt-lc .inner{z-index:10;}
/* pause control for the head: the same corner control the homepage photo has */
.abt-pause{position:absolute;z-index:12;right:clamp(14px,2vw,26px);bottom:clamp(14px,2vw,26px);
  width:36px;height:36px;padding:0;margin:0;border-radius:50%;border:1px solid var(--hair);
  background:color-mix(in srgb,var(--ground) 40%,transparent);
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);cursor:pointer;opacity:.7;transition:opacity .4s ease;}
.abt-pause:hover,.abt-pause:focus-visible{opacity:1;}
.abt-pause::before,.abt-pause::after{content:"";position:absolute;top:12px;width:3px;height:12px;background:var(--ink);}
.abt-pause::before{left:13px;}
.abt-pause::after{left:20px;}
.abt-pause[aria-pressed="true"]::before{left:14px;top:11px;width:0;height:0;background:none;border-style:solid;
  border-width:7px 0 7px 11px;border-color:transparent transparent transparent var(--ink);}
.abt-pause[aria-pressed="true"]::after{display:none;}
.hero.is-paused .bgvid{visibility:hidden;}
.hero.is-paused .bganim{visibility:hidden;}
.hero .still{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:0;
  filter:var(--lc-head-filter);visibility:hidden;}
.hero.is-paused .still{visibility:visible;}
@media (prefers-reduced-motion: reduce){ .abt-pause{transition:none;} }
/* the media box: on desktop it is the whole hero (absolute, inset 0, so nothing moves); under
   900px it comes out of the background and sits in flow below the copy at the clip's own 16:9,
   soft-edged top and bottom into the ground. From MotionSites `heritage-grove`. */
.abt-lc .abt-media{position:absolute;inset:0;z-index:0;}
@media (max-width:900px){
  .abt-lc{min-height:0;display:flex;flex-direction:column;}
  .abt-lc .inner{position:relative;flex:none;padding-bottom:18px;order:0;}
  .abt-lc .abt-media{order:1;}
  .abt-lc .top{margin-top:0;padding-top:clamp(28px,6vh,60px);}
  .abt-lc .stats{margin-top:clamp(30px,5vh,48px);}
  .abt-lc .abt-media{position:relative;inset:auto;width:100%;aspect-ratio:16/9;overflow:hidden;isolation:isolate;
    margin-top:8px;}
  .abt-lc .tint{background:linear-gradient(to bottom,var(--ground) 0%,transparent 26%,transparent 72%,var(--ground) 100%);}
  .abt-lc .tint::after{content:none;}
  .abt-lc h1,.abt-lc .top .sub{text-shadow:none;}
  .abt-pause{right:14px;bottom:14px;width:32px;height:32px;}
  .abt-pause::before,.abt-pause::after{top:10px;}
  .abt-pause::before{left:11px;}
  .abt-pause::after{left:18px;}
  .abt-pause[aria-pressed="true"]::before{left:12px;top:9px;}
}

/* ---- 6. reduced motion and print: END states, never hidden ---- */
@media (prefers-reduced-motion: reduce){
  .js .amx-scene,.js .amx-hero .amx-horizon,.js .amx-hero .amx-sub,.js .amx-hero .amx-cta,
  .js .pg-hero h1 > .rise,.js .pg-hero .eyebrow,.js .pg-hero .sub,.js .pg-hero .eyebrow::before,.js .horizon i{
    animation:none !important;opacity:1 !important;transform:none !important;clip-path:none !important;}
  .js .amx-hero h1 .w,.hero-exit,.geo,.geo i{
    opacity:1 !important;transform:none !important;filter:none !important;visibility:visible !important;
    transition:none !important;animation:none !important;}
  .geo .c1{opacity:.42 !important;} .geo .c2{opacity:.26 !important;} .geo .s1{opacity:.32 !important;} .geo .dot{opacity:.5 !important;}
  .geo i{transform:none !important;}
  .horizon img{transform:none !important;}
  .hero-stage.is-pinned::after{display:none;}
  .hero-stage.is-pinned .hero-pin{position:static;}
  .hero-stage.is-pinned + .quiet{margin-top:0;box-shadow:none;}
  html{scroll-behavior:auto;}
}
@media print{
  .js .amx-scene,.js .amx-hero .amx-horizon,.js .amx-hero .amx-sub,.js .amx-hero .amx-cta,
  .js .pg-hero h1 > .rise,.js .pg-hero .eyebrow,.js .pg-hero .sub,.js .pg-hero .eyebrow::before,.js .horizon i{
    animation:none !important;opacity:1 !important;transform:none !important;clip-path:none !important;}
  .js .amx-hero h1 .w,.hero-exit{opacity:1 !important;transform:none !important;filter:none !important;}
  .geo,.sea,.horizon{display:none;}
  .hero-stage.is-pinned::after{display:none;}
  .hero-stage.is-pinned .hero-pin{position:static;}
  .hero-stage.is-pinned + .quiet{margin-top:0;box-shadow:none;}
  .abt-pause{display:none;}
  /* the page's older reveals never had a print reset (printing does not scroll, so an
     un-scrolled section printed blank). Every one of them to its END state here. */
  .js .rv,.js .bu,.who-js .who [data-who-reveal],.wrk-js .wrk-rv,.eth .eth-panel,.eth .eth-coda-row,.eth .eth-head,
  .eth .eth-num,.eth .eth-copy,.eth .eth-copy p{
    opacity:1 !important;transform:none !important;translate:none !important;scale:none !important;
    filter:none !important;visibility:visible !important;transition:none !important;animation:none !important;}
  .eth .eth-track{height:auto !important;}
  .eth .eth-stage{position:static !important;height:auto !important;overflow:visible !important;display:block !important;}
  .eth .eth-wrap{display:block !important;}
  .eth .eth-panels{display:grid !important;position:static !important;}
  .eth .eth-panel{position:static !important;inset:auto !important;left:auto !important;width:auto !important;display:grid !important;}
  .eth .eth-glow,.eth .eth-rail,.band{display:none !important;}
  .band-row{transform:none !important;}
}
