:root {
  --void: #0a0a0a;
  --card: #1a1a1a;
  --strip: #2a2a2a;
  --border: #3a3a3a;
  --muted: #5a5a5a;
  --mid: #8a8a8a;
  --body: #b0b0b0;
  --near: #e0e0e0;
  --flash: #ffffff;
  --bleed: #ff003c;
  --scroll-bg: 0px;
  --scroll-fg: 0px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--body);
  background:
    radial-gradient(circle at 18% 8%, rgba(224,224,224,0.055), transparent 32vw),
    radial-gradient(circle at 82% 22%, rgba(90,90,90,0.11), transparent 28vw),
    linear-gradient(135deg, #0a0a0a 0%, #111111 48%, #0a0a0a 100%);
  font-family: "Outfit", Arial, sans-serif;
  font-weight: 300;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

.scan-field {
  position: fixed;
  inset: -20vh 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.95;
  transform: translateY(var(--scroll-bg)) translateZ(-60px);
  background:
    repeating-linear-gradient(transparent, transparent 2px, rgba(180,180,180,0.07) 2px, rgba(180,180,180,0.07) 3px),
    repeating-linear-gradient(90deg, transparent, transparent 46px, rgba(58,58,58,0.09) 47px, transparent 48px);
}

.scan-sweep {
  position: fixed;
  left: 0;
  top: -4px;
  width: 100%;
  height: 2px;
  z-index: 4;
  pointer-events: none;
  background: rgba(255,255,255,0.05);
  box-shadow: 0 0 24px rgba(224,224,224,0.18);
  animation: sweep 12s linear infinite;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid rgba(58,58,58,0.8);
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(12px);
}

.wordmark {
  font-family: "Chakra Petch", Arial, sans-serif;
  font-weight: 600;
  color: var(--near);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
}

.nav-links { display: flex; gap: clamp(14px, 3vw, 34px); }

.nav-links a {
  font-family: "Share Tech Mono", monospace;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.7rem;
  text-transform: uppercase;
  transition: color 180ms ease, text-shadow 100ms ease;
}

.nav-links a:hover { color: var(--near); text-shadow: -2px 0 var(--bleed), 2px 0 #00f0ff; }

.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 20px clamp(14px, 3vw, 44px) 72px;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.masonry-board {
  column-count: 3;
  column-gap: 20px;
  transform-style: preserve-3d;
}

.continuity-card {
  position: relative;
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  margin: 0 0 20px;
  padding: 28px 24px 23px 33px;
  min-height: 430px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(26,26,26,0.96), rgba(18,18,18,0.98));
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transform-style: preserve-3d;
  transition: transform 400ms cubic-bezier(.2,.8,.15,1), box-shadow 400ms cubic-bezier(.2,.8,.15,1), border-color 180ms ease, opacity 90ms linear;
}

.continuity-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: repeating-linear-gradient(to bottom, var(--card) 0 6px, var(--strip) 6px 12px);
}

.continuity-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background: linear-gradient(110deg, transparent 0 42%, rgba(224,224,224,0.035) 43%, transparent 49% 100%);
}

.continuity-card:hover {
  transform: translateZ(30px) scale(1.018);
  border-color: var(--mid);
  box-shadow: 0 22px 44px rgba(0,0,0,0.55);
}

.depth-forward { transform: translateZ(60px); }
.depth-mid { transform: translateZ(0); }
.depth-back { transform: translateZ(-40px); }
.depth-forward:hover, .depth-mid:hover, .depth-back:hover { transform: translateZ(30px) scale(1.018); }

.continuity-card.tall { min-height: 550px; }
.continuity-card.short { min-height: 335px; }
.continuity-card.wide-feel { min-height: 490px; }

h1, h2 {
  position: relative;
  z-index: 2;
  margin: 18px 0 12px;
  font-family: "Chakra Petch", Arial, sans-serif;
  font-weight: 600;
  font-size: clamp(1.6rem, 4vw, 3.2rem);
  line-height: 0.95;
  color: var(--near);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: text-shadow 80ms linear, color 80ms linear, transform 80ms linear;
}

p {
  position: relative;
  z-index: 2;
  margin: 0;
  color: var(--body);
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
}

small, .card-time, .edge-code {
  font-family: "Share Tech Mono", monospace;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.65rem;
  text-transform: uppercase;
}

small {
  position: relative;
  z-index: 2;
  display: block;
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid rgba(58,58,58,0.72);
}

.card-time {
  position: absolute;
  top: 13px;
  right: 14px;
  z-index: 3;
}

.edge-timecodes {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  transform: translateY(var(--scroll-fg)) translateZ(60px);
}

.edge-code {
  position: absolute;
  opacity: 0.4;
  font-size: 0.7rem;
  transition: opacity 80ms linear, text-shadow 80ms linear, color 80ms linear;
}

.edge-code:nth-child(1) { left: 14px; top: 72px; }
.edge-code:nth-child(2) { right: 18px; top: 31vh; writing-mode: vertical-rl; }
.edge-code:nth-child(3) { left: 22px; bottom: 18vh; }
.edge-code:nth-child(4) { right: 24px; bottom: 54px; }
.edge-code:nth-child(5) { left: 50%; top: 58px; transform: translateX(-50%); }

.object-scene {
  position: relative;
  z-index: 2;
  height: 190px;
  display: grid;
  place-items: center;
  margin: 16px 0 20px;
  perspective: 800px;
  transform-style: preserve-3d;
  background:
    radial-gradient(circle, rgba(224,224,224,0.10), transparent 42%),
    linear-gradient(90deg, transparent 0 49%, rgba(224,224,224,0.07) 50%, transparent 51% 100%);
}

.tall .object-scene { height: 260px; }
.short .object-scene { height: 140px; }

.object-3d {
  position: relative;
  width: 96px;
  height: 96px;
  transform-style: preserve-3d;
  will-change: transform;
  animation: spin 24s linear infinite;
}

.face {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(224,224,224,0.48);
  background: linear-gradient(135deg, #5a5a5a, #2a2a2a 54%, #1a1a1a);
}

.cube .front { transform: translateZ(48px); }
.cube .back { transform: rotateY(180deg) translateZ(48px); }
.cube .right { transform: rotateY(90deg) translateZ(48px); background: linear-gradient(135deg, #3a3a3a, #1a1a1a); }
.cube .left { transform: rotateY(-90deg) translateZ(48px); background: linear-gradient(135deg, #1a1a1a, #5a5a5a); }
.cube .top { transform: rotateX(90deg) translateZ(48px); background: linear-gradient(135deg, #e0e0e0, #5a5a5a 45%, #2a2a2a); }
.cube .bottom { transform: rotateX(-90deg) translateZ(48px); background: #1a1a1a; }

.alternate .cube { width: 82px; height: 82px; animation-duration: 29s; }
.alternate .cube .front { transform: translateZ(41px); }
.alternate .cube .back { transform: rotateY(180deg) translateZ(41px); }
.alternate .cube .right { transform: rotateY(90deg) translateZ(41px); }
.alternate .cube .left { transform: rotateY(-90deg) translateZ(41px); }
.alternate .cube .top { transform: rotateX(90deg) translateZ(41px); }
.alternate .cube .bottom { transform: rotateX(-90deg) translateZ(41px); }

.torus { width: 138px; height: 138px; animation-duration: 30s; }
.torus i {
  position: absolute;
  inset: 16px;
  border: 13px solid rgba(176,176,176,0.18);
  border-top-color: #e0e0e0;
  border-right-color: #5a5a5a;
  border-radius: 50%;
  transform: rotateY(calc(var(--i, 0) * 22.5deg));
  box-shadow: inset 0 0 18px rgba(0,0,0,0.75);
}
.torus i:nth-child(1) { --i: 0; } .torus i:nth-child(2) { --i: 1; } .torus i:nth-child(3) { --i: 2; } .torus i:nth-child(4) { --i: 3; }
.torus i:nth-child(5) { --i: 4; } .torus i:nth-child(6) { --i: 5; } .torus i:nth-child(7) { --i: 6; } .torus i:nth-child(8) { --i: 7; }

.pyramid { width: 120px; height: 120px; animation-duration: 21s; }
.pyramid span {
  position: absolute;
  left: 20px;
  top: 20px;
  width: 0;
  height: 0;
  border-left: 40px solid transparent;
  border-right: 40px solid transparent;
  border-bottom: 88px solid rgba(90,90,90,0.82);
  transform-origin: 50% 100%;
}
.pyramid span:nth-child(1) { transform: rotateY(0deg) translateZ(29px) rotateX(28deg); border-bottom-color: #5a5a5a; }
.pyramid span:nth-child(2) { transform: rotateY(90deg) translateZ(29px) rotateX(28deg); border-bottom-color: #3a3a3a; }
.pyramid span:nth-child(3) { transform: rotateY(180deg) translateZ(29px) rotateX(28deg); border-bottom-color: #2a2a2a; }
.pyramid span:nth-child(4) { transform: rotateY(270deg) translateZ(29px) rotateX(28deg); border-bottom-color: #1a1a1a; }

.helix { height: 160px; animation-duration: 27s; }
.helix b {
  position: absolute;
  left: 38px;
  top: calc(var(--n) * 15px);
  width: 22px;
  height: 22px;
  border: 1px solid rgba(224,224,224,0.58);
  background: radial-gradient(circle at 35% 30%, #e0e0e0, #5a5a5a 45%, #1a1a1a 78%);
  transform: rotateY(calc(var(--n) * 42deg)) translateZ(52px);
}
.helix b:nth-child(1) { --n: 0; } .helix b:nth-child(2) { --n: 1; } .helix b:nth-child(3) { --n: 2; } .helix b:nth-child(4) { --n: 3; } .helix b:nth-child(5) { --n: 4; } .helix b:nth-child(6) { --n: 5; } .helix b:nth-child(7) { --n: 6; } .helix b:nth-child(8) { --n: 7; } .helix b:nth-child(9) { --n: 8; }

.slab, .prism, .ladder, .shutter, .beads, .archive, .ring { animation-duration: 23s; }
.slab span, .archive span { position: absolute; border: 1px solid rgba(224,224,224,0.4); background: linear-gradient(135deg, #5a5a5a, #1a1a1a); }
.slab span:nth-child(1) { inset: 18px 8px; transform: rotateY(0deg) translateZ(24px); }
.slab span:nth-child(2) { inset: 28px 0; transform: rotateY(65deg) translateZ(10px); }
.slab span:nth-child(3) { inset: 8px 24px; transform: rotateX(72deg) translateZ(20px); }

.prism span { position: absolute; background: linear-gradient(135deg, #5a5a5a, #2a2a2a); border: 1px solid rgba(224,224,224,0.42); }
.prism span:nth-child(1) { inset: 8px 18px; transform: rotateY(0deg) translateZ(38px); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.prism span:nth-child(2) { inset: 8px 18px; transform: rotateY(120deg) translateZ(38px); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.prism span:nth-child(3) { inset: 8px 18px; transform: rotateY(240deg) translateZ(38px); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.prism span:nth-child(4) { left: 18px; right: 18px; bottom: 8px; height: 20px; transform: rotateX(90deg) translateZ(-32px); }
.prism span:nth-child(5) { left: 38px; top: 42px; width: 24px; height: 24px; background: #e0e0e0; }

.ring em { position: absolute; inset: 20px; border: 9px solid #5a5a5a; transform: rotateX(72deg) rotateZ(calc(var(--r) * 45deg)); box-shadow: 0 0 0 1px rgba(224,224,224,0.38); }
.ring em:nth-child(1) { --r: 0; } .ring em:nth-child(2) { --r: 1; } .ring em:nth-child(3) { --r: 2; } .ring em:nth-child(4) { --r: 3; }

.ladder span { position: absolute; left: 18px; right: 18px; height: 8px; border: 1px solid rgba(224,224,224,0.45); background: linear-gradient(90deg, #1a1a1a, #5a5a5a, #1a1a1a); transform: translateY(calc(var(--s) * 18px)) rotateX(72deg) translateZ(calc(var(--s) * 7px)); }
.ladder span:nth-child(1) { --s: 0; } .ladder span:nth-child(2) { --s: 1; } .ladder span:nth-child(3) { --s: 2; } .ladder span:nth-child(4) { --s: 3; } .ladder span:nth-child(5) { --s: 4; }

.shutter span { position: absolute; left: 46px; top: 6px; width: 10px; height: 88px; transform-origin: 50% 50%; background: linear-gradient(#e0e0e0, #3a3a3a 42%, #1a1a1a); border: 1px solid rgba(224,224,224,0.25); transform: rotateZ(calc(var(--a) * 30deg)) rotateY(58deg) translateZ(24px); }
.shutter span:nth-child(1) { --a: 0; } .shutter span:nth-child(2) { --a: 1; } .shutter span:nth-child(3) { --a: 2; } .shutter span:nth-child(4) { --a: 3; } .shutter span:nth-child(5) { --a: 4; } .shutter span:nth-child(6) { --a: 5; }

.beads span { position: absolute; top: 38px; left: calc(var(--b) * 19px + 4px); width: 17px; height: 17px; background: radial-gradient(circle at 35% 25%, #e0e0e0, #5a5a5a 48%, #1a1a1a); border: 1px solid rgba(224,224,224,0.36); transform: translateZ(calc(var(--b) * 10px)); }
.beads span:nth-child(1) { --b: 0; } .beads span:nth-child(2) { --b: 1; } .beads span:nth-child(3) { --b: 2; } .beads span:nth-child(4) { --b: 3; } .beads span:nth-child(5) { --b: 4; }

.archive span:nth-child(1) { inset: 32px 14px; transform: rotateY(-28deg) translateZ(34px); }
.archive span:nth-child(2) { inset: 24px 22px; transform: rotateY(-8deg) translateZ(18px); background: #2a2a2a; }
.archive span:nth-child(3) { inset: 16px 30px; transform: rotateY(18deg) translateZ(2px); background: #3a3a3a; }
.archive span:nth-child(4) { inset: 8px 38px; transform: rotateY(36deg) translateZ(-14px); background: #5a5a5a; }

.glitch-text { color: var(--flash); text-shadow: -2px 0 var(--bleed), 2px 0 #00f0ff; transform: translateX(1px); }
.glitch-shift { transform: translateX(3px) translateZ(40px) !important; border-color: var(--bleed); box-shadow: -2px 0 0 var(--bleed), 2px 0 0 #00f0ff, 0 4px 20px rgba(0,0,0,0.4); }
.glitch-flash { color: var(--flash) !important; opacity: 0.92 !important; text-shadow: 0 0 10px rgba(255,255,255,0.55), -2px 0 var(--bleed); }

@keyframes spin {
  from { transform: rotateX(-18deg) rotateY(0deg) rotateZ(2deg); }
  to { transform: rotateX(-18deg) rotateY(360deg) rotateZ(2deg); }
}

@keyframes sweep {
  0%, 18% { transform: translateY(-4px); opacity: 0; }
  20% { opacity: 1; }
  52% { opacity: 1; }
  58%, 100% { transform: translateY(105vh); opacity: 0; }
}

@media (max-width: 920px) {
  .masonry-board { column-count: 2; }
  .topbar { padding: 0 16px; }
  .nav-links { gap: 14px; }
}

@media (max-width: 640px) {
  .masonry-board { column-count: 1; }
  .stage { padding: 14px 12px 48px; }
  .topbar { height: 48px; }
  .nav-links a:nth-child(3), .nav-links a:nth-child(4) { display: none; }
  .continuity-card, .continuity-card.tall, .continuity-card.short { min-height: 360px; }
  .object-scene, .tall .object-scene, .short .object-scene { height: 155px; }
  .edge-code:nth-child(2), .edge-code:nth-child(5) { display: none; }
}
