/* ══════════════════════════════════════════════════════
   THE CAREER RIDE — Immersive 3D Portfolio
   Full-screen Three.js + scroll-driven content
══════════════════════════════════════════════════════ */

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

:root {
  --font: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'Space Mono', monospace;
  --gold: #FFD700;
  --saffron: #FF9933;
  --green: #138808;
  --cyan: #00d4ff;
  --white: #f0f6fc;
  --muted: rgba(255,255,255,0.5);
  --glass: rgba(6,8,18,0.88);
  --glass-border: rgba(255,255,255,0.12);
}

html {
  font-family: var(--font);
  color: var(--white);
  background: #000;
}
body {
  margin: 0;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ── 3D CANVAS: covers entire viewport ── */
#world {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  display: block;
}

/* ── SCROLL DRIVER: invisible tall div ── */
#scroll-driver {
  position: relative;
  z-index: 1;
  width: 100%;
  /* height set by JS based on content */
  pointer-events: none;
}

/* ── LOADER ── */
#loader {
  position: fixed; inset: 0;
  z-index: 1000;
  background: #050710;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s;
}
#loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-auto {
  font-size: 64px;
  animation: loader-bounce 1s ease-in-out infinite;
}
@keyframes loader-bounce {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}
.loader-text {
  font-family: var(--mono); font-size: 13px;
  color: var(--muted); margin-top: 20px; letter-spacing: 0.1em;
}
.loader-bar {
  width: 160px; height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px; margin-top: 16px;
  overflow: hidden;
}
.loader-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--saffron), var(--gold));
  border-radius: 2px;
  transition: width 0.3s;
}

/* ── NAV ── */
#topnav {
  position: fixed; top: 20px; right: 24px;
  z-index: 50;
  display: flex; gap: 20px;
  opacity: 0; transition: opacity 0.6s;
}
#topnav.show { opacity: 1; }
#topnav a {
  color: var(--muted); text-decoration: none;
  font-size: 12px; font-family: var(--mono);
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  transition: color 0.2s, border-color 0.2s;
}
#topnav a:hover { color: #fff; border-color: rgba(255,255,255,0.25); }

/* ── PROGRESS BAR ── */
#progress {
  position: fixed; right: 24px;
  top: 50%; transform: translateY(-50%);
  z-index: 50;
  display: flex; flex-direction: column;
  align-items: center;
  opacity: 0; transition: opacity 0.6s;
}
#progress.show { opacity: 1; }
.progress-road {
  width: 2px; height: 200px;
  background: repeating-linear-gradient(
    180deg,
    rgba(255,255,255,0.12) 0px,
    rgba(255,255,255,0.12) 6px,
    transparent 6px,
    transparent 12px
  );
  position: relative;
}
.progress-auto {
  position: absolute; top: 0; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  transition: top 0.2s linear;
  filter: drop-shadow(0 0 6px rgba(255,215,0,0.6));
}
.progress-dots {
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  height: 200px;
  display: flex; flex-direction: column;
  justify-content: space-between;
}
.progress-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: background 0.3s, transform 0.3s;
}
.progress-dots span.active {
  background: var(--gold);
  transform: scale(1.4);
  box-shadow: 0 0 8px var(--gold);
  animation: dot-pop 0.3s cubic-bezier(0.16,1,0.3,1);
}
@keyframes dot-pop {
  from { transform: scale(0.5); }
  to { transform: scale(1.4); }
}

/* ── CONTENT PANELS ── */
.panel {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.panel.visible {
  opacity: 1;
  pointer-events: auto;
  touch-action: pan-y;
}
.panel-inner {
  max-width: 600px;
  padding: 48px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  transform: translateY(30px);
  transition: transform 0.6s cubic-bezier(0.16,1,0.3,1), opacity 0.5s;
}
.panel.visible .panel-inner {
  transform: translateY(0);
}
.panel-wide { max-width: 800px; }

/* Content panels: left-aligned immersive layout */
.panel[data-index="1"],
.panel[data-index="2"],
.panel[data-index="3"],
.panel[data-index="4"] {
  justify-content: flex-start;
  padding-left: 4vw;
}
.panel[data-index="1"] .panel-inner,
.panel[data-index="2"] .panel-inner,
.panel[data-index="3"] .panel-inner,
.panel[data-index="4"] .panel-inner {
  background: linear-gradient(105deg, rgba(6,8,18,0.94) 0%, rgba(6,8,18,0.72) 75%, rgba(6,8,18,0) 100%);
  border: none;
  border-left: 3px solid var(--gold);
  border-radius: 0 20px 20px 0;
  padding: 44px 56px 44px 36px;
}

/* ── HERO PANEL ── */
.panel-hero {
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(6,8,18,0.88) 0%, rgba(6,8,18,0.5) 70%, transparent 100%);
  border: none;
  max-width: 720px;
  border-radius: 32px;
  padding: 56px 48px;
}
.hero-tag {
  display: inline-block;
  font-size: 11px; font-family: var(--mono);
  color: var(--gold); letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 6px 16px;
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 999px;
  margin-bottom: 28px;
}
.panel-hero h1 {
  font-size: clamp(52px, 10vw, 100px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
  text-shadow: 0 4px 40px rgba(0,0,0,0.6), 0 0 80px rgba(255,215,0,0.1);
}
.light { color: var(--white); }
.gradient {
  background: linear-gradient(135deg, var(--gold), var(--saffron));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-role {
  font-size: 16px; color: var(--muted);
  font-family: var(--mono);
  margin-bottom: 36px;
}
.hero-stats {
  display: flex; gap: 32px; justify-content: center;
  margin-bottom: 40px;
}
.stat { text-align: center; }
.stat strong {
  display: block;
  font-size: 28px; font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), #a855f7);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat span {
  font-size: 11px; color: var(--muted);
  font-family: var(--mono); letter-spacing: 0.05em;
}
/* ── SCROLL PROMPT ── */
.scroll-prompt {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
  animation: prompt-fade 2.5s ease-in-out infinite;
  transition: opacity 0.6s ease;
}
@keyframes prompt-fade {
  0%,100% { opacity: 0.5; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(4px); }
}
.scroll-dot {
  animation: scroll-bob 1.5s ease-in-out infinite;
}
@keyframes scroll-bob {
  0%,100% { cy: 10; }
  50% { cy: 24; opacity: 0.3; }
}
.scroll-prompt-text {
  font-size: 11px; color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.scroll-prompt.hidden { display: none; }

/* ── CONTENT PANELS ── */
.panel-km {
  font-family: var(--mono); font-size: 11px;
  color: var(--saffron); letter-spacing: 0.15em;
  text-transform: uppercase; margin-bottom: 16px;
  padding: 4px 12px;
  border: 1px solid rgba(255,153,51,0.3);
  border-radius: 6px;
  display: inline-block;
}
.panel-content h2 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  line-height: 1.12;
  margin-bottom: 22px;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 24px rgba(0,0,0,0.5);
}
.panel-content h2 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--cyan), #a855f7);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.panel-content p {
  font-size: 15px; color: rgba(255,255,255,0.85);
  line-height: 1.75; margin-bottom: 14px;
}
.panel-content p strong { color: #fff; }
.chips {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px;
}
.chips span {
  font-size: 11px; font-family: var(--mono);
  color: var(--cyan); padding: 5px 12px;
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 6px;
  background: rgba(0,212,255,0.05);
}

/* ── EXPERIENCE GRID ── */
.exp-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 16px; margin-top: 20px;
}
.exp-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px; padding: 20px;
  position: relative;
}
.exp-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.exp-role {
  font-size: 11px !important; font-family: var(--mono);
  color: var(--cyan) !important; margin-bottom: 10px !important;
}
.exp-card p { font-size: 13px !important; line-height: 1.6 !important; margin-bottom: 0 !important; }
.exp-badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 9px; font-family: var(--mono);
  color: var(--gold); letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 4px;
}
.exp-current { border-color: rgba(255,215,0,0.15); }

/* ── PROJECT GRID ── */
.proj-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 16px; margin-top: 20px;
}
.proj-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px; padding: 20px;
  transition: border-color 0.2s;
}
.proj-card:hover { border-color: rgba(255,255,255,0.15); }
.proj-icon { font-size: 28px; margin-bottom: 10px; }
.proj-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.proj-card p { font-size: 12px !important; line-height: 1.6 !important; margin-bottom: 10px !important; }
.proj-card a {
  font-size: 12px; color: var(--cyan);
  text-decoration: none; font-family: var(--mono);
  transition: gap 0.2s; display: inline-flex; gap: 4px;
}
.proj-card a:hover { gap: 8px; }

/* ── SKILLS ── */
.skill-cols {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 20px; margin-bottom: 24px;
}
.skill-cols h4 {
  font-size: 11px; font-family: var(--mono);
  color: #a855f7; letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 8px;
}
.skill-cols p { font-size: 13px !important; line-height: 1.7 !important; }
.edu-row {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.edu-pill {
  font-size: 13px; padding: 8px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
}
.edu-pill strong { color: #fff; }

/* ── GAME PANEL ── */
.panel-game h1 { margin-bottom: 10px; }
.game-title { font-size: clamp(40px, 8vw, 72px) !important; }
.game-controls {
  display: flex; gap: 10px; justify-content: center;
  flex-wrap: wrap; margin-bottom: 28px;
}
.game-controls span {
  font-size: 11px; font-family: var(--mono);
  color: rgba(255,255,255,0.5);
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
}

/* ── BUTTONS ── */
.btn-play {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 36px; border-radius: 12px;
  font-size: 15px; font-weight: 700;
  font-family: var(--font);
  background: linear-gradient(135deg, var(--gold), var(--saffron));
  color: #111; border: none; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(255,215,0,0.3);
}
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  font-family: var(--font);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff; cursor: pointer;
  transition: background 0.2s;
  margin-left: 10px;
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); }

/* ── GAME HUD ── */
#game-hud {
  position: fixed; top: 16px; left: 16px;
  z-index: 60;
  display: flex; gap: 10px; align-items: center;
}
#game-hud.hidden { display: none; }
#hud-lives, #hud-score {
  background: var(--glass);
  border: 1px solid rgba(255,215,0,0.2);
  backdrop-filter: blur(8px);
  border-radius: 10px; padding: 8px 14px;
  font-family: var(--mono); font-size: 13px;
  color: var(--gold);
}
#hud-exit {
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  border-radius: 8px; padding: 6px 14px;
  color: rgba(255,255,255,0.6);
  font-size: 12px; font-family: var(--mono);
  cursor: pointer; transition: color 0.2s;
}
#hud-exit:hover { color: #fff; }

/* (Checkpoint card removed — resume shown during scroll, game goes straight to survival) */

/* ── SPLASH ── */
#splash {
  position: fixed; inset: 0;
  z-index: 70;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(6px);
}
#splash.hidden { display: none; }
.splash-inner { text-align: center; padding: 40px; }
.splash-kan { font-size: 16px; color: rgba(255,215,0,0.6); margin-bottom: 8px; }
.splash-inner h2 {
  font-size: 48px; font-weight: 700;
  font-family: var(--mono); color: #fff;
  text-shadow: 0 0 40px rgba(255,215,0,0.3);
  margin-bottom: 12px;
}
#splash-score { font-size: 16px; color: var(--muted); margin-bottom: 24px; font-family: var(--mono); }
.splash-inner .btn-play { margin-right: 8px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .panel-inner { padding: 28px 20px; margin: 16px; }
  .exp-grid, .proj-grid, .skill-cols { grid-template-columns: 1fr; }
  .panel-wide { max-width: 100%; }
  .hero-stats { gap: 16px; }
  .stat strong { font-size: 22px; }
  #progress { display: none; }
  #topnav { top: 12px; right: 12px; gap: 8px; }
  #topnav a { font-size: 10px; padding: 5px 10px; }
}
@media (max-width: 480px) {
  .panel-hero h1 { font-size: 40px; }
  .hero-stats { flex-direction: column; gap: 8px; }
}
