:root {
  --bg-ink: #151311;
  --bg-ink-2: #1b1816;
  --bg-warm: #201b18;
  --bg-brown: #2a2420;
  --bg-gold: #d8b06a;
  --bg-bronze: #b88746;
  --bg-soft-gold: #e0c08a;
  --bg-copper: #a85b45;
  --bg-red: #b84b3a;
  --bg-cyan: #76e7d7;
  --bg-line-gold: rgba(216, 176, 106, 0.16);
  --bg-line-cyan: rgba(118, 231, 215, 0.09);
  --bg-panel-glass: rgba(25, 21, 18, 0.72);
  --bg-frame-image: url("../../assets/newton-circuit-background.png");
  --bg-hero-image: url("../../assets/newton-ai-classroom-hero.png");
}

html {
  background: var(--bg-ink);
}

body {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 16% 0%, rgba(216, 176, 106, 0.08), transparent 34rem),
    radial-gradient(circle at 92% 18%, rgba(118, 231, 215, 0.055), transparent 24rem),
    linear-gradient(180deg, var(--bg-ink), var(--bg-warm) 48%, var(--bg-ink));
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  opacity: 0.16;
  background-image: var(--bg-frame-image);
  background-repeat: no-repeat;
  background-size: max(1400px, 100vw) auto;
  background-position: top center;
  filter: saturate(0.92) brightness(0.72);
}

body::after {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(216, 176, 106, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(216, 176, 106, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 72% 12%, rgba(184, 75, 58, 0.045), transparent 14rem),
    radial-gradient(circle at 10% 66%, rgba(118, 231, 215, 0.035), transparent 13rem);
  background-size: 44px 44px, 44px 44px, auto, auto;
  opacity: 0.78;
}

.site-header {
  border-bottom-color: rgba(216, 176, 106, 0.16);
  background: rgba(18, 14, 12, 0.68);
}

.site-header.scrolled {
  background: rgba(18, 14, 12, 0.94);
}

.hero {
  min-height: clamp(680px, 84vh, 800px);
  align-items: center;
  background:
    radial-gradient(circle at 28% 45%, rgba(216, 176, 106, 0.13), transparent 22rem),
    radial-gradient(circle at 78% 54%, rgba(118, 231, 215, 0.12), transparent 18rem),
    linear-gradient(180deg, rgba(21, 19, 17, 0), var(--bg-ink));
}

.hero-bg {
  opacity: 0.82;
  object-position: center right;
  filter: saturate(0.96) brightness(0.72) contrast(1.03);
  transform: scale(1.02);
  animation: heroImageDrift 16s ease-in-out infinite alternate;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(10, 7, 5, 0.98), rgba(10, 7, 5, 0.76) 38%, rgba(10, 7, 5, 0.36) 68%, rgba(10, 7, 5, 0.22)),
    radial-gradient(circle at 24% 48%, rgba(216, 176, 106, 0.15), transparent 23rem),
    linear-gradient(0deg, var(--bg-ink), rgba(21, 19, 17, 0.1) 38%, rgba(21, 19, 17, 0.42));
}

.hero-grid {
  opacity: 0.24;
  background:
    radial-gradient(circle at 14% 50%, rgba(224, 192, 138, 0.36) 0 1px, transparent 2px),
    linear-gradient(90deg, var(--bg-line-cyan) 1px, transparent 1px),
    linear-gradient(180deg, var(--bg-line-gold) 1px, transparent 1px);
  background-size: 120px 120px, 76px 76px, 76px 76px;
  mask-image: linear-gradient(90deg, #000, transparent 82%);
  animation: heroCircuitPulse 8s ease-in-out infinite;
}

.hero-scan {
  opacity: 0.42;
  background:
    linear-gradient(115deg, transparent 0 40%, rgba(224, 192, 138, 0.12) 47%, transparent 54%),
    radial-gradient(circle at 82% 48%, rgba(118, 231, 215, 0.16), transparent 13rem);
  transform: translateX(-18%);
  animation: heroScanSweep 9s ease-in-out infinite;
  mask-image: linear-gradient(90deg, transparent, #000 35%, #000 80%, transparent);
}

.hero-content {
  position: relative;
  padding-top: 112px;
  padding-bottom: 46px;
}

.hero-content::before {
  content: "";
  position: absolute;
  left: -8rem;
  bottom: 4rem;
  width: min(48vw, 560px);
  aspect-ratio: 1;
  border: 1px solid rgba(216, 176, 106, 0.16);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 10px rgba(216, 176, 106, 0.018),
    inset 0 0 0 34px rgba(118, 231, 215, 0.012),
    0 0 82px rgba(216, 176, 106, 0.08);
  pointer-events: none;
  transform: translate(-28%, 42%);
}

.hero-lede {
  max-width: 620px;
}

.hero-metrics div {
  background: rgba(18, 14, 12, 0.72);
  backdrop-filter: blur(10px);
}

.hero-live span {
  animation: heroChipFloat 4.8s ease-in-out infinite;
}

.hero-live span:nth-child(2) {
  animation-delay: 0.55s;
}

.hero-live span:nth-child(3) {
  animation-delay: 1.1s;
}

.hero-live span:nth-child(4) {
  animation-delay: 1.65s;
}

@keyframes heroImageDrift {
  from {
    transform: scale(1.02) translate3d(0, 0, 0);
  }

  to {
    transform: scale(1.055) translate3d(-1.8%, 0.6%, 0);
  }
}

@keyframes heroCircuitPulse {
  0%,
  100% {
    opacity: 0.18;
  }

  50% {
    opacity: 0.32;
  }
}

@keyframes heroScanSweep {
  0%,
  100% {
    transform: translateX(-24%);
    opacity: 0.16;
  }

  48%,
  58% {
    transform: translateX(18%);
    opacity: 0.45;
  }
}

@keyframes heroChipFloat {
  0%,
  100% {
    transform: translateY(0);
    border-color: rgba(103, 216, 211, 0.22);
  }

  50% {
    transform: translateY(-4px);
    border-color: rgba(216, 176, 106, 0.38);
  }
}

:where(.intro, .method, .ages, .lab, .tracks, .spaces, .classroom, .outcomes, .faq, .contact) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

:where(.intro, .method, .ages, .lab, .tracks, .spaces, .classroom, .outcomes, .faq, .contact) > .section-inner {
  position: relative;
  z-index: 1;
}

.section-band,
.method,
.ages,
.lab,
.tracks,
.spaces,
.outcomes,
.faq {
  background:
    radial-gradient(circle at 12% 0%, rgba(216, 176, 106, 0.08), transparent 25rem),
    linear-gradient(180deg, rgba(32, 27, 24, 0.82), rgba(21, 19, 17, 0.9));
}

.section-band::before,
.method::before,
.ages::before,
.lab::before,
.tracks::before,
.spaces::before,
.outcomes::before,
.faq::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image: var(--bg-frame-image);
  background-repeat: no-repeat;
  background-size: min(1300px, 110vw) auto;
  background-position: 100% 50%;
  mask-image: linear-gradient(90deg, transparent, #000 58%, transparent);
  filter: saturate(0.84) brightness(0.68);
}

.method::after,
.ages::after,
.tracks::after,
.faq::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(216, 176, 106, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(216, 176, 106, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.38;
  mask-image: radial-gradient(circle at 50% 40%, #000, transparent 72%);
}

.intro::before,
.outcomes::before {
  background-position: left center;
  mask-image: linear-gradient(90deg, #000, transparent 74%);
}

.spaces {
  background:
    radial-gradient(circle at 75% 8%, rgba(118, 231, 215, 0.08), transparent 20rem),
    radial-gradient(circle at 18% 72%, rgba(216, 176, 106, 0.09), transparent 24rem),
    linear-gradient(180deg, rgba(21, 19, 17, 0.92), rgba(32, 27, 24, 0.94));
}

.classroom {
  background:
    radial-gradient(circle at 50% 6%, rgba(118, 231, 215, 0.14), transparent 24rem),
    radial-gradient(circle at 12% 85%, rgba(184, 75, 58, 0.08), transparent 17rem),
    linear-gradient(180deg, var(--bg-ink), var(--bg-brown) 48%, var(--bg-ink));
}

.classroom::before {
  opacity: 0.42;
  background:
    var(--bg-frame-image) center / min(1500px, 120vw) auto no-repeat,
    linear-gradient(90deg, rgba(118, 231, 215, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(216, 176, 106, 0.09) 1px, transparent 1px);
  background-size: min(1500px, 120vw) auto, 58px 58px, 58px 58px;
  mask-image: radial-gradient(circle at center, #000, transparent 78%);
  filter: saturate(0.94) brightness(0.7);
}

.video-wall {
  background:
    linear-gradient(135deg, rgba(224, 192, 138, 0.105), rgba(118, 231, 215, 0.045)),
    rgba(12, 8, 4, 0.58);
  border-color: rgba(118, 231, 215, 0.26);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(224, 192, 138, 0.1);
}

.contact {
  background:
    radial-gradient(circle at 82% 0%, rgba(216, 176, 106, 0.08), transparent 18rem),
    linear-gradient(180deg, rgba(21, 19, 17, 0.96), rgba(24, 20, 18, 0.98));
}

.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: var(--bg-frame-image);
  background-repeat: no-repeat;
  background-size: min(1100px, 120vw) auto;
  background-position: 110% 50%;
  filter: saturate(0.82) brightness(0.6);
  mask-image: linear-gradient(90deg, transparent, #000 72%, transparent);
}

.site-footer {
  background:
    linear-gradient(90deg, rgba(216, 176, 106, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, #151311, #100d0b);
  background-size: 48px 48px, auto;
}

.method-grid,
.track-card,
.age-card,
.space-card,
.faq-grid article,
.outcome-list article,
.lead-form,
.main-video-card,
.video-card,
.calibrator {
  backdrop-filter: blur(8px);
}

@media (max-width: 980px) {
  body::before {
    opacity: 0.11;
    background-size: 1260px auto;
    background-position: top center;
  }

  .hero-content::before {
    width: 480px;
    left: auto;
    right: -18rem;
    bottom: 10rem;
    opacity: 0.34;
  }

  .section-band::before,
  .method::before,
  .ages::before,
  .lab::before,
  .tracks::before,
  .spaces::before,
  .outcomes::before,
  .faq::before {
    opacity: 0.17;
    background-size: 1120px auto;
    background-position: center top;
    mask-image: linear-gradient(180deg, #000, transparent 68%);
  }
}

@media (max-width: 760px) {
  .hero {
    min-height: 620px;
    align-items: start;
  }

  body::before {
    opacity: 0.08;
    background-size: 980px auto;
    background-position: 58% top;
  }

  body::after {
    background-size: 64px 64px, 64px 64px, auto, auto;
    opacity: 0.45;
  }

  .hero-bg {
    opacity: 0.32;
    object-position: 70% center;
    animation-duration: 22s;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(12, 8, 4, 0.99), rgba(12, 8, 4, 0.9) 62%, rgba(12, 8, 4, 0.68)),
      linear-gradient(0deg, var(--bg-ink), rgba(21, 19, 17, 0.34) 42%, rgba(21, 19, 17, 0.74));
  }

  .hero-grid,
  .hero-content::before {
    opacity: 0.1;
  }

  .hero-scan {
    opacity: 0.16;
    animation-duration: 12s;
  }

  .hero-live {
    display: none;
  }

  .section-band::before,
  .method::before,
  .ages::before,
  .lab::before,
  .tracks::before,
  .spaces::before,
  .outcomes::before,
  .faq::before,
  .contact::before {
    opacity: 0.08;
    background-size: 900px auto;
    background-position: center top;
    mask-image: linear-gradient(180deg, #000, transparent 54%);
  }

  .method::after,
  .ages::after,
  .tracks::after,
  .faq::after {
    opacity: 0.18;
    background-size: 72px 72px;
  }

  .classroom::before {
    opacity: 0.2;
    background-size: 920px auto, 72px 72px, 72px 72px;
    background-position: 58% top, center, center;
  }

  .lead-form,
  .contact-points span {
    background-color: rgba(12, 8, 4, 0.34);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg,
  .hero-grid,
  .hero-scan,
  .hero-live span {
    animation: none;
  }
}
