/* ============================================================
   LAB.CSS — zenkai.studio/lab
   Cosmic Z particle universe. Scroll-driven camera + 6 pillar destinations.
   ============================================================ */

@font-face {
  font-family: Aeonik;
  src: url(/assets/fonts/Aeonik-Regular.woff2) format("woff2"),
       url(/assets/fonts/Aeonik-Regular.woff) format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  --color-off-white: #f4f4f4;
  --color-white: #fff;
  --color-black: #000;
  --color-red: #e60000;
  --color-red-dark: #b50000;
  --color-dark: #111;
  --base-padding-x: max(5vw, 40px);
  --header-size: clamp(0.875rem, 1vw, 1rem);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%; height: 100%;
  background: #010000;
  color: var(--color-white);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

html, body, h1, h2, h3, h4, button, input, a {
  font-family: Aeonik, 'DM Sans', system-ui, sans-serif;
  font-weight: 400;
}

/* ─── CUSTOM CURSOR ─────────────────────────────────────── */
#cursor-dot {
  position: fixed;
  width: 6px; height: 6px;
  background: var(--color-red);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}

#cursor-ring {
  position: fixed;
  width: 36px; height: 36px;
  border: 1px solid rgba(230,0,0,0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.22s, height 0.22s, border-color 0.22s;
}

#cursor-ring.expand {
  width: 54px; height: 54px;
  border-color: rgba(230,0,0,0.8);
}

/* ─── CANVAS BACKGROUNDS ────────────────────────────────── */
#lab-canvas {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%; display: block;
}

#grain-canvas {
  position: fixed; inset: 0; z-index: 2;
  width: 100%; height: 100%; display: block;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
}

/* ─── OVERLAYS ──────────────────────────────────────────── */
#scanlines {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 2px,
    rgba(0,0,0,0.035) 2px, rgba(0,0,0,0.035) 4px
  );
}

#lab-vignette {
  position: fixed; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 26%, rgba(0,0,0,0.90) 100%);
}

/* ─── SCROLL CONTAINER ──────────────────────────────────── */
#app {
  position: fixed; inset: 0; z-index: 5;
  overflow-y: scroll; overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--color-red) transparent;
  pointer-events: none;
}
#app::-webkit-scrollbar { width: 3px; }
#app::-webkit-scrollbar-track { background: transparent; }
#app::-webkit-scrollbar-thumb { background: var(--color-red); border-radius: 2px; }

#scroll-driver {
  height: 700vh; width: 100%; pointer-events: none;
}

/* ─── HEADER ────────────────────────────────────────────── */
#lab-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 var(--base-padding-x);
  height: clamp(52px, 5.5vw, 68px);
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.4s, backdrop-filter 0.4s;
}
#lab-header.scrolled {
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.header-logo img {
  height: clamp(34px, 4vw, 56px); width: auto; object-fit: contain;
  filter: brightness(0) invert(1);
}

.header-center {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center;
}
.header-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.62rem; letter-spacing: 0.42em; text-transform: uppercase;
  color: rgba(255,255,255,0.28);
}

.header-right { display: flex; align-items: center; gap: clamp(10px,1.5vw,20px); }

.btn-talk {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--color-red); color: #fff;
  font-family: inherit; font-size: var(--header-size); font-weight: 400;
  letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none;
  padding: 9px 18px; border-radius: 100px; border: none; cursor: none;
  transition: background 0.2s, transform 0.2s; white-space: nowrap;
}
.btn-talk:hover { background: var(--color-red-dark); transform: scale(1.03); }
.btn-talk-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.5); flex-shrink: 0; }

.btn-back {
  font-family: inherit; font-size: var(--header-size);
  color: rgba(255,255,255,0.42); text-decoration: none;
  letter-spacing: 0.08em; cursor: none;
  transition: color 0.2s; white-space: nowrap;
}
.btn-back:hover { color: #fff; }

/* ─── SIDE PROGRESS ─────────────────────────────────────── */
#side-progress {
  position: fixed; right: max(3vw, 28px); top: 50%;
  transform: translateY(-50%); z-index: 50;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
#side-track {
  width: 1px; height: 100px;
  background: rgba(255,255,255,0.08); position: relative; overflow: hidden;
}
#side-bar {
  position: absolute; top: 0; left: 0; width: 100%; height: 0%;
  background: var(--color-red); transition: height 0.08s linear;
}
#side-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.56rem; letter-spacing: 0.2em; color: rgba(255,255,255,0.25);
}

/* ─── NODE LABELS ───────────────────────────────────────── */
#node-labels {
  position: fixed; inset: 0; z-index: 20; pointer-events: none;
}

.node-label {
  position: absolute;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transform: translate(-50%, calc(-100% - 16px));
  text-decoration: none; pointer-events: auto; cursor: none;
  opacity: 0.45;
  transition: opacity 0.4s;
}
.node-label:hover,
.node-label.active { opacity: 1; }

.nl-num {
  font-family: 'Orbitron', monospace;
  font-size: 0.68rem; letter-spacing: 0.28em; color: var(--color-red);
  text-transform: uppercase; line-height: 1;
  text-shadow: 0 0 10px #000, 0 1px 4px #000;
}
.nl-name {
  font-size: 0.88rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.82); white-space: nowrap; line-height: 1;
  text-shadow: 0 0 10px #000, 0 1px 4px #000;
}
.node-label.active .nl-name { color: #fff; }

/* ─── SECTIONS (clip-path wipe) ─────────────────────────── */
.lab-section {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center;
  padding: clamp(80px,9vw,110px) var(--base-padding-x) clamp(60px,7vw,90px);
  pointer-events: none;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.72s cubic-bezier(0.76, 0, 0.24, 1);
}
.lab-section.active {
  clip-path: inset(0 0 0% 0);
  pointer-events: auto;
}
.lab-section.past {
  clip-path: inset(100% 0 0% 0);
  pointer-events: none;
}

/* ─── HUD CORNERS ───────────────────────────────────────── */
.hud-corners {
  position: absolute; inset: clamp(18px,2.5vw,36px); pointer-events: none;
}
.hud-corners span {
  position: absolute; width: 18px; height: 18px;
  border-color: rgba(230,0,0,0.18); border-style: solid;
}
.hud-tl { top: 0; left: 0; border-width: 1px 0 0 1px; }
.hud-tr { top: 0; right: 0; border-width: 1px 1px 0 0; }
.hud-bl { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.hud-br { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

.sec-coords {
  position: absolute; bottom: clamp(20px,3vw,40px); right: var(--base-padding-x);
  font-family: 'Orbitron', monospace;
  font-size: 0.54rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: rgba(255,255,255,0.12);
  opacity: 0; transition: opacity 0.5s ease 0.6s;
}
.lab-section.active .sec-coords { opacity: 1; }
.lab-section:not(.active) .sec-coords { opacity: 0; transition: none; }

/* ─── INTRO SECTION ─────────────────────────────────────── */
.lab-section--intro {
  align-items: flex-start; justify-content: center; text-align: left;
  flex-direction: column; gap: 0;
  padding-left: clamp(2vw, 4vw, 6vw);
}

.intro-inner { display: flex; flex-direction: column; align-items: flex-start; }

.intro-eyebrow {
  font-family: 'Orbitron', monospace;
  font-size: 0.62rem; letter-spacing: 0.38em; text-transform: uppercase;
  color: rgba(255,255,255,0.28); margin-bottom: clamp(14px,2vw,22px);
  opacity: 0; transition: opacity 0.6s ease 0.1s;
}
.lab-section.active .intro-eyebrow { opacity: 1; }
.lab-section:not(.active) .intro-eyebrow { opacity: 0; transition: none; }

.intro-heading {
  font-size: clamp(5rem, 14vw, 14rem);
  line-height: 0.88; font-weight: 400; letter-spacing: -0.04em;
  color: #fff; margin-bottom: clamp(18px,2.5vw,30px);
}
.intro-heading em {
  font-style: normal; color: var(--color-red);
}

.intro-sub {
  font-size: clamp(0.82rem, 1.0vw, 0.96rem);
  color: rgba(255,255,255,0.42); letter-spacing: 0.10em;
  text-transform: uppercase; line-height: 1.7;
  opacity: 0; transition: opacity 0.6s ease 0.6s;
}
.intro-sub-brand {
  font-family: 'Orbitron', monospace;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.82);
}
.lab-section.active .intro-sub { opacity: 1; }
.lab-section:not(.active) .intro-sub { opacity: 0; transition: none; }

.intro-scroll-hint {
  position: absolute; bottom: clamp(28px,4vw,52px); left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  opacity: 0; transition: opacity 0.6s ease 0.9s;
}
.lab-section.active .intro-scroll-hint { opacity: 1; }
.lab-section:not(.active) .intro-scroll-hint { opacity: 0; transition: none; }

.scroll-line-v { width: 1px; height: 40px; background: rgba(255,255,255,0.15); }
.scroll-hint-label {
  font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255,255,255,0.25);
}

/* ─── PILLAR SECTIONS ───────────────────────────────────── */
.lab-section--pillar { align-items: center; }

.pillar-inner { max-width: clamp(320px, 40vw, 500px); }

.pillar-num {
  display: block; font-family: 'Orbitron', monospace;
  font-size: 0.62rem; letter-spacing: 0.32em; color: var(--color-red);
  text-transform: uppercase; margin-bottom: clamp(12px,1.8vw,20px);
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.lab-section.active .pillar-num { opacity: 1; transform: translateY(0); }
.lab-section:not(.active) .pillar-num { opacity: 0; transform: translateY(0); transition: none; }

.pillar-heading {
  font-size: clamp(2.8rem, 6.5vw, 7rem);
  line-height: 0.92; font-weight: 400; letter-spacing: -0.03em;
  color: #fff; margin-bottom: clamp(14px,1.8vw,22px);
}

.pillar-tagline {
  font-size: clamp(0.95rem, 1.3vw, 1.2rem);
  color: rgba(255,255,255,0.5); line-height: 1.5;
  margin-bottom: clamp(12px,1.6vw,20px);
  opacity: 0; transition: opacity 0.55s ease 0.48s;
}
.pillar-tagline em { font-style: italic; color: rgba(255,80,80,0.85); }
.lab-section.active .pillar-tagline { opacity: 1; }
.lab-section:not(.active) .pillar-tagline { opacity: 0; transition: none; }

.pillar-body {
  font-size: clamp(0.82rem, 1vw, 0.95rem);
  color: rgba(255,255,255,0.3); line-height: 1.72;
  max-width: 360px; margin-bottom: clamp(18px,2.2vw,28px);
  opacity: 0; transition: opacity 0.55s ease 0.58s;
}
.lab-section.active .pillar-body { opacity: 1; }
.lab-section:not(.active) .pillar-body { opacity: 0; transition: none; }

.pillar-tags {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px;
  opacity: 0; transition: opacity 0.5s ease 0.7s;
}
.pillar-tags li {
  font-size: 0.64rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 5px 12px; border-radius: 100px;
  transition: border-color 0.2s, color 0.2s;
}
.pillar-tags li:hover { border-color: var(--color-red); color: rgba(255,100,100,0.9); }
.lab-section.active .pillar-tags { opacity: 1; }
.lab-section:not(.active) .pillar-tags { opacity: 0; transition: none; }

/* ─── CTA SECTION ───────────────────────────────────────── */
.lab-section--cta {
  align-items: flex-end; justify-content: center;
  padding-bottom: clamp(80px,10vw,130px);
}

.cta-inner { text-align: left; }

.cta-heading {
  font-size: clamp(4rem, 10vw, 11rem);
  line-height: 0.88; font-weight: 400; letter-spacing: -0.04em;
  color: #fff; margin-bottom: clamp(32px,4vw,52px);
}
.cta-heading em { font-style: normal; color: var(--color-red); }

.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

.btn-primary {
  display: inline-flex; align-items: center; padding: 14px 32px;
  background: var(--color-red); color: #fff;
  font-family: inherit; font-size: var(--header-size);
  letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
  border-radius: 100px; cursor: none;
  transition: background 0.2s, transform 0.2s;
}
.btn-primary:hover { background: var(--color-red-dark); transform: scale(1.03); }

.btn-secondary {
  display: inline-flex; align-items: center; padding: 14px 32px;
  background: transparent; color: rgba(255,255,255,0.45);
  font-family: inherit; font-size: var(--header-size);
  letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
  border: 1px solid rgba(255,255,255,0.15); border-radius: 100px; cursor: none;
  transition: color 0.2s, border-color 0.2s;
}
.btn-secondary:hover { color: #fff; border-color: rgba(255,255,255,0.4); }

/* ─── WORD ANIMATION ────────────────────────────────────── */
.word {
  display: inline-block;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.62s cubic-bezier(0.16,1,0.3,1),
              transform 0.62s cubic-bezier(0.16,1,0.3,1);
}
.lab-section.active .word { opacity: 1; transform: translateY(0); }

/* ─── GLITCH ────────────────────────────────────────────── */
.glitch {
  font-style: normal; color: var(--color-red);
  display: inline-block; position: relative;
  animation: glitch 6s infinite;
}
@keyframes glitch {
  0%, 88%, 100% { text-shadow: none; transform: none; }
  89% { text-shadow:  2px 0 rgba(0,240,160,0.6), -2px 0 rgba(230,0,0,0.95); transform: translateX(2px); }
  90% { text-shadow: -2px 0 rgba(0,240,160,0.6),  2px 0 rgba(230,0,0,0.95); transform: translateX(-2px); }
  91% { text-shadow: none; transform: none; }
  93% { text-shadow:  1px 0 rgba(0,240,160,0.4); transform: translateX(1px); }
  94% { text-shadow: none; transform: none; }
}

/* ─── BOTTOM TICKER ─────────────────────────────────────── */
#lab-ticker {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  height: clamp(26px,2.2vw,32px); overflow: hidden;
  border-top: 1px solid rgba(255,255,255,0.04);
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  display: flex; align-items: center;
}
.ticker-track {
  display: flex; white-space: nowrap;
  animation: ticker 32s linear infinite;
  will-change: transform;
}
.ticker-content {
  font-family: 'Orbitron', monospace;
  font-size: 0.56rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: rgba(255,255,255,0.14); padding-right: 2px;
}
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─── MOBILE ─────────────────────────────────────────────── */
@media (max-width: 700px) {
  html, body { cursor: auto; }
  #cursor-dot, #cursor-ring { display: none; }
  #side-progress { display: none; }
  #node-labels { display: none; }
  .header-center { display: none; }
  .btn-back { display: none; }
  .hud-corners { display: none; }
  .sec-coords { display: none; }
  .lab-section--pillar { align-items: flex-end; padding-bottom: clamp(70px,10vw,110px); }
  .intro-heading { font-size: clamp(4rem,16vw,6rem); }
  .pillar-heading { font-size: clamp(2.4rem,9vw,3.8rem); }
  .cta-heading { font-size: clamp(3rem,12vw,5rem); }
  .pillar-inner { max-width: 100%; }
  .btn-primary, .btn-secondary, .btn-talk, .btn-back { cursor: pointer; }
}
