/* Direção 05 — impressão LaserDisc: espaço, faixas verdes e papel granulado.
   Todas as camadas ficam atrás da leitura e conservam o movimento por interação. */
body,
body[data-question],
body[data-screen] {
  --vhs-tint-a: 119, 194, 112;
  --vhs-tint-b: 45, 158, 169;
  --vhs-tint-c: 189, 205, 105;
  background-color: #111a19;
  background-image:
    radial-gradient(ellipse at 88% 80%, #267b7938, transparent 59%),
    linear-gradient(180deg, #111512 0%, #142124 65%, #173c40 100%);
}
body::after { opacity: .045; }

#vhs-ambient { --vhs-light-opacity: .8; }
#vhs-ambient[data-focus="action"] { --vhs-light-opacity: .95; }
#vhs-ambient[data-focus="answer"] { --vhs-light-opacity: .86; }
#vhs-ambient[data-focus="summary"] { --vhs-light-opacity: .88; }
#vhs-ambient::before {
  inset: -2% -2% -2% 28%;
  background-image:
    linear-gradient(90deg, #111a19 2%, #111a1940 38%, transparent 72%),
    url('assets/fotos/sefer-guitarra-fundo.webp');
  background-position: center, 50% 54%;
  background-size: cover;
  opacity: .32;
  filter: saturate(.55) sepia(.14) contrast(1.05) brightness(.82);
  mask-image: linear-gradient(90deg, transparent, #000 30%);
}

/* Pontos de luz fixos: o céu move junto com a interação, sem piscar. */
.ambient-light {
  inset: -4%;
  background:
    radial-gradient(circle at 6% 13%, #e8e7b9 0 .7px, #e8e7b920 1.6px, transparent 3px),
    radial-gradient(circle at 13% 29%, #e8e7b9 0 .8px, transparent 2px),
    radial-gradient(circle at 19% 8%, #b1d6c4 0 .6px, transparent 2px),
    radial-gradient(circle at 23% 36%, #e8e7b9 0 .8px, transparent 2.2px),
    radial-gradient(circle at 30% 16%, #c9dec8 0 .7px, transparent 2px),
    radial-gradient(circle at 37% 44%, #e9e9c2 0 1px, #e9e9c220 1.6px, transparent 4px),
    radial-gradient(circle at 44% 9%, #c9dec8 0 .65px, transparent 2px),
    radial-gradient(circle at 49% 27%, #b2d1c9 0 .8px, transparent 2px),
    radial-gradient(circle at 55% 5%, #e8e7b9 0 .7px, transparent 2px),
    radial-gradient(circle at 61% 40%, #e8e7b9 0 .65px, transparent 2px),
    radial-gradient(circle at 67% 18%, #e8e7b9 0 1px, #e8e7b922 2px, transparent 5px),
    radial-gradient(circle at 71% 32%, #b2d1c9 0 .6px, transparent 2px),
    radial-gradient(circle at 78% 8%, #e8e7b9 0 .7px, transparent 2px),
    radial-gradient(circle at 86% 26%, #e8e7b9 0 .7px, transparent 2px),
    radial-gradient(circle at 93% 14%, #c9dec8 0 .75px, transparent 2px),
    radial-gradient(circle at 8% 57%, #c9dec8 0 .6px, transparent 2px),
    radial-gradient(circle at 17% 73%, #b2d1c9 0 .65px, transparent 2px),
    radial-gradient(circle at 31% 61%, #e8e7b9 0 .7px, transparent 2px),
    radial-gradient(circle at 58% 65%, #e8e7b9 0 .8px, transparent 2px),
    radial-gradient(circle at 83% 54%, #c9dec8 0 .8px, transparent 2px),
    radial-gradient(circle at 94% 78%, #e8e7b9 0 .6px, transparent 2px),
    radial-gradient(ellipse at 90% 76%, rgba(var(--vhs-tint-b), .31), transparent 53%),
    radial-gradient(ellipse at 30% 9%, rgba(var(--vhs-tint-a), .07), transparent 48%);
  animation: ambient-drift 32s ease-in-out infinite alternate;
}
.ambient-light-secondary {
  inset: -12%;
  background:
    radial-gradient(ellipse at 74% 100%, #34999c40, transparent 61%),
    radial-gradient(ellipse at 98% 42%, #6dab4a13, transparent 43%);
  opacity: calc(var(--vhs-light-opacity) * .7);
  animation: ambient-reel 36s ease-in-out infinite alternate;
}
/* Degradê pontilhado, separado do ruído: 2.400 pontos desenhados uma vez no SVG.
   A densidade cresce em direção ao canto iluminado, como tinta aerografada. */
.ambient-light:not(.ambient-light-secondary)::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/vhs/stipple-field.svg') right bottom / 700px 700px no-repeat;
  mask-image: radial-gradient(ellipse at 94% 85%, #000 7%, #0009 39%, transparent 68%);
  opacity: .66;
  mix-blend-mode: screen;
}

/* A guitarra real substitui o disco na ambientação. */
.ambient-orbit {
  display: none;
}

/* Riscos como tinta em uma capa de fita; a passagem pelo centro fica vazia. */
.ambient-ribbon {
  inset: 0;
  opacity: .36;
  background:
    linear-gradient(90deg, #bfce80 0%, #bfce8020 100%) 0 39% / 20% 2px no-repeat,
    linear-gradient(90deg, #9cbe60 0%, #9cbe6020 100%) 0 40.5% / 21.5% 3px no-repeat,
    linear-gradient(90deg, #68b77b 0%, #68b77b20 100%) 0 42% / 23% 4px no-repeat,
    linear-gradient(90deg, #3fa39b 0%, #3fa39b20 100%) 0 43.7% / 24.5% 4px no-repeat,
    linear-gradient(90deg, #348b9b 0%, #348b9b20 100%) 0 45.5% / 26% 3px no-repeat,
    linear-gradient(90deg, #348b9b20 0%, #348b9b 100%) 100% 39% / 27% 3px no-repeat,
    linear-gradient(90deg, #3fa39b20 0%, #3fa39b 100%) 100% 40.5% / 25.5% 4px no-repeat,
    linear-gradient(90deg, #68b77b20 0%, #68b77b 100%) 100% 42.2% / 24% 4px no-repeat,
    linear-gradient(90deg, #9cbe6020 0%, #9cbe60 100%) 100% 44% / 22.5% 3px no-repeat,
    linear-gradient(90deg, #bfce8020 0%, #bfce80 100%) 100% 45.5% / 21% 2px no-repeat;
}
.ambient-ribbon::after {
  content: '';
  position: absolute;
  left: 39%;
  top: 15%;
  width: min(54vw, 800px);
  height: min(52vw, 650px);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 650'%3E%3Cpath d='M16 60H784L400 620Z' fill='none' stroke='%23d3dbbd' stroke-width='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .4;
}

/* O horizonte é uma impressão de ciano, sem a malha de computador. */
.ambient-horizon {
  inset: auto -10% -30px;
  height: 44vh;
  transform: none;
  opacity: .32;
  background-image: linear-gradient(0deg, #2a989c63, #20747d29 60%, transparent);
  mask-image: linear-gradient(0deg, #000, transparent 100%);
}
.ambient-horizon::before {
  top: 17%;
  height: 1px;
  background: #6fbd8b55;
  box-shadow: 0 15px 0 #70b39510, 0 29px 0 #70b3950c;
}
.ambient-horizon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/vhs/stipple-field.svg') center bottom / 720px 600px repeat-x;
  mask-image: linear-gradient(0deg, #000 3%, #000b 46%, transparent 100%);
  opacity: .6;
  mix-blend-mode: screen;
}

/* Grão de impressão no cenário; a camada que cobre o conteúdo é muito mais leve. */
.ambient-dust {
  inset: 0;
  opacity: .3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
  background-size: 240px 240px;
  background-repeat: repeat;
  mix-blend-mode: soft-light;
}
.ambient-dust::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/vhs/vhs-wear.svg') center / 1600px 900px repeat-y;
  opacity: .5;
}

@media (max-width: 760px) {
  #vhs-ambient { --vhs-light-opacity: .7; }
  #vhs-ambient::before { inset: 0; opacity: .23; background-position: center, 52% 54%; }
  .ambient-light { background-size: auto; }
  .ambient-light-secondary { opacity: .4; }
  .ambient-light:not(.ambient-light-secondary)::after { background-size: 540px 540px; opacity: .55; }
  .ambient-ribbon { opacity: .28; }
  .ambient-ribbon::after { left: 22%; top: 18%; width: 100vw; height: 92vw; opacity: .25; }
  .ambient-horizon { height: 40vh; opacity: .3; }
  .ambient-dust { opacity: .29; }
}
@media (prefers-reduced-motion: reduce) {
  #vhs-ambient { transform: none; transition: none; }
  #vhs-ambient * { animation: none; transition: none; }
}
