/* ============================================================
   VITALITY — cinematic scroll-scrub layer (additive)
   All classes namespaced .cin-* so nothing collides with
   styles.css / modern-styles.css / elevated.css.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap');

.cin-scrub { position: relative; background: #05050a; }
.cin-scrub-intro { height: 360vh; }
.cin-scrub-core { height: 300vh; }

.cin-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #05050a;
}

.cin-scrub canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Shader mode — the fixed #vitality-shader-bg plasma shows through */
.cin-shader,
.cin-shader .cin-sticky { background: transparent; }
.cin-shader canvas { display: none; }
.cin-shader .cin-vignette {
  /* subtle radial only — linear strips create visible seams at section edges */
  background: radial-gradient(120% 90% at 50% 50%, transparent 58%, rgba(0, 0, 0, 0.3) 100%);
}

.cin-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 42%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, transparent 26%, transparent 68%, rgba(0, 0, 0, 0.82) 100%);
}

/* ---------- overlay copy ---------- */
.cin-overlay {
  position: relative;
  z-index: 10;
  width: 100%;
  text-align: center;
  padding: 0 24px;
}
.cin-line {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 1100px);
  opacity: 0;
  will-change: opacity, transform;
}
.cin-kicker {
  display: block;
  margin-bottom: 18px;
  font-family: "Clash Display", system-ui, sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.34em;
  color: #9147ff;
}
.cin-line h2 {
  font-family: "Clash Display", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(2.6rem, 6.5vw, 6.2rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: #f2eefc;
  text-shadow: 0 8px 60px rgba(0, 0, 0, 0.6);
}
.cin-line h2 em {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: #cdb2ff;
}

/* ---------- cycling word (Performance you can [feel/trust/measure/master].) ---------- */
.cin-words {
  display: inline-block;
  overflow: hidden;
  height: 1.04em;
  line-height: 1.04;
  vertical-align: -0.08em;
}
.cin-words-track {
  display: flex;
  flex-direction: column;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.cin-words-track .cin-word {
  display: block;
  height: 1.04em;
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.04;
  background: linear-gradient(120deg, #c9a6ff, #9147ff 40%, #7534b3 60%, #c9a6ff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradientShift 6s ease infinite;
}
.cin-line.cin-accent h2 {
  background: linear-gradient(120deg, #c9a6ff, #9147ff 40%, #7534b3 60%, #c9a6ff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 50px rgba(145, 71, 255, 0.45));
  animation: gradientShift 6s ease infinite;
}
.cin-line p {
  margin-top: 18px;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: rgba(242, 238, 252, 0.62);
}

/* ---------- telemetry / progress ---------- */
.cin-telemetry {
  position: absolute;
  z-index: 12;
  font-family: "Clash Display", system-ui, sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: rgba(201, 166, 255, 0.7);
}
.cin-telemetry b { color: #f2eefc; font-weight: 600; }
.cin-tl { top: 96px; left: 30px; }
.cin-tr { top: 96px; right: 30px; }
.cin-bl { bottom: 72px; left: 30px; }
.cin-br { bottom: 72px; right: 30px; }

.cin-progress {
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 48px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 12;
}
.cin-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7534b3, #9147ff);
  box-shadow: 0 0 14px #9147ff;
}
.cin-scroll-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  font-family: "Clash Display", system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.42em;
  color: rgba(242, 238, 252, 0.6);
  animation: cin-bob 1.8s ease-in-out infinite;
  transition: opacity 0.4s;
}
@keyframes cin-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ---------- mobile / reduced motion ---------- */
@media (max-width: 760px) {
  .cin-scrub-intro { height: 320vh; }
  .cin-scrub-core { height: 260vh; }
  .cin-telemetry { font-size: 9px; letter-spacing: 0.18em; }
  .cin-tl, .cin-tr { top: 84px; }
  .cin-progress { left: 16px; right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .cin-scrub-intro, .cin-scrub-core { height: 100vh; }
  .cin-scroll-hint { animation: none; }
  .cin-line { opacity: 1 !important; transform: translate(-50%, -50%) !important; }
  .cin-line:not(:first-of-type) { display: none; }
  .cin-words-track { transform: none !important; transition: none; }
  .cin-word { animation: none !important; }
}
