/* Louisa Lu · hero effects: depth, swelling letters, water, viewfinder, light leaks and the scroll badge */

/* Scroll progress and pointer depth (the frame opening, layers drifting with the pointer) are written
   by site.js straight onto each layer. The rules here are the resting state. */

/* ---------- Swelling letters ---------- */
.name .ch { display: inline-block; font-variation-settings: "wght" 400, "opsz" 36; }

/* ---------- Pool glow and light leaks ---------- */
.hero .glow {
  position: absolute; left: 50%; top: 56%; width: 56vw; height: 92vh; translate: -50% -50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0, 214, 240, .44), rgba(0, 206, 232, .26) 34%, rgba(0, 206, 232, .1) 66%, transparent);
  will-change: opacity;
}
.leaks { position: absolute; inset: -12%; pointer-events: none; mix-blend-mode: screen; opacity: .8; }
.leaks i { position: absolute; border-radius: 50%; will-change: transform; }
.leaks i:nth-child(1) {
  width: 52%; height: 64%; left: -14%; top: -8%;
  background: radial-gradient(closest-side, rgba(255, 128, 48, .7), rgba(255, 92, 80, .42) 38%, rgba(255, 62, 98, .14) 72%, transparent);
  animation: leak-a 14s ease-in-out infinite alternate;
}
.leaks i:nth-child(2) {
  width: 42%; height: 58%; right: -12%; bottom: -6%;
  background: radial-gradient(closest-side, rgba(255, 72, 150, .5), rgba(255, 72, 150, .2) 50%, transparent);
  animation: leak-b 18s ease-in-out infinite alternate;
}
.leaks i:nth-child(3) {
  width: 26%; height: 140%; left: -30%; top: -20%;
  background: radial-gradient(closest-side, rgba(255, 196, 128, .62), rgba(255, 140, 150, .28) 50%, transparent);
  rotate: 14deg;
  animation: leak-sweep 11s var(--ease-in-out) calc(var(--hero-delay, 1.45s) + .3s) infinite both;
}
@keyframes leak-a { to { transform: translate(28%, 18%) scale(1.25); } }
@keyframes leak-b { to { transform: translate(-30%, -22%) scale(.85); } }
@keyframes leak-sweep { 0% { transform: translateX(0); opacity: 0; } 4% { opacity: 1; } 26% { transform: translateX(560%); opacity: 1; } 30%, 100% { transform: translateX(560%); opacity: 0; } }

/* ---------- Water: the WebGL copy of the photo sits exactly over the img ---------- */
.frames .main canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0;
  transform-origin: 80% 25%; transform: scale(1.14); will-change: transform;
}
.frames .main canvas.on { opacity: 1; }

/* ---------- Viewfinder ---------- */
.stage.vf-on .frames .main { cursor: none; }
.vf {
  --bw: 150px; --bh: 110px;
  position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; color: #fff;
  opacity: 0; transition: opacity .25s, color .25s;
  font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45));
}
.vf.on { opacity: 1; }
.vf.lock { color: #8CFFB9; }
.vf .br {
  position: absolute; width: var(--bw); height: var(--bh); translate: -50% -50%;
  --c: currentColor;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 18px 1.5px, linear-gradient(var(--c), var(--c)) 0 0 / 1.5px 18px,
    linear-gradient(var(--c), var(--c)) 100% 0 / 18px 1.5px, linear-gradient(var(--c), var(--c)) 100% 0 / 1.5px 18px,
    linear-gradient(var(--c), var(--c)) 0 100% / 18px 1.5px, linear-gradient(var(--c), var(--c)) 0 100% / 1.5px 18px,
    linear-gradient(var(--c), var(--c)) 100% 100% / 18px 1.5px, linear-gradient(var(--c), var(--c)) 100% 100% / 1.5px 18px;
  background-repeat: no-repeat;
}
.vf.lock .br { animation: af-lock .35s steps(2) 2; }
@keyframes af-lock { 50% { opacity: .2; } }
.vf .cross { position: absolute; width: 14px; height: 14px; translate: -50% -50%;
  background: linear-gradient(currentColor, currentColor) 50% 0 / 1.5px 100% no-repeat, linear-gradient(currentColor, currentColor) 0 50% / 100% 1.5px no-repeat; }
.vf.lock .cross { opacity: 0; }
.vf .rd { position: absolute; left: calc(var(--bw) / -2); top: calc(var(--bh) / 2 + 10px); display: flex; gap: 10px; white-space: nowrap; }
.vf .rd b { font-weight: 500; padding: 2px 4px; border: 1px solid currentColor; border-radius: 2px; line-height: 1; }
.vf .go { position: absolute; left: calc(var(--bw) / -2); bottom: calc(var(--bh) / 2 + 10px); white-space: nowrap; }
.vf.lock .go::before { content: "● "; }

.hero-flash { position: absolute; inset: 0; z-index: 6; background: #fff; opacity: 0; pointer-events: none; }

/* ---------- The polaroid that develops after a shot ---------- */
.snap {
  position: fixed; z-index: 85; width: 152px; padding: 10px 10px 34px; background: #FBF8F4; pointer-events: none;
  box-shadow: 0 30px 50px -18px rgba(46, 50, 58, .55); border-radius: 2px;
  transform: translate(-50%, -50%) scale(.3); opacity: 0;
}
.snap i { display: block; width: 132px; height: 165px; background-repeat: no-repeat; background-color: #222; animation: develop 1.5s ease-out both; }
.snap span { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font: italic 400 15px/1 var(--display); color: var(--ink); }
@keyframes develop { from { filter: brightness(2.6) contrast(.5) saturate(0) blur(1.5px); } 60% { filter: brightness(1.15) contrast(.9) saturate(.7); } }

/* ---------- Rotating roles ---------- */
.flaps { display: inline-flex; gap: 2px; vertical-align: middle; margin-top: -4px; }
.hero .kicker { display: flex; align-items: center; white-space: nowrap; }

/* ---------- Spinning scroll badge ---------- */
.badge {
  position: absolute; right: var(--gr); top: calc(env(safe-area-inset-top, 0px) + 14vh); z-index: 3;
  width: 108px; height: 108px; display: grid; place-items: center; color: var(--ink); text-decoration: none;
  animation: fade 1.2s var(--ease) both; animation-delay: calc(var(--hero-delay, 1.45s) + .5s);
}
.badge svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; animation: badge-spin 16s linear infinite; }
.badge text { font: 500 9px var(--mono); text-transform: uppercase; fill: currentColor; }
.badge::before { content: ""; position: absolute; inset: 27px; border-radius: 50%; background: var(--ink); transition: transform .45s var(--ease), background .3s; }
.badge > span { position: relative; color: var(--paper); font-size: 18px; transition: transform .45s var(--ease); }
.badge:hover::before { transform: scale(1.12); background: var(--lacquer); }
.badge:hover > span { transform: translateY(3px); }
@keyframes badge-spin { to { transform: rotate(360deg); } }

/* ---------- Sound toggle and touch hint ---------- */
.snd {
  position: absolute; left: var(--gl); bottom: calc(7vh + 104px); z-index: 3;
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; border: 0; background: none; cursor: pointer;
  font: 400 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  animation: fade 1.2s var(--ease) both; animation-delay: calc(var(--hero-delay, 1.45s) + .6s);
}
.snd svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.snd .on { display: none; }
.snd[aria-pressed="true"] { color: var(--lacquer); }
.snd[aria-pressed="true"] .on { display: block; }
.snd[aria-pressed="true"] .off { display: none; }
.snd:hover { color: var(--ink); }
.tap-hint { display: none; }

@media (hover: none), (pointer: coarse) {
  .snd { display: none; }
  .tap-hint {
    display: block; position: absolute; left: 50%; top: calc(13% + 16px); z-index: 3; translate: -50% 0; pointer-events: none;
    padding: 9px 14px; border-radius: 999px; background: rgba(46, 50, 58, .55); color: #fff;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    font: 400 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
    opacity: 0; transition: opacity .5s;
  }
  .tap-hint.on { opacity: calc(1 - var(--p) * 4); }
}
@media (max-width: 760px) {
  .badge { top: auto; right: auto; left: var(--gl); bottom: calc(env(safe-area-inset-bottom, 0px) + 2vh); width: 78px; height: 78px; }
  .badge::before { inset: 20px; }
  .badge text { font-size: 10px; }
  .hero .glow { width: 110vw; height: 70vh; }
}

@media (prefers-reduced-motion: reduce) {
  .film, .name, .leaks, .hero .kicker, .hero .tag, .snd, .badge { transform: none; translate: none; }
  .leaks i, .badge svg, .snap i { animation: none; }
  .leaks i:nth-child(3) { display: none; }
}
@media print { .vf, .snap, .hero-flash { display: none !important; } }
