/* ── 1. IMPORT CUSTOM FONT ── */
@font-face {
  font-family: 'Williwaw';
  src: url('Williwaw-Book.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

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

:root {
  --black: #050100;
  --white: #fffff5;
  --gray: #c8c6c2;
  --sidebar-width: 40px;
}

html, body {
  width: 100%;
  min-height: 100vh; 
  overflow-x: hidden; 
  background: var(--black);
  font-family: 'Williwaw', sans-serif;
}

/* ── SCROLL ANIMATION WRAPPERS ── */
.sticky-wrapper {
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.scroll-spacer {
  height: 1300vh; 
  width: 100%;
  position: relative;
  z-index: -1; 
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  border-right: 1px solid var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  background: var(--black);
  cursor: pointer; 
  transition: background-color 0.4s ease, border-color 0.4s ease; 
}

.sidebar:hover {
  background-color: var(--white);
}

.sidebar-menu {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 5px; 
}

.sidebar-menu span {
  display: block;
  width: 16px; 
  height: 1px;
  background: var(--white);
  transition: background-color 0.4s ease; 
}

.sidebar:hover .sidebar-menu span {
  background-color: var(--black);
}

.sidebar-label {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-45%) translateY(-180%) rotate(-90deg);
  transform-origin: center center;
  white-space: nowrap;
  font-weight: 300;
  font-size: 16px;
  letter-spacing: -0.4px;
  color: var(--white);
  user-select: none;
  transition: color 0.4s ease; 
}

.sidebar:hover .sidebar-label {
  color: var(--black);
}

/* ── INVERTED STATES (Triggered by JS) ── */
.sidebar.inverted {
  background: transparent;
  border-right: 1px solid var(--black);
}

.sidebar.inverted .sidebar-menu span {
  background: var(--black);
}

.sidebar.inverted .sidebar-label {
  color: var(--black);
}

.sidebar.inverted:hover {
  background-color: var(--black);
}

.sidebar.inverted:hover .sidebar-menu span {
  background-color: var(--white);
}

.sidebar.inverted:hover .sidebar-label {
  color: var(--white);
}

/* Sidebar state during the Media section */
.sidebar.media-active {
  background-color: transparent;
  border-right: 1px solid var(--white);
}

.sidebar.media-active:hover {
  background-color: rgba(255, 255, 245, 0.1); 
}

.hero-name.inverted, 
.hero-subtitle.inverted {
  color: var(--black);
}

/* ── MAIN LAYOUT ── */
.page {
  position: relative;
  width: 100vw;
  height: 100vh;
}

/* ── LEFT DARK PANEL ── */
.panel-dark {
  position: absolute;
  top: 0;
  left: 0;
  width: 15%;
  height: 100%;
  background: var(--black);
  z-index: 3;
}

.panel-dark::after {
  content: '';
  position: absolute;
  top: 0;
  left: 100%;
  width: clamp(300px, 100vw, 1000px); 
  height: 100%;
  background: linear-gradient(
    to right,
    #050100          0%,
    #050100          10%,
    rgba(5,1,0,0.92) 25%,
    rgba(5,1,0,0.70) 50%,
    rgba(5,1,0,0.40) 70%, 
    rgba(5,1,0,0.15) 85%, 
    rgba(5,1,0,0.02) 95%, 
    rgba(5,1,0,0)    100% 
  );
  z-index: 3;
  pointer-events: none;
  opacity: var(--gradient-opacity, 1); 
}

/* ── RIGHT IMAGE PANEL ── */
.panel-image {
  position: absolute; 
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--black);
  z-index: 1; 
}

.panel-photo {
  position: absolute;
  top: 0;
  right: -15%; 
  height: 100%;
  width: 100%; 
  object-fit: cover; 
  object-position: 100% center; 
  display: block;
  transform-origin: 80% center; 
  will-change: transform, opacity; 
}

/* ── HERO TEXT ── */
.hero-text {
  position: absolute;
  bottom: 120px; 
  left: var(--sidebar-width);
  padding-left: 60px; 
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.3s ease; 
}

.hero-name {
  font-weight: 300;
  font-size: clamp(52px, 6.5vw, 96px);
  color: var(--white);
  letter-spacing: -1.92px;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(18px);
  animation: fadeUp 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
  transition: color 0.4s ease; 
}

.hero-subtitle {
  margin-top: -15px;
  font-weight: 300;
  font-size: 16px;
  letter-spacing: 2.8px;
  color: var(--white);
  text-transform: uppercase;
  text-align: center;
  margin-right: -0.35em;
  opacity: 0;
  animation: fadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.65s forwards;
  transition: color 0.4s ease; 
}

.hero-subtitle .dot {
  margin: 0 8px;
}

/* ── SCROLL INDICATOR ── */
.scroll-hint {
  position: absolute;
  bottom: 32px;
  right: 40px;
  font-weight: 300;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.3);
  writing-mode: vertical-rl;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 3;
  opacity: 0;
  animation: fadeIn 1.2s ease 1.2s forwards;
}

.scroll-hint::before {
  content: '';
  display: block;
  width: 1px;
  height: 40px;
  background: rgba(0,0,0,0.2);
  animation: scrollLine 2s ease-in-out 1.5s infinite;
}

/* ── STAGE 2 & 3: IMAGE AND TEXT LAYOUT ── */
.stage-wrapper {
  position: absolute;
  top: 50%;
  left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width)) / 2);
  height: clamp(266px, 37.33vw, 533px); 
  transform: translateY(-50%); 
  width: 0; 
  z-index: 10;
  pointer-events: none; 
}

.center-image-container {
  position: absolute;
  left: 0; 
  top: 0;
  transform: translate(-50%, 0) scale(0.8); 
  opacity: 0;
  width: clamp(200px, 28vw, 400px);
  aspect-ratio: 3 / 4; 
  background-color: #9e9e9e; 
  will-change: transform, opacity;
}

.center-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-section {
  position: absolute;
  left: 4vw; 
  top: 0; 
  width: clamp(300px, 30vw, 500px);
  opacity: 0;
  transform: translateX(40px); 
  color: #1C1C1B; 
  font-family: 'Williwaw', sans-serif;
  will-change: transform, opacity;
}

.about-section h2 {
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  letter-spacing: -1.28px;
  font-size: clamp(40px, 4.5vw, 64px); 
  margin-bottom: 24px;
}

.about-section p {
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.56px;
  line-height: 1.6; 
  font-size: clamp(14px, 1.2vw, 18px); 
}

/* ── STAGE 4: MEDIA SECTION ── */
.media-section {
  position: absolute;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  background-color: var(--black); 
  z-index: 20; 
  opacity: 0;
  pointer-events: none;
  will-change: opacity; 
  color: var(--white);
}

/* ── AUDIO VISUALIZER CANVAS ── */
#visualizer-canvas {
  width: 100%;
  height: 100%;
  display: block;
  
  /* CHANGED: Removed var(--black) so the box itself is invisible */
  background-color: transparent; 
  
  cursor: pointer;
}

/* ── BACKGROUND YOUTUBE VIDEO TRICK ── */
.media-bg-video {
  position: absolute;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  opacity: 0.20; 
  z-index: 1;
  pointer-events: none; 
  overflow: hidden; 
  
  /* ADDED: Smooth fade for the background swap */
  transition: opacity 0.8s ease; 
}

/* This math forces the YouTube iframe to act like 'object-fit: cover' */
.media-bg-video iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  
  /* Increased from 100vw to 120vw to crop out the UI */
  width: 120vw;
  height: 67.5vw; /* 16:9 Aspect Ratio of 120 (9 / 16 * 120) */
  
  /* Increased to ensure it covers the vertical space even when scaled */
  min-height: 120vh;
  min-width: 213.33vh; /* 16:9 Aspect Ratio of 120 (16 / 9 * 120) */
  
  transform: translate(-50%, -50%);
  border: none;
}

.media-heading {
  position: absolute;
  top: 15%;
  left: calc(var(--sidebar-width) + 6vw);
  font-weight: 400;
  font-size: clamp(40px, 4.5vw, 64px);
  z-index: 2;
  opacity: 0;
  transform: translateY(40px);
  will-change: transform, opacity;
}

.media-content {
  position: absolute;
  top: 50%;
  left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width)) / 2);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  
  /* CHANGED: Replaced 'center' and 'gap' with space-between to push text to the far edges */
  justify-content: space-between; 
  
  width: 85%; /* You can increase this to 90% if you ever want them pushed even further! */
  z-index: 2;
}

/* ── DYNAMIC LEFT TEXT WRAPPER ── */
.media-text-left-wrapper {
  position: relative;
  
  /* CHANGED: Increased the maximum width from 250px to 380px */
  width: clamp(150px, 22vw, 380px); 
  height: 100px; 
}

.media-text-left {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  transform: translateY(-50%);
  font-weight: 400;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.4;
  text-align: left;
  will-change: opacity, transform;
  
  /* ADDED: Smooth glide and fade for the text swap */
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ── DYNAMIC CENTER VIDEO WRAPPER ── */
.media-center-video-wrapper {
  position: relative;
  width: clamp(400px, 45vw, 900px);
  aspect-ratio: 16 / 9; 
}

.media-center-video {
  position: absolute;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  background-color: transparent; 
  
  /* CHANGED: Added 'opacity 0.6s ease' to the transition list! */
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease, opacity 0.6s ease;
  
  overflow: hidden; 
  will-change: opacity;
}

/*.media-center-video:hover {
  transform: scale(1.02);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
}*/

.media-center-video iframe {
  width: 100%; 
  height: 100%;
  display: block;
  border: none;
}

.media-text-right {
  /* CHANGED: Increased the width bounds (24vw and 420px) so the text has room to breathe */
  width: clamp(150px, 24vw, 420px); 
  
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px; 
  
  /* CHANGED: Increased from 2.5vw to 6vw to push the text further to the right. */
  padding-left: 6vw; 
}

.media-text-right h3 {
  font-weight: 400;
  font-size: clamp(24px, 2.5vw, 36px);
  margin-bottom: 2px;
  letter-spacing: -0.5px;
}

.media-text-right p {
  font-weight: 300;
  font-size: clamp(14px, 1vw, 16px);
  opacity: 0.4; 
}

.recordings-label {
  font-weight: 400;
  letter-spacing: -0.5px;
  margin: 0;
  transition: font-size 0.6s ease, opacity 0.6s ease; 
  transform-origin: left center;
  
  /* NEW: Forces the text to stay on a single line */
  white-space: nowrap; 
}

.recordings-label.active {
  font-size: clamp(24px, 2.5vw, 36px);
  opacity: 1;
}

.recordings-label.inactive {
  font-size: clamp(14px, 1vw, 16px);
  opacity: 0.4;
}

/* ── TALLER AUDIO VISUALIZER ── */
#center-audio {
  /* Increases the height to be 40% taller than the 16:9 videos */
  height: 140%; 
  
  /* Pulls the box up to keep it perfectly centered */
  top: -20%; 
  
  /* Optional: Adds a subtle curve to the edges so it feels like a premium UI card */
  border-radius: 8px; 
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  to { opacity: 1; }
}
@keyframes scrollLine {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}