/* ============================================================
   base.css -- Resets, body background, global hero/sub-hero/footer chrome shared across pages.
   Part of the split from the original single style.css.
   ============================================================ */


* {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-term);
  font-size: 17px;
  letter-spacing: -0.005em;
  color: var(--ink);
  background-color: var(--wall-yellow);
  overflow-x: hidden;
}

/* Real wallpaper photo (assets/images/wallpaper.jpg) + vignette, on a fixed
   pseudo-element rather than body's own background so it can sit behind all
   real content (z-index: -1, same trusted pattern as .hero::before below)
   and be dimmed independently in dark mode without touching body itself.
   background-color above is the fallback if the image is missing or still
   loading. background-attachment: fixed keeps it from scrolling with the
   page, matching how the old procedural pattern behaved.

   The photo itself is a seamless repeating tile, not a single full-viewport
   image -- so it uses background-repeat: repeat at its native size
   (--wallpaper-tile-size, tokens.css) rather than background-size: cover.
   The vignette gradient is the opposite: a single overlay meant to cover
   the whole viewport once, so that layer keeps background-size: cover /
   no-repeat. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 80% 80% at 50% 50%, transparent 35%, rgba(var(--shadow-rgb), 1) 100%),
    url("/assets/images/wallpaper.jpg");
  background-size: cover, var(--wallpaper-tile-size, auto);
  background-position: center, top left;
  background-repeat: no-repeat, repeat;
  background-attachment: fixed, fixed;
}

/* The photo is a bright/yellow-toned image -- in dark mode we dial it back
   rather than trying to filter/invert it, so the dark theme's near-black
   palette still reads as dark, with just a hint of the wallpaper texture
   showing through the vignette. */
html.theme-dark body::before {
  opacity: 0.35;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-noise);
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- HERO ---------- */
.hero {
  text-align: center;
  padding: 6rem 1.5rem 3.5rem;
  position: relative;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -2rem 0 auto;
  height: 28rem;
  background: radial-gradient(ellipse 55% 100% at 50% 0%, rgba(250, 246, 233, 0.5), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.eyebrow {
  font-family: var(--font-term);
  font-weight: 500;
  letter-spacing: 0.1em;
  font-size: 0.95rem;
  opacity: 1;
  margin: 0 0 1rem;
	  color: var(--ink);
}

.glitch-title {
  font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 6rem);
  margin: 0;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-shadow: 0 8px 28px rgba(var(--shadow-rgb), 0.16);
  position: relative;
  display: inline-block;
}

.glitch-title::before,
.glitch-title::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
}

.glitch-title::before {
  color: var(--glitch-pink);
  animation: glitchTop 3.2s infinite linear;
  clip-path: inset(0 0 55% 0);
}

.glitch-title::after {
  color: var(--cursed-green);
  animation: glitchBottom 2.6s infinite linear;
  clip-path: inset(55% 0 0 0);
}

@keyframes glitchTop {
  0%, 89%, 100% { transform: translate(0, 0); opacity: 0; }
  90% { transform: translate(-3px, -1px); opacity: 0.85; }
  92% { transform: translate(3px, 1px); opacity: 0.85; }
  94% { transform: translate(-2px, 0); opacity: 0.85; }
  96% { opacity: 0; }
}

@keyframes glitchBottom {
  0%, 92%, 100% { transform: translate(0, 0); opacity: 0; }
  93% { transform: translate(3px, 1px); opacity: 0.85; }
  95% { transform: translate(-3px, -1px); opacity: 0.85; }
  97% { opacity: 0; }
}

.tagline {
  font-size: 1.05rem;
  max-width: 36rem;
  margin: 1rem auto 2rem;
  opacity: 1;
	  color: var(--ink);
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.hero-buttons[hidden] {
  display: none;
}

.hint {
  font-size: 0.95rem;
  opacity: .75;
  font-family: var(--font-term);
	  color: var(--ink);
}

/* ---------- FOOTER ---------- */

.warning-plaque {
  text-align: center;
  padding: 2.5rem 1.25rem 3.5rem;
  margin-top: 1rem;
  font-family: var(--font-term);
  border-top: 1px solid var(--border-soft);
  opacity: 1;
  background-color: var(--paper);
}

.fine-print {
  font-size: 0.85rem;
  max-width: 34rem;
  margin: 0.5rem auto 0;
  opacity: 0.65;
}

.fine-print a {
  color: var(--stain-brown);
}

/* ---------- SUB-PAGE HERO (levels/entities/guide/shop) ---------- */
.page-hero {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
}

.page-hero h1 {
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.2rem);
  margin: 0 0 0.6rem;
}

.page-hero p {
  max-width: 36rem;
  margin: 0 auto 1.5rem;
  opacity: 1;
  color: var(--ink);
  font-size: 1.05rem;
}

.page-hero p:last-child {
  margin-bottom: 0;
}

/* ---------- LIVE PANEL (home) ---------- */
.live-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.featured-level { border-color: var(--stain-brown); }

.level-badge {
  display: inline-block;
  font-family: var(--font-term);
  font-size: 0.85rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink);
  background: var(--fluoro-white);
  margin-left: 0.5rem;
  vertical-align: middle;
}

.stars {
  color: var(--stain-brown);
  letter-spacing: 0.1em;
}

.updates-note {
  font-size: 0.85rem;
  opacity: 0.6;
  font-style: italic;
  margin-top: 0.75rem;
}

@media (max-width: 700px) {
  .live-panel { grid-template-columns: 1fr; }
}

