/* ==========================================================================
   KHET // Base CSS & Reset
   TYPO3 Sitepackage: Resources/Public/Css/base.css
   ========================================================================== */

/* Modern CSS Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  background-color: var(--khet-color-obsidian);
  color: var(--khet-color-sand);
  font-family: var(--khet-font-subtitle);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  min-height: 100%;
  background-color: var(--khet-color-obsidian);
  color: var(--khet-color-sand);
  overflow-x: hidden;
  line-height: 1.5;
}

/* Custom Selection Highlight */
::selection {
  background-color: var(--khet-color-gold);
  color: var(--khet-color-obsidian);
}

/* Focus Visible for Keyboard Accessibility */
:focus-visible {
  outline: 2px solid var(--khet-color-gold-bright);
  outline-offset: 4px;
}

/* --------------------------------------------------------------------------
   Layout & Stage Architecture
   -------------------------------------------------------------------------- */
.khet-app {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-color: var(--khet-color-obsidian);
}

/* Pinned Fullscreen Stage */
.khet-stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  z-index: var(--khet-z-canvas);
  background-color: var(--khet-color-obsidian);
}

/* Fullscreen Canvas */
.khet-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: var(--khet-z-canvas);
  touch-action: pan-y;
}

/* Scroll Driver Spacer
   Provides physical document scroll distance for ScrollTrigger scrub */
.khet-scroll-driver {
  position: relative;
  width: 100%;
  /* 800vh gives the ~50s master flight enough scroll room for a slow, cinematic scrub */
  height: 800vh;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Reduced Motion Support
   When user prefers reduced motion:
   1. Disable scrubbing pin and spacer.
   2. Position the canvas as a static atmospheric hero background.
   3. Render text copy items as clean, sequentially stacked editorial sections.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .khet-scroll-driver {
    display: none;
  }

  .khet-stage {
    position: fixed;
    height: 100vh;
    opacity: 0.35;
    pointer-events: none;
  }

  .khet-copy {
    position: relative !important;
    inset: auto !important;
    pointer-events: auto !important;
    padding: 6rem 1.5rem 8rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12vh !important;
    z-index: 10 !important;
  }

  .khet-scene {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
    text-align: center !important;
    padding: 4rem 1rem !important;
  }

  .khet-scene__title-line--two {
    opacity: 1 !important;
    transform: none !important;
  }

  .khet-scroll-hint {
    display: none !important;
  }

  .khet-scarab {
    position: fixed !important;
    bottom: 2rem !important;
    right: 2rem !important;
    top: auto !important;
    transform: none !important;
  }
}
