/* Local studio / screening / edit details. No content or media geometry changes. */

/* 01 — A matte floor below the existing camera; the key comes from above right. */
#top .f816-shot {
  background: #101316;
}
#top .f816-shot::before,
#top .f816-shot::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 1;
}
#top .f816-shot::before {
  inset: 0;
  background:
    radial-gradient(ellipse at 91% 9%, rgb(235 247 250 / 15%), transparent 42%),
    linear-gradient(126deg, transparent 48%, rgb(204 234 241 / 7%) 67%, transparent 84%);
}
#top .f816-shot::after {
  inset: auto 0 0;
  height: 32%;
  background:
    radial-gradient(ellipse 23% 13% at 76% 24%, rgb(0 0 0 / 75%), transparent 100%),
    radial-gradient(ellipse 32% 70% at 79% 0%, rgb(194 221 230 / 14%), transparent 90%),
    linear-gradient(180deg, #20262a, #15191c 28%, #101316 100%);
  border-top: 1px solid rgb(226 242 247 / 7%);
}
/* Keep the film and 3D rig in their existing stacking order. */
#top .scrim {
  background:
    linear-gradient(90deg, #080a12f5, #080a12dc 34%, #080a1240 69%, transparent),
    linear-gradient(0deg, #080a12 0%, transparent 24%, #080a1226 100%);
}

/* 02 — Stage outside the screen, never an inset border over the video. */
#showreel .stick {
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 88%, rgb(187 220 231 / 7%), transparent 56%);
}
#showreel .stick::before,
#showreel .stick::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}
#showreel .stick::before {
  top: calc(max(120px, 10vh + 44px) - 8px);
  left: calc(21vw - 8px);
  right: calc(21vw - 8px);
  height: calc(min(32.625vw, 66vh) + 16px);
  border: 1px solid rgb(226 239 245 / 24%);
  border-radius: 20px;
  background: linear-gradient(135deg, #333b40, #101519 42%, #252e33);
  box-shadow: 0 18px 28px rgb(0 0 0 / 55%), 0 0 0 3px #0d1114;
}
#showreel .stick::after {
  left: 18%;
  right: 18%;
  top: calc(max(120px, 10vh + 44px) + min(32.625vw, 66vh) + 9px);
  height: min(16vw, 150px);
  background:
    linear-gradient(90deg, transparent 44%, rgb(209 227 234 / 17%) 48%, #242c31 50%, rgb(209 227 234 / 17%) 52%, transparent 56%) center top / 100% 35% no-repeat,
    radial-gradient(ellipse 48% 6% at 50% 38%, rgb(224 241 247 / 24%), transparent),
    radial-gradient(ellipse at 50% 0%, rgb(166 212 228 / 14%), transparent 70%);
}

/* 03 — Ruler: 16px per frame, a longer tick every five frames. */
#works .bg-sprocket {
  opacity: 1 !important;
  background: none;
}
#works .works-head {
  position: relative;
}
#works .works-head::after {
  content: "";
  position: absolute;
  inset: auto 0 -15px;
  height: 12px;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgb(228 240 247 / 48%) 0 1px, transparent 1px 80px) left top / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, rgb(228 240 247 / 27%) 0 1px, transparent 1px 16px) left top / 100% 5px no-repeat;
  border-top: 1px solid rgb(228 240 247 / 20%);
}
#works .bg-sprocket::before {
  top: 0;
  bottom: 0;
  height: auto;
  left: 62%;
  right: auto;
  width: 1px;
  background: #5aabdf;
  opacity: .45;
}
#works .bg-sprocket::after {
  inset: 24% 0 auto;
  height: 72px;
  background:
    repeating-linear-gradient(0deg, transparent 0 22px, rgb(207 231 242 / 9%) 22px 23px, transparent 23px 24px),
    linear-gradient(90deg, transparent 4%, rgb(96 159 190 / 7%) 4% 38%, transparent 38% 40%, rgb(96 159 190 / 6%) 40% 83%, transparent 83%);
}

/* 04 — Screen spill: desaturated white/cyan bands and a floor reflection. */
#contact {
  background: #0c1115;
}
#contact > .bg-scene,
#contact > .g-flare,
#contact > .g-dust {
  opacity: 1 !important;
  background: none !important;
}
#contact > .bg-scene img {
  visibility: hidden;
}
#contact > .bg-scene {
  background:
    linear-gradient(108deg, transparent 27%, rgb(220 240 244 / 7%) 36%, transparent 46%),
    linear-gradient(78deg, transparent 56%, rgb(189 222 230 / 6%) 64%, transparent 72%) !important;
}
#contact > .g-flare {
  background: radial-gradient(ellipse 38% 75% at 50% 0%, rgb(214 238 243 / 9%), transparent 85%) !important;
}
#contact > .g-dust {
  background:
    radial-gradient(ellipse 44% 7% at 50% 87%, rgb(213 238 244 / 13%), transparent),
    linear-gradient(0deg, rgb(139 179 192 / 6%), transparent 24%) !important;
}

/* 05 — Article slate rules. All marks sit outside the text's line boxes. */
.article-page .film-header::after {
  content: "";
  position: absolute;
  inset: auto 0 -8px;
  height: 8px;
  pointer-events: none;
  border-top: 1px solid rgb(208 229 240 / 24%);
  background:
    repeating-linear-gradient(90deg, rgb(199 225 237 / 42%) 0 1px, transparent 1px 80px) left top / 100% 8px no-repeat,
    repeating-linear-gradient(90deg, rgb(199 225 237 / 20%) 0 1px, transparent 1px 16px) left top / 100% 3px no-repeat;
}
.article-page[data-f820="article"] .prose section[id] > h2::before {
  /* Preserve the existing counter, font, size and margin. */
  background:
    repeating-linear-gradient(90deg, rgb(182 211 228 / 45%) 0 1px, transparent 1px 40px) left bottom / 104px 7px no-repeat,
    repeating-linear-gradient(90deg, rgb(182 211 228 / 26%) 0 1px, transparent 1px 8px) left bottom / 104px 3px no-repeat,
    linear-gradient(#579eca, #579eca) 80px bottom / 1px 12px no-repeat;
  box-shadow: 0 1px rgb(182 211 228 / 17%);
}

@media (max-width: 1100px) and (min-width: 761px) {
  #top .f816-shot::after { height: 26%; }
}
@media (max-width: 760px) {
  #top .f816-shot::after {
    top: 500px;
    bottom: auto;
    height: 100px;
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 35%, #000 65%, transparent);
    mask-image: linear-gradient(180deg, transparent, #000 35%, #000 65%, transparent);
  }
  #top .scrim {
    background: linear-gradient(180deg, #080a12bf, #080a12a6 30%, transparent 53%, #080a12 76%);
  }
  /* Existing mobile screen is full width within its section padding. */
  #showreel .stick::before { inset: 43px -6px -6px; height: auto; border-radius: 6px; }
  #showreel .stick::after { top: calc(100% + 7px); left: 8%; right: 8%; height: 40px; }
}
@media (max-width: 360px) {
  #top .f816-shot::after { top: 465px; }
}
/* Added decoration is static; also stop inherited movement on its hosts. */
@media (prefers-reduced-motion: reduce) {
  #top .f816-shot::before, #top .f816-shot::after,
  #showreel .stick::before, #showreel .stick::after,
  #works .bg-sprocket::before, #works .bg-sprocket::after,
  #works .works-head::after,
  #contact > .bgl,
  .article-page .film-header::after,
  .article-page[data-f820="article"] .prose section[id] > h2::before {
    animation: none !important;
    transition: none !important;
  }
}
