:root {
  --bg: #0b0b10;
  --glow: rgba(255, 215, 120, 0.35);
  --shadow: rgba(0, 0, 0, 0.55);
}

/* Page baseline */
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(1200px 600px at 50% 30%, #1a1a26 0%, var(--bg) 60%);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow: hidden;
}

/* Background dimming overlay (jQuery toggles .dim-bg on body) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.0);
  transition: background 240ms ease;
  pointer-events: none;
  z-index: 0;
}

/* jQuery hover dim */
body.dim-bg::before {
  background: rgba(0, 0, 0, 0.55);
}

.wrap {
  position: relative;
  z-index: 1;
  padding: 24px;
  width: min(980px, 92vw);
  display: grid;
  place-items: center;
}

/* ============================================================
   === EDIT PARALLAX TILT SETTINGS HERE ========================
   These variables are driven by jQuery setting --rx and --ry.
   You can tweak the overall “feel” here.
   ============================================================ */

.hero {
  /* jQuery updates these */
  --rx: 0deg;         /* rotateX */
  --ry: 0deg;         /* rotateY */
  --lift: 0px;        /* lift on hover */

  position: relative;
  width: min(980px, 92vw);
  max-width: 980px;
  border-radius: 16px;
  overflow: hidden;

  /* 3D tilt + lift */
  transform:
    translateY(var(--lift))
    perspective(1000px)
    rotateX(var(--rx))
    rotateY(var(--ry));
  transform-origin: center;
  transform-style: preserve-3d;

  transition:
    transform 120ms ease-out,
    box-shadow 260ms ease,
    filter 260ms ease;

  box-shadow: 0 18px 55px var(--shadow);
  will-change: transform, box-shadow;
  isolation: isolate;
}

.hero img {
  display: block;
  width: 100%;
  height: auto;
  transform: translateZ(0); /* keeps it crisp during 3D transforms */
  transition: transform 260ms ease;
}

/* Hover behavior: lift + glow */
.hero:hover {
  --lift: -12px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.7), 0 0 50px var(--glow);
  filter: saturate(1.05) contrast(1.05);
}

.hero:hover img {
  transform: scale(1.015) translateZ(0);
}

/* ============================================================
   === EDIT FILM GRAIN + SCANLINES EFFECT HERE (HOVER ONLY) ===
   Change:
   - scanline opacity/spacing in .scanlines
   - grain strength + animation speed in .grain
   ============================================================ */

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;

  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.07) 0px,
    rgba(255, 255, 255, 0.07) 1px,
    rgba(0, 0, 0, 0.00) 2px,
    rgba(0, 0, 0, 0.00) 4px
  );

  mix-blend-mode: overlay;
  opacity: 0;
  transition: opacity 240ms ease;
  z-index: 2;
}

.grain {
  position: absolute;
  inset: -20%;
  pointer-events: none;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  background-size: 220px 220px;

  mix-blend-mode: overlay;
  opacity: 0;
  transition: opacity 240ms ease;
  z-index: 3;

  transform: translate3d(0,0,0);
}

.hero:hover .scanlines { opacity: 0.65; }
.hero:hover .grain {
  opacity: 0.22;
  animation: grainJitter 900ms steps(2) infinite;
}

@keyframes grainJitter {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(-2%, -1%); }
  20%  { transform: translate(-1%, 2%); }
  30%  { transform: translate(2%, -2%); }
  40%  { transform: translate(-2%, 2%); }
  50%  { transform: translate(1%, -1%); }
  60%  { transform: translate(2%, 1%); }
  70%  { transform: translate(-1%, -2%); }
  80%  { transform: translate(-2%, 1%); }
  90%  { transform: translate(2%, 2%); }
  100% { transform: translate(0, 0); }
}

/* ============================================================
   === EDIT CRT CURVATURE + VIGNETTE HERE (HOVER ONLY) =========
   You can tweak:
   - vignette darkness: .vignette opacity on hover
   - curvature amount: (keep subtle) in .crtCurve box-shadow/gradient
   ============================================================ */

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  z-index: 4;

  background: radial-gradient(
    ellipse at center,
    rgba(0,0,0,0.0) 45%,
    rgba(0,0,0,0.35) 75%,
    rgba(0,0,0,0.70) 100%
  );

  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity 240ms ease;
}

.crtCurve {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  z-index: 5;

  background:
    radial-gradient(ellipse at 50% 35%,
      rgba(255,255,255,0.10) 0%,
      rgba(255,255,255,0.04) 35%,
      rgba(0,0,0,0.00) 60%
    );

  box-shadow:
    inset 0 0 40px rgba(0,0,0,0.25),
    inset 0 0 120px rgba(0,0,0,0.25);

  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity 240ms ease;
}

/* Activate CRT effects on hover */
.hero:hover .vignette { opacity: 0.55; }  /* <-- vignette intensity */
.hero:hover .crtCurve { opacity: 0.85; }  /* <-- CRT glass intensity */

/* Optional footer text */
.sub {
  margin-top: 18px;
  color: rgba(255,255,255,0.72);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-align: center;
}

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero, .hero img, body::before, .scanlines, .grain, .vignette, .crtCurve {
    transition: none !important;
    animation: none !important;
  }
}