/* Reemyx site: background motion. Three layers, all optional.
   To switch them all off, remove this file and js/ambient.js from index.html.

   Rules every layer follows:
   - very faint wherever text sits on top of it
   - stops when it is off screen
   - stands still on phones and for people who ask for less motion */

/* ───────────── 1. first screen: words drift up and turn into video frames ───────────── */
.hero{position:relative}
.hero-bg{position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none;
  -webkit-mask-image:linear-gradient(180deg,transparent 0,#000 12%,#000 72%,transparent 94%);
  mask-image:linear-gradient(180deg,transparent 0,#000 12%,#000 72%,transparent 94%)}
.hero > .wrap{position:relative;z-index:1}

/* ───────────── 2. headlines: a volt glow blooms once as each one scrolls into view ───────────── */
h1.display,h2.display{position:relative;isolation:isolate}
h1.display::before,h2.display::before{content:"";position:absolute;z-index:-1;left:-8%;top:50%;width:min(100%,780px);height:270%;
  transform:translateY(-50%) scale(.55);background:radial-gradient(ellipse closest-side,rgba(215,255,46,.36),rgba(215,255,46,0));
  filter:blur(26px);opacity:0;pointer-events:none}
h1.display.lit::before,h2.display.lit::before{animation:bloom 2.4s cubic-bezier(.2,.7,.2,1) both}
/* no glow on the bone sections: volt light on a pale ground just looks like a stain */
.light h2.display::before{display:none}
@keyframes bloom{
  0%{opacity:0;transform:translateY(-50%) scale(.55)}
  26%{opacity:1}
  100%{opacity:.2;transform:translateY(-50%) scale(1.1)}
}

/* ───────────── 3. last section: a tilted wall of the real videos, drifting slowly ───────────── */
.final{position:relative;overflow:hidden}
.final > .wrap{position:relative;z-index:2}
.wall{position:absolute;top:-34%;bottom:-34%;right:-3%;width:min(104%,1360px);z-index:0;display:flex;gap:16px;justify-content:flex-end;
  transform:rotate(-8deg);transform-origin:70% 50%;opacity:.34;filter:saturate(.75);pointer-events:none}
.wall-col{flex:0 0 clamp(120px,13vw,196px);display:grid;gap:16px;align-content:start;will-change:transform;
  animation:wallA 46s ease-in-out infinite alternate;animation-play-state:paused}
.wall-col:nth-child(even){animation-name:wallB;animation-duration:54s}
.wall.run .wall-col{animation-play-state:running}
.wall-tile{aspect-ratio:9/16;border-radius:12px;overflow:hidden;background:var(--panel)}
.wall-tile img,.wall-tile video{display:block;width:100%;height:100%;object-fit:cover}
@keyframes wallA{from{transform:translateY(-3%)}to{transform:translateY(-19%)}}
@keyframes wallB{from{transform:translateY(-21%)}to{transform:translateY(-5%)}}
/* the scrim keeps the side with the words almost solid, and blends the wall into the page above and below */
.final::after{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  background:
    linear-gradient(180deg,var(--ink) 0%,rgba(15,16,13,0) 24%,rgba(15,16,13,0) 78%,var(--ink) 100%),
    linear-gradient(90deg,var(--ink) 0%,rgba(15,16,13,.93) 30%,rgba(15,16,13,.55) 62%,rgba(15,16,13,.3) 100%)}

@media (max-width:900px){
  /* on a phone the first screen is nearly all text, so the drifting layer is left out there */
  .hero-bg{display:none}
  .wall{top:-12%;bottom:-12%;right:-14%;left:-14%;width:auto;justify-content:center;opacity:.2}
  .wall-col{flex-basis:34vw;animation:none;transform:translateY(-8%)}
  .wall-col:nth-child(even){transform:translateY(-16%)}
  .wall-col:nth-child(n+4){display:none}
  .final::after{background:linear-gradient(180deg,var(--ink) 0%,rgba(15,16,13,.62) 22%,rgba(15,16,13,.62) 80%,var(--ink) 100%)}
}

@media (prefers-reduced-motion:reduce){
  h1.display.lit::before,h2.display.lit::before{animation:none;opacity:.2;transform:translateY(-50%) scale(1.1)}
  .wall-col{animation:none;transform:translateY(-8%)}
  .wall-col:nth-child(even){transform:translateY(-16%)}
}
