/* ==========================================================================
   Continental Biospheres — Y2K Sci-Fi Visual Treatment
   ==========================================================================
   Presentation-only layer. No text content is added, removed, or modified.
   All decorative text uses CSS pseudo-elements with purely ornamental content.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. CUSTOM PROPERTIES — Y2K palette override
   -------------------------------------------------------------------------- */
:root {
  --y2k-cyan: #00e5ff;
  --y2k-magenta: #ff00e5;
  --y2k-green: #39ff14;
  --y2k-chrome-light: #e0f7fa;
  --y2k-chrome-mid: #80deea;
  --y2k-chrome-dark: #00838f;
  --y2k-glass: rgba(16, 33, 62, 0.55);
  --y2k-glass-border: rgba(0, 229, 255, 0.18);
  --y2k-glass-highlight: rgba(255, 255, 255, 0.06);
  --y2k-glow-cyan: 0 0 20px rgba(0, 229, 255, 0.35);
  --y2k-glow-magenta: 0 0 20px rgba(255, 0, 229, 0.3);
  --y2k-glow-green: 0 0 14px rgba(57, 255, 20, 0.25);
  --y2k-transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Override base accent to iridescent cyan-gold */
  --accent: #00e5ff;
  --accent-hover: #80f0ff;
  --border: rgba(0, 229, 255, 0.15);
  --bg: #0a0a1a;
  --bg-surface: rgba(12, 20, 45, 0.7);
  --bg-card: rgba(10, 28, 60, 0.6);
}

/* --------------------------------------------------------------------------
   1. LIQUID GRADIENT BACKGROUND — on a fixed pseudo-layer (avoids body repaint)
   --------------------------------------------------------------------------
   The gradient is placed on a position:fixed ::before so it never repaints
   during scroll. The animation uses transform (GPU-composited) instead of
   background-position to stay off the main thread.
   -------------------------------------------------------------------------- */
body {
  background: #0a0a1a;
  position: relative;
}

/* Fixed background layer — composited independently from scroll content */
body > .y2k-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0, 229, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 0, 229, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(57, 255, 20, 0.04) 0%, transparent 50%),
    linear-gradient(180deg, #0a0a1a 0%, #0d1530 50%, #0a0a1a 100%);
  background-size: 200% 200%, 200% 200%, 200% 200%, 100% 100%;
  animation: y2k-bg-drift 20s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes y2k-bg-drift {
  0% { background-position: 0% 0%, 100% 100%, 50% 0%, 0% 0%; }
  50% { background-position: 100% 50%, 0% 50%, 0% 100%, 0% 0%; }
  100% { background-position: 50% 100%, 50% 0%, 100% 50%, 0% 0%; }
}

/* --------------------------------------------------------------------------
   2. HOLOGLASS PANELS — layered semi-opaque backgrounds (no backdrop-filter)
   --------------------------------------------------------------------------
   backdrop-filter: blur() on every scrolling element is extremely expensive
   (each blurred element forces a full re-composite every scroll frame).
   Instead we use layered semi-opaque backgrounds with subtle inner gradients
   to approximate the frosted-glass look at zero scroll cost.
   -------------------------------------------------------------------------- */
header {
  background: linear-gradient(
    135deg,
    rgba(12, 20, 45, 0.95) 0%,
    rgba(16, 33, 62, 0.92) 100%
  );
  border-bottom: 1px solid var(--y2k-glass-border);
  position: relative;
  overflow: hidden;
}

/* Iridescent top bar on header */
header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--y2k-cyan),
    var(--y2k-magenta),
    var(--y2k-green),
    var(--y2k-cyan)
  );
  background-size: 300% 100%;
  animation: y2k-chrome-shift 6s linear infinite;
}

@keyframes y2k-chrome-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* Inner highlight shimmer on header */
header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.04) 0%,
    transparent 50%,
    rgba(255, 255, 255, 0.02) 100%
  );
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   3. HEADER TITLE — chrome / holographic text
   -------------------------------------------------------------------------- */
header h1 {
  background: linear-gradient(
    135deg,
    var(--y2k-chrome-light) 0%,
    var(--y2k-cyan) 40%,
    var(--y2k-chrome-mid) 60%,
    #ffffff 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: y2k-title-sheen 5s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.3));
}

@keyframes y2k-title-sheen {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.subtitle {
  color: var(--y2k-chrome-mid);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.75rem;
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   4. GEL-STYLE NAV LINKS — pill-shaped, translucent, glow on hover
   -------------------------------------------------------------------------- */
nav a {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  color: var(--y2k-cyan);
  font-weight: 500;
  font-size: 0.85rem;
  transition:
    background var(--y2k-transition),
    border-color var(--y2k-transition),
    box-shadow var(--y2k-transition),
    transform 0.15s ease;
  position: relative;
  overflow: hidden;
}

/* Glossy inner highlight */
nav a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.12) 0%,
    transparent 100%
  );
  border-radius: 999px 999px 0 0;
  pointer-events: none;
}

nav a:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--y2k-cyan);
  box-shadow: var(--y2k-glow-cyan);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

nav a:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  background: rgba(0, 229, 255, 0.2);
}

/* --------------------------------------------------------------------------
   5. SECTIONS — glass card treatment
   -------------------------------------------------------------------------- */
main.container > section {
  background: linear-gradient(
    180deg,
    rgba(16, 33, 62, 0.88) 0%,
    rgba(12, 20, 45, 0.92) 100%
  );
  border: 1px solid var(--y2k-glass-border);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

/* Subtle inner highlight */
main.container > section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 229, 255, 0.3),
    rgba(255, 0, 229, 0.2),
    transparent
  );
}

/* --------------------------------------------------------------------------
   6. HEADINGS — gradient underline accent
   -------------------------------------------------------------------------- */
h2 {
  border-bottom: none;
  padding-bottom: 0.6rem;
  position: relative;
  color: #ffffff;
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--y2k-cyan),
    var(--y2k-magenta) 50%,
    transparent 100%
  );
  opacity: 0.6;
}

h3 {
  color: var(--y2k-chrome-mid);
}

/* --------------------------------------------------------------------------
   7. QUICK-LINK CARDS — hologlass with hover glow
   -------------------------------------------------------------------------- */
.quick-links .card {
  background: linear-gradient(
    135deg,
    rgba(16, 33, 62, 0.9) 0%,
    rgba(10, 28, 60, 0.92) 100%
  );
  border: 1px solid var(--y2k-glass-border);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--y2k-transition),
    box-shadow var(--y2k-transition),
    transform var(--y2k-transition);
}

/* Glass sheen */
.quick-links .card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05) 0%,
    transparent 40%,
    transparent 60%,
    rgba(0, 229, 255, 0.03) 100%
  );
  pointer-events: none;
  transition: opacity var(--y2k-transition);
}

.quick-links .card:hover {
  border-color: var(--y2k-cyan);
  box-shadow:
    var(--y2k-glow-cyan),
    inset 0 0 30px rgba(0, 229, 255, 0.05);
  transform: translateY(-3px);
  text-decoration: none;
}

.quick-links .card:hover::before {
  opacity: 1.5;
}

.quick-links .card h3 {
  color: var(--y2k-cyan);
}

.quick-links .card:hover h3 {
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

/* --------------------------------------------------------------------------
   8. INLINE LINKS — laser-trace animated underline
   -------------------------------------------------------------------------- */
main a:not(.card) {
  color: var(--y2k-cyan);
  text-decoration: none;
  position: relative;
  transition: color var(--y2k-transition);
}

main a:not(.card)::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--y2k-cyan), var(--y2k-magenta));
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

main a:not(.card):hover {
  color: var(--y2k-chrome-light);
  text-decoration: none;
}

main a:not(.card):hover::after {
  width: 100%;
}

/* --------------------------------------------------------------------------
   9. POSTER GRID — holographic hover borders
   -------------------------------------------------------------------------- */
.poster-item {
  background: rgba(16, 33, 62, 0.9);
  border: 1px solid var(--y2k-glass-border);
  border-radius: 10px;
  transition:
    border-color var(--y2k-transition),
    box-shadow var(--y2k-transition),
    transform var(--y2k-transition);
}

.poster-item:hover {
  border-color: var(--y2k-cyan);
  box-shadow:
    0 0 15px rgba(0, 229, 255, 0.25),
    0 0 30px rgba(0, 229, 255, 0.1);
  transform: translateY(-3px) scale(1.02);
}

/* Holographic overlay on poster image */
.poster-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 229, 255, 0.05) 0%,
    transparent 30%,
    transparent 70%,
    rgba(255, 0, 229, 0.05) 100%
  );
  opacity: 0;
  transition: opacity var(--y2k-transition);
  pointer-events: none;
  border-radius: 10px;
}

.poster-item:hover::after {
  opacity: 1;
}

.poster-type {
  color: var(--y2k-cyan);
}

/* --------------------------------------------------------------------------
   10. TABLE — glass treatment
   -------------------------------------------------------------------------- */
table {
  border-radius: 8px;
  overflow: hidden;
}

td {
  border-color: var(--y2k-glass-border);
  background: rgba(0, 229, 255, 0.03);
}

td:first-child {
  color: var(--y2k-cyan);
}

/* --------------------------------------------------------------------------
   11. FAQ DETAILS — gel accordion style
   -------------------------------------------------------------------------- */
details {
  background: linear-gradient(
    180deg,
    rgba(16, 33, 62, 0.9) 0%,
    rgba(12, 20, 45, 0.93) 100%
  );
  border: 1px solid var(--y2k-glass-border);
  border-radius: 10px;
  transition:
    border-color var(--y2k-transition),
    box-shadow var(--y2k-transition);
  overflow: hidden;
}

details:hover {
  border-color: rgba(0, 229, 255, 0.3);
}

details[open] {
  border-color: rgba(0, 229, 255, 0.25);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.08);
}

summary {
  transition: background var(--y2k-transition);
  border-radius: 10px;
}

summary:hover {
  background: rgba(0, 229, 255, 0.06);
}

summary::before {
  color: var(--y2k-cyan) !important;
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
}

/* --------------------------------------------------------------------------
   12. FOOTER — gradient top border, glass
   -------------------------------------------------------------------------- */
footer {
  background: rgba(12, 20, 45, 0.92);
  border-top: none;
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--y2k-cyan),
    var(--y2k-magenta),
    transparent
  );
  opacity: 0.5;
}

footer a {
  color: var(--y2k-cyan);
  transition: color var(--y2k-transition), text-shadow var(--y2k-transition);
}

footer a:hover {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   13. LISTS — subtle accent markers
   -------------------------------------------------------------------------- */
ul li::marker,
ol li::marker {
  color: var(--y2k-cyan);
}

strong {
  color: var(--y2k-chrome-light);
}

/* --------------------------------------------------------------------------
   14. ORB / HUD DECORATIVE ELEMENTS — corner accents
   -------------------------------------------------------------------------- */

/* Top-left corner orb — own compositor layer via will-change */
body::before {
  content: "";
  position: fixed;
  top: -80px;
  left: -80px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(0, 229, 255, 0.12) 0%,
    rgba(0, 229, 255, 0.04) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
  will-change: transform, opacity;
  animation: y2k-orb-pulse 8s ease-in-out infinite alternate;
}

/* Bottom-right corner orb — own compositor layer via will-change */
body::after {
  content: "";
  position: fixed;
  bottom: -100px;
  right: -100px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 0, 229, 0.1) 0%,
    rgba(255, 0, 229, 0.03) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
  will-change: transform, opacity;
  animation: y2k-orb-pulse 10s ease-in-out infinite alternate-reverse;
}

@keyframes y2k-orb-pulse {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.15); }
}

/* --------------------------------------------------------------------------
   15. SCROLLBAR — chrome styled
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0a0a1a;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--y2k-cyan), var(--y2k-magenta));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--y2k-chrome-light), var(--y2k-cyan));
}

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--y2k-cyan) #0a0a1a;
}

/* --------------------------------------------------------------------------
   16. SELECTION — themed highlight
   -------------------------------------------------------------------------- */
::selection {
  background: rgba(0, 229, 255, 0.3);
  color: #ffffff;
}

::-moz-selection {
  background: rgba(0, 229, 255, 0.3);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   17. FOCUS STYLES — glow ring for accessibility
   -------------------------------------------------------------------------- */
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--y2k-cyan);
  outline-offset: 2px;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

/* --------------------------------------------------------------------------
   18. LOADING MESSAGE — pulse glow
   -------------------------------------------------------------------------- */
.loading-msg {
  color: var(--y2k-chrome-mid);
  animation: y2k-loading-pulse 2s ease-in-out infinite;
}

@keyframes y2k-loading-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* --------------------------------------------------------------------------
   19. REDUCED MOTION — respect user preference
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body {
    background-size: 100% 100%;
  }
}

/* --------------------------------------------------------------------------
   20. GRACEFUL DEGRADATION — @supports guards
   -------------------------------------------------------------------------- */
@supports not (background-clip: text) {
  header h1 {
    color: var(--y2k-cyan);
    -webkit-text-fill-color: unset;
  }
}
