:root {
  --corruption: 0;
  --font-weight-drift: 0;
  --line-height-squeeze: 0;
  --margin-asymmetry: 0;
  --color-shift: 0;
  --noise-opacity: 0;
  --element-drift: 0;
  --scroll-resistance: 1;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #f8f9fa;
  color: #1a1a1a;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Noise overlay */
.noise-overlay {
  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");
  mix-blend-mode: overlay;
}

/* Corruption container effects */
.corruption-container {
  transition: filter 0.5s ease;
}

/* Header glitch effect */
.header-glitch {
  animation: headerGlitch 0.3s infinite;
}

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

/* Content block corruption */
.content-block {
  transition: all 0.3s ease;
}

.content-block:hover {
  transform: translateX(calc(var(--element-drift) * 0.1px));
}

/* Glitch text effect */
.glitch-text {
  animation: glitchText 2s infinite;
  position: relative;
}

@keyframes glitchText {
  0%, 90%, 100% { opacity: 1; transform: none; }
  92% { opacity: 0.8; transform: skewX(2deg); }
  94% { opacity: 1; transform: skewX(-2deg); }
  96% { opacity: 0.9; transform: none; }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  transition: opacity 0.3s;
}

/* Text selection corruption */
::selection {
  background: rgba(255, 100, 100, calc(var(--corruption) * 0.5));
  color: inherit;
}

/* Image corruption effects */
img {
  transition: filter 0.5s ease, transform 0.3s ease;
}

/* Link styling */
a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .corruption-container main {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  h1 {
    font-size: 2rem !important;
  }
}

/* Animation for depth indicator */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-pulse {
  animation: pulse 1s infinite;
}

/* Creepy hover effects at high corruption */
.content-block p {
  transition: color 0.3s, letter-spacing 0.3s;
}

/* Performance degradation simulation */
@keyframes stutter {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.98; }
}

/* Border corruption */
.border {
  border-width: 1px;
  border-style: solid;
}

/* Text corruption classes */
.corrupted-text {
  font-feature-settings: 'kern' 0;
  text-rendering: optimizeSpeed;
}

/* Fake crash screen styling */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Mobile touch feedback */
@media (hover: none) {
  .content-block:active {
    transform: scale(0.99);
  }
}

/* Prevent text selection at deep corruption */
.no-select {
  user-select: none;
  -webkit-user-select: none;
}

/* Vignette effect for atmosphere */
.corruption-container::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    transparent 60%,
    rgba(0, 0, 0, calc(var(--corruption) * 0.3)) 100%
  );
  z-index: 25;
}

/* Subtle grain texture */
.corruption-container::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: calc(var(--noise-opacity));
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)'/%3E%3C/svg%3E");
  z-index: 20;
}