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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: #f0f0f0;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  background: #0a0a0a;
}

.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: 
    radial-gradient(circle at 20% 50%, rgba(255, 0, 100, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0, 100, 255, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(100, 255, 0, 0.12) 0%, transparent 50%),
    linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
  will-change: transform;
  animation: backgroundMorph 20s ease-in-out infinite;
}

.background-image {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%) scale(1.01);
  object-fit: cover;
  opacity: 0.6;
  /* filter: blur(1px); */
}

@keyframes backgroundMorph {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
  .background::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
      radial-gradient(circle at 60% 70%, rgba(255, 100, 0, 0.12) 0%, transparent 40%),
      radial-gradient(circle at 30% 30%, rgba(200, 0, 255, 0.12) 0%, transparent 40%);
    animation: slowRotate 15s linear infinite;
    pointer-events: none;
  }

  @keyframes slowRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 30px 15px;
  position: relative;
}

.main-heading {
  font-size: clamp(2rem, 10vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 5%;
  text-align: center;
  color: #fff;
}

.sub-heading {
  font-size: clamp(1.2rem, 6vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 1.5%;
  text-align: center;
  color: #ddd;
  transform: skewY(-1deg);
  text-shadow: 2px 2px 0 rgba(255, 0, 100, 0.3);
}

.tile-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 40px 0;
}

.glitch-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
  text-decoration: none;
  color: #f0f0f0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  transform: rotate(var(--rotation, 0deg)) skewX(var(--skew, 0deg));
  clip-path: polygon(
    2% 0%, 98% 1%, 99% 3%, 100% 97%, 97% 100%, 3% 99%, 1% 98%, 0% 2%
  );
}

.glitch-tile span {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
}

.tile-1 {
  --rotation: -0.5deg;
  --skew: -1deg;
}

.tile-2 {
  --rotation: 0.5deg;
  --skew: 1deg;
}

.tile-3 {
  --rotation: -0.3deg;
  --skew: 0.5deg;
}

.tile-4 {
  --rotation: 0.7deg;
  --skew: -1deg;
}

.tile-5 {
  --rotation: -0.6deg;
  --skew: 1.2deg;
}

.tile-grid:has(.glitch-tile:hover) .glitch-tile:not(:hover) {
  opacity: 0.4;
}

.glitch-tile:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: rotate(var(--rotation, 0deg)) skewX(var(--skew, 0deg)) scale(1.02);
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.2));
}

.page-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
}

.page-title {
  flex: 1;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 12px 20px;
  backdrop-filter: blur(5px);
}

.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f0f0f0;
  text-decoration: none;
  font-size: 1.5rem;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(-5px);
}

.page-content {
  font-size: 1.1rem;
  line-height: 1.8;
  opacity: 0.9;
  text-align: center;
  hyphens: none;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 30px;
}

.page-content p {
  margin-bottom: 20px;
}

.subsection {
  margin-bottom: 30px;
}

.subsection:last-child {
  margin-bottom: 0;
}

.subsection h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.95);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-left: 3px solid rgba(255, 255, 255, 0.3);
  padding-left: 12px;
}

@media (min-width: 600px) {
  .container {
    padding: 60px 30px;
  }

  .glitch-tile span {
    font-size: 1.2rem;
  }

  .page-content {
    font-size: 1rem;
    line-height: 1.8;
  }

  .page-title {
    font-size: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
