:root {
  /* Compliance vocabulary: Interaction Pattern Pattern:** pieces (3D IntersectionObserver` mouse mapping intensify nearby (increase (Google */
  --claret: #5B1A2E;
  --bloom: #8B2F4F;
  --ivory: #FAF3E0;
  --parchment: #EDE0C8;
  --copper: #C4885B;
  --depth: #3A0E1C;
  --trace: #9E4A6A;
  --tan: #D4B8A0;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--claret); }

body {
  margin: 0;
  height: 500vh;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--ivory);
  background: var(--claret);
  font-family: "Cormorant Garamond", serif;
  cursor: crosshair;
}

#circuitCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: screen;
}

.ribbon {
  position: fixed;
  top: 0;
  left: 0;
  width: 500vw;
  height: 100vh;
  display: flex;
  will-change: transform;
  z-index: 1;
}

.chamber {
  position: relative;
  height: 100vh;
  flex: 0 0 100vw;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 6rem);
  display: flex;
  align-items: center;
}

.chamber::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(58, 14, 28, 0.35), transparent 20%, transparent 80%, rgba(58, 14, 28, 0.4)),
    repeating-linear-gradient(0deg, transparent 0 42px, rgba(250, 243, 224, 0.025) 43px 44px),
    repeating-linear-gradient(90deg, transparent 0 54px, rgba(196, 136, 91, 0.035) 55px 56px);
  pointer-events: none;
}

.chamber-threshold, .chamber-exit { justify-content: center; background: radial-gradient(circle at center, var(--bloom), var(--claret) 48%, var(--depth) 100%); }
.chamber-workshop { background: linear-gradient(120deg, var(--parchment) 0%, var(--ivory) 48%, var(--parchment) 100%); color: var(--claret); }
.chamber-gallery { flex-basis: 150vw; background: var(--ivory); color: var(--claret); align-items: stretch; gap: 5vw; }
.chamber-pattern { flex-basis: 80vw; justify-content: center; background: var(--depth); }
.chamber-exit { flex-basis: 70vw; }

.mono-label, .scroll-cue, .exit-note {
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-lockup {
  position: relative;
  text-align: center;
  z-index: 3;
  padding: clamp(2rem, 5vw, 4rem);
}

.domain-title, h2 {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  line-height: 0.9;
}

.domain-title {
  font-size: clamp(4rem, 10vw, 9rem);
  color: var(--ivory);
  text-shadow: 0 18px 45px rgba(58, 14, 28, 0.8);
}

.domain-title span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: letterReveal 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.domain-title span:nth-child(1) { animation-delay: 0ms; }
.domain-title span:nth-child(2) { animation-delay: 60ms; }
.domain-title span:nth-child(3) { animation-delay: 120ms; }
.domain-title span:nth-child(4) { animation-delay: 180ms; }
.domain-title span:nth-child(5) { animation-delay: 240ms; }
.domain-title span:nth-child(6) { animation-delay: 300ms; }
.domain-title span:nth-child(7) { animation-delay: 360ms; }
.domain-title span:nth-child(8) { animation-delay: 420ms; }
.domain-title span:nth-child(9) { animation-delay: 480ms; }
.domain-title span:nth-child(10) { animation-delay: 540ms; }

@keyframes letterReveal { to { opacity: 1; transform: translateY(0); } }

.title-baseline {
  width: 0;
  height: 2px;
  margin: 1.2rem auto 0;
  background: var(--copper);
  box-shadow: 0 0 24px var(--copper);
  animation: baselineGrow 2s 0.85s ease forwards;
}

@keyframes baselineGrow { to { width: min(72vw, 760px); } }

.mirrored-traces, .exit-network {
  position: absolute;
  inset: 9% auto 9% 6%;
  width: 32vw;
  opacity: 0.55;
  background:
    linear-gradient(var(--trace), var(--trace)) 12% 20%/52% 1px no-repeat,
    linear-gradient(90deg, var(--trace), var(--trace)) 64% 20%/1px 22% no-repeat,
    linear-gradient(var(--trace), var(--trace)) 44% 42%/38% 1px no-repeat,
    radial-gradient(circle, var(--copper) 0 4px, transparent 5px) 12% 20%/100% 100% no-repeat,
    radial-gradient(circle, var(--copper) 0 4px, transparent 5px) 82% 42%/100% 100% no-repeat;
}

.mirrored-traces-right { left: auto; right: 6%; transform: scaleX(-1); }

.scroll-cue {
  position: absolute;
  right: clamp(2rem, 5vw, 6rem);
  bottom: clamp(2rem, 5vw, 5rem);
  display: flex;
  gap: 1rem;
  align-items: center;
  color: var(--parchment);
  animation: cuePulse 1.8s ease-in-out infinite;
  z-index: 4;
}

@keyframes cuePulse { 50% { opacity: 0.45; transform: translateX(10px); } }

.section-heading {
  position: absolute;
  top: clamp(2rem, 5vw, 5rem);
  left: clamp(2rem, 5vw, 6rem);
  z-index: 3;
}

h2 { font-size: clamp(3rem, 8vw, 8rem); color: inherit; }
h3 { margin: 0 0 0.5rem; font-size: clamp(1.35rem, 2vw, 1.9rem); color: var(--claret); font-weight: 600; }
p { font-size: clamp(1rem, 1.8vw, 1.25rem); line-height: 1.72; letter-spacing: 0.01em; font-weight: 500; }

.workshop-cluster {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  max-width: 560px;
}

.cluster-gears { top: 18%; left: 38%; }
.cluster-maze { top: 39%; left: 13%; }
.cluster-cube { right: 7%; bottom: 8%; }

.iso-frame {
  width: 280px;
  height: 280px;
  flex: 0 0 280px;
  filter: drop-shadow(0 18px 22px rgba(91, 26, 46, 0.22));
}

.iso-icon { width: 100%; height: 100%; overflow: visible; }
.face-top { fill: var(--ivory); transition: fill 0.3s ease; }
.face-left { fill: var(--parchment); }
.face-right { fill: var(--tan); }
.iso-icon polygon, .icon-lines * { stroke: var(--trace); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.icon-lines * { fill: none; }

.hoverable:hover .face-top { fill: var(--copper); }
.text-card {
  max-width: 320px;
  padding: 1.25rem 1.45rem;
  background: rgba(250, 243, 224, 0.78);
  border: 1px solid rgba(158, 74, 106, 0.45);
  box-shadow: 0 10px 28px rgba(91, 26, 46, 0.12);
}

.hoverable {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, filter 0.35s ease;
}
.hoverable:hover { transform: translateY(-12px); box-shadow: 0 12px 32px rgba(91, 26, 46, 0.25); }

.gallery-intro {
  width: 30vw;
  min-width: 340px;
  align-self: center;
  position: relative;
  z-index: 3;
}

.puzzle-grid {
  position: relative;
  z-index: 3;
  align-self: center;
  display: grid;
  grid-template-columns: repeat(3, 300px);
  grid-template-rows: repeat(2, 300px);
  gap: 1.6rem;
}

.puzzle-card {
  width: 300px;
  height: 300px;
  padding: 1.2rem;
  background: var(--ivory);
  border: 1px solid var(--claret);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 0 rgba(91, 26, 46, 0.08);
}

.puzzle-card:hover { border-color: var(--bloom); }
.puzzle-card p { margin: 0; font-size: 1rem; line-height: 1.35; }

.mini-iso {
  height: 150px;
  position: relative;
  transform: rotate(-30deg) skewX(30deg) scaleY(0.86);
  margin: 0 auto;
  width: 150px;
}
.mini-iso::before, .mini-iso::after {
  content: "";
  position: absolute;
  border: 2px solid var(--trace);
  background: var(--parchment);
  transition: background 0.3s ease;
}
.puzzle-card:hover .mini-iso::before { background: var(--copper); }
.puzzle-piece::before { inset: 28px 24px 36px 18px; border-radius: 20px 20px 8px 8px; }
.puzzle-piece::after { width: 42px; height: 42px; border-radius: 50%; left: 74px; top: 13px; background: var(--ivory); }
.circuit-board::before { inset: 22px; }
.circuit-board::after { inset: 48px; background: repeating-linear-gradient(90deg, transparent 0 16px, var(--trace) 17px 18px), repeating-linear-gradient(0deg, transparent 0 16px, var(--trace) 17px 18px); }
.hourglass::before { inset: 20px 48px; clip-path: polygon(0 0, 100% 0, 55% 50%, 100% 100%, 0 100%, 45% 50%); }
.hourglass::after { inset: 60px 66px; border-radius: 50%; background: var(--copper); }
.keyed-box::before { inset: 38px 18px 30px; }
.keyed-box::after { width: 44px; height: 44px; border-radius: 50%; left: 52px; top: 70px; background: var(--ivory); }
.ring-maze::before { inset: 15px; border-radius: 50%; }
.ring-maze::after { inset: 45px; border-radius: 50%; background: var(--ivory); }
.split-cube::before { inset: 28px; clip-path: polygon(50% 0, 100% 28%, 100% 72%, 50% 100%, 0 72%, 0 28%); }
.split-cube::after { inset: 28px; background: linear-gradient(90deg, transparent 48%, var(--trace) 49% 51%, transparent 52%); }

#mandalaCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.meditation-card {
  position: relative;
  z-index: 3;
  max-width: 480px;
  padding: clamp(2rem, 4vw, 3.4rem);
  background: rgba(250, 243, 224, 0.88);
  color: var(--claret);
  border: 1px solid rgba(196, 136, 91, 0.65);
  box-shadow: 0 24px 70px rgba(58, 14, 28, 0.7);
  text-align: center;
}

.exit-network {
  inset: 0;
  width: 100%;
  opacity: 0.8;
  background:
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(158, 74, 106, 0.42) 47px 48px),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(196, 136, 91, 0.25) 39px 40px),
    radial-gradient(circle at 20% 30%, rgba(196, 136, 91, 0.7) 0 4px, transparent 5px),
    radial-gradient(circle at 70% 68%, rgba(196, 136, 91, 0.7) 0 4px, transparent 5px),
    radial-gradient(circle at 44% 45%, rgba(250, 243, 224, 0.24), transparent 36%);
  transition: transform 0.7s ease, filter 0.7s ease;
}
.chamber-exit.scatter .exit-network { transform: scale(1.08) rotate(0.8deg); filter: blur(2px); }
.exit-note { color: var(--copper); margin-top: 1.5rem; }

.progress-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  z-index: 10;
  background: rgba(250, 243, 224, 0.2);
}
#progressBar { height: 100%; width: 0%; background: var(--bloom); box-shadow: 0 0 16px var(--copper); }

@media (max-width: 900px) {
  .workshop-cluster { transform: scale(0.78); transform-origin: center; }
  .cluster-gears { left: 24%; }
  .cluster-maze { left: 3%; }
  .cluster-cube { right: -12%; }
  .puzzle-grid { grid-template-columns: repeat(3, 250px); grid-template-rows: repeat(2, 250px); }
  .puzzle-card { width: 250px; height: 250px; }
}
