/* Axtlan compatibility and accessibility layer — 20260723i */
:root {
  --axtlan-sdr-black: #070706;
  --axtlan-sdr-panel: #0f0d0a;
  --axtlan-sdr-ink: #f2e9da;
  --axtlan-sdr-orange: #e98232;
  --axtlan-sdr-gold: #f0b45f;
  color-scheme: dark;
}

html, body {
  background-color: var(--axtlan-sdr-black);
  color: var(--axtlan-sdr-ink);
}

/* Keep readable HTML visible when an optional GPU layer cannot initialise. */
html.axtlan-gpu-fallback [data-reveal],
html[data-axtlan-render-mode="low"] [data-reveal] {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

html.axtlan-gpu-fallback [data-hero-shader] {
  display: none !important;
}

html.axtlan-gpu-fallback .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 72% 20%, rgba(235, 121, 38, .18), transparent 36%),
    linear-gradient(180deg, rgba(7, 7, 6, .04), rgba(7, 7, 6, .72));
}

/* The user may explicitly override an automatic reduced-motion/low-power default. */
html[data-axtlan-render-mode="full"] *,
html[data-axtlan-render-mode="full"] *::before,
html[data-axtlan-render-mode="full"] *::after {
  animation-play-state: running;
}

html[data-axtlan-render-mode="low"] *,
html[data-axtlan-render-mode="low"] *::before,
html[data-axtlan-render-mode="low"] *::after {
  scroll-behavior: auto !important;
}

html[data-axtlan-render-mode="low"] .hero-shader,
html[data-axtlan-render-mode="low"] .solar-field,
html[data-axtlan-render-mode="low"] [data-world-rosette],
html[data-axtlan-render-mode="low"] [data-music-field],
html[data-axtlan-render-mode="low"] [data-krek-atlas] {
  visibility: hidden !important;
}

/* Fallback rotations are enabled only when the original stylesheet exposes no animation. */
html[data-axtlan-render-mode="full"].axtlan-motion-fallback .scope-identities {
  position: relative;
}
html[data-axtlan-render-mode="full"].axtlan-motion-fallback .scope-identity {
  animation: axtlan-scope-cycle 30s linear infinite !important;
  opacity: 0;
}
html[data-axtlan-render-mode="full"].axtlan-motion-fallback .scope-identity:nth-of-type(1) { animation-delay: 0s !important; }
html[data-axtlan-render-mode="full"].axtlan-motion-fallback .scope-identity:nth-of-type(2) { animation-delay: -24s !important; }
html[data-axtlan-render-mode="full"].axtlan-motion-fallback .scope-identity:nth-of-type(3) { animation-delay: -18s !important; }
html[data-axtlan-render-mode="full"].axtlan-motion-fallback .scope-identity:nth-of-type(4) { animation-delay: -12s !important; }
html[data-axtlan-render-mode="full"].axtlan-motion-fallback .scope-identity:nth-of-type(5) { animation-delay: -6s !important; }

html[data-axtlan-render-mode="full"].axtlan-motion-fallback .krek-atlas-cycle img {
  animation: axtlan-krek-cycle 40s linear infinite !important;
  opacity: 0;
}
html[data-axtlan-render-mode="full"].axtlan-motion-fallback .krek-atlas-cycle img:nth-child(1) { animation-delay: 0s !important; }
html[data-axtlan-render-mode="full"].axtlan-motion-fallback .krek-atlas-cycle img:nth-child(2) { animation-delay: -32s !important; }
html[data-axtlan-render-mode="full"].axtlan-motion-fallback .krek-atlas-cycle img:nth-child(3) { animation-delay: -24s !important; }
html[data-axtlan-render-mode="full"].axtlan-motion-fallback .krek-atlas-cycle img:nth-child(4) { animation-delay: -16s !important; }
html[data-axtlan-render-mode="full"].axtlan-motion-fallback .krek-atlas-cycle img:nth-child(5) { animation-delay: -8s !important; }

html[data-axtlan-render-mode="full"].axtlan-motion-fallback .art-preview {
  animation: axtlan-art-cycle 24s linear infinite !important;
  opacity: 0;
}
html[data-axtlan-render-mode="full"].axtlan-motion-fallback .art-preview:nth-child(1) { animation-delay: 0s !important; }
html[data-axtlan-render-mode="full"].axtlan-motion-fallback .art-preview:nth-child(2) { animation-delay: -18s !important; }
html[data-axtlan-render-mode="full"].axtlan-motion-fallback .art-preview:nth-child(3) { animation-delay: -12s !important; }
html[data-axtlan-render-mode="full"].axtlan-motion-fallback .art-preview:nth-child(4) { animation-delay: -6s !important; }

@keyframes axtlan-scope-cycle {
  0%, 16% { opacity: 1; transform: translate3d(0,0,0) scale(1); }
  20%, 96% { opacity: 0; transform: translate3d(0,0,0) scale(1.015); }
  100% { opacity: 1; }
}
@keyframes axtlan-krek-cycle {
  0%, 18% { opacity: .78; transform: scale(1.01); }
  22%, 96% { opacity: 0; transform: scale(1.05); }
  100% { opacity: .78; }
}
@keyframes axtlan-art-cycle {
  0%, 20% { opacity: 1; transform: translate3d(0,0,0) rotate(0deg); }
  25%, 95% { opacity: 0; transform: translate3d(0,0,0) rotate(.25deg); }
  100% { opacity: 1; }
}

/* Restore the seventeen-sun spectral title treatment using an SDR-safe baseline. */
.hero h1 .accent {
  color: var(--axtlan-sdr-orange);
  background-image: linear-gradient(94deg, #ff7040 0%, #f39b45 30%, #ffd27a 50%, #e65a34 73%, #f0a54d 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[data-axtlan-render-mode="full"] .hero h1 .accent {
  animation: axtlan-title-spectrum 12s ease-in-out infinite !important;
}
html[data-axtlan-render-mode="low"] .hero h1 .accent {
  animation: none !important;
  background-position: 45% 50%;
}
@keyframes axtlan-title-spectrum {
  0%, 100% { background-position: 0% 50%; filter: saturate(1) brightness(1); }
  50% { background-position: 100% 50%; filter: saturate(1.12) brightness(1.06); }
}

/* Light copy deterrence: media remains semantic, accessible and crawler-readable. */
img[draggable="false"],
.hero canvas,
.rosette-stage canvas,
.music-field canvas,
.krek-atlas canvas {
  -webkit-user-drag: none;
  user-drag: none;
}
.hero-media img,
.scope-card img,
.foundation-chapter img,
.doctrine-image img,
.game-vision img,
.art-section img,
.release-card img,
.creator-portrait img,
.krek-atlas-cycle img {
  -webkit-user-select: none;
  user-select: none;
}

/* Normal SDR is the source of truth; wide-gamut colour is progressive enhancement only. */
@supports (color: color(display-p3 1 0 0)) {
  @media (dynamic-range: high) and (color-gamut: p3) {
    :root {
      --axtlan-sdr-orange: color(display-p3 .92 .39 .12);
      --axtlan-sdr-gold: color(display-p3 .98 .68 .29);
    }
    .hero h1 .accent {
      background-image: linear-gradient(94deg,
        color(display-p3 1 .30 .16),
        color(display-p3 .98 .56 .20),
        color(display-p3 1 .78 .38),
        color(display-p3 .88 .24 .12),
        color(display-p3 .96 .57 .22));
    }
  }
}

@media (prefers-contrast: more) {
  .button, .render-mode-toggle, .audio-toggle, .site-navigation a, .krek-class-button {
    border-width: 2px !important;
  }
  body { color: #fff8eb; }
}

@media (forced-colors: active) {
  *, *::before, *::after {
    forced-color-adjust: auto;
    text-shadow: none !important;
    box-shadow: none !important;
  }
  .hero h1 .accent {
    color: CanvasText !important;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
  }
  .button, .render-mode-toggle, .audio-toggle, .krek-class-button {
    border: 1px solid ButtonText !important;
  }
  canvas { display: none !important; }
}
