/* ============================================
   Night Venice — Immersive Scroll Experience
   ============================================ */

:root {
  --c-bg: #0a0a0c;
  --c-video-overlay: rgba(5, 5, 10, 0.35);
  --c-text: #f0eee6;
  --c-text-dim: #9a978e;
  --c-accent: #c8a960;
  --c-border: rgba(200, 169, 96, 0.15);

  --font-display: 'Cormorant Garamond', 'Georgia', 'Palatino', 'Times New Roman', serif;
  --font-body: 'Cormorant Garamond', 'Georgia', serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

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

html {
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--c-accent) transparent;
}

html::-webkit-scrollbar {
  width: 3px;
}

html::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb {
  background: var(--c-accent);
  border-radius: 3px;
}

body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---- Loader ---- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.2s var(--ease-out-expo), visibility 0s 1.2s;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.loader-line {
  width: 60px;
  height: 1px;
  background: var(--c-accent);
  transform-origin: left;
  animation: loaderLine 1.8s var(--ease-out-expo) infinite;
}

@keyframes loaderLine {
  0% {
    transform: scaleX(0);
    opacity: 0.3;
  }
  50% {
    transform: scaleX(1);
    opacity: 1;
  }
  100% {
    transform: scaleX(0);
    opacity: 0.3;
  }
}

.loader-text {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--c-text-dim);
}

/* ---- Video ---- */
.video-container {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 65% at 50% 50%,
    transparent 0%,
    rgba(5, 5, 10, 0.25) 65%,
    rgba(5, 5, 10, 0.65) 100%
  );
  pointer-events: none;
}

.vignette::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 12, 0.3) 0%,
    transparent 18%,
    transparent 82%,
    rgba(10, 10, 12, 0.45) 100%
  );
}

/* ---- Scroll Container ---- */
.scroll-container {
  position: relative;
  z-index: 2;
  height: 700vh;
  pointer-events: none;
}

.scroll-content {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* ---- Text Blocks ---- */
.text-block {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.9s var(--ease-out-expo),
    visibility 0s 0.9s;
  will-change: opacity;
}

.text-block.active {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.9s var(--ease-out-expo),
    visibility 0s 0s;
}

.text-inner {
  max-width: 620px;
}

.block-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: var(--c-text);
  margin-bottom: 24px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s var(--ease-out-expo) 0.12s,
    transform 0.7s var(--ease-out-expo) 0.12s;
}

.block-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--c-accent);
  margin: 18px auto 0;
  opacity: 0.5;
}

.text-block.active .block-title {
  opacity: 1;
  transform: translateY(0);
}

.block-subtitle {
  font-family: var(--font-display);
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 300;
  line-height: 1.75;
  letter-spacing: 0.015em;
  color: var(--c-text-dim);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.7s var(--ease-out-expo) 0.28s,
    transform 0.7s var(--ease-out-expo) 0.28s;
}

.text-block.active .block-subtitle {
  opacity: 0.88;
  transform: translateY(0);
}

/* ---- Scroll Progress ---- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.04);
}

.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    var(--c-accent),
    rgba(200, 169, 96, 0.5)
  );
  transition: none;
  will-change: width;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .scroll-content {
    padding: 20px;
  }

  .text-inner {
    max-width: 90%;
  }

  .block-title {
    margin-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .block-subtitle br {
    display: none;
  }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .text-block {
    transition: none;
  }

  .block-title,
  .block-subtitle {
    transition: none;
  }
}
