/* ============================================================================
   Global layout
   ============================================================================ */
:root {
  --accent: #3dfcff;
  --accent-2: #66f7b0;
  --ink: #eaf4ff;
  --panel-bg: rgba(10, 14, 34, 0.62);
  --panel-border: rgba(120, 200, 255, 0.28);
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #04030f;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

.hidden {
  display: none !important;
}

/* ============================================================================
   HUD (mute button, progress pill, toast)
   ============================================================================ */
#hud {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 90;
}

#mute-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  pointer-events: auto;
  cursor: pointer;
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  background: rgba(8, 12, 30, 0.55);
  color: var(--ink);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}
#mute-btn:hover {
  border-color: var(--accent);
  background: rgba(20, 40, 60, 0.7);
}
#mute-btn:active {
  transform: scale(0.92);
}
#mute-btn.muted {
  color: rgba(234, 244, 255, 0.35);
  border-color: rgba(234, 244, 255, 0.2);
}
#mute-btn .bar {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 2px;
  background: rgba(234, 244, 255, 0.35);
  transform: translate(-50%, -50%) rotate(45deg);
  display: none;
}
#mute-btn.muted .bar {
  display: block;
}

#progress-pill {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  font-size: 14px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
}

#toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 16px 30px;
  border-radius: 14px;
  background: rgba(8, 24, 18, 0.82);
  border: 1px solid rgba(102, 247, 176, 0.4);
  color: #b9ffd9;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 40px var(--shadow);
  pointer-events: none;
}
.toast-in {
  animation: toast-in 0.3s ease forwards;
}
.toast-out {
  animation: toast-out 0.3s ease forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
@keyframes toast-out {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -60%) scale(1.05);
  }
}

/* ============================================================================
   Intro overlay
   ============================================================================ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(20, 18, 60, 0.6), rgba(4, 3, 15, 0.92));
  transition: opacity 0.6s ease;
}
.overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}
.intro-card {
  max-width: 620px;
  width: 90%;
  text-align: center;
  padding: 40px 30px;
  border-radius: 22px;
  background: rgba(10, 14, 34, 0.4);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 80px var(--shadow);
}
#intro-title {
  margin: 0;
  font-size: clamp(22px, 4.4vw, 42px);
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(90deg, #7fdcff, #66f7b0, #a98bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(102, 247, 176, 0.25);
}
#intro-subtitle {
  margin: 18px auto 26px;
  font-size: clamp(15px, 2.4vw, 18px);
  line-height: 1.6;
  color: rgba(234, 244, 255, 0.82);
  max-width: 520px;
  white-space: pre-line;
}
.btn-primary {
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 14px 36px;
  font-size: 18px;
  font-weight: 700;
  color: #04121a;
  background: linear-gradient(90deg, var(--accent), #66f7b0);
  box-shadow: 0 10px 30px rgba(61, 252, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(61, 252, 255, 0.45);
}
.btn-primary:active {
  transform: translateY(0);
}
.hint {
  margin-top: 20px;
  font-size: 13px;
  color: rgba(234, 244, 255, 0.5);
}

/* ============================================================================
   Breakthrough flash
   ============================================================================ */
#flash {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: #ffffff;
  pointer-events: none;
}
.flash-in {
  animation: flash-in 0.7s ease forwards;
}
.flash-out {
  animation: flash-out 0.7s ease forwards;
}
@keyframes flash-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes flash-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* ============================================================================
   Resume panel (4 tabbed images)
   ============================================================================ */
#resume {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 28px;
  gap: 16px;
  background: linear-gradient(
    180deg,
    rgba(4, 3, 15, 0.25),
    rgba(4, 3, 15, 0.02) 30%,
    rgba(4, 3, 15, 0.02) 70%,
    rgba(4, 3, 15, 0.3)
  );
}
.fade-in {
  animation: panel-in 0.8s ease forwards;
}
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.resume-header {
  display: flex;
  align-items: center;
  gap: 16px;
}
.resume-header h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 30px);
  letter-spacing: 0.05em;
  text-shadow: 0 2px 14px var(--shadow);
}
.resume-tab {
  cursor: pointer;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(10, 14, 34, 0.45);
  backdrop-filter: blur(6px);
  text-decoration: none;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease,
    border-color 0.2s ease;
}
.resume-tab:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.resume-stage {
  position: relative;
  flex: 1;
  width: min(100%, 1200px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  box-shadow: 0 24px 70px var(--shadow);
  background: rgba(10, 14, 34, 0.5);
}
.pdf-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(10, 14, 34, 0.55);
}
.pdf-btn {
  cursor: pointer;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(20, 40, 70, 0.4);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.pdf-btn:hover {
  border-color: var(--accent);
  background: rgba(40, 70, 110, 0.5);
}
.pdf-btn:active {
  transform: scale(0.95);
}
.pdf-page {
  min-width: 64px;
  text-align: center;
  font-size: 13px;
  color: rgba(234, 244, 255, 0.8);
}
.pdf-spacer {
  flex: 1;
}
.pdf-viewport {
  position: relative;
  flex: 1;
  overflow: auto;
  background: rgba(4, 3, 15, 0.35);
  padding: 14px;
}
.pdf-content {
  position: relative;
  margin: auto;
}
.pdf-content canvas {
  display: block;
  background: #ffffff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.pdf-linklayer {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}
.pdf-linklayer a {
  display: block;
  background: transparent;
  cursor: pointer;
}
.resume-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(234, 244, 255, 0.5);
  font-size: 16px;
}
