/* -------------- Base & Layout -------------- */

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

:root {
  --bg-deep: #050716;
  --bg-card: rgba(11, 16, 40, 0.85);
  --bg-card-soft: rgba(19, 23, 57, 0.9);
  --accent: #ff7cf7;
  --accent-soft: #8e2de2;
  --text-main: #e6e7ff;
  --text-muted: #a7a8c4;
  --border-soft: rgba(255, 255, 255, 0.12);
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.6);
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--text-main);
  background-color: var(--bg-deep);
  overflow-x: hidden;
}

/* -------------- Background Animations -------------- */

#background-gradient {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 10% 0%, #3a1c71 0, transparent 45%),
    radial-gradient(circle at 90% 100%, #0f9b8e 0, transparent 40%),
    linear-gradient(135deg, #0b1028, #050716);
  opacity: 0.95;
  z-index: -2;
  animation: bgPulse 18s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% {
    transform: scale(1);
    filter: hue-rotate(0deg);
  }
  100% {
    transform: scale(1.02);
    filter: hue-rotate(12deg);
  }
}

#starfield {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.7) 1px, transparent 0),
    radial-gradient(circle, rgba(255, 255, 255, 0.4) 1px, transparent 0);
  background-size: 180px 180px, 260px 260px;
  background-position: 0 0, 80px 80px;
  opacity: 0.22;
  z-index: -1;
  animation: starDrift 40s linear infinite;
}

@keyframes starDrift {
  from {
    background-position: 0 0, 80px 80px;
  }
  to {
    background-position: 0 600px, 80px 680px;
  }
}

/* -------------- Floating Atoms -------------- */

.atom {
  position: fixed;
  pointer-events: none;
  z-index: -1;
}

.atom-1 {
  top: 10%;
  left: 8%;
  transform-origin: center;
  animation: floatAtom1 20s ease-in-out infinite alternate;
}
.atom-2 {
  bottom: 8%;
  right: 5%;
  transform-origin: center;
  animation: floatAtom2 24s ease-in-out infinite alternate;
}

@keyframes floatAtom1 {
  0% {
    transform: translate3d(0, 0, 0) scale(0.9);
  }
  100% {
    transform: translate3d(40px, 30px, 0) scale(1.05);
  }
}

@keyframes floatAtom2 {
  0% {
    transform: translate3d(0, 0, 0) scale(0.8);
  }
  100% {
    transform: translate3d(-35px, -25px, 0) scale(0.95);
  }
}

.atom .nucleus {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: radial-gradient(circle, #ffffff, var(--accent-soft));
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}

.atom .orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.atom-1 .orbit-1 {
  width: 80px;
  height: 50px;
  top: -5px;
  left: -20px;
  transform: rotate(25deg);
}
.atom-1 .orbit-2 {
  width: 90px;
  height: 60px;
  top: -10px;
  left: -25px;
  transform: rotate(-25deg);
}

.atom-2 .orbit-1 {
  width: 70px;
  height: 45px;
  top: -4px;
  left: -18px;
  transform: rotate(35deg);
}

.electron {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
}

.atom-1 .e-1 {
  top: -5px;
  left: 15px;
  animation: orbit1 8s linear infinite;
}
.atom-1 .e-2 {
  bottom: -10px;
  left: 40px;
  animation: orbit2 10s linear infinite;
}
.atom-2 .e-1 {
  top: 5px;
  left: 30px;
  animation: orbit3 9s linear infinite;
}

@keyframes orbit1 {
  from {
    transform: rotate(0deg) translateX(30px);
  }
  to {
    transform: rotate(360deg) translateX(30px);
  }
}
@keyframes orbit2 {
  from {
    transform: rotate(0deg) translateX(-25px);
  }
  to {
    transform: rotate(360deg) translateX(-25px);
  }
}
@keyframes orbit3 {
  from {
    transform: rotate(0deg) translateX(25px);
  }
  to {
    transform: rotate(360deg) translateX(25px);
  }
}

/* -------------- HUD / Header -------------- */

.hud {
  position: fixed;
  inset: 0 auto auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: linear-gradient(
    to right,
    rgba(5, 7, 22, 0.9),
    rgba(5, 7, 22, 0.4),
    transparent
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: conic-gradient(from 180deg, var(--accent), #2af598, #4facfe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fira Code", monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: #050716;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.35);
}

.hud-title h1 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}
.hud-title p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hud-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hud-pill {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-decoration: none;
  color: var(--text-main);
  background: rgba(5, 7, 22, 0.7);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
}
.hud-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}
.hud-pill.primary {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  border-color: transparent;
  color: #050716;
}
.hud-pill.ghost {
  background: transparent;
}

/* -------------- Progress Nav -------------- */

.progress-nav {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
}

.progress-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.progress-nav li + li {
  margin-top: 16px;
}

.progress-nav a {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(5, 7, 22, 0.7);
  transition: transform 0.2s ease, background 0.25s ease, border-color 0.25s ease;
}

.progress-nav a::after {
  content: attr(data-episode);
  position: absolute;
  right: 150%;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: rgba(5, 7, 22, 0.95);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.progress-nav a:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(-4px);
}

.progress-nav a.active {
  background: var(--accent);
  border-color: transparent;
  transform: scale(1.2);
}

/* -------------- Journey / Chapters -------------- */

.journey {
  height: 100vh;
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
}

.chapter {
  min-height: 100vh;
  padding: 96px 10vw 40px;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: center;
}

.chapter-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  background: linear-gradient(
    135deg,
    rgba(5, 7, 22, 0.9),
    rgba(9, 11, 34, 0.9)
  );
  border-radius: 24px;
  padding: 28px 26px 26px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

.chapter::before {
  content: attr(data-episode);
  position: absolute;
  left: 9vw;
  top: 72px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.35);
}

.chapter-meta {
  margin-bottom: 18px;
}

.episode-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.chapter-title {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0;
  min-height: 2.2em; /* room for typewriter */
}

.chapter-content {
  position: relative;
}

.chapter-text {
  font-size: 0.98rem;
  color: var(--text-main);
  margin-bottom: 16px;
  max-width: 52rem;
}

.highlight {
  color: var(--accent);
  font-weight: 600;
}

/* -------------- Grids & Cards -------------- */

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
  align-items: flex-start;
  margin-top: 10px;
}

.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1rem;
}

.card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.card ul li {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.chapter-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

/* Timeline */

.timeline {
  border-left: 2px dashed rgba(255, 255, 255, 0.2);
  padding-left: 18px;
  margin-top: 12px;
}

.timeline-item {
  position: relative;
  margin-bottom: 16px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

.timeline-item h3 {
  font-size: 0.98rem;
  margin: 0 0 4px;
}
.timeline-sub {
  margin: 0 0 2px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.timeline-tag {
  margin: 0;
  font-size: 0.83rem;
  color: var(--accent);
}

/* Lists */

.subheading {
  font-size: 1rem;
  margin-top: 14px;
  margin-bottom: 6px;
}

.bullet-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
}

.bullet-list li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.bullet-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* -------------- Contact Panel -------------- */

.contact-panel {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 260px;
  background: var(--bg-card-soft);
  border-radius: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  font-size: 0.85rem;
}

.contact-panel h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.contact-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-panel li {
  margin-bottom: 5px;
}

.contact-panel span {
  color: var(--text-muted);
  display: inline-block;
  min-width: 60px;
}

.contact-panel a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.83rem;
}

/* -------------- Scroll Hint Button -------------- */

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(5, 7, 22, 0.9);
  padding: 8px 16px;
  color: var(--text-main);
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.25s ease;
}

.scroll-hint:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.7);
  background: rgba(5, 7, 22, 0.98);
}

/* -------------- Final Chapter / Footer -------------- */

.chapter.final .chapter-inner {
  background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.08), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 0.08), transparent 50%),
    linear-gradient(135deg, #090e2b, #050716);
}

.job-card ul li {
  font-size: 0.9rem;
}

.callout p {
  font-size: 0.9rem;
  color: var(--text-main);
}

.cta-button {
  margin-top: 10px;
  display: inline-flex;
  padding: 9px 16px;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: #050716;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.6);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 34px rgba(0, 0, 0, 0.7);
}

.site-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* -------------- Typewriter Effect (JS will fill text) -------------- */

.typewriter {
  font-family: "Fira Code", monospace;
  border-right: 2px solid var(--accent);
  white-space: nowrap;
  overflow: hidden;
}

.typewriter.done {
  border-right-color: transparent;
}

/* -------------- Responsive -------------- */

@media (max-width: 960px) {
  .hud {
    padding: 10px 16px;
  }
  .hud-right {
    display: none;
  }
  .chapter {
    padding: 90px 16px 44px;
  }
  .chapter-inner {
    padding: 18px 16px 20px;
    border-radius: 18px;
  }
  .contact-panel {
    position: static;
    width: 100%;
    margin-top: 10px;
  }
  .grid-two {
    grid-template-columns: minmax(0, 1fr);
  }
  .progress-nav {
    right: 12px;
  }
}

@media (max-width: 600px) {
  .chapter-title {
    font-size: 1.35rem;
  }
  .chapter-text {
    font-size: 0.92rem;
  }
  .timeline-sub,
  .timeline-tag {
    font-size: 0.8rem;
  }
}

/* -------------- Print (simple CV-ish) -------------- */

@media print {
  body {
    background: #ffffff;
    color: #000000;
  }

  #background-gradient,
  #starfield,
  .atom,
  .hud,
  .progress-nav,
  .scroll-hint {
    display: none !important;
  }

  .journey {
    overflow: visible;
    height: auto;
  }

  .chapter {
    page-break-after: always;
    padding: 20px;
  }

  .chapter-inner {
    box-shadow: none;
    border-radius: 0;
    background: #ffffff;
    border: none;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  .typewriter {
    border-right: none;
  }
}

