/* ═══════════════════════════════════════════════
   RADIOWAVE NASA v6 — STYLE.CSS
   Font: Roboto + Bebas Neue
   Inspired by: deadwater.fr / designcanada.com / pixelismo.it
═══════════════════════════════════════════════ */
:root {
  --bg:        #000;
  --fg:        #fff;
  --dim:       rgba(255,255,255,.30);
  --border:    rgba(255,255,255,.13);
  --sidebar-w: 220px;
  --meta-h:    52px;
  --progress-h:2px;
  --info-w:    100vw;
  --f:         'Roboto', sans-serif;
  --f-display: 'Bebas Neue', sans-serif;
  --neon:      #39ff14;
  --accent:    #fff;
  --ease-expo: cubic-bezier(0.87, 0, 0.13, 1);
  --ease-circ: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html, body {
  width:100%; height:100%;
  background:var(--bg); color:var(--fg);
  font-family:var(--f);
  overflow:hidden;
  cursor: none; /* custom cursor */
}

/* ── CUSTOM CURSOR ───────────────────────────── */
#cursor-dot {
  position: fixed;
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .15s, height .15s, background .15s;
  mix-blend-mode: difference;
}
#cursor-ring {
  position: fixed;
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform .06s linear, width .25s var(--ease-circ), height .25s var(--ease-circ), border-color .2s;
  mix-blend-mode: difference;
}
body.cursor-hover #cursor-dot { width: 10px; height: 10px; background: var(--neon); }
body.cursor-hover #cursor-ring { width: 60px; height: 60px; border-color: var(--neon); }
body.cursor-glitch #cursor-ring { border-color: red; animation: cursorGlitch .15s steps(2) infinite; }
@keyframes cursorGlitch {
  0%   { transform: translate(calc(-50% + 3px), calc(-50% - 2px)); border-color: red; }
  50%  { transform: translate(calc(-50% - 3px), calc(-50% + 2px)); border-color: cyan; }
  100% { transform: translate(-50%, -50%); border-color: rgba(255,255,255,.5); }
}

/* ── WATER CANVAS ────────────────────────────── */
#water-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: .18;
}

/* ── LOADER ─────────────────────────────────── */
#loader {
  position:fixed; inset:0; background:#000; z-index:1000;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:14px;
  animation:loaderOut .5s ease 2s forwards;
  pointer-events:none;
}
@keyframes loaderOut { to { opacity:0; visibility:hidden; pointer-events:none; } }
.ll { font-family:var(--f-display); font-size:clamp(4rem,10vw,8rem); letter-spacing:.06em; line-height:.9; text-align:center; }
.ls { font-size:.55rem; letter-spacing:.35em; color:var(--dim); text-transform:uppercase; font-weight:400; }
.lbw { width:160px; height:1px; background:rgba(255,255,255,.1); margin-top:8px; }
.lb  { height:100%; background:#fff; animation:lp 1.8s ease forwards; }
@keyframes lp { from{width:0} to{width:100%} }

/* ── SWIPE FLASH ─────────────────────────────── */
#swipe-flash { position:fixed; inset:0; z-index:190; pointer-events:none; background:#fff; opacity:0; transition:opacity .06s; }

/* ════════════════════════════════════════════════
   HOME PAGE
════════════════════════════════════════════════ */
#home-page {
  position: fixed; inset: 0;
  z-index: 10;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  transition: opacity .7s var(--ease-expo), transform .7s var(--ease-expo);
}
#home-page::-webkit-scrollbar { display: none; }

/* ── HOME SECTIONS ───────────────────────────── */
#home-hero {
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
#home-tracks {
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 5vh, 60px) 0;
  overflow: hidden;
}
#home-page.exit {
  opacity: 0;
  transform: translateY(-40px);
  pointer-events: none;
}

/* ── HOME HERO HEADER ────────────────────────── */
#home-header {
  width: 100%;
  padding: clamp(24px, 4vh, 48px) clamp(24px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
#home-logo {
  display: flex;
  flex-direction: column;
  line-height: .88;
  user-select: none;
}
.hl-nasa, .hl-say {
  font-family: var(--f-display);
  font-size: clamp(5rem, 14vw, 13rem);
  letter-spacing: -.01em;
  color: #fff;
  display: block;
  position: relative;
  overflow: hidden;
  /* glitch effect on hover via JS class */
}
.hl-nasa::after, .hl-say::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  color: var(--neon);
  clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
  transition: clip-path .4s var(--ease-expo);
}
.hl-nasa:hover::after, .hl-say:hover::after {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  animation: glitchText .35s steps(3) forwards;
}
@keyframes glitchText {
  0%   { transform: skewX(0deg) translateX(0); }
  20%  { transform: skewX(-8deg) translateX(-4px); color: red; }
  40%  { transform: skewX(6deg) translateX(4px); color: cyan; }
  60%  { transform: skewX(-3deg) translateX(-2px); color: var(--neon); }
  100% { transform: skewX(0deg) translateX(0); }
}

#home-sub {
  max-width: none;
  font-size: clamp(.65rem, 1.1vw, .82rem);
  font-weight: 300;
  line-height: 1.4;
  color: rgba(255,255,255,.7);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.home-sub-nowrap { white-space: nowrap; }
.home-description {
  width: 100%;
  max-width: 450px;
  font-size: .95rem;
  font-weight: 300;
  line-height: 1.3;
  color: rgba(255,255,255,.45);
}

/* ── HOME TRACKLIST — deadwater style ─────────── */
#home-tracklist {
  width: 100%;
  padding: 0 clamp(24px, 5vw, 72px);
  position: relative;
}
#htl-label {
  font-size: .65rem;
  letter-spacing: .4em;
  color: rgba(255,255,255,.25);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
#htl-items {
  list-style: none;
  width: 100%;
}
.htl-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .2s;
}
.htl-item:hover { border-color: rgba(255,255,255,.2); }
.htl-item:hover .htl-num { color: #fff; }
.htl-item:hover .htl-name-inner { transform: translateX(8px); }
.htl-item:hover .htl-arrow { opacity: 1; transform: translateX(0); }

/* Number */
.htl-num {
  font-family: var(--f-display);
  font-size: clamp(1.6rem, 3.5vw, 3rem);
  color: rgba(255,255,255,.15);
  flex-shrink: 0;
  width: clamp(36px, 4vw, 56px);
  transition: color .3s var(--ease-expo);
  line-height: 1;
  letter-spacing: -.02em;
}

/* Name — clip reveal on hover */
.htl-name {
  flex: 1;
  overflow: hidden;
  padding: clamp(10px, 1.8vh, 18px) 0;
}
.htl-name-inner {
  font-family: var(--f-display);
  font-size: clamp(1.4rem, 3vw, 2.6rem);
  letter-spacing: .03em;
  color: #fff;
  text-transform: uppercase;
  transition: transform .4s var(--ease-expo);
  white-space: nowrap;
  line-height: 1;
}

/* Arrow hint */
.htl-arrow {
  font-size: 1.2rem;
  color: rgba(255,255,255,.4);
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity .3s, transform .4s var(--ease-expo);
  flex-shrink: 0;
  font-family: var(--f-display);
  letter-spacing: -.05em;
}

/* Hover full-width white bar (deadwater style) */
.htl-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: rgba(255,255,255,.04);
  transition: width .4s var(--ease-expo);
  z-index: 0;
}
.htl-item:hover::before { width: 100%; }
.htl-num, .htl-name, .htl-arrow { position: relative; z-index: 1; }

/* ── AMBIENT STATUS ──────────────────────────── */
#ambient-status {
  display: none;
}

/* ── SCROLL HINT ─────────────────────────────── */
#scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 10;
  transition: opacity .4s ease;
}
#scroll-hint.hint-hidden {
  opacity: 0;
}
.sh-text {
  font-family: var(--f);
  font-size: .52rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,255,255,.50);
  font-weight: 700;
  white-space: nowrap;
}
.sh-arrow {
  font-size: 1.7rem;
  transform: rotate(90deg);
  animation: sh-fade 2s ease-in-out infinite;
}
@keyframes sh-fade {
  0%, 100% { opacity: .2; }
  50%       { opacity: 1; }
}

/* ── SOURCES BUTTON ──────────────────────────── */
#sources-btn {
  position: absolute;
  top: clamp(24px, 4vh, 48px);
  right: 0;
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  background: rgba(0,0,0,.6);
  border: 1px solid var(--border);
  border-right: none;
  color: rgba(255,255,255,.55);
  font-family: var(--f);
  font-size: .42rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s;
  backdrop-filter: blur(6px);
}
#sources-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
#sources-btn.panel-open .ia-arrow { transform: rotate(180deg); }

/* ════════════════════════════════════════════════
   SOURCES PANEL
════════════════════════════════════════════════ */
#sources-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(500px, 100vw);
  background: rgba(0,0,0,.30);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid rgba(255,255,255,.15);
  z-index: 15;
  transform: translateX(100%);
  transition: transform .65s var(--ease-expo);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#sources-panel.open {
  transform: translateX(0);
}
#sources-close-btn {
  flex-shrink: 0;
  padding: 16px 24px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.45);
  font-family: var(--f);
  font-size: .5rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: color .2s;
}
#sources-close-btn:hover { color: #fff; }
#sources-panel-inner {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
  padding-bottom: 80px;
}
#sources-panel-inner::-webkit-scrollbar { width: 2px; }
#sources-panel-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); }
.sp-section {
  padding: clamp(20px, 3.5vh, 36px) clamp(20px, 3.5vw, 36px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .55s var(--ease-expo), transform .55s var(--ease-expo);
}
.sp-section.revealed {
  opacity: 1;
  transform: translateY(0);
}
.sp-num {
  font-family: var(--f-display);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  letter-spacing: .06em;
  color: rgba(255,255,255,.18);
  line-height: 1;
  margin-bottom: 12px;
}
.sp-citation {
  font-size: .68rem;
  font-weight: 400;
  line-height: 1.65;
  color: rgba(255,255,255,.42);
  letter-spacing: .015em;
  margin-bottom: 12px;
}
.sp-citation em { font-style: italic; }
.sp-description {
  font-size: .78rem;
  font-weight: 300;
  line-height: 1.5;
  color: rgba(255,255,255,.75);
  letter-spacing: .02em;
}

/* ════════════════════════════════════════════════
   TRACK PAGE
════════════════════════════════════════════════ */
#track-page {
  position: fixed; inset: 0;
  z-index: 20;
  display: flex;
  opacity: 0;
  pointer-events: none;
  transform: translateX(40px);
  transition: opacity .65s var(--ease-expo), transform .65s var(--ease-expo);
}
#track-page.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}
#track-page.hidden { display: none; }

/* ── SIDEBAR ─────────────────────────────────── */
#sidebar {
  position: relative;
  width: var(--sidebar-w);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  background: var(--bg);
  flex-shrink: 0;
}
#sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  transition: color .2s;
}
#back-btn:hover { color: #fff; }
.back-arrow { font-size: .85rem; line-height: 1; flex-shrink: 0; }

#sidebar-logo {
  display: flex;
  flex-direction: column;
  line-height: .88;
  user-select: none;
}
.sl-line {
  font-family: var(--f-display);
  font-size: 1.15rem;
  letter-spacing: -.01em;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
}
.sl-line::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  color: var(--neon);
  clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
  transition: clip-path .4s var(--ease-expo);
}
#back-btn:hover .sl-line::after {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  animation: glitchText .35s steps(3) forwards;
}

/* Track list in sidebar */
#track-list {
  flex:1; overflow-y:auto;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.06) transparent;
}
#track-list::-webkit-scrollbar { width:2px; }
#track-list::-webkit-scrollbar-thumb { background:rgba(255,255,255,.08); }

.titem {
  display:flex; align-items:baseline; gap:10px;
  padding: 9px 14px;
  border-bottom:1px solid rgba(255,255,255,.04);
  cursor:pointer;
  font-family: var(--f-display);
  font-size:.85rem; letter-spacing:.08em;
  color:rgba(255,255,255,.38);
  text-transform:uppercase;
  font-weight:500;
  transition:background .08s, color .08s;
  line-height:1.5;
  user-select:none;
}
.titem:hover { background:rgba(255,255,255,.05); color:#fff; }
.titem.active { background:#fff; color:#000; }
.titem-num { font-size:.75rem; color:var(--dim); flex-shrink:0; width:28px; font-weight:400; }
.titem.active .titem-num { color:rgba(0,0,0,.35); }
.titem-name { flex:1; font-size:.85rem; }

/* ── STAGE ───────────────────────────────────── */
#stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

/* ── SCENE ───────────────────────────────────── */
#scene-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}
#scene-canvas {
  position:absolute; inset:0;
  width:100%; height:100%;
  pointer-events:none;
}
#particle-canvas {
  position:absolute; inset:0;
  width:100%; height:100%;
  pointer-events:none;
  z-index:1;
}
#particle-canvas canvas {
  width:100% !important;
  height:100% !important;
}
#scene-dom {
  position:absolute; inset:0;
  width:100%; height:100%;
  overflow:hidden;
  z-index:2;
  /* leave bottom space for meta bar */
  padding-bottom: calc(var(--meta-h) + var(--progress-h) + 12px);
}

/* ── INFO ARROW BUTTON ───────────────────────── */
#info-arrow-btn {
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  background: rgba(0,0,0,.6);
  border: 1px solid var(--border);
  border-right: none;
  color: rgba(255,255,255,.55);
  font-family: var(--f);
  font-size: .42rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s;
  backdrop-filter: blur(6px);
}
#info-arrow-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.ia-arrow {
  font-size: 1.3rem;
  line-height: 1;
  display: block;
  transition: transform .3s var(--ease-expo);
}
#info-arrow-btn.panel-open .ia-arrow { transform: rotate(180deg); }

/* ── PROGRESS BAR ────────────────────────────── */
#progress-wrap {
  display: flex; align-items: center;
  gap: 10px; padding: 0 14px;
  height: 22px;
  flex-shrink: 0;
  background: var(--bg);
  border-top: 1px solid rgba(255,255,255,.06);
}
#progress-bar {
  flex:1; height:1px;
  background: rgba(255,255,255,.1);
  position:relative; overflow:hidden;
}
#progress-bar::after {
  content:''; position:absolute; top:0; left:0; bottom:0;
  width: var(--p, 0%);
  background: rgba(255,255,255,.6);
  transition: width .2s linear;
}
#progress-time {
  font-size:.38rem; letter-spacing:.1em;
  color:var(--dim); flex-shrink:0; font-weight:400;
}

/* ── META BAR (always visible) ───────────────── */
#meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  height: var(--meta-h);
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  overflow: hidden;
}
.meta-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 14px;
  border-right: 1px solid rgba(255,255,255,.06);
  min-width: 0;
}
.meta-item:last-child { border-right: none; }
.meta-lbl {
  font-size: .46rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,255,255,.50);
  font-weight: 700;
}
.meta-val {
  font-size: .68rem;
  letter-spacing: .05em;
  color: #fff;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ════════════════════════════════════════════════
   INFO PANEL — slides from right (full screen)
════════════════════════════════════════════════ */
#info-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(480px, 100vw);
  background: rgba(0,0,0,.30);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid rgba(255,255,255,.15);
  z-index: 200;
  transform: translateX(100%);
  transition: transform .65s var(--ease-expo);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#info-panel.open {
  transform: translateX(0);
}
#info-close-btn {
  flex-shrink: 0;
  padding: 16px 24px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.45);
  font-family: var(--f);
  font-size: .5rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: color .2s;
}
#info-close-btn:hover { color: #fff; }

#info-panel-inner {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
  padding-bottom: 80px;
}
#info-panel-inner::-webkit-scrollbar { width: 2px; }
#info-panel-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); }

/* Each section — designcanada inspired */
.ip-section {
  padding: clamp(24px, 4vh, 48px) clamp(20px, 3.5vw, 36px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .55s var(--ease-expo), transform .55s var(--ease-expo);
}
.ip-section.revealed {
  opacity: 1;
  transform: translateY(0);
}
.ip-section-label {
  font-family: var(--f-display);
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  letter-spacing: .06em;
  color: rgba(255,255,255,.18);
  line-height: 1;
  margin-bottom: 10px;
  text-transform: uppercase;
  transition: color .3s;
}
.ip-section:hover .ip-section-label { color: rgba(255,255,255,.32); }
.ip-section-text {
  font-size: .78rem;
  font-weight: 300;
  line-height: 1.5;
  color: rgba(255,255,255,.75);
  letter-spacing: .02em;
  max-width: 100%;
}

/* Culture links */
.id-culture {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.id-culture a {
  color: rgba(255,255,255,.7);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.15);
  padding-bottom: 4px;
  transition: color .2s, border-color .2s;
  font-size: .75rem;
}
.id-culture a:hover { color: #fff; border-color: #fff; }
.id-culture span {
  font-size: .75rem;
  color: rgba(255,255,255,.7);

}

/* ── SCENE WORDS (draggable) ─────────────────── */
[data-draggable] { cursor:grab; }
[data-draggable]:active { cursor:grabbing; }

/* ── REVEAL ANIMATIONS ───────────────────────── */
@keyframes lineReveal {
  from { opacity:0; transform:translateY(20px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 600px) {
  :root { --sidebar-w: 160px; }
  .htl-name-inner { font-size: 1.2rem; }
  .hl-nasa, .hl-say { font-size: 4.5rem; }
  #meta-bar { flex-wrap: wrap; height: auto; padding: 8px 0; }
  .meta-item { flex: 0 0 50%; border-right: none; border-bottom: 1px solid rgba(255,255,255,.06); }
}
