/* STRITA · IN MOTION — three film frames with an old-camera finish */
.reels {
  --fx: 0.6;
  --p: 0;
  position: relative;
  padding: 130px 0 150px;
  overflow: hidden;
  border-block: 1px solid var(--line);
  background:
    radial-gradient(60% 50% at 50% 62%, rgba(255, 255, 255, 0.045), transparent 70%),
    var(--bg);
  isolation: isolate;
}
.reels-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}
.reels-bg span {
  font-family: "Cinzel", serif;
  font-size: clamp(110px, 17vw, 300px);
  line-height: 1;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.07);
  transform: translate3d(calc(-18% + var(--p) * 9%), 6%, 0);
  will-change: transform;
}

.reels-head {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 22px;
  text-align: center;
}
.reels-head h2 {
  margin: 12px 0 0;
  font-family: var(--head);
  font-weight: 400;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.2;
}
.reels-text {
  margin: 18px auto 0;
  max-width: 30rem;
  color: #cfcdc8;
  font-size: 17px;
}

/* stage */
.reels-stage {
  direction: ltr;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(18px, 3vw, 48px);
  margin: 70px auto 0;
  padding: 30px 22px 10px;
  max-width: 1320px;
}
.reel {
  --w: clamp(220px, 24vw, 330px);
  --tilt: 0deg;
  --lift: 0px;
  --drift: 0px;
  position: relative;
  flex: 0 0 var(--w);
  margin: 0;
  transform: translate3d(0, calc(var(--lift) + var(--p) * var(--drift)), 0) rotate(var(--tilt));
  transition: opacity 0.6s var(--ease), filter 0.6s var(--ease), scale 0.7s var(--ease);
  will-change: transform;
}
.reels-stage[data-count="3"] .reel:nth-child(1) { --tilt: -3.5deg; --lift: 46px; --drift: -60px; }
.reels-stage[data-count="3"] .reel:nth-child(2) { --w: clamp(260px, 29vw, 400px); --drift: 30px; z-index: 2; }
.reels-stage[data-count="3"] .reel:nth-child(3) { --tilt: 3.5deg; --lift: 46px; --drift: -60px; }
.reels-stage[data-count="2"] .reel:nth-child(1) { --tilt: -2.5deg; --drift: -40px; }
.reels-stage[data-count="2"] .reel:nth-child(2) { --tilt: 2.5deg; --lift: 40px; --drift: 30px; }

.js .reels .reel-film {
  opacity: 0;
  transform: translateY(90px) scale(0.92);
  filter: brightness(2.2) blur(6px);
}
.js .reels.in .reel-film {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 1.1s var(--ease), transform 1.4s var(--ease), filter 1.2s ease;
  transition-delay: calc(var(--i) * 0.14s + 0.1s);
}

/* film strip with sprocket holes */
.reel-film {
  position: relative;
  padding: 14px 20px;
  background: linear-gradient(180deg, #121110, #0a0a09 50%, #121110);
  border-radius: 3px;
  box-shadow:
    0 40px 80px -30px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.reel-film::before,
.reel-film::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='20'%3E%3Crect x='0' y='5' width='8' height='10' rx='2' fill='%23f4f1ea'/%3E%3C/svg%3E") repeat-y 0 0 / 8px 20px;
  opacity: 0.16;
}
.reel-film::before { left: 6px; }
.reel-film::after { right: 6px; }
@media (hover: hover) and (min-width: 761px) {
  .reel:hover { scale: 1.035; z-index: 3; }
  .reels-stage:hover .reel:not(:hover) { opacity: 0.5; filter: grayscale(0.7); }
}

.reel-screen {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #050505;
  border-radius: 2px;
}
.reel-screen video {
  position: absolute;
  inset: -2%;
  width: 104%;
  height: 104%;
  object-fit: cover;
  filter: contrast(1.14) saturate(calc(1 - 0.3 * var(--fx))) sepia(calc(0.22 * var(--fx))) brightness(0.95);
}
.fx-flicker .reel-screen video { animation: reel-weave 0.42s steps(1) infinite; }

/* black specks, hairs and scratches are drawn on this canvas by js/reels.js */
.reel-specks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.reels:not(.fx-specks) .reel-specks { display: none; }

.reel-grain {
  position: absolute;
  inset: -60%;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.6 -.45'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: calc(0.35 + 0.5 * var(--fx));
  mix-blend-mode: multiply;
  animation: reel-grain 0.6s steps(6) infinite;
}
.reels:not(.fx-grain) .reel-grain { display: none; }

.reel-flicker {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: #000;
  opacity: 0;
}
.fx-flicker .reel-flicker { animation: reel-flicker 3.1s steps(1) infinite; animation-delay: calc(var(--i) * -0.9s); }

.reel-vig {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 70% at 50% 48%, transparent 48%, rgba(0, 0, 0, calc(0.35 + 0.4 * var(--fx))) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 18%, transparent 78%, rgba(0, 0, 0, 0.55));
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
}

/* viewfinder */
.reel-hud {
  --c: rgba(244, 241, 234, 0.75);
  position: absolute;
  inset: 12px;
  pointer-events: none;
  font-family: "Montserrat", sans-serif;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: rgba(244, 241, 234, 0.88);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 16px 1px,
    linear-gradient(var(--c), var(--c)) 0 0 / 1px 16px,
    linear-gradient(var(--c), var(--c)) 100% 0 / 16px 1px,
    linear-gradient(var(--c), var(--c)) 100% 0 / 1px 16px,
    linear-gradient(var(--c), var(--c)) 0 100% / 16px 1px,
    linear-gradient(var(--c), var(--c)) 0 100% / 1px 16px,
    linear-gradient(var(--c), var(--c)) 100% 100% / 16px 1px,
    linear-gradient(var(--c), var(--c)) 100% 100% / 1px 16px;
  background-repeat: no-repeat;
}
.reel-hud > span { position: absolute; }
.reel-rec { top: 10px; left: 12px; display: flex; align-items: center; gap: 7px; }
.reel-rec i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e3232f;
  box-shadow: 0 0 10px rgba(227, 35, 47, 0.9);
  animation: reel-rec 1.2s steps(1) infinite;
}
.reel-fmt { top: 10px; right: 12px; opacity: 0.7; }
.reel-tc { bottom: 10px; left: 12px; font-variant-numeric: tabular-nums; }
.reel-no { bottom: 10px; right: 12px; opacity: 0.7; }

.reel figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 0 4px;
}
.reel figcaption span {
  font-family: var(--wide);
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--muted);
}
.reel figcaption b {
  font-family: var(--head);
  font-weight: 400;
  font-size: 20px;
  color: var(--ink);
}
html[dir="rtl"] .reel figcaption { direction: rtl; }

@keyframes reel-grain {
  0% { transform: translate(0, 0); }
  17% { transform: translate(-7%, 4%); }
  33% { transform: translate(5%, -9%); }
  50% { transform: translate(-10%, -3%); }
  67% { transform: translate(8%, 7%); }
  83% { transform: translate(-3%, 10%); }
}
@keyframes reel-weave {
  0% { transform: translate(0, 0); }
  25% { transform: translate(0.6px, -0.8px); }
  50% { transform: translate(-0.5px, 0.4px); }
  75% { transform: translate(0.3px, 0.9px); }
}
@keyframes reel-flicker {
  0% { opacity: 0.04; }
  6% { opacity: 0.12; }
  9% { opacity: 0; }
  22% { opacity: 0.07; }
  31% { opacity: 0.02; }
  47% { opacity: 0.16; }
  49% { opacity: 0.03; }
  63% { opacity: 0.09; }
  71% { opacity: 0; }
  84% { opacity: 0.13; }
  88% { opacity: 0.05; }
}
@keyframes reel-rec { 50% { opacity: 0.15; } }

/* phones: swipeable strip, centred frame in focus */
.reel-dots { display: none; }

@media (max-width: 760px) {
  .reels { --rw: min(72vw, 330px); padding: 88px 0 92px; }
  .reels-bg span { font-size: 92px; }
  .reels-stage {
    justify-content: flex-start;
    gap: 10px;
    margin-top: 38px;
    padding: 16px calc((100% - var(--rw)) / 2) 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .reels-stage::-webkit-scrollbar { display: none; }
  .reels-stage .reel,
  .reels-stage[data-count] .reel:nth-child(n) {
    --w: var(--rw);
    --tilt: 0deg;
    --lift: 0px;
    --drift: 0px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    transform: scale(0.84);
    opacity: 0.35;
    filter: grayscale(0.6);
    cursor: pointer;
    transition: transform 0.6s var(--ease), opacity 0.6s var(--ease), filter 0.6s var(--ease);
  }
  .reels-stage[data-count] .reel.is-active:nth-child(n) { transform: none; opacity: 1; filter: none; cursor: auto; }
  .reel figcaption { transition: opacity 0.5s var(--ease); }
  .reel:not(.is-active) figcaption { opacity: 0; }
  .reel-grain { opacity: calc(0.2 + 0.3 * var(--fx)); }
  .reel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 26px;
  }
  .reel-dots button {
    width: 28px;
    height: 20px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
  }
  .reel-dots button::before {
    content: "";
    display: block;
    height: 1px;
    background: rgba(244, 241, 234, 0.25);
    transition: background 0.4s ease, height 0.4s ease;
  }
  .reel-dots button.on::before { height: 2px; background: var(--ink); }
  .reel-film { padding: 10px 15px; }
  .reel-film::before { left: 4px; }
  .reel-film::after { right: 4px; }
  .reel-film::before, .reel-film::after { width: 6px; background-size: 6px 16px; }
  .reel-hud { inset: 9px; font-size: 8.5px; }
  .reel figcaption b { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .reel-grain, .reel-flicker, .reel-screen video, .reel-rec i { animation: none !important; }
  .reels-bg span, .reel { transform: none !important; }
  .js .reels .reel-film { opacity: 1; transform: none; filter: none; }
}
