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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a0a;
  color: #fff;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  cursor: none;
}

/* ── Custom cursor ── */
#cursor {
  position: fixed;
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  mix-blend-mode: difference;
  transition: transform 0.06s ease;
}

/* ── Scene container (full-screen) ── */
#scenes {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── Scene layer ── */
.scene-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

/* ── Zoom image ── */
.zoom-img {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  background-size: cover;
  background-position: center;
  transform-origin: center center;
  will-change: transform;
}

/* ── Video clip ── */
.scene-layer video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Dark vignette overlay (subtle) ── */
#scenes::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right,  rgba(0,0,0,0.55) 0%, transparent 40%),
    linear-gradient(to bottom, rgba(0,0,0,0.3)  0%, transparent 30%),
    linear-gradient(to top,    rgba(0,0,0,0.4)  0%, transparent 25%);
  pointer-events: none;
  z-index: 1;
}

/* ── Top navigation ── */
#top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

#nav-owner {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

#nav-links {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  cursor: none;
  transition: color 0.3s;
  background: none;
  border: none;
  padding: 0;
}
.nav-link:hover,
.nav-link.active {
  color: rgba(255,255,255,0.75);
}

#nav-contact a {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  transition: color 0.3s;
}
#nav-contact a:hover { color: rgba(255,255,255,0.8); }

#nav-ai-btn {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-decoration: none;
  border-radius: 2px;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}
#nav-ai-btn:hover { opacity: 0.85; transform: scale(1.04); }

/* ── Left info panel ── */
#info-panel {
  position: fixed;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  max-width: 420px;
  perspective: 1000px;
  transform-style: preserve-3d;
}

/* Ambient Radial Dark Backdrop behind text */
#info-panel::before {
  content: '';
  position: absolute;
  inset: -60px -40px -60px -80px;
  background: radial-gradient(circle at left center, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.3) 40%, transparent 75%);
  filter: blur(25px);
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
}

#project-label {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 16px;
}

#scene-title {
  font-size: clamp(2.1rem, 3.8vw, 3.6rem);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 10px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: opacity 0.5s ease, transform 0.1s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform, opacity;
}

#scene-subtitle {
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 24px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
  transition: opacity 0.5s ease, transform 0.1s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform, opacity;
}

#scene-divider {
  width: 48px;
  height: 1px;
  background: rgba(255, 255, 255, 0.4);
  margin-bottom: 24px;
  transition: opacity 0.5s ease, transform 0.1s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform, opacity;
}

#scene-specs {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.5s ease, transform 0.1s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform, opacity;
}

#scene-specs li {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  padding-left: 14px;
  position: relative;
  line-height: 1.45;
}
#scene-specs li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: rgba(255,255,255,0.2);
}

/* ── Right indicators ── */
#right-panel {
  position: fixed;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

#scene-code {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  text-align: right;
  transition: opacity 0.5s ease;
}
#scene-code span {
  display: block;
  font-size: 0.52rem;
  color: rgba(255,255,255,0.25);
  margin-top: 3px;
}

#crosshair {
  font-size: 1.4rem;
  font-weight: 100;
  color: rgba(255,255,255,0.3);
  line-height: 1;
  user-select: none;
}

#coordinates {
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.22);
  text-align: right;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* ── Bottom bar ── */
#bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  z-index: 100;
  border-top: 1px solid rgba(255,255,255,0.08);
}

#progress {
  position: absolute;
  top: -1px;
  left: 0;
  height: 1px;
  width: 0%;
  background: rgba(255,255,255,0.55);
  transition: none;
}

#scroll-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.3);
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  transition: opacity 0.7s ease;
}

.wheel {
  width: 16px;
  height: 26px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  position: relative;
  display: flex;
  justify-content: center;
}
.wheel-dot {
  width: 2px;
  height: 5px;
  background: rgba(255,255,255,0.45);
  border-radius: 2px;
  margin-top: 4px;
  animation: wheelScroll 1.8s ease infinite;
}
@keyframes wheelScroll {
  0%   { opacity:1; transform:translateY(0) }
  70%  { opacity:0; transform:translateY(8px) }
  100% { opacity:0; transform:translateY(0) }
}

#scene-cta {
  margin-left: auto;
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  transition: color 0.3s, opacity 0.5s;
}
#scene-cta:not(:empty)::after {
  content: ' →';
}

/* ── Fog layers ── */
.fog-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.fog-layer {
  position: absolute;
  top: -20%;
  left: 0;
  width: 200%;
  height: 140%;
  background-repeat: repeat-x;
  background-size: auto 100%;
  will-change: transform;
  pointer-events: none;
}
.fog-1 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='400'%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='32'/%3E%3C/filter%3E%3Cg filter='url(%23b)' opacity='0.45'%3E%3Cellipse cx='200' cy='300' rx='300' ry='120' fill='%23ffffff'/%3E%3Cellipse cx='650' cy='280' rx='350' ry='140' fill='%23ffffff'/%3E%3Cellipse cx='1050' cy='310' rx='280' ry='110' fill='%23ffffff'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.22;
  animation: fogA 28s linear infinite;
}
.fog-2 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='500'%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='48'/%3E%3C/filter%3E%3Cg filter='url(%23b)' opacity='0.38'%3E%3Cellipse cx='300' cy='400' rx='420' ry='170' fill='%23c8d8f0'/%3E%3Cellipse cx='850' cy='370' rx='460' ry='185' fill='%23c8d8f0'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.14;
  animation: fogB 44s linear infinite reverse;
  top: 30%;
}
.fog-3 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1000' height='300'%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='22'/%3E%3C/filter%3E%3Cg filter='url(%23b)' opacity='0.55'%3E%3Cellipse cx='150' cy='200' rx='200' ry='85' fill='%23ffffff'/%3E%3Cellipse cx='520' cy='185' rx='270' ry='100' fill='%23ffffff'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.10;
  animation: fogA 56s linear infinite;
  top: 55%;
}
@keyframes fogA { from{transform:translateX(0)} to{transform:translateX(-50%)} }
@keyframes fogB { from{transform:translateX(-50%)} to{transform:translateX(0)} }

/* ── Vignette ── */
.vignette-strong {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center,
    transparent 30%,
    rgba(0,0,0,0.42) 72%,
    rgba(0,0,0,0.78) 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* ── Film Grain ── */
.film-grain {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  opacity: 0.055;
  pointer-events: none;
  z-index: 3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  animation: grainShift 0.12s steps(1) infinite;
}
@keyframes grainShift {
  0%  { transform: translate(0,0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(2px, -2px); }
  75% { transform: translate(-2px, 3px); }
}

/* ── Loading ── */
#loading {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.9s ease;
}
#loading.hidden { opacity: 0; pointer-events: none; }

.loading-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  animation: pulse 1.3s ease infinite;
  margin-bottom: 18px;
}
@keyframes pulse {
  0%,100%{ transform:scale(1);   opacity:.3 }
  50%    { transform:scale(1.9); opacity:1  }
}
#loading span {
  color: rgba(255,255,255,0.22);
  font-size: 0.58rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
}

/* ── Social links (scene đầu) ── */
.social-links {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  pointer-events: all;
}
.social-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.18);
  transition: border-color 0.2s, color 0.2s;
}
.social-links a:hover {
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}
.social-links svg {
  width: 12px; height: 12px;
  fill: currentColor; flex-shrink: 0;
}

/* ── YouTube Action Buttons ── */
#scene-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
  opacity: 1;
  transition: opacity 0.5s ease, transform 0.1s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform, opacity;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: all;
  cursor: none;
}
.action-btn::after {
  content: ' →';
  opacity: 0.6;
  transition: transform 0.3s;
}
.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.05);
}
.action-btn:hover::after {
  transform: translateX(4px);
}

/* ── Audio toggle soundwave ── */
#audio-toggle {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 32px;
  height: 24px;
  background: none;
  border: none;
  padding: 0;
  margin: 0 24px;
  cursor: none;
  z-index: 100;
  pointer-events: all;
}
#audio-toggle .bar {
  display: block;
  width: 2px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 1px;
  height: 3px;
  transition: height 0.3s ease, background-color 0.3s;
}
#audio-toggle .bar-1 { height: 6px; }
#audio-toggle .bar-2 { height: 14px; }
#audio-toggle .bar-3 { height: 10px; }
#audio-toggle .bar-4 { height: 8px; }

/* Animation when playing */
#audio-toggle:not(.audio-muted) .bar-1 { animation: soundPlay 0.8s ease-in-out infinite alternate; }
#audio-toggle:not(.audio-muted) .bar-2 { animation: soundPlay 0.5s ease-in-out infinite alternate 0.15s; }
#audio-toggle:not(.audio-muted) .bar-3 { animation: soundPlay 0.7s ease-in-out infinite alternate 0.05s; }
#audio-toggle:not(.audio-muted) .bar-4 { animation: soundPlay 0.6s ease-in-out infinite alternate 0.2s; }

/* Hover states */
#audio-toggle:hover .bar {
  background: #fff;
}

@keyframes soundPlay {
  0% { height: 4px; }
  100% { height: 20px; }
}

/* Spec link styling */
#scene-specs a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.3s;
  cursor: none;
  pointer-events: all;
}
#scene-specs a:hover {
  color: #fff;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  #top-nav    { padding: 0 20px; }
  #info-panel { left: 20px; max-width: 320px; }
  #info-panel::before {
    inset: -40px -20px -40px -40px;
    background: radial-gradient(circle at left center, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 80%);
  }
  #right-panel{ right: 20px; }
  #bottom-bar { padding: 0 20px; }
  #nav-links  { display: none; }
  #scene-title { font-size: 1.8rem; }
}
