/* Newsletter signup. Scoped to .avn; leaves site.css untouched.
   Matches the hero styles. Background is transparent so it blends with the page. */

.avn {
  --avn-ink: var(--ink, #0a0f1f);
  --avn-blue: var(--blue, #536dfe);
  --avn-blue-lt: var(--blue-lt, #8fa0ff);
  --avn-text: var(--white, #f3f4f6);
  --avn-error: #ffb4b4;
  position: relative; isolation: isolate;
  padding: clamp(5rem, 11vw, 8.5rem) max(16px, env(safe-area-inset-right, 0px)) clamp(5rem, 11vw, 8.5rem) max(16px, env(safe-area-inset-left, 0px));
  color: var(--avn-text);
  font-family: var(--sans, "Afteroids Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  line-height: 1.5; text-align: center;
}
.avn *, .avn *::before, .avn *::after { box-sizing: border-box; }
.avn [hidden] { display: none; }

/* Soft halo and glass shreds, faded top and bottom so there is no hard edge */
.avn::before, .avn::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.avn::before { background: radial-gradient(ellipse 48% 42% at 50% 46%, rgba(83,109,254,.34), rgba(143,160,255,.1) 55%, transparent 100%); }
.avn::after {
  background: linear-gradient(90deg, rgba(255,255,255,.42) 0, rgba(255,255,255,.14) 3px, rgba(255,255,255,.03) 60%, rgba(0,0,40,.10) calc(100% - 4px), rgba(0,0,40,.26) 100%) 0 0 / 26px 100% repeat-x;
  mix-blend-mode: soft-light; opacity: .32;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}

.avn__wrap { max-width: 44rem; margin: 0 auto; }
.avn__title {
  margin: 0; font-weight: 800; letter-spacing: -.03em; line-height: 1.02;
  font-size: clamp(2.3rem, 1rem + 4.7vw, 5.2rem);
  text-shadow: 0 0 22px rgba(83,109,254,.5), 0 0 70px rgba(83,109,254,.32), 0 2px 34px rgba(10,15,31,.6);
}
.avn__title em {
  font-style: italic; color: #bac5ff; padding-right: .04em; white-space: nowrap;
  text-shadow: 0 0 14px rgba(143,160,255,.85), 0 0 46px rgba(143,160,255,.6), 0 0 110px rgba(83,109,254,.5);
}
.avn__lede { margin: 1.25rem auto 0; max-width: 34em; color: rgba(243,244,246,.8); font-size: clamp(1rem, .95rem + .25vw, 1.14rem); line-height: 1.55; text-wrap: balance; }

.avn__panel { max-width: 36rem; margin: 2.25rem auto 0; text-align: left; }

/* Timeline: playhead follows progress */
.avn__timeline {
  position: relative; height: 14px; margin-bottom: 1.5rem;
  background: repeating-linear-gradient(90deg, rgba(161,161,170,.45) 0 1px, transparent 1px 12px) bottom / 100% 6px no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.avn__playhead {
  position: absolute; top: 0; bottom: 0; left: 12%; width: 2px;
  background: var(--avn-blue-lt); box-shadow: 0 0 14px 2px var(--avn-blue);
  transition: left .7s cubic-bezier(.2,.7,.2,1);
}
.avn__panel:focus-within .avn__playhead { left: 30%; }
.avn__panel:has(#avn-name:focus) .avn__playhead { left: 48%; }
.avn__panel:has(#avn-consent:focus) .avn__playhead { left: 64%; }
.avn__panel:has(.avn__button:focus-visible) .avn__playhead { left: 76%; }
.avn.is-sending .avn__playhead { animation: avn-scrub 1.1s ease-in-out infinite alternate; }
.avn.is-done .avn__playhead { left: 86% !important; }
@keyframes avn-scrub { from { left: 18%; } to { left: 82%; } }

.avn__form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: .875rem; row-gap: .375rem; }
.avn__field label { display: flex; justify-content: space-between; align-items: baseline; padding: 0 .5rem; font-weight: 550; font-size: .875rem; }
.avn__hint { color: var(--grey, #a1a1aa); font-weight: 400; font-size: .75rem; }
.avn input[type=email], .avn input[type=text] {
  width: 100%; margin-top: .45rem; padding: .9rem 1.25rem;
  font: inherit; font-size: 1rem; color: var(--avn-text);
  background: rgba(10,15,31,.92); border: 1px solid rgba(143,160,255,.45); border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 24px -14px rgba(4,8,40,.8);
  transition: border-color .2s;
}
.avn input[type=email]:hover, .avn input[type=text]:hover { border-color: var(--avn-blue-lt); }
.avn input:focus-visible { outline: 2px solid var(--avn-blue-lt); outline-offset: 3px; }
.avn input[type=email][aria-invalid=true] { border-color: var(--avn-error); }
.avn__error { margin: .35rem 0 0; padding: 0 .5rem; min-height: 1.3em; color: var(--avn-error); font-size: .8125rem; line-height: 1.3; }

.avn__field--consent { grid-column: 1 / -1; justify-self: center; text-align: center; }
.avn .avn__check { justify-content: center; align-items: flex-start; gap: .65rem; font-weight: 400; color: rgba(243,244,246,.8); cursor: pointer; text-align: left; }
.avn__check input { flex: none; width: 1.15rem; height: 1.15rem; margin: .1rem 0 0; accent-color: var(--avn-blue); }
.avn__check input[aria-invalid=true] { outline: 2px solid var(--avn-error); outline-offset: 1px; }

.avn__trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Same recipe as .btn in the hero */
.avn__button {
  grid-column: 1 / -1; justify-self: center; margin-top: .25rem;
  padding: 17px 38px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 550; font-size: 15px; line-height: 1; color: var(--avn-text);
  text-shadow: 0 1px 1px rgba(10,15,60,.3);
  background: linear-gradient(180deg, #6a80ff 0%, var(--avn-blue) 55%, #4a62f2 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 0 0 1px rgba(255,255,255,.14),
    0 1px 2px rgba(4,8,40,.55), 0 4px 8px -1px rgba(4,8,40,.45), 0 12px 20px -6px rgba(4,8,40,.5), 0 20px 36px -10px rgba(83,109,254,.6);
  transition: transform .2s cubic-bezier(.2,.7,.2,1), filter .2s;
}
.avn__button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.07); }
.avn__button:active:not(:disabled) { transform: translateY(1px); }
.avn__button:focus-visible { outline: 2px solid var(--avn-blue-lt); outline-offset: 3px; border-radius: 999px; }
.avn__button:disabled { cursor: progress; opacity: .65; }

.avn__status { margin: 0; text-align: center; }
.avn__status:focus { outline: none; }
.avn__status:focus-visible { outline: 2px solid var(--avn-blue-lt); outline-offset: 6px; }
.avn__status--failed { margin-top: 1rem; color: var(--avn-error); }
.avn__status--done {
  padding: 1rem 0; font-size: clamp(1.35rem, 3vw, 1.8rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.25; text-wrap: balance;
  text-shadow: 0 0 28px rgba(83,109,254,.6);
  animation: avn-reveal .95s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes avn-reveal { from { opacity: 0; transform: translateY(14px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
.avn__noscript { grid-column: 1 / -1; color: var(--avn-error); margin: .5rem 0 0; text-align: center; }

@media (max-width: 40rem) {
  .avn__form { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .avn *, .avn *::before { animation: none !important; transition: none !important; }
}
