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

/* ─── Base ───────────────────────────────────────────────────────────────── */
:root {
  --header-h: 0px;
  --footer-h: 0px;
  --bg:       #0d0d14;
  --chrome:   #11111c;
  --border:   rgba(255, 255, 255, 0.07);
  --text:     #c8c8d8;
  --accent:   #8b7cf6;
  --secondary: #FC3B6E;
}

html, body {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Backs up the viewport meta's user-scalable=no (some mobile browsers
     ignore that for accessibility reasons) by killing double-tap/pinch-zoom
     at the CSS level too — touchmove panning itself is still hand-tracked
     by ScrollTimeline (which calls preventDefault() on it), so this only
     needs to disable the zoom gestures, not panning. */
  touch-action: manipulation;
}

.pink {
  color: var(--secondary);
}

.bold {
  font-weight: 600;
}

/* ─── Hanging footnote symbol ────────────────────────────────────────────── */
/* Shared by every footnote container across the app (see js/footnoteHang.js),
   which splits raw footnote text into one .fn-line per line — each an
   independent hang: the leading symbol sits at the left edge via
   position:absolute, and the padding-left on the line itself keeps wrapped
   copy aligned under the body text rather than the symbol. */
.fn-line {
  position: relative;
  padding-left: 0em;
}

.fn-line + .fn-line {
  margin-top: 6px;
}

.fn-symbol {
  position: absolute;
  left: -7px;
  top: 0;
}

.fn-body {
  display: inline;
}

/* body grows with #scroll-track so the page is scrollable;
   all visual chrome (header, viewer, footer) stays position:fixed */
body {
  overflow-x: hidden;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  z-index: 200;
}
.header__logo {
  width: 15vw;
  cursor: pointer;
  display: block;
}
.header__logo img {
  width: 100%;
}



.header__nav {
  padding: 0 2vw;
  display: flex;
  gap: 2vw;
  transform: translateY(-1.7vw);
}
.header__link {
  margin-bottom: 0.5vw;
  color: #FFF;
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  font-size: clamp(10px,0.73vw, 14px);
  font-style: normal;
  font-weight: 500;
  line-height: 120%; /* 19.2px */
  letter-spacing: 0.8px;
  transition: color 0.1s ease-in-out;
  text-decoration: none;
}

/* Unscoped :hover on a tappable element makes iOS Safari treat the first tap
   as "just hover" and require a second tap for the real click — scoping this
   to real-mouse devices avoids that, same reasoning as the dropdown fix below. */
@media (hover: hover) and (pointer: fine) {
  .header__link:hover {
    color: #FC3B6E;
  }
}

/* ─── Start Form dropdown ────────────────────────────────────────────────── */
.header__dropdown {
  position: relative;
}

.header__dropdown-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.footer__collapse-btn .header__dropdown-arrow {
  transform: translateY(4px) rotate(0deg);
}


.header__dropdown-arrow {
  width: 0.8vw;
  flex-shrink: 0;
  margin-left: 0vw;
  transform: rotate(0deg);
  transition: transform 0.25s ease;
}

.header__dropdown-btn[aria-expanded="true"] .header__dropdown-arrow {
  transform: rotate(180deg);
}

/* Touch devices can get stuck simulating :hover on tap, with no un-hover
   gesture to clear it — the aria-expanded tap-toggle below would then have
   no way to actually close the menu. Keep :hover opening/closing restricted
   to devices with a real mouse; touch relies solely on the tap-toggle. */
@media (hover: hover) and (pointer: fine) {
  .header__dropdown:hover .header__dropdown-arrow {
    transform: rotate(180deg);
  }
}

.header__dropdown-menu {
  opacity: 0;
  position: absolute;
  /* top:100% + padding-top (rather than a top offset) keeps the box flush
     against the button — a gap here would break :hover as the mouse moves
     from the button down to the menu, closing it before a click lands. */
  top: 100%;
  left: 0;
  list-style: none;
  margin: 0;
  padding: 10px 0 0;
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}

.header__dropdown-btn[aria-expanded="true"] + .header__dropdown-menu {
  opacity: 1;
  pointer-events: all;
}

@media (hover: hover) and (pointer: fine) {
  .header__dropdown:hover .header__dropdown-menu {
    opacity: 1;
    pointer-events: all;
  }
}

.header__dropdown-item {
  display: block;
  padding: 8px 0px;
  color: #fff;
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  font-size: clamp(10px,0.73vw, 14px);
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: capitalize;
  transition: color 0.15s ease;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .header__dropdown-item:hover {
    color: var(--secondary);
  }
}

/* ─── Audio mute toggle ──────────────────────────────────────────────────── */

.audio-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 900;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.audio-toggle:hover {
  background: #e02f5e;
}

.audio-toggle__icon {
  width: 20px;
  height: 20px;
}

.audio-toggle .audio-toggle__icon--off,
.audio-toggle.is-muted .audio-toggle__icon--on {
  display: none;
}

.audio-toggle.is-muted .audio-toggle__icon--off {
  display: block;
}

/* ─── Viewer ─────────────────────────────────────────────────────────────── */
#viewer-container {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: 100%;
  height: calc(100vh - var(--header-h) - var(--footer-h));
  overflow: hidden;
}

/* Three.js appends a <canvas> — ensure it fills the container */
#viewer-container canvas {
  display: block;
}

/* ─── Loading overlay ────────────────────────────────────────────────────── */
#loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 10;
  transition: opacity 0.4s ease;
}

#loading.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-bar {
  width: 220px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

#loading-progress {
  height: 100%;
  width: 100%;
  background: #FC3B6E;
  border-radius: 2px;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

#loading-label {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text);
  opacity: 0.7;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.scroll {
  position: fixed;
  height: clamp(100px, 8vw, 200px);
  width: 8vw;
  height: 8vw;
  aspect-ratio: 1;
  z-index: 10;
  top: calc(100vh - 120px - 8vw);
  left: 50%;
  transform: translateX(-50%) translateY(-70px) scale(1);
  font-size: clamp(0.6rem, 0.67vw , 1rem);
  opacity: 0;
  font-weight: 600;
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
  cursor: pointer;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;

}
.scroll:after {
  z-index: -1;
  content: '';
  opacity: 0.6;
  background: #FC3B6E;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

body.footer-collapse .scroll {
  transform: translateX(-50%) translateY(0px) scale(1);
}

.scroll:hover {
  transform: translateX(-50%) translateY(-70px) scale(1.1);
}

body.footer-collapse .scroll:hover {
  transform: translateX(-50%) translateY(0px) scale(1.1);
}

.scroll.is-visible {
  opacity: 1.0;
  pointer-events: all;
}

.scroll.is-entering {
  animation: scroll-enter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.footer-collapse .scroll.is-entering {
  animation: scroll-enter-collapsed 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scroll-enter {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-70px) scale(0.4); }
  100% { opacity: 0.6; transform: translateX(-50%) translateY(-70px) scale(1); }
}

@keyframes scroll-enter-collapsed {
  0%   { opacity: 0; transform: translateX(-50%) translateY(0px) scale(0.4); }
  100% { opacity: 0.6; transform: translateX(-50%) translateY(0px) scale(1); }
}

.scroll.is-clicked {
  animation: scroll-click-pulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.footer-collapse .scroll.is-clicked {
  animation: scroll-click-pulse-collapsed 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scroll-click-pulse {
  0%   { transform: translateX(-50%) translateY(-70px) scale(1.1); }
  40%  { transform: translateX(-50%) translateY(-70px) scale(0.85); }
  100% { transform: translateX(-50%) translateY(-70px) scale(1); }
}

@keyframes scroll-click-pulse-collapsed {
  0%   { transform: translateX(-50%) translateY(0px) scale(1.1); }
  40%  { transform: translateX(-50%) translateY(0px) scale(0.85); }
  100% { transform: translateX(-50%) translateY(0px) scale(1); }
}

.scroll__arrows {
  position: absolute;
  top: 100%;
  left: 50%;
  margin-top: 8px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.scroll__arrow path {
  stroke: #FC3B6E;
}

.scroll__arrow {
  width: 12px;
  height: auto;
  opacity: 0;
  transform: translateY(-4px) scale(0.7);
  animation: scroll-arrow-cue 1.6s cubic-bezier(0.2, 0.9, 0.4, 1.1) infinite;
}

.scroll__arrow:nth-child(1) { animation-delay: 0s; }
.scroll__arrow:nth-child(2) { animation-delay: 0.2s; }

@keyframes scroll-arrow-cue {
  0% {
    opacity: 0;
    transform: translateY(-4px) scale(0.7);
  }
  40% {
    opacity: 1;
    transform: translateY(0px) scale(1);
  }
  75% {
    opacity: 1;
    transform: translateY(1.5px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(4px) scale(0.85);
  }
}

/* ─── Start over (shown on the last section, in place of the scroll hint) ── */

.start-over-btn {
  position: fixed;
  z-index: 10;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px) scale(0.9);
  padding: 18px 48px;
  border: none;
  border-radius: 999px;
  background: var(--secondary);
  color: #fff;
  font-family: "Open Sans", Arial, Helvetica, sans-serif;
  font-size: clamp(0.8rem, 0.95vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s ease;
}

.start-over-btn.is-visible {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0) scale(1);
}

.start-over-btn:hover {
  background: #e02d5c;
}

.footer {
  position: fixed;
  z-index: 1000;
  height: 100vh;
  max-height: 100vh;
  overflow: scroll;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(calc(100vh - 150px));
  border-radius: 30px 30px 0 0;
  background: rgba(94, 108, 133, 0.75);
  color: white;
  transition: transform 0.3s ease-in-out;
  backdrop-filter: blur(10px);
}
.footer.open {
  transform: translateY(0px);
}
.footer.collapse {
  transform: translateY(calc(100vh - 70px));
}
.footer__content-box {
  width: 66vw;
  margin: 0 auto;
}

.footer__header {
  height: 70px;
  display: flex;
  align-items: center;
  font-size: 16px;
}
.footer__header h2 {
  font-size: 16px;
}

.footer__button {
  cursor: pointer;
  position: absolute;
  right: 50px;
  font-size: 10px;
}

.footer.open .footer__button {
  opacity: 0.4;
  pointer-events: none;
}

.footer__button--expand .header__dropdown-arrow {
  transform: translateY(4px) rotate(180deg);
}

.footer__collapse-btn {
  cursor: pointer;
  position: absolute;
  right: 166px;
  font-size: 10px;
}

.footer__collapse-btn span {
  margin-right: 5px;
}
.footer__button span {
  margin-right: 5px;
}
.footer.collapse .footer__collapse-btn {
  opacity: 0.4;
  pointer-events: none;
}


.footer__content {
  font-size: 12px;
}

.footer__content > * {
  padding: 0;
  margin-bottom: 12px;
}

.footer__content ul {
  margin: 0;
  padding-left: 20px;
}

.footer__content h4 {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
}

.footer__boxed-warning {
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 16px 20px;
}

.footer__boxed-warning > * {
  margin-bottom: 12px;
}

.footer__boxed-warning > *:last-child {
  margin-bottom: 0;
}

.footer__legal {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px 0 40px;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.footer__legal-notice {
  flex: 1 1 100%;
  font-size: 12px;
  font-weight: 600;
  color: white;
  margin: 0;
}

.footer__legal-logo {
  height: 28px;
  width: auto;
}

.footer__legal-links {
  display: flex;
  gap: 16px;
  transform: translateY(-3px);
}

.footer__legal-link {
  color: white;
  font-size: 12px;
  text-decoration: underline;
}

.footer__legal-copy {
  flex: 1 1 100%;
  font-size: 10px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* ─── HCP / device gate ──────────────────────────────────────────────────── */
body.gate-active {
  overflow: hidden;
}

.hcp-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 13, 20, 0.6);
  padding: 24px;
  transition: opacity 0.4s ease;
}

.hcp-gate.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.hcp-gate__panel {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border-radius: 16px;
  padding: 40px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.hcp-gate__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.hcp-gate__close:hover {
  opacity: 0.85;
  transform: scale(1.08);
}

.hcp-gate__close svg {
  width: 11px;
  height: 11px;
}

.hcp-gate__text {
  font-size: 14px;
  line-height: 1.55;
  color: #16161f;
  font-weight: 500;
}

.hcp-gate__text--italic {
  font-style: italic;
  font-size: 12px;
  color: #7a7a88;
}

.hcp-gate__continue {
  margin-top: 4px;
  padding: 9px 26px;
  border-radius: 999px;
  border: 1.5px solid var(--secondary);
  background: transparent;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.hcp-gate__continue:hover {
  background: var(--secondary);
  color: #ffffff;
}
