/* ============================================
   NEXT ERA — EXTRAS
   New scroll motion + intro layers + new sections
   (Adds; does not remove anything existing.)
   ============================================ */

/* ============================================
   EXTRA INTRO LAYERS
   ============================================ */
.intro-rings {
  position: absolute;
  top: 50%; left: 50%;
  width: 70vmin; height: 70vmin;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  animation: introRingsIn 2s ease forwards;
  animation-delay: 1s;
}
@keyframes introRingsIn { to { opacity: 0.7; } }
.intro-rings .r {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(201, 169, 110, 0.16);
  border-radius: 50%;
  animation: spin 30s linear infinite;
}
.intro-rings .r:nth-child(2) { inset: 8%; border-color: rgba(201, 169, 110, 0.22); animation-duration: 24s; animation-direction: reverse; }
.intro-rings .r:nth-child(3) { inset: 18%; border-style: dashed; border-color: rgba(232, 201, 138, 0.3); animation-duration: 18s; }
.intro-rings .r:nth-child(4) { inset: 32%; border-color: rgba(201, 169, 110, 0.4); animation-duration: 12s; animation-direction: reverse; }
.intro-rings .r::before {
  content: '';
  position: absolute;
  top: -3px; left: 50%;
  width: 6px; height: 6px;
  background: var(--gold-bright);
  border-radius: 50%;
  box-shadow: 0 0 16px var(--gold-bright);
}

.intro-code {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--f-mono);
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: 1.5px;
  color: rgba(201, 169, 110, 0.3);
  pointer-events: none;
  z-index: 3;
  white-space: pre;
  opacity: 0;
  animation: codeFade 1.8s ease forwards;
  animation-delay: 3s;
  max-height: 60vh;
  overflow: hidden;
}
.intro-code .glow { color: var(--gold-bright); opacity: 0.8; }
@keyframes codeFade { to { opacity: 0.6; } }

.intro-helix {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: 60px; height: 320px;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  animation: codeFade 1.8s ease forwards;
  animation-delay: 4s;
}
.intro-helix svg { width: 100%; height: 100%; overflow: visible; }
.intro-helix path { stroke: var(--gold); fill: none; stroke-width: 0.8; opacity: 0.6; }
.intro-helix circle { fill: var(--gold-bright); opacity: 0.7; }
@keyframes helixSpin { to { transform: rotateY(360deg); } }

.intro-glitch {
  display: none;
}

/* Scrolling "telemetry" line bottom of intro */
.intro-ticker {
  position: absolute;
  bottom: 80px; left: 0; right: 0;
  height: 18px;
  overflow: hidden;
  z-index: 4;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 4px;
  color: rgba(232, 201, 138, 0.55);
  text-transform: uppercase;
  opacity: 0;
  animation: codeFade 1.6s ease forwards;
  animation-delay: 5s;
}
.intro-ticker .line {
  white-space: nowrap;
  animation: tickerLeft 38s linear infinite;
  display: inline-block;
}
@keyframes tickerLeft { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

/* ============================================
   FLOATING SECTION NAVIGATOR
   ============================================ */
.section-nav {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 10px;
  background: rgba(7, 6, 10, 0.6);
  border: 1px solid rgba(201, 169, 110, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.section-nav.show { opacity: 1; }
.section-nav .dot {
  position: relative;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(201, 169, 110, 0.3);
  cursor: none;
  transition: background 0.3s ease, transform 0.3s ease;
}
.section-nav .dot:hover {
  background: var(--gold-bright);
  transform: scale(1.5);
}
.section-nav .dot.active {
  background: var(--gold-bright);
  box-shadow: 0 0 8px var(--gold);
}
.section-nav .dot .lbl {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--gold-bright);
  white-space: nowrap;
  background: rgba(7, 6, 10, 0.92);
  padding: 4px 10px;
  border: 1px solid rgba(201, 169, 110, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.section-nav .dot:hover .lbl {
  opacity: 1;
  transform: translateY(-50%) translateX(-4px);
}
@media (max-width: 900px) { .section-nav { display: none; } }

/* Section counter bottom-left */
.section-counter {
  position: fixed;
  bottom: 22px; left: 26px;
  z-index: 100;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 4px;
  color: rgba(201, 169, 110, 0.7);
  opacity: 0;
  transition: opacity 0.5s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.section-counter.show { opacity: 1; }
.section-counter .now { color: var(--gold-bright); font-size: 22px; font-family: var(--f-display); }
.section-counter .of { color: var(--warm-gray); }

/* ============================================
   SCROLL VELOCITY BLUR / SCALE on every section
   ============================================ */
.velocity {
  transition: filter 0.2s ease, transform 0.4s ease;
  will-change: filter, transform;
}
.velocity.fast { filter: blur(2px); }

/* Sticky scroll-pinned section */
.sticky-stage {
  position: relative;
  height: 320vh;
  background: var(--pitch);
}
.sticky-stage .sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.sticky-stage .frames {
  position: relative;
  width: min(880px, 92vw);
  height: min(560px, 80vh);
  perspective: 1200px;
}
.sticky-stage .frame {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px;
  background: linear-gradient(160deg, #15110d, #07060a);
  border: 1px solid rgba(201, 169, 110, 0.18);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  text-align: center;
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.sticky-stage .frame.active { opacity: 1; transform: translateY(0) scale(1); }
.sticky-stage .frame .ic {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 5px;
  color: var(--gold); margin-bottom: 26px;
}
.sticky-stage .frame h3 {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(24px, 3.6vw, 48px); letter-spacing: 0.03em;
  margin-bottom: 22px; line-height: 1.1;
}
.sticky-stage .frame h3 em { color: var(--gold-bright); font-family: var(--f-editorial); font-style: italic; }
.sticky-stage .frame p {
  font-family: var(--f-editorial); font-style: italic;
  font-size: clamp(13px, 1.2vw, 16px);
  color: rgba(251, 247, 240, 0.7);
  max-width: 540px;
}
.sticky-stage .frame .meta {
  margin-top: 30px; display: flex; gap: 40px;
}
.sticky-stage .frame .meta .v {
  font-family: var(--f-display); font-weight: 600;
  font-size: 28px; color: var(--gold-bright);
}
.sticky-stage .frame .meta .k {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 3px;
  color: var(--warm-gray); margin-top: 4px;
}
.sticky-stage .stage-progress {
  position: absolute;
  bottom: 8vh; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 10px;
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 3px;
  color: var(--warm-gray);
}
.sticky-stage .stage-progress span {
  width: 36px; height: 2px;
  background: rgba(201, 169, 110, 0.2);
  transition: background 0.4s ease;
}
.sticky-stage .stage-progress span.active { background: var(--gold-bright); box-shadow: 0 0 8px var(--gold); }

/* ============================================
   NEURAL CONSTELLATION
   ============================================ */
.neural-section {
  background: var(--void);
  position: relative;
  padding: 12vh 8vw;
}
.neural-stage {
  position: relative;
  margin-top: 60px;
  height: 520px;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(201, 169, 110, 0.08), transparent 70%),
    linear-gradient(180deg, #0d0b08, #050403);
  border: 1px solid rgba(201, 169, 110, 0.18);
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}
.neural-stage canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.neural-stage .legend {
  position: absolute;
  top: 22px; left: 22px;
  z-index: 2;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 4px;
  color: var(--gold); padding: 8px 12px;
  border: 1px solid rgba(201, 169, 110, 0.3);
  background: rgba(7, 6, 10, 0.6);
}
.neural-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 32px;
  border-top: 1px solid rgba(201, 169, 110, 0.18);
}
.neural-stats .n {
  padding: 22px;
  border-right: 1px solid rgba(201, 169, 110, 0.1);
  text-align: center;
}
.neural-stats .n:last-child { border-right: none; }
.neural-stats .v { font-family: var(--f-display); font-weight: 600; font-size: 28px; color: var(--gold-bright); }
.neural-stats .k { font-family: var(--f-mono); font-size: 9px; letter-spacing: 4px; color: var(--warm-gray); margin-top: 6px; }

/* ============================================
   HEX FEATURE GRID
   ============================================ */
.hex-section { background: #0c0a07; }
.hex-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 60px;
  max-width: 1100px;
}
.hex {
  aspect-ratio: 1 / 1.15;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: rgba(201, 169, 110, 0.05);
  border: 1px solid rgba(201, 169, 110, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 22px 16px;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: none;
  position: relative;
  background-clip: padding-box;
}
.hex:nth-child(even) { transform: translateY(30px); }
.hex:hover {
  background: linear-gradient(135deg, rgba(201, 169, 110, 0.22), rgba(232, 201, 138, 0.1));
  transform: scale(1.08);
}
.hex:nth-child(even):hover { transform: translateY(30px) scale(1.08); }
.hex .num { font-family: var(--f-mono); font-size: 9px; letter-spacing: 3px; color: var(--gold); }
.hex .nm { font-family: var(--f-display); font-weight: 600; font-size: 14px; margin-top: 8px; letter-spacing: 0.04em; line-height: 1.2; }
.hex .v { font-family: var(--f-display); font-size: 20px; color: var(--gold-bright); margin-top: 6px; }

/* ============================================
   BEFORE / AFTER COMPARE
   ============================================ */
.compare-img-section { background: var(--void); }
.compare-img {
  position: relative;
  max-width: 1100px;
  margin: 60px auto 0;
  height: 540px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  cursor: ew-resize;
  user-select: none;
}
.compare-img .side {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 60px;
}
.compare-img .a {
  background:
    repeating-linear-gradient(45deg, transparent 0 30px, rgba(201, 169, 110, 0.04) 30px 31px),
    linear-gradient(160deg, #1a1612, #0a0807);
}
.compare-img .b {
  background:
    radial-gradient(ellipse at 50% 50%, rgba(232, 201, 138, 0.25), transparent 60%),
    linear-gradient(160deg, #2a2218, #0d0a07);
  clip-path: inset(0 0 0 50%);
}
.compare-img .lbl {
  position: absolute;
  top: 22px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 4px;
  color: var(--gold);
}
.compare-img .a .lbl { left: 22px; }
.compare-img .b .lbl { right: 22px; }
.compare-img h4 {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(22px, 3.2vw, 40px); letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.compare-img p {
  font-family: var(--f-editorial); font-style: italic;
  font-size: 15px; color: rgba(251, 247, 240, 0.7);
  max-width: 320px;
}
.compare-img .handle {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--gold);
  box-shadow: 0 0 18px var(--gold);
  z-index: 5;
  transform: translateX(-1px);
}
.compare-img .grip {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 6;
  color: #000;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 2px;
  box-shadow: 0 0 30px var(--gold);
}

/* ============================================
   SCROLLING DISPLAY TYPE (big)
   ============================================ */
.scroll-type-section {
  background: var(--pitch);
  padding: 24vh 0;
  overflow: hidden;
  position: relative;
}
.scroll-type-line {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(56px, 11vw, 180px);
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: rgba(201, 169, 110, 0.06);
  -webkit-text-stroke: 1px var(--gold);
  will-change: transform;
}
.scroll-type-line.solid {
  color: var(--gold-bright);
  -webkit-text-stroke: 0;
  text-shadow: 0 0 80px rgba(201, 169, 110, 0.4);
  margin: 12px 0;
}
.scroll-type-line .em {
  font-family: var(--f-editorial);
  font-style: italic;
  font-weight: 400;
  color: var(--warm-white);
  -webkit-text-stroke: 0;
}

/* ============================================
   3D ROTATING GALLERY (carousel)
   ============================================ */
.gallery-section { background: var(--void); padding: 12vh 8vw; }
.gallery-stage {
  position: relative;
  margin: 60px auto 0;
  width: min(360px, 80vw);
  height: 500px;
  perspective: 1400px;
  perspective-origin: 50% 50%;
}
.gallery-track {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: gallerySpin 30s linear infinite;
  will-change: transform;
}
@keyframes gallerySpin { to { transform: rotateY(360deg); } }
.gallery-card {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #1a1612, #07060a);
  border: 1px solid rgba(201, 169, 110, 0.25);
  padding: 40px 30px;
  display: flex; flex-direction: column; justify-content: space-between;
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
  backface-visibility: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.gallery-card .tag { font-family: var(--f-mono); font-size: 10px; letter-spacing: 4px; color: var(--gold); }
.gallery-card h4 {
  font-family: var(--f-display); font-weight: 600; font-size: 26px;
  letter-spacing: 0.03em; line-height: 1.1;
  margin: 14px 0;
}
.gallery-card .swatch {
  height: 200px; margin: 14px 0;
  background:
    repeating-linear-gradient(45deg, rgba(201, 169, 110, 0.08) 0 14px, transparent 14px 28px),
    linear-gradient(180deg, rgba(201, 169, 110, 0.15), transparent);
  border: 1px solid rgba(201, 169, 110, 0.2);
}
.gallery-card p {
  font-family: var(--f-editorial); font-style: italic; font-size: 14px;
  color: rgba(251, 247, 240, 0.65); line-height: 1.5;
}
.gallery-card .nm {
  font-family: var(--f-display); font-weight: 600;
  font-size: 30px; color: var(--gold-bright);
  margin-top: auto;
}
.gallery-controls {
  display: flex; justify-content: center; gap: 16px;
  margin-top: 28px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 4px;
  color: var(--gold);
}

/* ============================================
   GLITCH / DUAL TYPE HEADLINE
   ============================================ */
.glitch-text {
  position: relative;
  display: inline-block;
}
.glitch-text::before, .glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.glitch-text::before {
  color: var(--gold-bright);
  transform: translate(2px, 0);
  mix-blend-mode: screen;
  opacity: 0.5;
  animation: glitchA 5s steps(20) infinite;
}
.glitch-text::after {
  color: var(--warm-white);
  transform: translate(-2px, 0);
  mix-blend-mode: screen;
  opacity: 0.4;
  animation: glitchB 5s steps(20) infinite;
}
@keyframes glitchA {
  0%, 92%, 100% { transform: translate(2px, 0); opacity: 0; }
  93% { transform: translate(6px, -2px); opacity: 0.7; }
  95% { transform: translate(-4px, 1px); opacity: 0.5; }
  97% { transform: translate(2px, 0); opacity: 0; }
}
@keyframes glitchB {
  0%, 91%, 100% { transform: translate(-2px, 0); opacity: 0; }
  94% { transform: translate(-6px, 2px); opacity: 0.6; }
  96% { transform: translate(4px, -1px); opacity: 0.4; }
}

/* ============================================
   SCROLL-LINKED PARALLAX BIG WORDS
   ============================================ */
.big-words {
  position: absolute;
  font-family: var(--f-display); font-weight: 900;
  font-size: clamp(120px, 22vw, 360px);
  color: rgba(201, 169, 110, 0.04);
  letter-spacing: 0.06em;
  pointer-events: none;
  z-index: 0;
  white-space: nowrap;
}

/* Section transition wipe between scenes */
section.scene::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.4;
  pointer-events: none;
  z-index: 2;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
  .hex-grid { grid-template-columns: repeat(3, 1fr); }
  .neural-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .hex-grid { grid-template-columns: repeat(2, 1fr); }
  .compare-img { height: 380px; }
  .compare-img .side { padding: 28px; }
}
