/* =============================================================================
   CINEMATIC SLIDES // FULL-BLEED, DOT-MATRIX, VIGNETTE & PARALLAX
   ============================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Reenie+Beanie&family=Caveat:wght@400;500&display=swap');

.slide--cinematic {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0 !important;
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* Base Full-Screen Image Layer */
.cinematic-bg-layer {
  position: absolute;
  inset: -20px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: brightness(0.65) contrast(1.15) saturate(0.85);
  z-index: 1;
}

/* Layer 1: Dark Edge Vignette Filter */
.layer-vignette-dark {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(4, 5, 7, 0.45) 0%,
    rgba(4, 5, 7, 0.85) 65%,
    rgba(4, 5, 7, 0.98) 100%
  );
  z-index: 2;
  pointer-events: none;
}

/* Subtle Vignette for contained frames */
.layer-vignette-subtle {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(4, 5, 7, 0.15) 0%,
    rgba(4, 5, 7, 0.80) 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* Layer 2: Tight Black Dot-Matrix Pattern */
.layer-dot-matrix {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle,
    rgba(0, 0, 0, 0.92) 1.2px,
    transparent 1.2px
  );
  background-size: 4px 4px;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* Layer 3: Base Digital Grain Simulation */
.layer-analog-noise {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 0);
  background-size: 3px 3px;
  opacity: 0.25;
  z-index: 4;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* Masked Image Layer (Slide 3) */
.masked-bg-layer {
  position: absolute;
  inset: 0;
  background-image: var(--img-src);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: brightness(0.7) contrast(1.2);
  -webkit-mask-image: var(--mask-src);
  mask-image: var(--mask-src);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  z-index: 1;
}

/* 30% Height Contained Parallax Frame (Slide 2) */
.parallax-quote-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  z-index: 5;
}

.parallax-frame-30 {
  position: absolute;
  width: 85vw;
  max-width: 1200px;
  height: 30vh;
  overflow: hidden;
  border-radius: 2px;
  z-index: 1;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  pointer-events: auto; /* Ensures mouse capture */
}


.parallax-target-img {
  position: absolute;
  /* Extra bleed so edge doesn't show when moving */
  inset: -25%;
  width: 150%;
  height: 150%;
  
  /* ADJUST DEFAULT FRAMING HERE (or via inline style --focus-x, --focus-y) */
  background-position: var(--focus-x, 50%) var(--focus-y, 40%);
  background-size: cover;
  background-repeat: no-repeat;
  
  /* Translates dynamically relative to cursor/tilt */
  transform: translate3d(var(--para-x, 0px), var(--para-y, 0px), 0) scale(1.02);
  will-change: transform;
  filter: brightness(0.70) saturate(0.85);
}

.frame-corner-tag {
  position: absolute;
  top: 10px;
  left: 12px;
  font-family: var(--font-family-mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  color: var(--accent-cyan);
  z-index: 3;
}

/* Typographic Quote Layout */
.quote-viewport-center {
  position: relative;
  z-index: 6;
  max-width: 960px;
  padding: 2rem 3rem;
  text-align: center;
  margin: 0 auto;
}

.quote-monolith {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.2rem;
}

.quote-text {
  font-family: var(--font-family-sans);
  font-size: clamp(1.2rem, 2.2vw, 1.85rem);
  font-weight: 300;
  line-height: 1.55;
  letter-spacing: -0.015em;
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.95);
}

.quote-text .mask-line {
  margin-bottom: 0.35rem;
}

/* Handwritten Signature Section */
.quote-sign-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.handwritten-signature {
  font-family: 'Reenie Beanie', 'Caveat', cursive;
  font-size: clamp(2.4rem, 4.2vw, 3.8rem);
  line-height: 0.9;
  color: #ffffff;
  transform: rotate(-3deg) translateY(-4px);
  text-shadow: 0 0 10px rgba(0, 230, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.02em;
  user-select: none;
}

.signature-title {
  font-style: normal;
  font-family: var(--font-family-mono);
  font-size: var(--font-mono);
  letter-spacing: 0.18em;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

/* =============================================================================
   JPG LUMINANCE MASK ENGINE (CONVERTS JPG BRIGHTNESS TO ALPHA)
   ============================================================================= */
.masked-bg-layer-jpg {
  position: absolute;
  inset: 0;
  background-image: var(--img-src);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: brightness(0.85) contrast(1.15);
  z-index: 1;

  /* 1. Tell browser to derive alpha transparency from JPG luminance */
  -webkit-mask-image: var(--mask-jpg);
  mask-image: var(--mask-jpg);

  -webkit-mask-mode: luminance;
  mask-mode: luminance;

  -webkit-mask-size: cover;
  mask-size: cover;

  -webkit-mask-position: center;
  mask-position: center;

  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* 
 * NOTE: If your JPG mask is inverted (i.e., black is where you WANT the image, 
 * and white is what you want hidden), add this helper class to the container:
 */
.masked-bg-layer-jpg.is-inverted-mask {
  mask-composite: subtract;
  -webkit-mask-composite: destination-out;
}