/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
}
body {
  color: #111;
  background: #0c0c0f;
  height: 100%;
  margin: 0;
}

/* Splunk Data Sans (Regular + Bold) */
@font-face {
  font-family: "Splunk Data Sans";
  src: url("fonts/Splunk Data Sans/SplunkDataSans_Rg.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Splunk Data Sans";
  src: url("fonts/Splunk Data Sans/SplunkDataSans_Bd.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Splunk Data Sans Pro (Regular + Bold) */
@font-face {
  font-family: "Splunk Data Sans Pro";
  src: url("fonts/Splunk Data Sans Pro/SplunkDataSansPro_Rg.ttf")
    format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Splunk Data Sans Pro";
  src: url("fonts/Splunk Data Sans Pro/SplunkDataSansPro_Bd.ttf")
    format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Use Splunk Data Sans by default */
body {
  font-family: "Splunk Data Sans", "Splunk Data Sans Pro", system-ui,
    -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
}

/* Centering the app content and constraining width improves readability on large screens. */
#app {
  min-height: 100%;
  display: grid;
  place-items: center;
}

/* Ensure hidden elements are never displayed */
[hidden] {
  display: none !important;
}

/* Splash screen layout uses a column with a responsive grid of buttons. */
.splash-container {
  background: #20003f url(../media/splash/background.png) no-repeat no-repeat;
  background-size: cover;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  justify-items: center;
  text-align: center;
  width: 100%;
}
.splash-logo {
  margin: 30px auto 0;
  max-width: 700px;
  min-width: 300px;
  width: 30%;
}
.splash-header {
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-items: center;
}
.splash-title {
  color: #f5f7fb;
  font-size: 16vh;
  font-weight: 700;
  line-height: 0.85;
  margin: 0;
  text-transform: uppercase;
}
.splash-title span {
  display: block;
}
.splash-button-container {
  background: #4f1c99;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  height: 35vh;
  padding: 10px 30px;
  text-transform: uppercase;
  width: 100%;
}
.splash-buttons {
  align-items: center;
  display: grid;
  gap: 0px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 2vh auto 0;
  width: 80%;
}
.splash-button {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: transform 120ms ease-in-out;
  aspect-ratio: 16 / 9;
  display: block;
  width: 100%;
}
.splash-button-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}
.splash-button:hover {
  transform: scale(1.1);
}
.splash-button:focus,
.splash-button:focus-visible,
.splash-button:active {
  outline: 0 !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* Mobile */
@media (max-width: 768px) and (orientation: portrait) {
  .splash-container {
    overflow: hidden;
  }
  .splash-logo {
    width: 100px;
  }
  .splash-title {
    font-size: 10vh;
  }
  .splash-button-container h1 {
    font-size: 20px;
  }
  .splash-button-container {
    height: 50vh;
    padding: 0;
  }
  .splash-buttons {
    align-items: start;
    display: flex;
    flex-direction: column;
    gap: 14px 12px;
    margin: 0;
    position: relative;
    justify-items: center;
  }
  .splash-button {
    position: absolute;
  }
  .splash-buttons .splash-button:nth-child(1) {
    left: -8vw;
    top: 0vh;
  }

  .splash-buttons .splash-button:nth-child(2) {
    right: -42vw;
    top: 8vh;
  }

  .splash-buttons .splash-button:nth-child(3) {
    left: 0vw;
    top: 28vh;
  }
}

@media (max-width: 1000px) and (orientation: landscape) {
  .splash-container {
    overflow: hidden;
  }
  .splash-logo {
    margin-top: 0px;
    width: 100px;
  }
  .splash-title {
    display: flex;
    font-size: 10vh;
    gap: 8px;
    margin: 0 auto;
  }
  .splash-button-container h1 {
    font-size: 20px;
  }
  .splash-button-container {
    height: 50vh;
    padding: 0;
  }
  .splash-buttons {
    align-items: center;
    display: flex;
    gap: 14px 12px;
    justify-content: space-around;
    margin: 0;
    width: 100%;
  }
}

/* Global audio controls (music + sound) in the top-right */
.global-audio-controls {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 2000;
}

/* Base button style: 30px, round, white bg, black border */
.audio-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 3px solid #000;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Icon size & color */
.audio-toggle svg {
  width: 18px;
  height: 18px;
  fill: #000;
}

/* Off state: subtle visual change */
.audio-toggle.is-off {
  opacity: 0.4;
}

/* Remove default focus outline; optional: add your own if desired */
.audio-toggle:focus {
  outline: none;
}

/* Stage container keeps a consistent aspect ratio and letterboxes on tall screens. */
.stage {
  width: min(100vw, 100vh * (16 / 9));
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.stage:focus {
  outline: none;
}
.stage.fullscreen {
  position: fixed;
  inset: 0;
  border-radius: 0;
  box-shadow: none;
  margin: auto;
}
.stage-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Small slide counter, top-right */
.slide-counter {
  position: absolute;
  top: 70px;
  right: 8px;
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  border-radius: 3px;
  pointer-events: none; /* don't block clicks on the slide */
  z-index: 1000;
}

/* Base media fills the stage with cover behavior so art remains edge-to-edge. */
.stage-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Overlays are positioned with percentages and scale with the stage. */
.overlay {
  position: absolute;
  pointer-events: none; /* interactive children re-enable pointer events selectively */
  display: grid;
  place-items: center;
}

/* Text captions use a readable pill with slight translucency for varied backgrounds. */
.overlay-text {
  pointer-events: none;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 8px 12px;
  color: #000000;
  background: #ffffff;
  border-radius: 6px;
  font-size: clamp(14px, 2.1vw, 20px);
  text-align: center;
  border: 3px solid #000000;
  text-transform: uppercase;
}

/* Overlay images are decorative sprites that scale within their box. */
.overlay-image,
.sprite {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* Buttons and hotspots are the only overlays that accept input. */
.overlay-button,
.overlay-hotspot,
.button,
.hotspot {
  pointer-events: auto;
}

/* Hotspots */
.overlay-hotspot,
.hotspot {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background: transparent;
  color: transparent;

  border: 0;
  border-radius: 0;
  box-shadow: none;

  cursor: pointer;
  display: block;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* Primary call-to-action button. */
.overlay-button,
.button {
  appearance: none;
  border: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: #ffffff;
  color: #0b0d12;
  font-weight: 700;
  font-size: clamp(14px, 2vw, 18px);
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}
.overlay-button {
  background: url(../media/ui/overlays/skip.svg) no-repeat;
  background-size: contain;
}
.overlay-button:hover,
.button:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
  cursor: pointer;
}
.overlay-button:active,
.button:active {
  transform: translateY(0);
}

/* Hotspots are visually subtle by default */
.overlay-hotspot,
.hotspot {
  width: 100%;
  height: 100%;
  background: transparent;
  color: transparent;
  cursor: pointer;
}

/* Overlay video */
.overlay-video {
  border-radius: 8px;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: auto;
}
.overlay-video-play {
  position: absolute;
  inset: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.overlay-video-play::before {
  content: "▶";
  font-size: 5rem;
  color: #000;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
}
.thought-text {
  font-size: 20px;
  font-weight: bold;
}

@media (max-width: 480px) {
  .thought-text {
    font-size: 0.5rem;
  }
}

@media (min-width: 480px) and (max-width: 1080px) {
  .thought-text {
    font-size: 14px;
  }
}

/* CTA overlay */
.cta-overlay {
  display: block;
  font-size: 16px;
  font-weight: bold;
  max-width: 50%;
  margin: 10% auto 0px;
  padding: 10px 40px;
  pointer-events: all;
  text-align: center;
}

@media (max-width: 480px) {
  .cta-overlay {
    font-size: 0.5rem;
    max-width: 60%;
    padding-top: 0;
  }
}

@media (min-width: 480px) and (max-width: 1000px) {
  .cta-overlay {
    font-size: 14px;
  }
}

@media (min-width: 1000px) and (orientation: landscape) and (pointer: fine) {
  .cta-overlay {
    font-size: 26px;
  }
}

.cta-button {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  background: #6a1bff; /* Base purple */
  border: none;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  pointer-events: all;
}

.cta-button:hover,
.cta-button:focus {
  background: linear-gradient(90deg, #ff9b00 0%, #ff3fa5 100%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1000px) {
  .cta-button {
    font-size: 16px;
    margin-top: -5px;
  }
}

/* Loading and error states keep the experience explicit during data issues. */
.loading {
  color: #e6e8ef;
  opacity: 0.8;
  font-weight: 600;
}
.error {
  color: #ffd7d7;
  background: rgba(120, 0, 0, 0.18);
  border: 1px solid rgba(255, 120, 120, 0.35);
  padding: 16px 20px;
  border-radius: 10px;
}

/* Animations are opt-in via class names so motion can be applied per-overlay. */
.overlay-visible {
  /* This class exists to allow CSS selectors if you want transitions tied to show/hide. */
}

/* Fade in keeps initial presence gentle over busy backgrounds. */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-in {
  animation: fadeIn 420ms ease-out both;
}

/* Pop-in adds a slight scale for prominent CTAs without jarring motion. */
@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  60% {
    opacity: 1;
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}
.pop-in {
  animation: popIn 280ms ease-out both;
}

/* Blink is a low-amplitude opacity pulse for instrument readouts. */
@keyframes blinkPulse {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}
.blink {
  animation: blinkPulse 1200ms ease-in-out infinite;
}

/* Float is a gentle drift for decorative sprites. */
@keyframes floatDrift {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4%);
  }
  100% {
    transform: translateY(0);
  }
}
.float {
  animation: floatDrift 3200ms ease-in-out infinite;
}

/* Sparkle uses a subtle scale and glow for energy effects. */
@keyframes sparklePulse {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 0px rgba(255, 255, 200, 0));
  }
  50% {
    transform: scale(1.04);
    filter: drop-shadow(0 0 10px rgba(255, 255, 200, 0.6));
  }
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0px rgba(255, 255, 200, 0));
  }
}
.sparkle {
  animation: sparklePulse 1600ms ease-in-out infinite;
}

/* Respect users who prefer reduced motion by disabling non-essential animations. */
@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .pop-in,
  .blink,
  .float,
  .sparkle,
  .pulse {
    animation: none !important;
  }
  .splash-button,
  .overlay-button,
  .button {
    transition: none;
  }
}
