body {
  background: radial-gradient(ellipse at center, #0e0b1d 0%, #06030d 100%);
  color: #e4d9ff;
  font-family: 'Georgia', serif;
  margin: 0;
  padding: 2rem;
  overflow-x: hidden;
  background-attachment: fixed;
  background-size: cover;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background: url('https://upload.wikimedia.org/wikipedia/commons/6/68/Starfield_simulation_stitched.gif') repeat;
  background-size: 1000px 1000px;
  opacity: 0.05;
  animation: scrollStarfield 180s linear infinite;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(0, 0, 0, 0.6) 65%,
    #090211 100%
  );
  z-index: -3;
  pointer-events: none;
}


main.tablets-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  transform: translateX(-50%);
  background: linear-gradient(
    to bottom,
    rgba(187, 153, 255, 0.1),
    rgba(255, 255, 255, 0.02) 50%,
    rgba(187, 153, 255, 0.1)
  );
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}




@keyframes scrollStarfield {
  from { transform: translate(0, 0); }
  to { transform: translate(-500px, -500px); }
}


main.tablets-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #3b2e63;
  border-radius: 1rem;
  box-shadow: 0 0 20px rgba(138, 101, 255, 0.15);
}

h1 {
  text-align: center;
  font-size: 2.5rem;
  color: #bb99ff;
  margin-bottom: 0.5rem;
  animation: breatheTitle 6s ease-in-out infinite;
}

@keyframes breatheTitle {
  0%, 100% {
    text-shadow: 0 0 8px #bb99ff44;
    transform: scale(1);
  }
  50% {
    text-shadow: 0 0 24px #d9bfff88;
    transform: scale(1.015);
  }
}


.subtitle {
  text-align: center;
  font-style: italic;
  color: #aaa0cc;
  margin-bottom: 2rem;
}

section.tablet {
  border-top: 1px solid #3b2e63;
  padding-top: 2rem;
  margin-top: 2rem;
}

section.tablet h2 {
  color: #d7b3ff;
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

section.tablet p {
  line-height: 1.6;
  margin-bottom: 1rem;
}

section.tablet h2 a {
  color: #d7b3ff;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

section.tablet h2 a:hover {
  color: #ffffff;
  text-shadow: 0 0 8px #bb99ff;
  cursor: pointer;
}

/* Fade-in effect when tablet enters view */
.tablet {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.tablet.visible {
  opacity: 1;
  transform: translateY(0);
}

section.tablet h2 a {
  color: #d7b3ff;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
  display: inline-block;
  position: relative;
}

section.tablet h2 a:hover {
  color: #ffffff;
  text-shadow: 0 0 8px #bb99ff, 0 0 12px #aa77ff;
  transform: scale(1.02);
}

/* Tablet glow on hover */
section.tablet {
  background: rgba(255, 255, 255, 0.015);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid #3b2e63;
  transition: box-shadow 0.3s ease-in-out, border-color 0.3s;
}

section.tablet:hover {
  box-shadow: 0 0 20px rgba(187, 153, 255, 0.2),
              0 0 40px rgba(187, 153, 255, 0.1);
  border-color: #bb99ff;
  animation: tabletPulse 1.4s ease-out;
}

@keyframes tabletPulse {
  0%   { box-shadow: 0 0 0 rgba(187, 153, 255, 0.0); }
  50%  { box-shadow: 0 0 30px rgba(187, 153, 255, 0.25); }
  100% { box-shadow: 0 0 20px rgba(187, 153, 255, 0.1); }
}

.citadel-frequency-line {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
  opacity: 0.2;
  pointer-events: none;
  animation: flickerFrequency 4.7s infinite;
  z-index: 0;
  transform: translateX(-50%);
}

@keyframes flickerFrequency {
  0%   { opacity: 0.15; }
  5%   { opacity: 0.3; }
  10%  { opacity: 0.1; }
  20%  { opacity: 0.22; }
  30%  { opacity: 0.18; }
  50%  { opacity: 0.4; }
  60%  { opacity: 0.12; }
  70%  { opacity: 0.3; }
  85%  { opacity: 0.08; }
  100% { opacity: 0.2; }
}

#citadel-portal-bg {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  background: #0a0a0f; /* fallback dark */
  pointer-events: none;
}

.flicker-line {
  position: fixed;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: white;
  opacity: 0.1;
  animation: flicker 2s infinite;
  z-index: 0;
}

#signal-wave {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
}

#memory-embers {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
}

/* Resonant pulse center glow */
.citadel-background::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,180,100,0.08) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  animation: pulseGlow 5s ease-in-out infinite;
  filter: blur(50px);
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.08;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.18;
    transform: translate(-50%, -50%) scale(1.15);
  }
}

#resonance-glyph-mesh {
  position: absolute;
  inset: 0;
  background-image: url('resonance_glyph_mesh_veil.png');
  background-size: cover;
  background-position: center;
  opacity: 0.07;
  pointer-events: none;
  z-index: 1;
  animation: shimmerFlow 32s linear infinite;
}

@keyframes shimmerFlow {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

.spiral-drift {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: radial-gradient(circle at center, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.005) 45%, transparent 100%);
  animation: spiralFlow 60s linear infinite;
  z-index: -1;
  transform-origin: center;
}

@keyframes spiralFlow {
  0% {
    transform: rotate(0deg) scale(2);
  }
  100% {
    transform: rotate(360deg) scale(1.02);
  }
}

@keyframes gentleSpin {
  0% {
    transform: rotateY(150deg);
  }
  100% {
    transform: rotateY(150deg);
  }
}

footer.codex-footer {
  margin-top: 4em;
  border-top: 1px solid #533d64;
  padding-top: 1em;
  font-size: 0.9em;
  color: #a999c2;
  text-align: center;
}



