/* ----------------------------------------------------------------
   musical.quest - v2
   corporate aesthetic / minimal-navigation / condensed typography
   high-contrast palette / ripple patterns / marble-texture / vintage
   zen-contemplative tone
   ---------------------------------------------------------------- */

:root {
  --marble-cream: #F5F0E8;
  --ink-black: #1A1A18;
  --score-gray: #888888;
  --vintage-gold: #B8962E;
  --deep-charcoal: #2A2A28;
  --marble-vein: #D8D0C0;
  --resonance-blue: #4A6888;

  --content-width: 600px;
  --side-margin: 200px;
  --movement-gap: 120px;

  --font-display: "Barlow Condensed", "Inter", sans-serif;
  --font-body: "Lora", Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--marble-cream);
  color: var(--ink-black);
  font-size: clamp(16px, 1.1vw, 18px);
  line-height: 2.0;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Marble texture via layered gradients + SVG turbulence overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(216, 208, 192, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(216, 208, 192, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgba(184, 150, 46, 0.04) 0%, transparent 70%),
    linear-gradient(135deg, #F7F2EB 0%, #F2EDE3 50%, #F5F0E8 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  filter: url(#marble-turbulence);
  opacity: 0.55;
  mix-blend-mode: multiply;
  background: var(--marble-cream);
}

.marble-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ----------------------------------------------------------------
   Tuning silence (100vh)
   ---------------------------------------------------------------- */

.tuning-silence {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tuning-inner {
  text-align: center;
  width: 100%;
  max-width: var(--content-width);
  padding: 0 24px;
}

.domain-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(20px, 2.5vw, 36px);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-black);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 1500ms ease, transform 1500ms ease;
}

.domain-title.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.title-rule {
  display: block;
  height: 1px;
  width: 0;
  margin: 28px auto 0;
  background-color: var(--score-gray);
  transition: width 800ms ease;
}

.title-rule.is-drawn {
  width: 60%;
}

.prelude-meta {
  margin-top: 22px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13px;
  color: var(--score-gray);
  opacity: 0;
  transition: opacity 1200ms ease 600ms;
}

.prelude-meta.is-revealed {
  opacity: 1;
}

/* ----------------------------------------------------------------
   Movements
   ---------------------------------------------------------------- */

.movements {
  display: block;
  padding: var(--movement-gap) 0;
}

.movement {
  padding: var(--movement-gap) 0;
  position: relative;
}

.movement-inner {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 max(40px, calc((100vw - 1000px) / 2 + 40px));
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 40px;
}

@media (min-width: 1280px) {
  .movement-inner {
    max-width: 1100px;
    padding: 0 40px;
  }
}

.movement-marker {
  position: relative;
  user-select: none;
}

.numeral {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(48px, 6vw, 120px);
  letter-spacing: 0.02em;
  color: var(--deep-charcoal);
  opacity: 0.2;
  display: inline-block;
  line-height: 1;
  transition: opacity 800ms ease, transform 800ms ease;
  transform: translateX(-12px);
}

.movement.is-visible .numeral {
  opacity: 0.2;
  transform: translateX(0);
}

.movement-body {
  max-width: var(--content-width);
  opacity: 0.3;
  transition: opacity 800ms ease;
}

.movement.is-visible .movement-body {
  opacity: 1;
}

.movement-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 2.4vw, 34px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-black);
  margin-bottom: 24px;
  position: relative;
  padding-bottom: 16px;
}

.movement-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 1px;
  background-color: var(--score-gray);
  transition: width 400ms ease;
}

.movement-title:hover::after {
  width: 44px;
}

.movement-text {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(16px, 1.1vw, 18px);
  line-height: 2.0;
  color: var(--ink-black);
  margin-bottom: 28px;
}

.movement-text:last-child {
  margin-bottom: 0;
}

/* ----------------------------------------------------------------
   Ripple zones
   ---------------------------------------------------------------- */

.ripple-zone {
  height: 220px;
  width: 100%;
  position: relative;
  overflow: hidden;
  cursor: crosshair;
}

.ripple-zone::before,
.ripple-zone::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 1px;
  transform: translate(-50%, -50%);
  background: var(--score-gray);
  opacity: 0.4;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--vintage-gold);
  pointer-events: none;
  opacity: 0.4;
  transform: translate(-50%, -50%) scale(0);
  animation: ripple-expand 1600ms ease-out forwards;
}

@keyframes ripple-expand {
  0% {
    width: 0;
    height: 0;
    opacity: 0.4;
  }
  100% {
    width: 200px;
    height: 200px;
    opacity: 0;
  }
}

.ripple.ripple--small {
  animation: ripple-expand-small 1100ms ease-out forwards;
}

@keyframes ripple-expand-small {
  0% {
    width: 0;
    height: 0;
    opacity: 0.5;
  }
  100% {
    width: 60px;
    height: 60px;
    opacity: 0;
  }
}

/* ----------------------------------------------------------------
   Final note (100vh)
   ---------------------------------------------------------------- */

.final-note {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.final-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

.final-dot {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--ink-black);
  opacity: 0.8;
  animation: dot-pulse 2000ms ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.final-text {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  font-size: 13px;
  color: var(--score-gray);
  letter-spacing: 0.05em;
}

/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */

@media (max-width: 768px) {
  :root {
    --side-margin: 24px;
    --movement-gap: 80px;
  }

  .movement-inner {
    grid-template-columns: 60px 1fr;
    gap: 16px;
    padding: 0 24px;
  }

  .numeral {
    font-size: clamp(36px, 8vw, 64px);
  }

  .ripple-zone {
    height: 140px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .domain-title,
  .title-rule,
  .prelude-meta,
  .numeral,
  .movement-body {
    transition: none;
  }
  .final-dot {
    animation: none;
  }
  .ripple {
    animation: none;
    display: none;
  }
}
