* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --app-height: 100dvh;
  --app-width: 100vw;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --mobile-shell-width: 390px;
  --mobile-shell-height: 844px;
  --mobile-scale: 1;
  --mobile-top: 0px;
  --mobile-left: 0px;
}

@supports not (height: 100dvh) {
  :root {
    --app-height: 100vh;
  }
}

html, body {
  width: var(--app-width);
  height: var(--app-height);
  overflow: hidden;
  background-color: #0b0b0d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

/* Vertical Scroll on Mobile */
body.is-mobile {
  overflow-x: hidden;
  overflow-y: auto;
}

#scroll-container {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 200vh;
  pointer-events: none;
}

body.is-mobile #scroll-container {
  display: block;
}

/* Base App Viewport Shell - Normalized Safe Sizing */
#app-viewport {
  position: fixed;
  inset: 0;
  width: var(--app-width);
  height: var(--app-height);
  min-height: 0;
  z-index: 1;
  overflow: hidden;
  background-color: #000;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              top 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              left 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-radius 0.4s ease,
              box-shadow 0.4s ease;
}

#mobile-shell-wrapper {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#mobile-shell {
  position: relative;
  width: var(--mobile-shell-width);
  height: var(--mobile-shell-height);
  transform-origin: center center;
  transform: scale(var(--mobile-scale, 1));
  overflow: hidden;
  border-radius: 0;
}

#mobile-shell > #video-container,
#mobile-shell > #cloud-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#mobile-shell #mobile-scroll-indicator,
#mobile-shell .carousel-dots {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

body.is-mobile #mobile-shell {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--mobile-shell-width);
  height: var(--mobile-shell-height);
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(var(--mobile-scale, 1));
}

body.mode-desktop #mobile-shell {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
}

/* Debug marker only: leave is-simulated-mobile available for diagnostics without layout changes. */

/* Background Video Layer */
#video-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  overflow: hidden;
  background-color: #000;
}

#bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  pointer-events: none;
}

#bg-video::-webkit-media-controls,
#bg-video::-webkit-media-controls-panel,
#bg-video::-webkit-media-controls-play-button,
#bg-video::-webkit-media-controls-start-playback-button,
#bg-video::-webkit-media-controls-overlay-play-button {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Interactive 2D Cloud Stage */
#cloud-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: auto;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  overflow: visible;
}

#cloud-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.cloud-item {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform, opacity;
  cursor: pointer;
  filter: url(#cloud-wave-filter);
  transform-origin: center center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
  transition: opacity 0.2s ease-out;
}

.cloud-item img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* Copyright Text Watermark */
#copyright-text {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  color: #ffd500;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0px #000, 0px 0px 6px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.2s ease;
}

body.is-mobile #copyright-text {
  position: absolute !important;
  left: 50% !important;
  bottom: 85px !important;
  transform: translateX(-50%) scale(1) !important;
  text-align: center !important;
  white-space: nowrap !important;
  font-size: 10px !important;
  z-index: 99999 !important;
}


.icon-phone {
  width: 14px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 4px;
  position: relative;
}

.icon-phone::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
}

.icon-desktop {
  width: 20px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 2px;
  position: relative;
}

.icon-desktop::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 3px;
  background: #fff;
}

/* Mobile Indicators */
.mobile-scroll-indicator {
  display: none;
  position: absolute;
  bottom: 300px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  text-shadow: 0px 2px 10px rgba(0, 0, 0, 0.9);
  opacity: 1;
  pointer-events: none;
}

body.is-mobile .mobile-scroll-indicator {
  display: flex !important;
  position: absolute !important;
  left: 50% !important;
  bottom: 357px !important;
  transform: translateX(-50%) scale(1) !important;
  z-index: 99999 !important;
  pointer-events: auto !important;
}

.carousel-dots {
  display: none;
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  gap: 10px;
  pointer-events: none;
}

body.is-mobile .carousel-dots {
  display: flex !important;
  bottom: 30px !important;
  position: absolute !important;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: transform 0.3s ease, background 0.3s ease;
}

.dot.active {
  background: #ffffff;
  transform: scale(1.4);
}