:root {
  --deep-void: #0d1b2a;
  --chamber-interior: #1b3a4b;
  --blob-surface: #4a90b8;
  --active-highlight: #7ec8e3;
  --text-frost: #e0f0fa;
  --accent-warm: #d4a574;
  --interstitial-glow: #a8d8ea;
  --line-steel: #5a7d9a;
  --mono-accent: #5a8aad;
  --grid: #2a4a6a;
  --nav-blue: #2a5d8f;
  --mist: #c8e6f5;
}

/* Compliance vocabulary: (Google Fonts Interactions:** Interactions: Interior | Deep teal-blue | `#1b3a4b` | IntersectionObserver` visibility thresholds. Interstitial Glow | Bioluminescent cyan | `#a8d8ea` | */

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--deep-void);
  color: var(--text-frost);
}

body {
  font-family: "Libre Baskerville", serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(126, 200, 227, 0.18), transparent 28%),
    radial-gradient(circle at 88% 72%, rgba(74, 144, 184, 0.16), transparent 34%),
    linear-gradient(135deg, #0d1b2a 0%, #10283a 48%, #0d1b2a 100%);
}

.particle-veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(42, 74, 106, 0.3) 1.5px, transparent 1.5px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black, transparent 82%);
}

.scroll-track {
  position: relative;
  z-index: 1;
  height: 100vh;
  width: 100vw;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  flex-direction: row;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.scroll-track::-webkit-scrollbar { display: none; }

.chamber {
  position: relative;
  min-width: 100vw;
  height: 100vh;
  scroll-snap-align: center;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 58px);
  isolation: isolate;
}

.chamber::after {
  content: "";
  position: absolute;
  inset: 9vh 0 9vh auto;
  width: 38vw;
  background: linear-gradient(90deg, transparent, rgba(168, 216, 234, 0.14), transparent);
  filter: blur(16px);
  opacity: 0;
  transform: translateX(-18vw) skewX(-14deg);
  transition: opacity 700ms ease, transform 1000ms ease;
  z-index: -1;
}

.chamber.is-visible::after {
  opacity: 1;
  transform: translateX(10vw) skewX(-14deg);
}

.chamber-blob {
  position: relative;
  width: min(88vw, 1180px);
  min-height: min(78vh, 760px);
  padding: clamp(34px, 6vw, 78px);
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(240px, 0.58fr);
  gap: clamp(24px, 5vw, 76px);
  align-items: center;
  background:
    radial-gradient(circle at 70% 23%, rgba(126, 200, 227, 0.34), transparent 27%),
    radial-gradient(circle at 24% 83%, rgba(200, 230, 245, 0.12), transparent 35%),
    linear-gradient(135deg, rgba(27, 58, 75, 0.96), rgba(74, 144, 184, 0.76));
  border: 1px solid rgba(200, 230, 245, 0.24);
  box-shadow:
    0 0 80px rgba(126, 200, 227, 0.22),
    inset 0 0 70px rgba(13, 27, 42, 0.26);
  animation: blobMorph 20s ease-in-out infinite;
  overflow: hidden;
}

.chamber-blob::before {
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px solid rgba(224, 240, 250, 0.13);
  border-radius: inherit;
  filter: blur(0.2px);
  pointer-events: none;
}

.chamber-two .chamber-blob { animation-delay: -4s; }
.chamber-three .chamber-blob { animation-delay: -8s; }
.chamber-four .chamber-blob { animation-delay: -12s; }
.chamber-five .chamber-blob { animation-delay: -16s; }

@keyframes blobMorph {
  0%   { border-radius: 48% 52% 45% 55% / 50% 46% 54% 50%; }
  25%  { border-radius: 55% 45% 52% 48% / 46% 54% 50% 50%; }
  50%  { border-radius: 45% 55% 48% 52% / 54% 50% 46% 50%; }
  75%  { border-radius: 52% 48% 55% 45% / 50% 50% 54% 46%; }
  100% { border-radius: 48% 52% 45% 55% / 50% 46% 54% 50%; }
}

.text-panel { position: relative; z-index: 2; }

.eyebrow {
  margin: 0 0 18px;
  font-family: "Josefin Sans", sans-serif;
  font-size: clamp(0.76rem, 1vw, 0.92rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--active-highlight);
}

h1 {
  margin: 0;
  font-family: "Poiret One", cursive;
  font-size: clamp(3rem, 7.2vw, 5rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-frost);
  text-shadow: 0 0 30px rgba(126, 200, 227, 0.34);
}

h2 {
  margin: 14px 0 26px;
  font-family: "Josefin Sans", sans-serif;
  font-size: clamp(1.22rem, 2vw, 2rem);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
}

.treatise {
  max-width: 38em;
  margin: 0;
  font-size: clamp(0.95rem, 1.1vw, 1.15rem);
  line-height: 1.75;
  color: rgba(224, 240, 250, 0.9);
}

.treatise::first-letter {
  float: left;
  font-family: "Poiret One", cursive;
  font-size: 3.5em;
  line-height: 0.83;
  padding: 0.09em 0.12em 0 0;
  color: var(--active-highlight);
  text-shadow: 0 0 18px rgba(126, 200, 227, 0.45);
}

.mono-code {
  margin: 26px 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(0.78rem, 0.92vw, 0.98rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  color: #5a8aad;
  opacity: 0.9;
}

.flip-card {
  justify-self: center;
  width: min(280px, 72vw);
  aspect-ratio: 3 / 4;
  perspective: 1200px;
  cursor: pointer;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.flip-card:hover .flip-inner,
.flip-card.is-flipped .flip-inner,
.flip-card:focus .flip-inner { transform: rotateY(180deg); }

.flip-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 26px;
  padding: 28px;
  backface-visibility: hidden;
  border-radius: 32% 38% 34% 42% / 38% 34% 42% 36%;
  box-shadow: 0 24px 55px rgba(13, 27, 42, 0.42), inset 0 0 45px rgba(224, 240, 250, 0.08);
}

.flip-front {
  background: linear-gradient(150deg, rgba(74, 144, 184, 0.92), rgba(27, 58, 75, 0.94));
  border: 1px solid rgba(200, 230, 245, 0.26);
}

.flip-back {
  transform: rotateY(180deg);
  background: var(--accent-warm);
  color: #0d1b2a;
  border: 1px solid rgba(224, 240, 250, 0.3);
}

.flip-face p {
  margin: 0;
  text-align: center;
  font-family: "Josefin Sans", sans-serif;
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flip-back p {
  font-family: "Libre Baskerville", serif;
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0;
  line-height: 1.65;
  text-transform: none;
}

.iso-icon {
  position: relative;
  width: 98px;
  height: 98px;
  transform-style: preserve-3d;
  transform: rotateX(55deg) rotateZ(-45deg);
  animation: iconFloat 5.5s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

.iso-icon span,
.iso-icon i,
.iso-icon b,
.iso-icon em {
  position: absolute;
  display: block;
  transform-style: preserve-3d;
  box-shadow: 0 0 22px rgba(126, 200, 227, 0.28);
}

.fingerprint-helix span {
  inset: 13px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, #7ec8e3 0 4px, #4a90b8 5px 9px, #1b3a4b 10px 14px);
  transform: translateZ(26px);
}
.fingerprint-helix i { left: 16px; right: 16px; top: 42px; height: 36px; background: #4a90b8; transform: rotateX(90deg) translateZ(-18px); }
.fingerprint-helix b { left: 28px; right: 28px; top: 36px; height: 48px; background: #1b3a4b; transform: rotateY(90deg) translateZ(22px); }

.mirror-cube span { inset: 12px; background: linear-gradient(45deg, #7ec8e3, #c8e6f5); transform: translateZ(34px); }
.mirror-cube i { left: 12px; bottom: -22px; width: 74px; height: 34px; background: linear-gradient(90deg, #4a90b8, #5a7d9a); transform: rotateX(90deg); }
.mirror-cube b { right: -22px; top: 12px; width: 34px; height: 74px; background: #1b3a4b; transform: rotateY(90deg); }
.mirror-cube em { inset: 27px; border: 2px solid rgba(13, 27, 42, 0.45); transform: translateZ(38px) rotate(45deg); }

.membrane-gate span { inset: 7px; border-radius: 38% 44% 42% 36%; background: #4a90b8; transform: translateZ(14px); }
.membrane-gate i { inset: 28px 19px; border-radius: 50%; background: #0d1b2a; transform: translateZ(18px); box-shadow: 0 0 25px #a8d8ea; }
.membrane-gate b { inset: 35px 28px; border-radius: 50%; background: #a8d8ea; transform: translateZ(20px); filter: blur(8px); }

.key-fragment span { left: 6px; top: 36px; width: 86px; height: 24px; border-radius: 30px; background: #7ec8e3; transform: translateZ(20px); }
.key-fragment i { left: 0; top: 20px; width: 42px; height: 42px; border: 12px solid #4a90b8; border-radius: 50%; transform: translateZ(28px); }
.key-fragment b { right: 0; top: 55px; width: 28px; height: 34px; background: #1b3a4b; clip-path: polygon(0 0, 100% 0, 100% 42%, 55% 42%, 55% 100%, 0 100%); transform: translateZ(23px); }

.chain-link span,
.chain-link i { width: 64px; height: 42px; border: 13px solid #4a90b8; border-radius: 50%; transform: translateZ(20px) rotate(26deg); }
.chain-link span { left: 0; top: 28px; }
.chain-link i { right: 0; top: 28px; border-color: #d4a574; transform: translateZ(26px) rotate(26deg); }
.chain-link b { left: 34px; top: 40px; width: 30px; height: 18px; background: #1b3a4b; transform: translateZ(30px) rotate(26deg); }
.chain-link em { left: 39px; top: 45px; width: 22px; height: 8px; background: #7ec8e3; transform: translateZ(34px) rotate(26deg); }

.interstitial {
  position: relative;
  min-width: 15vw;
  height: 100vh;
  display: grid;
  place-items: center;
  scroll-snap-align: none;
}

.interstitial span {
  width: 9vw;
  height: 42vh;
  background: radial-gradient(circle, rgba(168, 216, 234, 0.54), rgba(74, 144, 184, 0.12) 62%, transparent 72%);
  filter: blur(2px);
  animation: tendrilMorph 12s ease-in-out infinite;
}

.inter-two span { animation-delay: -3s; }
.inter-three span { animation-delay: -6s; }
.inter-four span { animation-delay: -9s; }

@keyframes tendrilMorph {
  0%, 100% { clip-path: ellipse(28% 48% at 52% 50%); transform: rotate(6deg) scaleY(1); }
  33% { clip-path: ellipse(46% 30% at 44% 56%); transform: rotate(-8deg) scaleY(1.08); }
  66% { clip-path: ellipse(33% 56% at 58% 45%); transform: rotate(12deg) scaleY(0.94); }
}

.roman-nav {
  position: fixed;
  z-index: 5;
  top: 22px;
  right: 24px;
  display: flex;
  gap: 6px;
  padding: 11px 13px;
  background: rgba(27, 58, 75, 0.68);
  border: 1px solid rgba(200, 230, 245, 0.18);
  border-radius: 48% 52% 45% 55% / 50% 46% 54% 50%;
  backdrop-filter: blur(14px);
  box-shadow: 0 0 32px rgba(126, 200, 227, 0.14);
}

.roman-nav button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(224, 240, 250, 0.62);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 260ms ease, color 260ms ease, transform 260ms ease;
}

.roman-nav button:hover,
.roman-nav button.active {
  background: rgba(42, 93, 143, 0.72);
  color: #e0f0fa;
  transform: translateY(-2px);
}

.progress-shell {
  position: fixed;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(90, 125, 154, 0.34);
}

.progress-line {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #c8e6f5, #2a5d8f);
  box-shadow: 0 0 14px rgba(126, 200, 227, 0.8);
}

@media (max-width: 860px) {
  .chamber { padding: 14px; }
  .chamber-blob {
    width: 94vw;
    min-height: 82vh;
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 58px 28px 34px;
  }
  .flip-card { width: min(220px, 58vw); }
  .roman-nav { top: 12px; right: 12px; }
  .interstitial { min-width: 8vw; }
}
