/* ─── Esoteric · ancient · brutalist texture system ─── */

:root {
  --texture-noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --texture-grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --texture-stone: url("data:image/svg+xml,%3Csvg width='120' height='120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.04' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)' opacity='0.35'/%3E%3C/svg%3E");
  --texture-etch: url("data:image/svg+xml,%3Csvg width='64' height='64' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 32h64M32 0v64' stroke='%23ffffff' stroke-width='0.35' opacity='0.04'/%3E%3Cpath d='M0 16h64M0 48h64M16 0v64M48 0v64' stroke='%23ffffff' stroke-width='0.2' opacity='0.025'/%3E%3C/svg%3E");
  --brutal-edge: rgba(255, 255, 255, 0.09);
  --brutal-edge-dim: rgba(255, 255, 255, 0.04);
  --brutal-fill: rgba(12, 10, 8, 0.72);
  --brutal-fill-deep: rgba(6, 5, 4, 0.88);
}

/* Global body — sigil black */
.esoteric-surface {
  background-color: #010101;
  background-image: none;
}

.esoteric-surface::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: var(--texture-grain);
}

.esoteric-surface::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: soft-light;
  background-image: var(--texture-etch);
  background-size: 64px 64px;
}

/* Panel-level ancient stone wash */
.main.esoteric-panel {
  position: relative;
}

.esoteric-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: overlay;
  background-image: var(--texture-stone);
  background-size: 180px 180px;
}

/* Inscribed text — carved stone feel */
.esoteric-inscribe {
  position: relative;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.65),
    0 0 1px rgba(255, 255, 255, 0.12);
}

.esoteric-inscribe::after {
  content: '';
  position: absolute;
  inset: -2px -4px;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: var(--texture-noise);
  border-radius: 1px;
}

/* Brutalist blocks — cards, buttons, header */
.brutal-block,
.archive-card,
.stage__enter-btn,
.main__header {
  position: relative;
  background:
    linear-gradient(145deg, rgba(18, 14, 11, 0.92) 0%, rgba(8, 6, 5, 0.96) 100%);
  border: 1px solid var(--brutal-edge);
  box-shadow:
    inset 0 1px 0 var(--brutal-edge-dim),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    0 8px 32px rgba(0, 0, 0, 0.35);
}

.brutal-block::before,
.archive-card::before,
.stage__enter-btn::before,
.main__header::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: var(--texture-grain);
  border-radius: inherit;
}

.brutal-block::after,
.archive-card::after,
.stage__enter-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: var(--texture-etch);
  background-size: 48px 48px;
  border-radius: inherit;
}

/* Sigil disc — solid black fill when alive */
.stage--alive .stage__sigil-reveal::after {
  opacity: 0;
  animation: sigilDiscEtch 2.6s var(--ease-open) 0.5s forwards;
}

.stage--alive .stage__sigil-reveal::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  background: #010101;
  opacity: 1;
}

@keyframes sigilDiscEtch {
  to { opacity: 0.04; }
}

/* Sigil — pre-alive reveal */
.stage__sigil-img {
  filter: contrast(1.06) saturate(0.92);
}

.stage__sigil-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: var(--texture-stone);
  background-size: 120px 120px;
  border-radius: 50%;
}

/* Living glyph strokes — etched metal */
.living__ouroboros svg {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.06));
}

/* Photorealistic 3D serpent ring — subtle grounding glow */
.living__ouroboros-img {
  mix-blend-mode: normal;
}

/* Stage grain enhancement */
.stage__grain,
.main__grain {
  opacity: 0.09;
  mix-blend-mode: overlay;
}

/* Tagline & enter — inscribed */
.stage__tagline span,
.stage__enter-hint {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5), 0 0 18px rgba(255, 255, 255, 0.06);
}

/* Main typography texture */
.main__title,
.main__section-title {
  letter-spacing: 0.06em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55), 0 0 1px rgba(255, 255, 255, 0.08);
}

.main__manifesto p,
.main__lead,
.archive-card__desc {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .esoteric-surface::before,
  .esoteric-surface::after {
    opacity: 0.04;
  }
}
