:root {
  --ink: #050506;
  --ink-2: #0a0b10;
  --blue: #3fd0ff;
  --blue-dim: #14587a;
  --red: #ff2b46;
  --red-dim: #7a0f1f;
  --cream: #f2efe6;
  --cream-dim: #b3afa6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--ink);
  color: var(--cream);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  width: 100%;
}

::selection { background: var(--blue); color: var(--ink); }

.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  /* No mix-blend-mode: a full-viewport blend layer forces the browser to
     recompute pixel blending against the scrub canvases underneath on every
     single frame they redraw — a real GPU compositing cost that doesn't show
     up in JS-side timing checks but reads as stutter/glitchiness on real
     hardware. Plain low-alpha compositing achieves nearly the same texture
     and can be cached as a static layer instead of recomputed per frame. */
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Loader */
.loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader-name {
  font-family: 'Anton', sans-serif;
  font-size: clamp(1.6rem, 4.4vw, 3rem);
  letter-spacing: 0.06em;
  color: var(--cream);
}
.loader-vs {
  color: var(--cream-dim);
  font-size: 0.6em;
  margin: 0 0.15em;
}
.loader-bar {
  width: 220px;
  height: 2px;
  background: rgba(242,239,230,0.15);
  overflow: hidden;
}
.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--red));
  transition: width 0.2s ease;
}

/* Nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 48px;
  /* Was mix-blend-mode: difference — forced a recompute against whatever the
     scrub canvas below was doing on every frame it changed, right at the top
     of the pinned hero section. A solid fade bar keeps the text legible over
     any frame without a per-frame blend cost. */
  background: linear-gradient(180deg, rgba(5,5,6,0.75), transparent);
}
.nav-logo {
  font-family: 'Anton', sans-serif;
  letter-spacing: 0.08em;
  font-size: 1rem;
}
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
}
.nav-links a:hover { opacity: 1; }

/* Shared section/canvas scaffolding */
.hero, .domain, .mahoraga {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  /* Fences off layout/paint invalidation to this subtree so a canvas
     redrawing on every scroll tick doesn't force the browser to re-check the
     rest of the page each frame. */
  contain: layout paint style;
}
.scrub-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Color grade is baked into each cached frame at extraction time (see
     script.js captureFrame) instead of a live CSS filter here — a GPU filter
     recomputed on a large canvas every scroll tick was a major jank source. */
}

/* HERO */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,5,6,0.4) 0%, rgba(5,5,6,0.15) 40%, rgba(5,5,6,0.8) 100%);
}
.hero-content {
  position: relative;
  z-index: 5;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 20px;
}
.hero-title {
  font-family: 'Anton', sans-serif;
  line-height: 0.88;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.02em;
}
.title-row { display: flex; }
.title-row span {
  display: inline-block;
  opacity: 0;
  transform: translateY(60px);
  font-size: clamp(3.4rem, 13vw, 10.5rem);
}
.title-blue span { color: var(--blue); text-shadow: 0 0 34px rgba(63,208,255,0.55); }
.title-red span { color: var(--red); text-shadow: 0 0 34px rgba(255,43,70,0.55); }
.title-vs span {
  color: var(--cream-dim);
  font-size: clamp(1.2rem, 3.4vw, 2.6rem) !important;
  letter-spacing: 0.2em;
}
.hero-subtitle {
  margin-top: 26px;
  max-width: 560px;
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  color: var(--cream-dim);
  font-weight: 400;
  opacity: 0;
  transform: translateY(20px);
}
.scroll-cue {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--cream-dim);
  text-transform: uppercase;
}
.scroll-cue-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(var(--blue), transparent);
  animation: scrollLine 1.8s ease-in-out infinite;
}
@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

.stats {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(242,239,230,0.15);
  /* No backdrop-filter: it sits directly over the actively scroll-scrubbing
     hero canvas, and re-blurring changing content every frame was a real
     scroll-jank contributor. A denser solid gradient gets the same
     legibility without the per-frame cost. */
  background: linear-gradient(180deg, transparent, rgba(5,5,6,0.85) 40%, rgba(5,5,6,0.92));
}
.stat {
  padding: 22px 10px 26px;
  text-align: center;
  border-right: 1px solid rgba(242,239,230,0.1);
}
.stat:last-child { border-right: none; }
.stat-num {
  display: block;
  font-family: 'Anton', sans-serif;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  background: linear-gradient(90deg, var(--blue), var(--red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

/* DOMAIN EXPANSION */
.domain-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5,5,6,0.55);
}
.domain-content {
  position: relative;
  z-index: 5;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4vw;
  padding: 0 8vw;
}
.section-tag {
  position: absolute;
  top: 14vh;
  left: 8vw;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream-dim);
}
.mahoraga-content .section-tag,
.powers-content .section-tag { position: static; margin-bottom: 24px; display: inline-block; }
.domain-label {
  max-width: 420px;
  opacity: 0;
  transform: translateY(30px);
}
.domain-void { text-align: left; }
.domain-shrine { text-align: right; margin-left: auto; }
.domain-title {
  font-family: 'Anton', sans-serif;
  font-size: clamp(2.2rem, 6.5vw, 4.6rem);
  line-height: 1;
}
.title-blue-solid { color: var(--blue); text-shadow: 0 0 26px rgba(63,208,255,0.4); }
.title-red-solid { color: var(--red); text-shadow: 0 0 26px rgba(255,43,70,0.4); }
.domain-desc {
  margin-top: 16px;
  color: var(--cream-dim);
  font-size: 1rem;
  line-height: 1.5;
}

/* MAHORAGA */
.mahoraga-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,5,6,0.55) 0%, rgba(5,5,6,0.8) 100%);
}
.mahoraga-content {
  position: relative;
  z-index: 5;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 8vw;
}
.mahoraga-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 560px;
}
.mahoraga-wheel {
  width: clamp(80px, 12vw, 140px);
  height: clamp(80px, 12vw, 140px);
  color: var(--red);
  filter: drop-shadow(0 0 18px rgba(255,43,70,0.5));
  margin-bottom: 28px;
}
.mahoraga-title {
  font-family: 'Anton', sans-serif;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1.05;
}
.mahoraga-desc {
  margin-top: 18px;
  color: var(--cream-dim);
  font-size: 1.05rem;
  line-height: 1.55;
}

/* POWER PROFILES */
.powers {
  padding: 14vh 8vw;
  background: var(--ink-2);
}
.powers-heading {
  font-family: 'Anton', sans-serif;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  margin-top: 10px;
  margin-bottom: 48px;
  line-height: 1.05;
}
.powers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.power-card {
  position: relative;
  padding: 32px 26px;
  border: 1px solid rgba(242,239,230,0.15);
  background: rgba(10,11,16,0.6);
  transition: transform 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}
.power-blue:hover { transform: translateY(-8px); border-color: var(--blue); background: rgba(63,208,255,0.06); }
.power-red:hover { transform: translateY(-8px); border-color: var(--red); background: rgba(255,43,70,0.06); }
.power-card-num {
  font-family: 'Anton', sans-serif;
  font-size: 0.95rem;
  color: var(--cream-dim);
}
.power-card h3 {
  margin-top: 14px;
  font-size: 1.7rem;
  font-family: 'Anton', sans-serif;
  letter-spacing: 0.01em;
}
.power-blue h3 { color: var(--blue); }
.power-red h3 { color: var(--red); }
.technique-list {
  margin-top: 20px;
  list-style: none;
}
.technique-list li {
  padding: 12px 0;
  border-top: 1px solid rgba(242,239,230,0.1);
  font-size: 1rem;
  color: var(--cream-dim);
  opacity: 0;
  transform: translateX(-16px);
}
.technique-list li:last-child { border-bottom: 1px solid rgba(242,239,230,0.1); }

/* FINALE */
.finale {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14vh 8vw 40px;
  overflow: hidden;
}
.finale-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 20%, rgba(63,208,255,0.12), transparent 55%),
              linear-gradient(180deg, rgba(5,5,6,0.5) 0%, rgba(5,5,6,0.9) 100%);
}
.finale-content { position: relative; z-index: 5; text-align: center; margin: auto 0; }
.finale-title {
  font-family: 'Anton', sans-serif;
  font-size: clamp(3rem, 10vw, 7.5rem);
  line-height: 0.95;
  opacity: 0;
  transform: translateY(40px);
}
.finale-buttons {
  margin-top: 40px;
  display: flex;
  gap: 18px;
  justify-content: center;
  opacity: 0;
  transform: translateY(30px);
}
.btn {
  padding: 16px 32px;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 2px;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.btn-primary {
  background: linear-gradient(90deg, var(--blue), var(--red));
  color: var(--ink);
  font-weight: 700;
}
.btn-primary:hover { transform: translateY(-3px); }
.btn-ghost {
  border: 1px solid rgba(242,239,230,0.3);
  color: var(--cream);
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-3px); }

.footer {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 30px;
  border-top: 1px solid rgba(242,239,230,0.12);
  font-size: 0.8rem;
  color: var(--cream-dim);
}
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--cream-dim); text-decoration: none; }
.footer-links a:hover { color: var(--blue); }

@media (max-width: 768px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .nav { padding: 20px 24px; }
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 0.75rem; }

  .domain-content { flex-direction: column; justify-content: center; text-align: center; gap: 40px; }
  .domain-void, .domain-shrine { text-align: center; margin-left: 0; max-width: 100%; }
  .section-tag { position: static; margin-bottom: 24px; }

  .powers-grid { grid-template-columns: 1fr; }

  .power-card:hover { transform: none !important; }

  .grain { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue-line { animation: none; }
}
