/* Unlock Integrations v6.7 (v9.1 timing): the home hero as a pinned, scroll-driven sequence. The stage
   holds still while you scroll: the un-link mark closes, then four service chapters play over photos
   of the work itself. Without JS or with reduced motion it is a single, still opening screen.
   --step is the scroll given to each scene; the last chapter gets only --tail of a step before the
   page moves on (hero-cinema-v2.js reads the same --tail). */

.cine-scroll { --hdr:88px; --step:62svh; --tail:.3; position:relative; background:var(--c-sage-6); color:var(--c-sage-96); }
html.js .page-home .cine-scroll { margin-top:calc(-1 * var(--hdr)); }
@media (prefers-reduced-motion:no-preference) {
  html.js .cine-scroll:not(.is-static) { height:calc(100svh + (var(--chapters) + var(--tail)) * var(--step)); }
  html.js .cine-scroll:not(.is-static) .cine-pin { position:sticky; top:0; }
  html.js .cine-scroll:not(.is-static) { --link:0; }
}
.cine-pin { position:relative; display:flex; height:100svh; min-height:600px; max-height:1000px; overflow:hidden; isolation:isolate; }

/* The header floats over the stage while it is on screen. */
html.js .page-home .site-header { transition:background-color var(--dur-3) ease, border-color var(--dur-3) ease, backdrop-filter var(--dur-3) ease; }
html.js .page-home .site-header.is-over-hero:not(.menu-open) { background:transparent; border-bottom-color:transparent; backdrop-filter:none; -webkit-backdrop-filter:none; }

/* Photos: one per scene, crossfaded, each pushing in slowly as you scroll through it. */
.cine-stage { position:absolute; inset:0; z-index:-1; background:var(--c-sage-6); }
.cine-frame { position:absolute; inset:0; opacity:0; transition:opacity var(--dur-5) ease;
  background:var(--photo-md, none) var(--photo-pos, center)/cover no-repeat;
  filter:grayscale(1) sepia(.28) hue-rotate(112deg) saturate(1.5) contrast(1.08) brightness(calc(var(--photo-bright, 1) * .62));
  -webkit-mask-image:linear-gradient(90deg, color-mix(in srgb, var(--c-black) 18%, transparent) 0, color-mix(in srgb, var(--c-black) 18%, transparent) 26%, var(--c-black) 62%); mask-image:linear-gradient(90deg, color-mix(in srgb, var(--c-black) 18%, transparent) 0, color-mix(in srgb, var(--c-black) 18%, transparent) 26%, var(--c-black) 62%);
  transform:scale(calc(1.03 + var(--push, 0) * .09)); transform-origin:60% 45%; will-change:transform, opacity; }
.cine-frame.is-active { opacity:.82; }
.cine-stage::after { content:""; position:absolute; inset:0; background:
  linear-gradient(90deg, color-mix(in srgb, var(--c-sage-6) 94%, transparent) 0%, color-mix(in srgb, var(--c-sage-6) 80%, transparent) 30%, color-mix(in srgb, var(--c-sage-6) 36%, transparent) 60%, color-mix(in srgb, var(--c-sage-6) 24%, transparent) 80%, color-mix(in srgb, var(--c-sage-6) 46%, transparent) 100%),
  linear-gradient(0deg, var(--c-sage-6) 0%, color-mix(in srgb, var(--c-sage-6) 70%, transparent) 18%, color-mix(in srgb, var(--c-sage-6) 0%, transparent) 46%),
  linear-gradient(180deg, color-mix(in srgb, var(--c-sage-6) 74%, transparent) 0%, color-mix(in srgb, var(--c-sage-6) 0%, transparent) 24%),
  linear-gradient(120deg, color-mix(in srgb, var(--c-green-39) 0%, transparent) 40%, color-mix(in srgb, var(--c-green-39) 28%, transparent) 100%); }

/* The mark: its two shackles start apart and hook together as the sequence begins. */
.cine-mark { position:absolute; z-index:0; top:50%; right:max(48px, calc((100vw - 1312px) / 2 + 40px));
  width:clamp(160px, 19vw, 300px); height:auto; color:var(--c-mint-87); overflow:visible; pointer-events:none;
  translate:0 -56%; transition:opacity var(--dur-4) ease, scale var(--dur-5) var(--ease-out); }
.cine-mark path { transition:transform var(--dur-1) linear; }
.cine-mark .link-n { transform:translate(calc((1 - var(--link, 1)) * -7px), calc((1 - var(--link, 1)) * -15px)); }
.cine-mark .link-u { transform:translate(calc((1 - var(--link, 1)) * 7px), calc((1 - var(--link, 1)) * 15px)); }
.cine-scroll.is-chapter .cine-mark { opacity:0; scale:.86; }

/* Copy: every scene sits in the same spot, low on the left; only the current one shows. */
.cine-body { position:relative; z-index:1; display:grid; grid-template-rows:1fr auto; padding-top:calc(var(--hdr) + var(--sp-13)); padding-bottom:var(--sp-11); }
.cine-scenes { display:grid; align-self:end; }
.cine-scene { grid-area:1 / 1; align-self:end; max-width:var(--w-13); padding-bottom:clamp(var(--sp-13), 6vh, var(--sp-16));
  opacity:0; visibility:hidden; transform:translateY(26px);
  transition:opacity var(--dur-3) ease, transform var(--dur-4) var(--ease-out), visibility 0s linear var(--dur-4); }
.cine-scene.is-active { opacity:1; visibility:visible; transform:none; transition:opacity var(--dur-4) ease var(--dur-1), transform var(--dur-5) var(--ease-out) var(--dur-1), visibility 0s; }
.cine-scroll.is-static .cine-scene:not(:first-child), html:not(.js) .cine-scene:not(:first-child) { display:none; }
.unlock-site .cine-scroll h1, .unlock-site .cine-scroll h2 { margin:0; color:var(--c-sage-96); font:var(--fw-600) var(--fs-display)/var(--lh-2) var(--display);
  letter-spacing:var(--ls-tighter); word-spacing:.03em; text-wrap:balance; }
.unlock-site .cine-scroll h2 { font-size:var(--fs-display); max-width:var(--measure-1); }
.cine-line { display:block; overflow:hidden; padding-bottom:.08em; margin-bottom:-.08em; }
.cine-line > span { display:inline-block; }
.cine-line + .cine-line > span { color:var(--c-mint-87); }
.cine-lede { max-width:var(--w-5); margin:var(--sp-11) 0 0 !important; color:var(--c-sage-85); font-size:var(--fs-lead); line-height:var(--lh-8); letter-spacing:var(--ls-trim); }
.cine-scroll .actions { display:flex; flex-wrap:wrap; align-items:center; gap:var(--sp-9) var(--sp-11); margin-top:var(--sp-12); }
.cine-scroll .flow-link { color:var(--c-mint-87); }
.cine-scene > .flow-link { display:inline-flex; margin-top:var(--sp-11); }

/* The reel: one bar per chapter, filled by your scroll position. */
.cine-reel { display:flex; align-items:flex-end; gap:var(--sp-12); }
.cine-cues { flex:1; display:grid; grid-template-columns:repeat(var(--chapters), minmax(0,1fr)); gap:var(--sp-11); }
.unlock-site .cine-cue { display:grid; gap:var(--sp-6); color:var(--c-sage-96) !important; font:var(--fw-600) var(--fs-5)/var(--lh-5) var(--display); letter-spacing:var(--ls-trim); text-decoration:none; opacity:.55; transition:opacity var(--dur-3) ease; }
.unlock-site .cine-cue:hover, .unlock-site .cine-cue.is-current { opacity:1; }
.cue-bar { position:relative; display:block; height:2px; overflow:hidden; border-radius:var(--r-1); background:color-mix(in srgb, var(--c-sage-96) 20%, transparent); }
.cue-bar i { position:absolute; inset:0; transform:scaleX(0); transform-origin:left; background:var(--c-mint-87); }
.cine-scroll-hint { display:flex; align-items:center; gap:var(--sp-5); color:var(--c-sage-70); font-size:var(--fs-3); letter-spacing:var(--ls-wide); transition:opacity var(--dur-3) ease; }
.cine-scroll-hint i { position:relative; display:block; width:1px; height:26px; overflow:hidden; background:color-mix(in srgb, var(--c-sage-96) 22%, transparent); }
.cine-scroll-hint i::after { content:""; position:absolute; left:0; top:-40%; width:1px; height:40%; background:var(--c-mint-87); animation:cine-hint 1.8s ease-in-out infinite; }
@keyframes cine-hint { to { top:100%; } }
.cine-scroll.is-chapter .cine-scroll-hint, .cine-scroll.is-static .cine-scroll-hint, html:not(.js) .cine-scroll-hint { opacity:0; }

/* Opening: the headline rises in once. */
@media (prefers-reduced-motion:no-preference) {
  html.js:not(.motion-off) .cine-line > span { animation:cine-rise var(--dur-5) var(--ease-out) both; }
  html.js:not(.motion-off) .cine-line + .cine-line > span { animation-delay:var(--dur-1); }
  html.js:not(.motion-off) .cine-scene:first-child .cine-lede, html.js:not(.motion-off) .cine-scene:first-child .actions { animation:cine-fade var(--dur-5) ease var(--dur-3) both; }
  html.js:not(.motion-off) .cine-reel, html.js:not(.motion-off) .cine-mark { animation:cine-fade var(--dur-5) ease var(--dur-4) both; }
}
@keyframes cine-rise { from { transform:translateY(105%); } }
@keyframes cine-fade { from { opacity:0; } }
@media (prefers-reduced-motion:reduce) { .cine-scroll-hint i::after { animation:none; } }

@media (min-width: 1600px) { .cine-frame { background-image:var(--photo-lg, var(--photo-md, none)); } }
@media (max-height:760px) and (min-width: 861px) {
  .cine-body { padding-top:calc(var(--hdr) + var(--sp-10)); }
  .unlock-site .cine-scroll h1 { font-size:var(--fs-display); }
  .unlock-site .cine-scroll h2 { font-size:var(--fs-hero); }
  .cine-lede { margin-top:var(--sp-9) !important; }
  .cine-scroll .actions { margin-top:var(--sp-10); }
  .cine-scene { padding-bottom:var(--sp-11); }
}
@media (max-width: 1100px) { .cine-cues { gap:var(--sp-9); } .unlock-site .cine-cue { font-size:var(--fs-4); } }
@media (max-width: 860px) {
  .cine-scroll { --hdr:76px; --step:70svh; }
  .cine-frame { background-image:var(--photo-sm, var(--photo-md, none)); }
  .cine-stage::after { background:
    linear-gradient(0deg, var(--c-sage-6) 0%, color-mix(in srgb, var(--c-sage-6) 90%, transparent) 34%, color-mix(in srgb, var(--c-sage-6) 66%, transparent) 58%, color-mix(in srgb, var(--c-sage-6) 40%, transparent) 78%, color-mix(in srgb, var(--c-sage-6) 66%, transparent) 100%),
    linear-gradient(120deg, color-mix(in srgb, var(--c-green-39) 0%, transparent) 40%, color-mix(in srgb, var(--c-green-39) 26%, transparent) 100%); }
  .cine-mark { top:calc(var(--hdr) + 56px); right:28px; width:clamp(84px, 22vw, 140px); translate:none; }
  /* Phone reel: four bars, with the current chapter's name underneath. */
  .cine-reel { position:relative; padding-bottom:var(--sp-11); gap:var(--sp-8); }
  .cine-cues { gap:var(--sp-4); }
  .unlock-site .cine-cue { gap:0; opacity:1; min-height:24px; padding-top:var(--sp-5); }
  .cine-cue .cue-label { display:none; }
  .cine-cue.is-current .cue-label { display:block; position:absolute; left:0; bottom:0; }
  .cine-scroll-hint { display:none; }
}
@media (max-width: 700px) {
  .cine-scroll { --hdr:64px; }
  .cine-body { padding-top:calc(var(--hdr) + var(--sp-12)); padding-bottom:var(--sp-9); }
  .unlock-site .cine-scroll h1 { font-size:clamp(44px, 12.4vw, 64px); line-height:var(--lh-2); }
  .unlock-site .cine-scroll h2 { font-size:var(--fs-m-h1); line-height:var(--lh-3); }
  .cine-lede { font-size:var(--fs-7); margin-top:var(--sp-9) !important; }
  .cine-scene { padding-bottom:var(--sp-11); }
  .cine-scroll .actions { margin-top:var(--sp-10); gap:var(--sp-7) var(--sp-9); }
  /* The mark sits on the text gutter, smaller, well clear of the header and the headline. */
  .cine-mark { top:calc(var(--hdr) + 44px); right:28px; width:clamp(60px, 17vw, 76px); }
}
/* Short phones: the headline climbs toward the header, so the mark steps aside. */
@media (max-width: 860px) and (max-height:680px) { .cine-mark { display:none; } }
@media (max-width: 420px) { .cine-scroll .actions .btn { width:100%; justify-content:center; } }
@media print { .cine-stage, .cine-reel, .cine-mark { display:none; } .cine-scroll { height:auto !important; color:var(--c-sage-9); } }
