/* ═══════════════════════════════════════════
   COSMOS — Global Styles
   Black & white minimalist astronomy theme
   ═══════════════════════════════════════════ */

/* ── Font Face ── */
@font-face {
  font-family: 'JiXiHei';
  src: url('../fonts/AaJiXiHei-2.ttf') format('truetype');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Numbers';
  src: url('../fonts/Numbers.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Variables ── */
:root {
  --black: #000000;
  --near-black: #0a0a0a;
  --dark: #111111;
  --white: #ffffff;
  --off-white: rgba(255,255,255,0.85);
  --gray-light: rgba(255,255,255,0.5);
  --gray-mid: rgba(255,255,255,0.28);
  --gray-dark: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.18);

  --font-sans: 'JiXiHei', 'Satoshi Variable', 'Inter', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Noto Sans SC', monospace;

  --ease-cosmos: cubic-bezier(0.625, 0.05, 0, 1);
  --ease-cosmos-out: cubic-bezier(0.16, 1, 0.3, 1);

  --nav-height: 60px;
  --section-padding: 120px 80px;
}

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

html {
  font-size: clamp(13px, calc(14 * (100vw / 1440)), 22px);
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: auto;
}

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.8;
  overflow-x: hidden;
  cursor: none;
  letter-spacing: 0.02em;
}

::-webkit-scrollbar { display: none; }
::selection { background: transparent; color: inherit; }
* { user-select: none; -webkit-user-select: none; }

img, svg { display: block; }
a { text-decoration: none; color: inherit; }

button { border: none; background: none; cursor: none; font-family: inherit; color: inherit; }
a { cursor: none; }

/* ── Lenis ── */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

/* ── Starfield Canvas (global background) ── */
.starfield-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}


/* ── Section Base ── */
.section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: var(--section-padding);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── Side Nav ── */
.side-nav {
  position: fixed;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}

.side-nav__dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.32);
  transition: all 0.4s var(--ease-cosmos-out);
  display: block;
}

.side-nav__dot.active {
  background: var(--white);
  transform: scale(1.5);
  box-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.side-nav__label {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(255,255,255,0.86);
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
  pointer-events: none;
}

.side-nav__dot:hover .side-nav__label,
.side-nav__dot.active .side-nav__label {
  opacity: 1;
}

/* ── Star Tooltip ── */
.star-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 10003;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--white);
  background: rgba(0,0,0,0.85);
  border: 1px solid var(--gray-dark);
  padding: 8px 14px;
  opacity: 0;
  transition: opacity 0.25s ease;
  line-height: 1.6;
  letter-spacing: 0.05em;
}
.star-tooltip.is-visible { opacity: 1; }
.star-tooltip__name {
  font-size: 0.75rem;
  margin-bottom: 2px;
}
.star-tooltip__data {
  color: var(--gray-light);
  font-size: 0.65rem;
}

/* ── Star Info Card ── */
.star-card {
  position: fixed;
  z-index: 9000;
  width: 320px;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 16px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.star-card.is-open {
  opacity: 1;
  pointer-events: auto;
}
.star-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.star-card__name {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--white);
}
.star-card__close {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.3);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s;
  line-height: 1;
}
.star-card__close:hover { color: #fff; }
.star-card__body {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.star-card__color {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.06);
}
.star-card__props {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}
.star-card__prop {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.6rem;
}
.star-card__prop span:first-child {
  color: rgba(255,255,255,0.3);
}
.star-card__prop span:last-child {
  color: rgba(255,255,255,0.7);
  text-align: right;
}
.star-card__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.star-card__listen {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 6px 16px;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s var(--ease-cosmos-out);
}
.star-card__listen:hover {
  color: var(--white);
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.04);
}
.star-card__listen.is-playing {
  color: #6c5ce7;
  border-color: #6c5ce766;
  animation: listenPulse 1.5s ease-in-out infinite;
}
@keyframes listenPulse {
  0%, 100% { box-shadow: 0 0 0 transparent; }
  50% { box-shadow: 0 0 10px rgba(108,92,231,0.15); }
}
.star-card__status {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.08em;
}

/* ── Preloader (Hyperspace Warp) ── */
.preloader {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: var(--black);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.preloader-warp {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.preloader-content {
  position: relative; z-index: 2; text-align: center;
}

.preloader-text-track {
  overflow: hidden;
  margin-bottom: 48px;
}

.preloader-text-inner {
  display: flex; gap: 4px; justify-content: center;
  font-family: var(--font-sans);
  font-size: 3rem; font-weight: 300; letter-spacing: 0.25em;
  color: var(--white);
}

.preloader-text-inner span:not(.preloader-gap) {
  display: inline-block;
  will-change: transform, opacity;
}

.preloader-gap { width: 32px; }

/* ── Constellation Modal ── */
.constellation-modal {
  position: fixed; inset: 0; z-index: 10001;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s;
}
.constellation-modal.is-open { opacity: 1; pointer-events: auto; }
.constellation-modal__bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.94);
  backdrop-filter: blur(8px);
}
.constellation-modal__content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  max-width: min(900px, 92vw); width: 90%;
}
.constellation-modal__title {
  font-size: 1.5rem; font-weight: 300; letter-spacing: 0.2em;
  margin-bottom: 24px; text-align: center;
}
.constellation-modal__canvas {
  width: 100%; max-width: min(800px, 90vw);
  aspect-ratio: 5/4; display: block;
}
.constellation-modal__info {
  margin-top: 16px; min-height: 40px;
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--gray-light); text-align: center;
}
.constellation-modal__close {
  position: absolute; top: -40px; right: 0;
  font-size: 2rem; color: var(--gray-light);
  background: none; border: none; cursor: pointer;
  transition: color 0.3s; line-height: 1;
}
.constellation-modal__close:hover { color: var(--white); }

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 0 40px;
}

.hero-particles {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  perspective: 800px;
}

.hero-title {
  font-size: clamp(5rem, 16vw, 14rem);
  font-weight: 200;
  letter-spacing: 0.25em;
  line-height: 1;
  margin-bottom: 24px;
}

.hero-title .char {
  display: inline-block;
  opacity: 0; /* hidden until GSAP animates in */
}

.hero-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: indicatorBounce 2s infinite;
}

.hero-indicator__text {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--gray-light);
}

.hero-indicator__arrow {
  opacity: 0.6;
}

@keyframes indicatorBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ── Constellation ── */
.constellation {
  position: relative;
  z-index: 1;
}

.constellation-header {
  margin-bottom: 60px;
  text-align: center;
}

.constellation-title {
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.constellation-desc {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 200;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.68);
  opacity: 1;
}

/* ── Constellation Slider ── */
.constellation-slider {
  position: relative;
  width: 100%;
  height: 460px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.constellation-cards {
  position: relative;
  width: 240px;
  height: 320px;
  list-style: none;
  cursor: none;
}

.drag-proxy {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
}

.constellation-card {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.72);
  padding: 20px 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
  will-change: transform, opacity;
  transition: top 0.35s var(--ease-cosmos-out), border-color 0.35s, background 0.35s;
}

.constellation-card:hover {
  top: -8px;
  border-color: rgba(255,255,255,0.36);
  background: rgba(0,0,0,0.86);
}

.constellation-card__canvas {
  width: 100%;
  max-width: 140px;
  margin-bottom: 12px;
  display: block;
}

.constellation-card__name {
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  margin-bottom: 3px;
  color: rgba(255,255,255,0.82);
  transition: color 0.35s;
}

.constellation-card:hover .constellation-card__name {
  color: rgba(255,255,255,0.95);
}

.constellation-card__desc {
  font-size: 0.6rem;
  font-family: var(--font-mono);
  color: rgba(255,255,255,0.48);
  transition: color 0.35s;
}

.constellation-card:hover .constellation-card__desc {
  color: rgba(255,255,255,0.6);
}

/* ── Cosmic Clock (Digital Timeline) ── */
.clock {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

.clock__inner {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

/* ── Header ── */
.clock__header {
  text-align: center;
}
.clock__title {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 200;
  letter-spacing: 0.18em;
  margin-bottom: 10px;
  text-shadow: 0 0 40px rgba(255,255,255,0.03);
}
.clock__sub {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 200;
  letter-spacing: 0.25em;
  color: rgba(255,255,255,0.68);
  opacity: 1;
}

/* ── Digital display ── */
.clock__display {
  text-align: center;
  padding: 20px 0;
}
.clock__time {
  font-family: 'Numbers', var(--font-mono);
  font-size: clamp(3.5rem, 10vw, 6rem);
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--white);
  text-shadow: 0 0 30px rgba(255,255,255,0.05);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  line-height: 1;
}

/* ── Progress rail ── */
.clock__rail {
  position: relative;
  width: 100%;
  height: 40px;
  margin: 8px 0;
}
.clock__rail-bg {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255,255,255,0.08);
  transform: translateY(-50%);
}
.clock__rail-fill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 1px;
  background: rgba(255,255,255,0.3);
  transform: translateY(-50%);
  width: 0%;
  transition: width 0.15s linear;
}

/* ── Dots on rail ── */
.clock__dot {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  transform: translate(-50%, -50%);
  transition: all 0.4s var(--ease-cosmos-out);
  cursor: pointer;
  z-index: 2;
}
.clock__dot.is-active {
  width: 10px;
  height: 10px;
  background: var(--white);
  box-shadow: 0 0 12px rgba(255,255,255,0.3);
}
.clock__dot.is-past {
  background: rgba(255,255,255,0.3);
}

/* Position each dot */
.clock__dot[data-ix="0"] { left: 0%; }
.clock__dot[data-ix="1"] { left: 7.7%; }
.clock__dot[data-ix="2"] { left: 15.4%; }
.clock__dot[data-ix="3"] { left: 23.1%; }
.clock__dot[data-ix="4"] { left: 30.8%; }
.clock__dot[data-ix="5"] { left: 38.5%; }
.clock__dot[data-ix="6"] { left: 46.2%; }
.clock__dot[data-ix="7"] { left: 53.8%; }
.clock__dot[data-ix="8"] { left: 61.5%; }
.clock__dot[data-ix="9"] { left: 69.2%; }
.clock__dot[data-ix="10"] { left: 76.9%; }
.clock__dot[data-ix="11"] { left: 84.6%; }
.clock__dot[data-ix="12"] { left: 92.3%; }
.clock__dot[data-ix="13"] { left: 100%; }

/* ── Dot labels ── */
.clock__dot-label {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.45rem;
  color: rgba(255,255,255,0.15);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.clock__dot.is-active .clock__dot-label,
.clock__dot:hover .clock__dot-label {
  opacity: 1;
  color: rgba(255,255,255,0.5);
}

/* ── Event card ── */
.clock__card {
  width: 100%;
  max-width: 520px;
  text-align: center;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 0 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.clock__card-title {
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  line-height: 1.3;
}
.clock__card-year {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--gray-light);
  letter-spacing: 0.15em;
  opacity: 0.6;
}
.clock__card-desc {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.68);
  line-height: 1.8;
  letter-spacing: 0.03em;
  max-width: 440px;
}

/* ── Event image ── */
.clock__image-wrap {
  width: 100%;
  max-width: 400px;
  height: 140px;
  overflow: hidden;
  border-radius: 4px;
  margin-top: -8px;
  transition: height 0.5s var(--ease-cosmos-out);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}

.clock__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.58;
  filter: grayscale(1);
  transition: all 0.5s var(--ease-cosmos-out);
  will-change: filter, opacity;
  background: rgba(0,0,0,0.15);
}

.clock__image-wrap:hover {
  height: 180px;
}

.clock__image-wrap:hover .clock__image {
  filter: grayscale(0);
  opacity: 0.85;
}

/* ── Scroll hint ── */
.clock__hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.35;
  animation: hintBreathe 2.5s ease-in-out infinite;
}
.clock__hint-text {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--gray-light);
  letter-spacing: 0.15em;
}
.clock__hint-arrow {
  font-size: 1rem;
  color: var(--gray-light);
}

@keyframes hintBreathe {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 0.5; transform: translateY(4px); }
}

/* ── Clock Responsive ── */
@media (max-width: 768px) {
  .clock__inner { padding: 40px 24px; gap: 28px; }
  .clock__time { font-size: clamp(2.5rem, 8vw, 4rem); }
  .clock__card { min-height: 120px; }
  .clock__card-title { font-size: 1.2rem; }
  .clock__dot-label { display: none; }
}

/* ── ASCII Solar System ── */
.ascii {
  position: relative;
  z-index: 1;
}

.ascii-container {
  display: flex;
  align-items: center;
  gap: 80px;
  width: 100%;
}

.ascii-info {
  flex: 0 0 auto;
  max-width: 380px;
  min-width: 200px;
}

.ascii-title {
    font-size: clamp(3rem, 6vw, 4rem);
    font-weight: 250;
    line-height: 1.15;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
    white-space: nowrap;
}

.ascii-desc {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 200;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.68);
  opacity: 1;
  margin-bottom: 32px;
}

.ascii-canvas-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  overflow: hidden;
}

.ascii-pre {
  font-size: 6.5px;
  line-height: 7px;
  letter-spacing: 0;
  text-align: center;
  white-space: pre;
  user-select: none;
  font-family: 'Courier New', Courier, monospace;
  margin: 0;
}

.ascii-pre .sun { font-weight: bold; text-shadow: 0 0 8px rgba(255,255,255,0.6), 0 0 24px rgba(255,240,220,0.3); }
.ascii-pre .planet { text-shadow: 0 0 2px rgba(255,255,255,0.15); }
.ascii-pre .moon { color: rgba(255,255,255,0.45); }
.ascii-pre .orbit { color: rgba(255,255,255,0.08); }

/* ── Nebula Filing Cabinet ── */
.gallery {
  position: relative;
  z-index: 1;
  padding-bottom: 160px;
}

.gallery-header {
  margin-bottom: 60px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.gallery-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: 0.08em;
}

.gallery-desc {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 200;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.68);
  opacity: 1;
}

/* === Cabinet Container === */
.nebula-cabinet {
  display: flex;
  width: 100%;
  height: 560px;
  gap: 2px;
  background: transparent;
  user-select: none;
}

/* === Individual Folder === */
.nebula-folder {
  position: relative;
  height: 100%;
  flex-basis: 0;
  flex-grow: 1;
  overflow: hidden;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.5s ease;
  will-change: flex-grow;
}

.nebula-folder:last-child {
  border-right: none;
}

.nebula-folder:hover {
  border-right-color: rgba(255, 255, 255, 0.22);
}

.nebula-folder.active {
  flex-grow: 12;
  cursor: default;
  border-right-color: rgba(255, 255, 255, 0.06);
}

/* === Folder Tab / Spine === */
.folder-tab {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 36px;
  background: rgba(0, 0, 0, 0.18);
  z-index: 10;
  transition: background 0.6s ease;
}

.nebula-folder.active .folder-tab {
  background: rgba(0, 0, 0, 0.44);
}

.tab-id {
  color: rgba(255, 255, 255, 0.34);
  font-size: 0.6rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
}

.tab-text {
  writing-mode: vertical-rl;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1rem;
  letter-spacing: 0.12em;
  font-weight: 300;
  white-space: nowrap;
  transition: color 0.4s ease;
}

.nebula-folder.active .tab-text {
  color: rgba(255, 255, 255, 0.9);
}

.tab-icon {
  color: rgba(255, 255, 255, 0.28);
  font-size: 0.75rem;
  transition: color 0.4s ease;
}

.nebula-folder.active .tab-icon {
  color: rgba(255, 255, 255, 0.35);
}

/* === Folder Expanded Content === */
.folder-content {
  position: absolute;
  left: 48px;
  top: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.nebula-folder.active .folder-content {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.6s ease 0.35s;
}

/* === Media Area === */
.nebula-folder .gallery-card__media {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.nebula-bg {
  width: 110%;
  height: 110%;
  object-fit: cover;
  opacity: 0.68;
  position: absolute;
  top: -5%;
  left: -5%;
  animation: nebula-breathe 12s ease-in-out infinite;
  filter: contrast(1.08) brightness(0.92);
  z-index: 0;
}

.nebula-folder.active .nebula-bg {
  opacity: 0.92;
  animation-duration: 15s;
}

.nebula-folder .gallery-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.76) 0%, rgba(0,0,0,0.34) 34%, rgba(0,0,0,0.08) 72%),
    linear-gradient(0deg, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.12) 48%, rgba(0,0,0,0.34) 100%);
}

@keyframes nebula-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* Keep star twinkle layer */
.nebula-folder .gallery-card__stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 50% 30%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 70% 80%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 85% 40%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 15% 75%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 45% 10%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 90% 65%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 60% 90%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 25% 45%, rgba(255,255,255,0.4), transparent);
  opacity: 0.2;
  animation: stars-twinkle 4s ease-in-out infinite alternate;
  z-index: 2;
  pointer-events: none;
}

.nebula-folder.active .gallery-card__stars {
  opacity: 0.4;
}

@keyframes stars-twinkle {
  0% { opacity: 0.1; }
  100% { opacity: 0.35; }
}

/* === Data Panel — readable by default, brightens on mouse hover === */
.folder-data {
  position: absolute;
  bottom: 32px;
  left: 32px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px 28px;
  border-left: 1px solid rgba(255, 255, 255, 0.34);
  max-width: 400px;
  color: #fff;
  opacity: 0.72;
  transition: opacity 0.35s ease;
  pointer-events: none;
  box-shadow: 0 18px 60px rgba(0,0,0,0.38);
}

.folder-data__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 2px 8px;
  border-radius: 1px;
  margin-bottom: 12px;
}

.folder-data__title {
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  line-height: 1.2;
}

.folder-data__desc {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
  margin-bottom: 16px;
}

.folder-data__stats {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.folder-data__stats .stat {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.05em;
}

.folder-data__stats .stat strong {
  display: block;
  font-size: 0.52rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.42);
  margin-bottom: 2px;
}

/* ── Cursor Dot (in-page custom cursor) ── */
.cursor-dot {
  position: fixed;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  pointer-events: none;
  z-index: 10002;
  transform: translate(-50%, -50%);
  transition: width 0.25s, height 0.25s, background 0.25s, border 0.25s;
  will-change: transform, width, height;
}
.cursor-dot.is-hover {
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.6);
}

/* ── Footer ── */
.footer {
  position: relative;
  z-index: 1;
  padding: 280px 40px 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.footer-glow {
  position: absolute;
  bottom: 0; left: -20%; right: -20%;
  height: 60%;
  background: radial-gradient(ellipse at 50% 100%, rgba(255,255,255,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s;
}

.footer-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.footer-title {
  font-size: clamp(5rem, 9vw, 8rem);
  font-weight: 100;
  padding-left: 0em;
  margin-bottom: 20px;
  line-height: 1;
}

.footer-tagline {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 200;
  letter-spacing: 0.2em;
  color: var(--white);
  opacity: 0.5;
  margin-bottom: 64px;
  text-shadow: 0 0 20px rgba(255,255,255,0.04);
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}

.footer-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.35);
  transition: color 0.4s;
}

.footer-link:hover { color: var(--white); }

.footer-sep {
  color: rgba(255,255,255,0.1);
  font-size: 0.7rem;
}

.footer-back {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.15);
  transition: color 0.4s, transform 0.4s;
}

.footer-back:hover {
  color: rgba(255,255,255,0.5);
  transform: translateY(-3px);
}

/* ── Footer Spacer (empty scroll room for star glow at bottom) ── */
.footer-spacer {
  height: 100vh;
  pointer-events: none;
}

/* ── Noise Texture Overlay ── */

body::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── Scroll Progress Bar ── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  z-index: 9999;
  pointer-events: none;
}

.scroll-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(255,255,255,0.1), rgba(255,255,255,0.4));
  transition: width 0.1s linear;
}

/* ── Responsive: Footer ── */
@media (max-width: 768px) {
  :root {
    --section-padding: 80px 24px;
  }

  html {
    font-size: 14px;
  }

  body {
    cursor: auto;
  }

  button,
  a {
    cursor: pointer;
  }

  .cursor-dot {
    display: none;
  }

  .side-nav {
    right: 14px;
    gap: 14px;
  }

  .side-nav__label {
    display: none;
  }

  .hero {
    padding: 0 24px;
  }

  .hero-title {
    letter-spacing: 0.12em;
  }

  .constellation-header,
  .gallery-header {
    margin-bottom: 40px;
  }

  .constellation-desc,
  .gallery-desc,
  .ascii-desc {
    letter-spacing: 0.08em;
  }

  .ascii-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
  }

  .ascii-title {
    white-space: normal;
    font-size: clamp(2.4rem, 12vw, 3.5rem);
  }

  .ascii-canvas-wrapper {
    width: 100%;
    min-height: 260px;
  }

  .ascii-pre {
    font-size: 4.5px;
    line-height: 5px;
    max-width: 100%;
  }

  .gallery {
    padding-bottom: 80px;
  }

  .gallery-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .nebula-cabinet {
    flex-direction: column;
    height: 720px;
    gap: 1px;
  }

  .nebula-folder {
    width: 100%;
    min-height: 56px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .nebula-folder:last-child {
    border-bottom: none;
  }

  .nebula-folder.active {
    flex-grow: 8;
  }

  .folder-tab {
    right: 0;
    bottom: auto;
    width: 100%;
    height: 52px;
    flex-direction: row;
    justify-content: space-between;
    padding: 0 18px;
  }

  .tab-id,
  .tab-text {
    writing-mode: horizontal-tb;
  }

  .tab-text {
    font-size: 0.9rem;
  }

  .folder-content {
    left: 0;
    top: 52px;
  }

  .folder-data {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
    padding: 18px;
    opacity: 0.9;
    pointer-events: auto;
  }

  .folder-data__title {
    font-size: 1.25rem;
  }

  .folder-data__desc {
    font-size: 0.78rem;
    line-height: 1.6;
  }

  .folder-data__stats {
    gap: 12px;
  }

  .footer { padding: 80px 24px 50px; }
  .footer-links { gap: 28px; }
}
