/* PPUZZL.net v2 — Bathyspheric Honeycomb Reliquary
   Aesthetic: neubrutalism, hexagonal-honeycomb, playful-rounded type, ocean-deep palette,
              tilt-3d, organic-blobs, crystalline motifs, opulent-grand tone.
   Palette:
     #000810 Trench Black     #02132A Abyssal Charcoal
     #0E2240 Bathyal Indigo   #114B7A Mid-Pelagic
     #1F7BAA Sodium Glow Cyan #F5C152 Beeswax Amber
     #FFE08A Honey Highlight  #E5413B Distress Coral
     #F2E7D2 Calcite Cream
   Fonts: Fredoka, Baloo 2, Inter, Space Mono.
*/

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

:root {
  --trench: #000810;
  --abyssal: #02132A;
  --indigo: #0E2240;
  --mid-pelagic: #114B7A;
  --sodium: #1F7BAA;
  --amber: #F5C152;
  --honey: #FFE08A;
  --coral: #E5413B;
  --cream: #F2E7D2;

  --border-w: 4px;
  --shadow-off: 7px;
  --hex-radius: 6px;

  --scroll-progress: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--trench);
}

body {
  background: var(--trench);
  color: var(--cream);
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(15px, 1vw, 17px);
  line-height: 1.55;
  overflow-x: hidden;
  cursor: none;
  perspective: 1800px;
  perspective-origin: 50% 30%;
  min-height: 100vh;
}

a {
  color: var(--sodium);
  text-decoration: none;
  cursor: none;
}
a:hover { color: var(--honey); }

button {
  font: inherit;
  background: none;
  border: none;
  cursor: none;
  color: inherit;
}

/* ================= Beeswax-mortar noise overlay (page-wide) ================= */
.beeswax-mortar {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.55;
}
.beeswax-mortar svg { width: 100%; height: 100%; display: block; }

/* ================= Custom cursor ================= */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 22px;
  height: 22px;
  z-index: 9999;
  pointer-events: none;
  transform: translate3d(-50px, -50px, 0) rotate(15deg);
  transition: transform 0.05s linear;
  filter: drop-shadow(0 0 6px rgba(255, 224, 138, 0.65));
}
.cursor svg { width: 100%; height: 100%; }

.cursor-trail {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}
.trail-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sodium);
  box-shadow: 0 0 12px var(--sodium);
  transform: translate(-50%, -50%);
  animation: trailFade 280ms linear forwards;
  pointer-events: none;
}
@keyframes trailFade {
  0%   { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0;    transform: translate(-50%, -50%) scale(0.3); }
}

/* ================= Audio toggle ================= */
.audio-toggle {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--abyssal);
  border: 3px solid var(--trench);
  box-shadow: var(--shadow-off) var(--shadow-off) 0 var(--mid-pelagic);
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--honey);
  transition: transform 200ms ease;
}
.audio-toggle:hover {
  transform: translate(-2px, -2px);
  box-shadow: calc(var(--shadow-off) + 2px) calc(var(--shadow-off) + 2px) 0 var(--mid-pelagic);
}
.audio-toggle svg { width: 22px; height: 22px; }
.audio-toggle.active { background: var(--coral); color: var(--cream); }

/* ================= Depth meter (zone header) ================= */
.depth-meter {
  position: relative;
  z-index: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin: 30px 0 0 30px;
  background: var(--trench);
  border: 3px solid var(--cream);
  box-shadow: 6px 6px 0 var(--sodium);
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: clamp(13px, 0.95vw, 15px);
  color: var(--cream);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.depth-meter .depth-num { color: var(--honey); }
.depth-meter .depth-sep { color: var(--sodium); }
.depth-meter::after {
  content: "";
  display: block;
  position: absolute;
  bottom: -7px;
  left: 12px;
  width: 60%;
  height: 2px;
  background: var(--sodium);
}

/* ================= Zone wrapper ================= */
.zone {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 0 80px;
  overflow: hidden;
  isolation: isolate;
}

.zone-atrium   { min-height: 100vh;  background: var(--trench); }
.zone-twilight { min-height: 150vh;  background: linear-gradient(180deg, var(--trench) 0%, var(--abyssal) 100%); }
.zone-bathyal  { min-height: 120vh;  background: linear-gradient(180deg, var(--abyssal) 0%, var(--indigo) 100%); }
.zone-hadal    { min-height: 140vh;  background: linear-gradient(180deg, var(--indigo) 0%, var(--abyssal) 80%, var(--trench) 100%); }

/* ================= Organic blobs ================= */
.blob-layer {
  position: absolute;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  mix-blend-mode: screen;
  opacity: 0.22;
}
.blob-1 {
  width: 540px;
  height: 540px;
  top: 10%;
  left: -10%;
  background: radial-gradient(circle, var(--mid-pelagic) 0%, transparent 70%);
  animation: blobDrift 11s ease-in-out infinite alternate;
}
.blob-2 {
  width: 420px;
  height: 420px;
  top: 50%;
  right: -8%;
  background: radial-gradient(circle, var(--sodium) 0%, transparent 70%);
  animation: blobDrift 14s ease-in-out infinite alternate-reverse;
  opacity: 0.18;
}
.blob-3 {
  width: 660px;
  height: 660px;
  bottom: -20%;
  left: 30%;
  background: radial-gradient(circle, var(--indigo) 0%, transparent 70%);
  animation: blobDrift 8s ease-in-out infinite alternate;
  opacity: 0.32;
}
@keyframes blobDrift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, -40px) scale(1.08); }
  100% { transform: translate(-30px, 50px) scale(0.95); }
}

/* ================= Zone intro headings ================= */
.zone-intro {
  position: relative;
  z-index: 500;
  max-width: 760px;
  margin: 40px 0 50px 8vw;
  padding-right: 24px;
}
.zone-title {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: clamp(34px, 4.6vw, 72px);
  letter-spacing: -0.01em;
  color: var(--honey);
  line-height: 1.05;
  transform: rotate(var(--tilt, 0deg));
  display: inline-block;
  text-shadow: 5px 5px 0 var(--trench);
}
.zone-sub {
  margin-top: 18px;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: clamp(15px, 1.1vw, 18px);
  line-height: 1.55;
  color: var(--cream);
  max-width: 56ch;
}

/* ================= Hex shapes (the foundation) ================= */
.hex {
  position: relative;
  display: block;
  transform-style: preserve-3d;
  transition: transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1);
  --tilt-x: 0deg;
  --tilt-y: 0deg;
}
.hex-shadow {
  position: absolute;
  inset: 0;
  background: var(--mid-pelagic);
  clip-path: polygon(50% 2%, 96% 28%, 96% 87%, 50% 113%, 4% 87%, 4% 28%);
  transform: translate3d(var(--shadow-off), var(--shadow-off), -1px);
  z-index: -1;
  pointer-events: none;
}
.hex-shape {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--amber);
  clip-path: polygon(50% 2%, 96% 28%, 96% 87%, 50% 113%, 4% 87%, 4% 28%);
  border: 0;
  transform:
    rotateX(calc(var(--tilt-x) + var(--scroll-progress) * 2deg))
    rotateY(calc(var(--tilt-y) - var(--scroll-progress) * 1.5deg));
  transition: transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 280ms ease;
}
/* Black-border trick: draw a slightly larger black hex behind */
.hex .hex-shape::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: var(--trench);
  clip-path: polygon(50% 2%, 96% 28%, 96% 87%, 50% 113%, 4% 87%, 4% 28%);
  z-index: -1;
  transform: scale(1.05);
  transform-origin: 50% 50%;
}
.hex .hex-shape::after {
  /* sodium underglow */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255, 224, 138, 0.5) 0%, transparent 55%),
              radial-gradient(circle at 70% 80%, rgba(31, 123, 170, 0.32) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}
.hex-inner {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  padding: 14% 12% 16%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--trench);
}
.hex:hover .hex-shape {
  transform: rotateX(0deg) rotateY(0deg);
  filter: brightness(1.08);
}
.hex.is-pulse .hex-shape {
  animation: hexPulse 280ms ease-out;
}
@keyframes hexPulse {
  0%   { box-shadow: 0 0 0 0 var(--honey); filter: brightness(1.15); }
  100% { box-shadow: 0 0 0 24px transparent; filter: brightness(1); }
}

.hex.is-wobble .hex-shape {
  animation: wobble 700ms ease-out;
}
@keyframes wobble {
  0%   { transform: translate3d(0,0,0) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)); border-color: var(--coral); }
  20%  { transform: translate3d(-12px,0,0) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)); }
  40%  { transform: translate3d(10px,0,0); }
  60%  { transform: translate3d(-6px,0,0); }
  80%  { transform: translate3d(3px,0,0); }
  100% { transform: translate3d(0,0,0) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)); }
}

.hex.is-extrude .hex-shape {
  transform: rotateX(0deg) rotateY(0deg) translateZ(80px) !important;
}
.hex.is-recede .hex-shape {
  transform: translateZ(-20px)
    rotateX(calc(var(--tilt-x) + var(--scroll-progress) * 2deg))
    rotateY(calc(var(--tilt-y) - var(--scroll-progress) * 1.5deg)) !important;
  filter: brightness(0.85);
}

/* ================= ATRIUM grid ================= */
.atrium-grid {
  position: relative;
  z-index: 400;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, auto);
  gap: 24px 18px;
  margin: 30px 5vw 0;
  padding-bottom: 60px;
  align-items: start;
}

.hex-atrium {
  grid-column: 1 / span 3;
  grid-row: 1 / span 3;
  width: clamp(20rem, 36vw, 35rem);
  aspect-ratio: 1 / 1.15;
}

.hex-bell {
  grid-column: 4 / span 2;
  grid-row: 1 / span 2;
  width: clamp(13rem, 22vw, 22rem);
  aspect-ratio: 1 / 1.15;
}

.hex-sm {
  width: clamp(8rem, 12vw, 14rem);
  aspect-ratio: 1 / 1.15;
}

.hex-sm:nth-of-type(3)  { grid-column: 6 / span 1; grid-row: 1; }
.hex-sm:nth-of-type(4)  { grid-column: 6 / span 1; grid-row: 2; }
.hex-sm:nth-of-type(5)  { grid-column: 4 / span 1; grid-row: 3; }
.hex-sm:nth-of-type(6)  { grid-column: 5 / span 1; grid-row: 3; }
.hex-sm:nth-of-type(7)  { grid-column: 6 / span 1; grid-row: 3; }
.hex-sm:nth-of-type(8)  { grid-column: 4 / span 1; grid-row: 4; }

/* Atrium content */
.atrium-eyebrow {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--trench);
  background: var(--coral);
  padding: 4px 10px;
  border: 2px solid var(--trench);
  margin-bottom: 12px;
  color: var(--cream);
}
.wordmark {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: clamp(34px, 5.4vw, 78px);
  letter-spacing: -0.02em;
  color: var(--trench);
  line-height: 0.95;
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
}
.wm-char {
  display: inline-block;
  transform: translateY(0);
}
.wm-z-crystal {
  display: inline-block;
  width: clamp(34px, 5vw, 70px);
  vertical-align: middle;
  animation: zRotate 9s linear infinite;
  filter: drop-shadow(3px 3px 0 var(--trench));
}
.z-crystal { width: 100%; height: auto; }
@keyframes zRotate {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}
.wm-tld {
  font-size: 0.45em;
  margin-left: 4px;
  color: var(--coral);
}
.atrium-tag {
  margin-top: 12px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: clamp(16px, 1.5vw, 22px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--trench);
}
.atrium-meta {
  margin-top: 18px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.meta-mono {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  color: var(--trench);
  background: var(--honey);
  padding: 3px 8px;
  border: 2px solid var(--trench);
}

/* Diving bell hex */
.hex-bell .hex-inner {
  padding: 8% 8% 10%;
  justify-content: flex-start;
  position: relative;
}
.coral-rope {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 4px;
  height: 60px;
  background: var(--coral);
  border-left: 1px solid var(--trench);
  border-right: 1px solid var(--trench);
  transform: translateX(-50%);
  z-index: 4;
}
.diving-bell {
  width: 70%;
  max-width: 160px;
  margin-top: 18px;
  animation: bellSwing 6s ease-in-out infinite alternate;
  transform-origin: 50% 0;
}
@keyframes bellSwing {
  0%   { transform: rotate(-3deg) translateY(0); }
  100% { transform: rotate(3deg) translateY(8px); }
}
.bell-caption {
  margin-top: 6px;
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  color: var(--trench);
  letter-spacing: 0.08em;
}

/* Small atrium hex */
.sm-inner {
  padding: 18% 12%;
}
.sm-depth {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: clamp(13px, 1.1vw, 17px);
  color: var(--trench);
  background: var(--cream);
  padding: 3px 6px;
  border: 2px solid var(--trench);
  margin-bottom: 8px;
}
.sm-label {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: clamp(11px, 0.85vw, 13px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--trench);
}

/* ================= TWILIGHT honeycomb wall ================= */
.honeycomb-wall {
  position: relative;
  z-index: 400;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px 16px;
  margin: 30px 5vw 0;
  align-items: start;
}
/* Offset every other row */
.hex-cell {
  width: 100%;
  aspect-ratio: 1 / 1.15;
}
.honeycomb-wall .hex-cell:nth-child(6n + 4),
.honeycomb-wall .hex-cell:nth-child(6n + 5),
.honeycomb-wall .hex-cell:nth-child(6n + 6) {
  transform: translateY(0);
}
.honeycomb-wall .hex-cell:nth-child(6n + 1) { transform: translateY(0); }
.honeycomb-wall .hex-cell:nth-child(6n + 2) { transform: translateY(28px); }
.honeycomb-wall .hex-cell:nth-child(6n + 3) { transform: translateY(0); }

.cell-inner { padding: 12% 10% 14%; }
.cell-cat {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: clamp(13px, 1.1vw, 18px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--trench);
  background: var(--trench);
  color: var(--honey);
  padding: 3px 8px;
  border: 2px solid var(--trench);
  margin-bottom: 8px;
}
.crystal {
  width: 56%;
  max-width: 92px;
  margin: 6px 0;
  animation: crystalSpin 24s linear infinite;
  transform-style: preserve-3d;
  filter: drop-shadow(0 0 8px rgba(255, 224, 138, 0.5));
}
@keyframes crystalSpin {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}
.hex:hover .crystal { animation-duration: 4s; }

.cell-num {
  margin-top: 4px;
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: clamp(15px, 1.3vw, 19px);
  color: var(--trench);
  background: var(--cream);
  padding: 2px 8px;
  border: 2px solid var(--trench);
}
.cell-label {
  margin-top: 2px;
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--trench);
}

/* ================= BATHYAL pressure manifold ================= */
.telegraph-tape {
  position: absolute;
  top: 8px;
  left: 0;
  width: 100%;
  height: 34px;
  z-index: 200;
  background: var(--abyssal);
  border-top: 3px solid var(--coral);
  border-bottom: 3px solid var(--coral);
  overflow: hidden;
  pointer-events: none;
}
.tape-track {
  display: inline-block;
  white-space: nowrap;
  animation: tapeScroll 40s linear infinite;
}
.tape-msg {
  display: inline-block;
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 14px;
  color: var(--coral);
  letter-spacing: 0.1em;
  padding: 6px 0;
}
@keyframes tapeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.manifold {
  position: relative;
  z-index: 400;
  width: 90vw;
  max-width: 1200px;
  aspect-ratio: 1 / 0.88;
  margin: 40px auto 0;
  transform-style: preserve-3d;
}
.manifold-shadow {
  position: absolute;
  inset: 0;
  background: var(--mid-pelagic);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  transform: translate(10px, 10px);
  z-index: -1;
}
.manifold-shell {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--trench);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  display: grid;
  place-items: center;
  transform: rotate(calc(var(--scroll-progress) * 3deg));
  transition: transform 220ms ease;
}
.manifold-inner {
  position: relative;
  width: 96%;
  height: 96%;
  background: var(--indigo);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  place-items: center;
  padding: 2%;
}

/* Center chamber spans 1x1 grid center but is much larger */
.chamber-center {
  grid-column: 2;
  grid-row: 2;
  width: 78%;
  aspect-ratio: 1 / 1.15;
  background: var(--trench);
  clip-path: polygon(50% 2%, 96% 28%, 96% 87%, 50% 113%, 4% 87%, 4% 28%);
  border: 0;
  outline: 4px solid var(--trench);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10%;
  text-align: center;
  color: var(--cream);
  position: relative;
  transform:
    rotateX(calc(var(--tilt-x) + var(--scroll-progress) * 2deg))
    rotateY(calc(var(--tilt-y) - var(--scroll-progress) * 1.5deg));
  transform-style: preserve-3d;
}
.chamber-center::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 224, 138, 0.32) 0%, transparent 60%),
    var(--abyssal);
  clip-path: polygon(50% 2%, 96% 28%, 96% 87%, 50% 113%, 4% 87%, 4% 28%);
  z-index: 0;
}
.chamber-center > * { position: relative; z-index: 2; }
.featured-crystal {
  width: 60%;
  max-width: 200px;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 14px rgba(255, 224, 138, 0.55));
  animation: crystalSpin 24s linear infinite;
}
.featured-title {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--honey);
  margin-bottom: 6px;
}
.featured-name {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: clamp(20px, 2vw, 30px);
  letter-spacing: -0.01em;
  color: var(--amber);
  text-shadow: 3px 3px 0 var(--trench);
  margin-bottom: 8px;
}
.featured-desc {
  font-family: "Inter", sans-serif;
  font-size: clamp(13px, 0.95vw, 15px);
  color: var(--cream);
  max-width: 32ch;
}

/* Side chambers */
.chamber-side {
  width: 92%;
  aspect-ratio: 1 / 1.15;
  background: var(--amber);
  clip-path: polygon(50% 2%, 96% 28%, 96% 87%, 50% 113%, 4% 87%, 4% 28%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8%;
  text-align: center;
  color: var(--trench);
  position: relative;
  transform:
    rotateX(calc(var(--tilt-x) + var(--scroll-progress) * 2deg))
    rotateY(calc(var(--tilt-y) - var(--scroll-progress) * 1.5deg));
  transition: transform 320ms ease;
}
.chamber-side::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: var(--trench);
  clip-path: polygon(50% 2%, 96% 28%, 96% 87%, 50% 113%, 4% 87%, 4% 28%);
  transform: scale(1.04);
  z-index: -1;
}
.chamber-side::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255, 224, 138, 0.4) 0%, transparent 60%);
  clip-path: polygon(50% 2%, 96% 28%, 96% 87%, 50% 113%, 4% 87%, 4% 28%);
  pointer-events: none;
}
.chamber-side > * { position: relative; z-index: 1; }
.cs-1 { grid-column: 1; grid-row: 1; }
.cs-2 { grid-column: 2; grid-row: 1; }
.cs-3 { grid-column: 3; grid-row: 1; }
.cs-4 { grid-column: 1; grid-row: 3; }
.cs-5 { grid-column: 2; grid-row: 3; }
.cs-6 { grid-column: 3; grid-row: 3; }

.chamber-label {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: clamp(12px, 1vw, 16px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--trench);
  color: var(--honey);
  padding: 3px 8px;
  border: 2px solid var(--trench);
  margin-bottom: 6px;
}
.chamber-value {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: clamp(20px, 2.4vw, 36px);
  color: var(--trench);
  line-height: 1.05;
  text-shadow: 2px 2px 0 var(--cream);
}
.chamber-mono {
  margin-top: 4px;
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--trench);
}
.chamber-bar {
  margin-top: 6px;
  width: 80%;
  height: 8px;
  background: var(--cream);
  border: 2px solid var(--trench);
}
.chamber-bar-fill {
  height: 100%;
  background: var(--coral);
}

/* ================= HADAL silt floor ================= */
.hadal-stage {
  position: relative;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 60px 5vw 0;
}

.hex-footer {
  width: clamp(20rem, 60vw, 50rem);
  aspect-ratio: 1 / 0.85;
  margin-bottom: 30px;
}
.hex-footer .hex-shape {
  clip-path: polygon(50% 2%, 96% 28%, 96% 87%, 50% 113%, 4% 87%, 4% 28%);
}
.footer-inner {
  padding: 10% 8% 14%;
  justify-content: center;
}
.footer-title {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: clamp(22px, 2.4vw, 36px);
  color: var(--trench);
  margin-bottom: 18px;
  letter-spacing: -0.01em;
  text-shadow: 3px 3px 0 var(--cream);
}
.contact-glyphs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 22px;
  margin-bottom: 18px;
}
.glyph {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--trench);
  transition: transform 220ms ease;
}
.glyph svg {
  width: clamp(54px, 6vw, 78px);
  height: auto;
  filter: drop-shadow(4px 4px 0 var(--trench));
  transition: transform 280ms ease;
}
.glyph:hover { transform: translate(-2px, -2px); color: var(--coral); }
.glyph:hover svg { transform: rotate(-8deg) scale(1.05); }

.footer-mono {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: clamp(11px, 0.9vw, 13px);
  color: var(--trench);
  background: var(--honey);
  padding: 4px 10px;
  border: 2px solid var(--trench);
  display: inline-block;
  letter-spacing: 0.06em;
}

/* Silt row of half-hexes */
.silt-row {
  position: relative;
  z-index: 400;
  width: 100%;
  display: flex;
  justify-content: space-evenly;
  align-items: flex-end;
  height: 130px;
  margin-top: 30px;
  background: linear-gradient(180deg, transparent 0%, var(--abyssal) 50%, var(--trench) 100%);
}
.half-hex {
  width: clamp(11rem, 14vw, 16rem);
  aspect-ratio: 1 / 1.15;
  background: var(--amber);
  clip-path: polygon(50% 2%, 96% 28%, 96% 87%, 50% 113%, 4% 87%, 4% 28%);
  border: 0;
  margin-bottom: -55%;
  position: relative;
  transform:
    rotateX(calc(var(--tilt-x) + var(--scroll-progress) * 2deg))
    rotateY(calc(var(--tilt-y) - var(--scroll-progress) * 1.5deg));
}
.half-hex::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: var(--trench);
  clip-path: polygon(50% 2%, 96% 28%, 96% 87%, 50% 113%, 4% 87%, 4% 28%);
  transform: scale(1.04);
  z-index: -1;
}
.half-hex::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 224, 138, 0.55) 0%, transparent 55%),
    linear-gradient(180deg, transparent 0%, var(--abyssal) 60%, var(--trench) 100%);
  clip-path: polygon(50% 2%, 96% 28%, 96% 87%, 50% 113%, 4% 87%, 4% 28%);
  pointer-events: none;
}

.impact-band {
  width: 100%;
  height: 60px;
  background: var(--trench);
  margin-top: 60px;
}

/* ================= Detail stage (in-grid solve view) ================= */
.detail-stage {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(540px, 86vw);
  z-index: 700;
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  pointer-events: none;
  transition: transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 280ms ease;
}
.detail-stage[data-active="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.detail-card {
  background: var(--amber);
  border: 4px solid var(--trench);
  box-shadow: 8px 8px 0 var(--coral);
  padding: 28px 26px 24px;
  color: var(--trench);
  position: relative;
}
.detail-cat {
  display: inline-block;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--trench);
  color: var(--honey);
  padding: 4px 10px;
  border: 2px solid var(--trench);
  margin-bottom: 10px;
}
.detail-title {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: clamp(26px, 3vw, 40px);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  text-shadow: 3px 3px 0 var(--cream);
}
.detail-body {
  font-family: "Inter", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--trench);
  margin-bottom: 14px;
}
.detail-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}
.solve-btn, .close-btn {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 18px;
  border: 3px solid var(--trench);
  box-shadow: 5px 5px 0 var(--trench);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.solve-btn {
  background: var(--coral);
  color: var(--cream);
}
.close-btn {
  background: var(--cream);
  color: var(--trench);
}
.solve-btn:hover, .close-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--trench);
}
.solve-btn:active, .close-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--trench);
}
.detail-mono {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--trench);
  background: var(--honey);
  padding: 3px 8px;
  border: 2px solid var(--trench);
  display: inline-block;
}

/* ================= Solve confetti (amber bees) ================= */
.bee-confetti {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  background: var(--amber);
  clip-path: polygon(50% 2%, 96% 28%, 96% 87%, 50% 113%, 4% 87%, 4% 28%);
  border: 2px solid var(--trench);
  pointer-events: none;
  z-index: 800;
  animation: beeFly 900ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
@keyframes beeFly {
  0%   { transform: translate(-50%, -50%) scale(0.4) rotate(0deg); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--bx, 0px)), calc(-50% + var(--by, 0px))) scale(1.4) rotate(720deg); opacity: 0; }
}

/* ================= Page-load intro (descending hexes) ================= */
.hex {
  opacity: 0;
  transform: translateY(-60vh) scale(0.95);
  animation: hexDescend 900ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.hex.hex-atrium { animation-delay: 100ms; }
.hex.hex-bell   { animation-delay: 220ms; }
.hex.hex-sm:nth-of-type(3)  { animation-delay: 320ms; }
.hex.hex-sm:nth-of-type(4)  { animation-delay: 380ms; }
.hex.hex-sm:nth-of-type(5)  { animation-delay: 440ms; }
.hex.hex-sm:nth-of-type(6)  { animation-delay: 500ms; }
.hex.hex-sm:nth-of-type(7)  { animation-delay: 560ms; }
.hex.hex-sm:nth-of-type(8)  { animation-delay: 620ms; }
@keyframes hexDescend {
  0%   { opacity: 0; transform: translateY(-60vh) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
/* Twilight cells reveal staggered on intersection — keep CSS animation only for atrium */
.hex.hex-cell {
  opacity: 0;
  transform: translateY(40px) scale(0.96);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: none;
}
.hex.hex-cell.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.hex.hex-footer {
  animation: none;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 800ms ease, transform 800ms ease;
}
.hex.hex-footer.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================= Responsive: < 900px collapses to vertical descent ================= */
@media (max-width: 900px) {
  body { perspective: 1200px; }

  .atrium-grid,
  .honeycomb-wall {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 6vw 0;
    gap: 36px;
  }

  .hex-atrium,
  .hex-bell,
  .hex-sm,
  .hex-cell {
    width: 88vw !important;
    aspect-ratio: 1 / 1.15;
    grid-column: auto !important;
    grid-row: auto !important;
    transform: translateY(0) !important;
  }

  .silt-row {
    flex-wrap: wrap;
    height: auto;
    gap: 8px;
    padding-top: 30px;
  }
  .half-hex {
    width: 28vw;
    margin-bottom: 0;
  }

  .manifold {
    width: 92vw;
    aspect-ratio: 1 / 1;
  }
  .manifold-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .chamber-side, .chamber-center {
    width: 80%;
    grid-column: 1 !important;
    grid-row: auto !important;
    margin: 6px auto;
  }
}
