@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --background: 220 15% 4%;
  --foreground: 220 10% 85%;

  --card: 220 15% 6%;
  --card-foreground: 220 10% 85%;

  --popover: 220 15% 5%;
  --popover-foreground: 220 10% 85%;

  --muted: 220 10% 12%;
  --muted-foreground: 220 8% 55%;

  --primary: 0 35% 28%;
  --primary-foreground: 220 10% 90%;

  --secondary: 220 12% 10%;
  --secondary-foreground: 220 10% 75%;

  --accent: 0 30% 22%;
  --accent-foreground: 220 10% 90%;

  --destructive: 0 45% 35%;
  --destructive-foreground: 220 10% 90%;

  --border: 220 10% 15%;
  --input: 220 10% 12%;
  --ring: 0 35% 28%;

  --radius: 0.25rem;

  --void: 220 15% 3%;
  --ash: 220 8% 20%;
  --ash-light: 220 6% 35%;
  --blood: 0 35% 28%;
  --blood-dark: 0 40% 18%;
  --smoke: 220 10% 45%;
  --bone: 35 15% 75%;
}

/* Hard guarantee: void background covers the whole site even if Tailwind/CDNs fail */
#void-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.void-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--ash)) hsl(var(--void));
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.7;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel', serif;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

::selection {
  background: hsl(var(--blood) / 0.4);
  color: hsl(var(--foreground));
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: hsl(var(--void));
}

::-webkit-scrollbar-thumb {
  background: hsl(var(--ash));
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--ash-light));
}

/* Noise texture overlay */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.03;
  z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Ornament line */
.ornament-line {
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    hsl(var(--blood) / 0.3) 15%,
    hsl(var(--blood)) 50%,
    hsl(var(--blood) / 0.3) 85%,
    transparent 100%
  );
}

/* Section divider */
.section-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    hsl(var(--ash)) 20%,
    hsl(var(--blood) / 0.5) 50%,
    hsl(var(--ash)) 80%,
    transparent 100%
  );
}

/* Text gradient */
.text-blood-gradient {
  background: linear-gradient(135deg, hsl(var(--blood)) 0%, hsl(0 25% 40%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Card glow */
.border-glow {
  box-shadow: 0 0 0 1px hsl(var(--border)), 0 0 20px -5px hsl(var(--blood) / 0.2);
}

/* Character card */
.character-card {
  background: linear-gradient(145deg, hsl(var(--card)) 0%, hsl(var(--void)) 100%);
  border: 1px solid hsl(var(--border));
  border-radius: 2px;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.character-card:hover {
  border-color: hsl(var(--blood) / 0.5);
  box-shadow: 0 20px 60px -20px hsl(var(--void)), 0 0 40px -10px hsl(var(--blood) / 0.15);
}

/* Animate blood pulse */
.animate-blood-pulse {
  animation: bloodPulse 4s ease-in-out infinite;
}

@keyframes bloodPulse {
  0%, 100% { box-shadow: 0 0 20px -5px hsl(var(--blood) / 0.3); }
  50% { box-shadow: 0 0 40px -5px hsl(var(--blood) / 0.5); }
}

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s cubic-bezier(0.25, 0.1, 0.25, 1), transform 1.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Easter egg glitch */
.glitch-active {
  animation: glitchScreen 0.1s infinite;
}

@keyframes glitchScreen {
  0% { filter: hue-rotate(0deg) saturate(1); }
  20% { filter: hue-rotate(-10deg) saturate(1.2); transform: translateX(-2px); }
  40% { filter: hue-rotate(5deg) saturate(0.8); transform: translateX(2px); }
  60% { filter: hue-rotate(-5deg) saturate(1.1); transform: translateX(-1px); }
  80% { filter: hue-rotate(10deg) saturate(1); transform: translateX(1px); }
  100% { filter: hue-rotate(0deg) saturate(1); transform: translateX(0); }
}

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

.glitch-text::before {
  animation: glitchText 0.3s infinite;
  color: hsl(var(--blood));
  z-index: -1;
}

.glitch-text::after {
  animation: glitchText 0.3s infinite reverse;
  color: hsl(var(--smoke));
  z-index: -2;
}

@keyframes glitchText {
  0% { transform: translate(0); }
  20% { transform: translate(-3px, 3px); }
  40% { transform: translate(-3px, -3px); }
  60% { transform: translate(3px, 3px); }
  80% { transform: translate(3px, -3px); }
  100% { transform: translate(0); }
}

/* Mobile menu helper */
[data-mobile-menu='panel'][aria-hidden='true'] {
  pointer-events: none;
}

/* Background canvas container */
#void-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#void-bg canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
