/* === 3D DNA Gate Intro === */
.intro-stage {
  position: fixed; inset: 0; z-index: 9999;
  background: #000;
  overflow: hidden;
  pointer-events: none;
}
.intro-stage canvas, .intro-stage .intro-hud { pointer-events: auto; }
.intro-scroll-driver {
  position: relative;
  width: 1px;
  pointer-events: none;
  z-index: 1;
}
body.intro-active { overflow-x: hidden; }
body.intro-active main, body.intro-active header { display: none !important; }
.intro-progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: rgba(245,158,11,0.15);
  z-index: 10;
}
.intro-progress-fill {
  height: 100%; background: linear-gradient(90deg, #f59e0b, #fef3c7);
  transform-origin: left; transform: scaleX(0);
  box-shadow: 0 0 12px rgba(245,158,11,0.8);
}
.scroll-hint {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin-top: 12px;
}
.scroll-mouse {
  width: 24px; height: 38px; border: 1.5px solid rgba(245,158,11,0.6);
  border-radius: 12px; display: flex; justify-content: center; padding-top: 6px;
}
.scroll-wheel {
  width: 3px; height: 8px; background: #f59e0b; border-radius: 2px;
  animation: scroll-wheel 1.6s ease-in-out infinite;
}
@keyframes scroll-wheel {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(8px); opacity: 0.3; }
}
.intro-stage canvas {
  display: block; width: 100% !important; height: 100% !important;
  transition: opacity 0.9s ease;
}
.intro-stage canvas.fading { opacity: 0; }

.intro-hud {
  position: absolute; inset: 0; pointer-events: none;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: #fef3c7;
  transition: opacity 0.9s ease;
}
.intro-hud.fading { opacity: 0; }
.intro-hud .intro-corner {
  position: absolute;
  font-size: 10px; letter-spacing: .25em;
  display: flex; flex-direction: column; gap: 4px;
  text-transform: uppercase;
}
.intro-hud .intro-corner.tl { top: 24px; left: 24px; }
.intro-hud .intro-corner.tr { top: 24px; right: 24px; align-items: flex-end; text-align: right; }
.intro-hud .intro-corner.bl { bottom: 24px; left: 24px; }
.intro-hud .intro-corner.br { bottom: 24px; right: 24px; pointer-events: auto; }
.intro-hud .hud-line { color: rgba(254, 243, 199, 0.9); }
.intro-hud .hud-line.dim { color: rgba(254, 243, 199, 0.4); }

.intro-hud .intro-corner.tl::before {
  content: ''; position: absolute; top: -10px; left: -10px;
  width: 18px; height: 18px;
  border-top: 1px solid rgba(245,158,11,0.5);
  border-left: 1px solid rgba(245,158,11,0.5);
}
.intro-hud .intro-corner.tr::before {
  content: ''; position: absolute; top: -10px; right: -10px;
  width: 18px; height: 18px;
  border-top: 1px solid rgba(245,158,11,0.5);
  border-right: 1px solid rgba(245,158,11,0.5);
}
.intro-hud .intro-corner.bl::before {
  content: ''; position: absolute; bottom: -10px; left: -10px;
  width: 18px; height: 18px;
  border-bottom: 1px solid rgba(245,158,11,0.5);
  border-left: 1px solid rgba(245,158,11,0.5);
}
.intro-hud .intro-corner.br::before {
  content: ''; position: absolute; bottom: -10px; right: -10px;
  width: 18px; height: 18px;
  border-bottom: 1px solid rgba(245,158,11,0.5);
  border-right: 1px solid rgba(245,158,11,0.5);
}

.intro-skip {
  background: transparent;
  border: 1px solid rgba(245,158,11,0.4);
  color: #fef3c7;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: .3em;
  cursor: pointer;
  transition: all 0.25s;
}
.intro-skip:hover {
  background: rgba(245,158,11,0.15);
  border-color: #f59e0b;
  letter-spacing: .4em;
}

.intro-narr {
  position: absolute;
  bottom: 14%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(20px, 2.4vw, 32px);
  color: rgba(254, 243, 199, 0.92);
  text-align: center;
  max-width: 720px;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  text-shadow: 0 2px 24px rgba(245,158,11,0.4);
  pointer-events: none;
  letter-spacing: 0.005em;
}
.intro-narr.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.intro-cta {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: auto;
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.intro-cta.gone {
  opacity: 0;
  transform: translate(-50%, -60%);
  pointer-events: none;
}
.intro-cta .cta-pre {
  font-size: 11px;
  letter-spacing: .5em;
  color: #f59e0b;
  margin-bottom: 24px;
  font-family: 'JetBrains Mono', monospace;
}
.intro-cta .cta-line {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(28px, 3.5vw, 48px);
  color: #e6edf3;
  line-height: 1.2;
  max-width: 680px;
  margin: 0 auto 36px;
  letter-spacing: -0.005em;
  text-shadow: 0 2px 30px rgba(0,0,0,0.8);
}
.intro-cta .cta-btn {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(245,158,11,0.6);
  color: #fef3c7;
  padding: 16px 32px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .4em;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
}
.intro-cta .cta-btn:hover {
  background: rgba(245,158,11,0.25);
  border-color: #f59e0b;
  letter-spacing: .5em;
  color: #fff;
  box-shadow: 0 0 40px rgba(245,158,11,0.4);
}
.intro-cta .cta-foot {
  margin-top: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: .3em;
  color: rgba(254,243,199,0.4);
}

.intro-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #fff 0%, #fef3c7 30%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.intro-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
}

.post-intro-fade {
  animation: post-intro-in 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes post-intro-in {
  0% { opacity: 0; transform: scale(1.04); filter: brightness(2.5); }
  40% { opacity: 0.4; filter: brightness(1.8); }
  100% { opacity: 1; transform: scale(1); filter: brightness(1); }
}

@media (max-width: 720px) {
  .intro-hud .intro-corner { font-size: 8px; letter-spacing: .15em; }
  .intro-hud .intro-corner.tl { top: 14px; left: 14px; }
  .intro-hud .intro-corner.tr { top: 14px; right: 14px; }
  .intro-hud .intro-corner.bl { bottom: 14px; left: 14px; }
  .intro-hud .intro-corner.br { bottom: 14px; right: 14px; }
  .intro-cta .cta-line { font-size: 22px; }
  .intro-narr { font-size: 18px; bottom: 18%; padding: 0 20px; }
}

/* === Side glyphs (milestones along the climb) === */
.intro-glyphs {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
}
.glyph {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  will-change: opacity, transform;
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(.2,.7,.2,1);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.glyph.left  { left: 6%;  transform-origin: left center; }
.glyph.right { right: 6%; transform-origin: right center; flex-direction: row-reverse; }

.glyph .glyph-rail {
  width: 70px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,158,11,0.65) 30%, rgba(245,158,11,0.95));
  position: relative;
}
.glyph.right .glyph-rail {
  background: linear-gradient(-90deg, transparent, rgba(168,216,255,0.55) 30%, rgba(168,216,255,0.9));
}
.glyph .glyph-rail::before {
  content: '';
  position: absolute;
  right: -3px; top: -2px;
  width: 5px; height: 5px;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}
.glyph.right .glyph-rail::before {
  right: auto; left: -3px;
  background: #a8d8ff;
  box-shadow: 0 0 8px #a8d8ff;
}

.glyph .glyph-card {
  min-width: 180px; max-width: 240px;
  background: linear-gradient(180deg, rgba(10, 8, 14, 0.85), rgba(20, 14, 8, 0.7));
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  border: 1px solid rgba(245,158,11,0.35);
  padding: 10px 14px;
  position: relative;
  box-shadow: 0 8px 36px rgba(0,0,0,0.6), 0 0 0 1px rgba(245,158,11,0.06) inset;
}
.glyph.right .glyph-card {
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.85), rgba(8, 16, 24, 0.7));
  border-color: rgba(168,216,255,0.32);
  text-align: right;
}
.glyph .glyph-card::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; width: 8px; height: 8px;
  border-top: 1px solid #f59e0b;
  border-left: 1px solid #f59e0b;
}
.glyph .glyph-card::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px; width: 8px; height: 8px;
  border-bottom: 1px solid #f59e0b;
  border-right: 1px solid #f59e0b;
}
.glyph.right .glyph-card::before { border-color: #a8d8ff; }
.glyph.right .glyph-card::after  { border-color: #a8d8ff; }

.glyph .glyph-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 9px; letter-spacing: 0.25em;
  margin-bottom: 6px;
}
.glyph.right .glyph-head { flex-direction: row-reverse; }
.glyph .glyph-tag { color: #f59e0b; }
.glyph.right .glyph-tag { color: #a8d8ff; }
.glyph .glyph-year { color: rgba(254,243,199,0.55); }

.glyph .glyph-title {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  line-height: 1.1;
  color: #fef3c7;
  letter-spacing: -0.005em;
}
.glyph.right .glyph-title { color: #eaf6ff; }
.glyph .glyph-sub {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(254,243,199,0.55);
  margin-top: 4px;
}
.glyph.right .glyph-sub { color: rgba(234,246,255,0.55); }

.glyph.kind-now .glyph-card { border-color: rgba(255, 200, 100, 0.7); }
.glyph.kind-now .glyph-card::before, .glyph.kind-now .glyph-card::after { border-color: #ffc864; }
.glyph.kind-now .glyph-tag { color: #ffd966; }
.glyph.kind-now .glyph-card { animation: glyphPulse 2.4s ease-in-out infinite; }
@keyframes glyphPulse {
  0%, 100% { box-shadow: 0 8px 36px rgba(0,0,0,0.6), 0 0 12px rgba(255,200,100,0.2); }
  50%      { box-shadow: 0 8px 36px rgba(0,0,0,0.6), 0 0 28px rgba(255,200,100,0.5); }
}

@media (max-width: 900px) {
  .glyph .glyph-card { min-width: 140px; max-width: 180px; padding: 8px 10px; }
  .glyph .glyph-rail { width: 36px; }
  .glyph .glyph-title { font-size: 17px; }
  .glyph.left  { left: 3%; }
  .glyph.right { right: 3%; }
}
@media (max-width: 560px) {
  .glyph { display: none; }
}

/* === Door arrival prompt === */
.intro-door-prompt {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%) translateY(20px);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.7,.2,1);
  z-index: 8;
}
.intro-door-prompt.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.intro-door-prompt.gone {
  opacity: 0 !important;
  transform: translateX(-50%) translateY(-12px) !important;
  pointer-events: none !important;
}
.intro-door-prompt .dp-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .5em;
  color: #f59e0b;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.intro-door-prompt .dp-title {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(22px, 2.6vw, 34px);
  color: #fef3c7;
  margin-bottom: 22px;
  text-shadow: 0 2px 30px rgba(245,158,11,0.5);
}
.intro-door-prompt .dp-btn {
  position: relative;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(245,158,11,0.7);
  color: #fef3c7;
  padding: 18px 44px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin: 0 auto;
  transition: all 0.3s;
  animation: dpPulse 2.4s ease-in-out infinite;
}
.intro-door-prompt .dp-btn-label {
  font-size: 14px;
  letter-spacing: .55em;
  font-weight: 600;
}
.intro-door-prompt .dp-btn-sub {
  font-size: 9px;
  letter-spacing: .3em;
  color: rgba(254,243,199,0.55);
  text-transform: uppercase;
}
.intro-door-prompt .dp-btn:hover {
  background: rgba(245,158,11,0.22);
  border-color: #fef3c7;
  color: #fff;
  box-shadow: 0 0 60px rgba(245,158,11,0.55), 0 0 0 1px rgba(254,243,199,0.4) inset;
  letter-spacing: .65em;
  animation: none;
}
.intro-door-prompt .dp-btn::before,
.intro-door-prompt .dp-btn::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border-color: #f59e0b;
  border-style: solid;
  border-width: 0;
  transition: border-color 0.3s;
}
.intro-door-prompt .dp-btn::before {
  top: -2px; left: -2px;
  border-top-width: 2px; border-left-width: 2px;
}
.intro-door-prompt .dp-btn::after {
  bottom: -2px; right: -2px;
  border-bottom-width: 2px; border-right-width: 2px;
}
.intro-door-prompt .dp-btn:hover::before,
.intro-door-prompt .dp-btn:hover::after { border-color: #fef3c7; }
@keyframes dpPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(245,158,11,0.25); }
  50%      { box-shadow: 0 0 48px rgba(245,158,11,0.55); }
}

/* === Matrix rain takeover === */
.intro-matrix {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 7;
  background: #000;
  transition: opacity 0.3s ease;
}
.intro-matrix.on { opacity: 1; }
