/* Cinematic layer for Dr. Raymundo Flores — 2026-08-24 */
:root {
  --wv-clinical: #1a56db;
  --wv-indigo: #221e4e;
  --wv-deep: #0f0d24;
  --wv-vital: #31c48d;
  --wv-gold: #f6c177;
  --wv-paper: #f5f6f9;
}

body.wv-loading {
  overflow: hidden;
}

#wv-preloader {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  background: var(--wv-paper);
  color: var(--wv-indigo);
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

#wv-preloader.wv-loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.wv-preloader-inner {
  width: min(360px, calc(100vw - 48px));
}

.wv-preloader-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
}

.wv-preloader-mark img {
  width: 42px;
  height: 42px;
  border-radius: 4px;
}

.wv-preloader-line {
  height: 2px;
  margin-top: 24px;
  overflow: hidden;
  background: #e4e7ec;
}

#wv-preloader-progress {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--wv-clinical), var(--wv-vital));
  transition: width 0.18s ease;
}

#scroll-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0;
  background: var(--wv-paper);
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.wv-page {
  position: relative;
  z-index: 2;
}

.wv-story {
  position: relative;
  height: 240vh;
  color: #fff;
  background: transparent;
  isolation: isolate;
}

.wv-story::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(15, 13, 36, 0.82) 0%, rgba(15, 13, 36, 0.56) 44%, rgba(15, 13, 36, 0.18) 76%, rgba(15, 13, 36, 0.38) 100%);
}

.wv-story-stage {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.wv-story-copy {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 96px 24px;
}

.wv-story-card {
  max-width: 600px;
  padding: clamp(26px, 4vw, 48px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 13, 36, 0.64);
  backdrop-filter: blur(5px);
}

.wv-story-card--compact {
  width: min(360px, 100%);
  padding: clamp(18px, 2.4vw, 28px);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(15, 13, 36, 0.46);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.wv-story-kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c6d8ff;
}

.wv-story h2 {
  max-width: 12ch;
  margin-top: 18px;
  font-family: "Archivo", sans-serif;
  font-size: clamp(36px, 6vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.wv-story p {
  max-width: 47ch;
  margin-top: 24px;
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.55;
  color: #eef2ff;
}

.wv-story--compact h2 {
  max-width: 13ch;
  margin-top: 12px;
  font-size: clamp(30px, 3.8vw, 48px);
  line-height: 1.02;
}

.wv-story--compact p {
  margin-top: 16px;
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.45;
}

.wv-story-data {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.34);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wv-gold);
}

.wv-story-progress {
  position: absolute;
  right: 24px;
  bottom: 28px;
  width: min(220px, 34vw);
  height: 2px;
  background: rgba(255, 255, 255, 0.25);
}

.wv-story-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: #fff;
}

.wv-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d6dae2;
  border-radius: 999px;
  background: #fff;
  color: var(--wv-indigo);
  cursor: pointer;
}

.wv-mobile-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  padding: 10px 24px 22px;
  border-bottom: 1px solid #e4e7ec;
  background: rgba(250, 251, 253, 0.98);
}

.wv-mobile-menu.wv-open {
  display: grid;
}

.wv-mobile-menu a {
  padding: 13px 0;
  border-bottom: 1px solid #e4e7ec;
  color: #111827;
  font-weight: 600;
}

.wv-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #6b7280;
}

.wv-consent input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--wv-clinical);
}

.wv-consent a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wv-privacy-note {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #9ca3af;
}

@media (max-width: 820px) {
  .wv-menu-toggle {
    display: inline-flex;
  }

  #nav nav > a.mag {
    display: none !important;
  }

  .wv-story {
    height: 190vh;
  }

  .wv-story::before {
    background: linear-gradient(180deg, rgba(15, 13, 36, 0.5), rgba(15, 13, 36, 0.82));
  }

  .wv-story-stage {
    align-items: end;
  }

  .wv-story-copy {
    padding: 110px 18px 72px;
  }

  .wv-story-card {
    background: rgba(15, 13, 36, 0.78);
  }

  .wv-story--compact .wv-story-stage {
    align-items: flex-start;
  }

  .wv-story--compact .wv-story-copy {
    margin: 0;
    padding: clamp(88px, 12vh, 108px) 18px 48px;
  }

  .wv-story-card--compact {
    width: min(60vw, 260px);
    padding: 16px;
    background: rgba(15, 13, 36, 0.48);
  }

  .wv-story--compact .wv-story-kicker {
    font-size: 9px;
    line-height: 1.35;
  }

  .wv-story--compact h2 {
    margin-top: 10px;
    font-size: clamp(23px, 6.4vw, 29px);
  }

  .wv-story--compact p {
    margin-top: 12px;
    font-size: 13.5px;
    line-height: 1.4;
  }
}

@media (max-width: 680px) {
  #treeCaptions {
    bottom: 18px !important;
    padding-inline: 14px !important;
  }

  #treeCaptions > div {
    width: min(100%, 94vw) !important;
    min-height: 156px !important;
    padding: 11px 14px !important;
  }

  #treeCaptions .tcap p {
    margin-top: 8px !important;
    font-size: clamp(17px, 5.5vw, 21px) !important;
    line-height: 1.18 !important;
  }

  #treeHint {
    bottom: 3px !important;
  }
}

@media (max-width: 360px), (max-height: 640px) {
  #treeCaptions > div {
    min-height: 150px !important;
    padding-inline: 10px !important;
  }

  #treeCaptions .tcap > div {
    font-size: 9px !important;
  }

  #treeCaptions .tcap p {
    font-size: clamp(16px, 5.35vw, 19px) !important;
    line-height: 1.16 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #scroll-canvas {
    transition: none;
  }

  .wv-story {
    height: auto;
    min-height: 100vh;
  }

  .wv-story-stage {
    position: relative;
  }
}
