:root {
  --bg: linear-gradient(120deg, #07161d, #0b2a33, #102f3a, #07161d);
  --accent-color: #19c3c0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  width: 100%;
  background: var(--bg);
  background-size: 300% 300%;
  animation: rimacFlow 18s ease-in-out infinite;
}

.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.viewer {
  position: relative;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 2800px;
  perspective-origin: 50% 50%;
}

body.menu-open .viewer {
  filter: blur(3px) brightness(0.7);
  transition: .4s ease;
}

.stack {
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform-style: preserve-3d;
}

.slot {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  opacity: 1;
  will-change: transform, opacity;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  /* Added perspective and rotateY for 3D flip effect */
  perspective: 1200px;
}

.slot.active {
  opacity: 1;
  transform: scale(1);
  z-index: 50;
}

.slot.behind {
  opacity: 0.6;
  z-index: 10;
}

.overlay {
  position: absolute;
  padding: 20px;
  border-radius: 10px;
  z-index: 60;
  pointer-events: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  max-width: 86%;
}

.overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
}

.glow-btn {
  margin-top: 15px;
  position: relative;
  display: inline-block;
  padding: 15px 60px;
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  background: transparent;
  border: 1.1px solid rgba(255, 255, 255);
  border-left: none;
  border-right: none;
  cursor: pointer;
  overflow: hidden;
  letter-spacing: 2px;
  transition: color 0.4s ease, border-color 0.2s ease;
  z-index: 1;
}

.glow-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 0%;
  height: 100%;
  background: #fff;
  transform: translateX(-50%);
  z-index: -1;
  transition: width 0.5s ease;
}

.glow-btn:hover {
  color: #000;
  border-color: rgb(255, 255, 255);
  border-left: none;
  border-right: none;
}

.glow-btn:hover::before {
  width: 100%;
}

.glow-btn:active::before {
  width: 0%;
}

.glow-btn:active {
  color: #fff;
}

.overlay h1 {
  font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 5vw, 56px);
  margin-bottom: 10px;
  letter-spacing: 1.2px;
  color: white;
  text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.35);
}

.overlay p {
  font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
  font-weight: 400;
  font-size: 22px;
  color: white;
  line-height: 1.5;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.25);
}

.side-nav {
  position: fixed;
  left: 60px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
}

.side-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.side-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.side-nav-item:hover {
  opacity: 0.95;
  transform: translateX(8px);
}

.side-nav-item.active {
  opacity: 1;
  transform: scale(1.05);
}

.side-nav-item .num {
  font-size: 13px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.6);
}

.side-nav-item .label {
  font-size: 15px;
  letter-spacing: 2px;
  font-weight: 400;
  text-transform: uppercase;
  color: #ffffff;
}

.side-nav-item.active::before {
  content: "";
  width: 13px;
  height: 3px;
  background: #ffffff;
  margin-right: 6px;
}

@media (max-width: 900px) {
  .side-nav {
    left: 20px;
  }
}

.nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 26px;
  display: flex;
  gap: 12px;
  z-index: 90;
}

.nav-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.nav-btn:hover {
  background: var(--glass);
  border-color: rgba(255, 255, 255, 0.3);
}

.nav-btn.active {
  background: rgba(25, 195, 192, 0.15);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.rimac-light {
  position: absolute;
  inset: -30%;
  background: radial-gradient(500px 400px at var(--mx, 50%) var(--my, 50%), rgba(0, 255, 200, 0.18), transparent 60%),
    radial-gradient(
      700px 500px at calc(100% - var(--mx, 50%)) calc(100% - var(--my, 50%)),
      rgba(80, 140, 255, 0.12),
      transparent 65%
    );
  transition: background-position 0.15s ease-out;
  pointer-events: none;
  z-index: 1;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(900px 600px at 15% 30%, rgba(255, 255, 255, 0.06), transparent 60%);
  animation: rimacLight 14s ease-in-out infinite;
  z-index: 0;
}

@keyframes rimacFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes rimacLight {
  0% {
    transform: translate(-80px, -40px);
    opacity: 0.35;
  }
  50% {
    transform: translate(80px, 40px);
    opacity: 0.6;
  }
  100% {
    transform: translate(-80px, -40px);
    opacity: 0.35;
  }
}

/* Simplified scroll indicator with just text */
.scroll-indicator {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeInUp 1.2s ease-out 0.8s both;
}

.scroll-text {
  font-size: 13px;
  letter-spacing: 2.5px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  font-weight: 500;
  animation: textGlow 3s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(25, 195, 192, 0.4);
}

.scroll-indicator.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

/* Custom scroll indicator cursor - clean Rimac style with no animation */
.custom-scroll-cursor {
  position: fixed;
  width: 65px;
  height: 65px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: transparent;
  pointer-events: none;
  z-index: 999;
  display: none;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 1);
  letter-spacing: 1.2px;
}

.custom-scroll-cursor::before {
  content: "SCROLL";
  text-transform: uppercase;
}

.custom-scroll-cursor.active {
  display: flex;
}

/* Hide custom cursor on mobile and tablet devices */
@media (max-width: 800px) {
  .custom-scroll-cursor {
    display: none !important;
  }

  .custom-scroll-cursor.active {
    display: none !important;
  }
}

/* Hide default cursor when custom cursor is active */
body {
  cursor: auto;
}

body.show-scroll-cursor {
  cursor: none;
}

/* MOBILE SCROLL INDICATOR */
@media (max-width: 800px) {
  .scroll-indicator {
    bottom: 80px;
    gap: 12px;
  }

  .scroll-text {
    font-size: 11px;
    letter-spacing: 1.5px;
  }

  .arrow {
    width: 1.5px;
    height: 10px;
  }

  .arrow::after {
    border-left: 2px solid transparent;
    border-right: 2px solid transparent;
    border-top: 3px solid #19c3c0;
  }
}

/* -------- MOBILE EXPERIENCE (300px – 800px) -------- */
@media (min-width: 300px) and (max-width: 800px) {
  .viewer {
    height: 100vh;
    padding: 0;
    perspective: 2400px;
  }

  .slot {
    border-radius: 0;
    box-shadow: none;
  }

  .overlay {
    top: 54%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    max-width: 92%;
    padding: 8px 6px;
  }

  .overlay h1 {
    font-size: clamp(18px, 6vw, 30px);
    letter-spacing: 2px;
    line-height: 1.2;
  }

  .overlay p {
    font-size: clamp(12px, 3.6vw, 18px);
    line-height: 1.45;
    margin-top: 8px;
  }

  .glow-btn {
    width: 92%;
    max-width: 360px;
    padding: 10px 20px;
    margin-top: 16px;
    font-size: 1rem;
    letter-spacing: 2px;
    border-width: 1px;
  }

  .side-nav {
    left: 10px;
    bottom: 18px;
    top: auto;
    transform: none;
    display: flex;
    justify-content: center;
  }

  .side-nav ul {
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 18px;
    backdrop-filter: blur(10px);
  }

  .side-nav-item {
    opacity: 0.7;
    transform: none !important;
  }

  .side-nav-item.active {
    opacity: 1;
  }

  .side-nav-item .label {
    font-size: 12px;
    letter-spacing: 1.2px;
  }

  .side-nav-item .num {
    font-size: 11px;
  }

  .stack {
    transform-style: preserve-3d;
  }
}

/* MOBILE SCROLL INDICATOR */
@media (max-width: 800px) {
  .scroll-indicator {
    bottom: 80px;
  }

  .scroll-label {
    font-size: 11px;
    letter-spacing: 1.5px;
  }

  .scroll-animation span {
    width: 1.5px;
    height: 6px;
  }
}