/* ========================================
   COSMIC TERMINAL — Academic Portfolio
   Aayush Randeep
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  /* Nebula palette */
  --bg-deep:        #06060f;
  --bg-surface:     #0c0c1d;
  --bg-card:        rgba(14, 14, 35, 0.55);
  --bg-card-hover:  rgba(22, 22, 55, 0.65);

  --accent-blue:    #4f8eff;
  --accent-violet:  #8b5cf6;
  --accent-cyan:    #22d3ee;
  --accent-pink:    #ec4899;

  --gradient-main:  linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
  --gradient-warm:  linear-gradient(135deg, var(--accent-violet), var(--accent-pink));
  --gradient-cool:  linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));

  --text-primary:   #e8e8f0;
  --text-secondary: #9d9db8;
  --text-muted:     #5e5e7e;
  --text-accent:    var(--accent-cyan);

  --border-subtle:  rgba(139, 92, 246, 0.15);
  --glow-blue:      0 0 30px rgba(79, 142, 255, 0.15);
  --glow-violet:    0 0 30px rgba(139, 92, 246, 0.15);

  /* Layout */
  --max-width:      1100px;
  --section-gap:    6rem;
  --card-radius:    16px;
  --pill-radius:    999px;

  /* Fonts */
  --font-sans:  'Inter', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-violet) var(--bg-deep);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.25s ease;
}
a:hover { color: var(--accent-blue); }

::selection {
  background: var(--accent-violet);
  color: #fff;
}

/* ---------- Starfield Canvas ---------- */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  background: rgba(6, 6, 15, 0.7);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.3s ease;
}

.nav__logo {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.nav__logo span {
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  font-weight: 400;
}

.nav__links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav__links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  padding-bottom: 2px;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-main);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.nav__links a:hover {
  color: var(--text-primary);
}
.nav__links a:hover::after {
  width: 100%;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ---------- Main Content ---------- */
.main {
  position: relative;
  z-index: 1;
}

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--section-gap) 2rem;
}

.section__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-violet);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section__label::before {
  content: '//';
  color: var(--text-muted);
}

.section__title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

/* ---------- Reveal Animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Hero Section ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
}

.hero__greeting {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeSlideUp 0.7s 0.3s ease forwards;
}

.hero__name {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeSlideUp 0.7s 0.5s ease forwards;
}

.hero__name .gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  color: var(--text-secondary);
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  opacity: 0;
  animation: fadeSlideUp 0.7s 0.7s ease forwards;
}

.hero__tagline .sep {
  color: var(--accent-violet);
}

.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeSlideUp 0.7s 0.9s ease forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--pill-radius);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none;
}

.btn--primary {
  background: var(--gradient-main);
  color: #fff;
  box-shadow: 0 4px 20px rgba(79, 142, 255, 0.3);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(79, 142, 255, 0.45);
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
}
.btn--outline:hover {
  border-color: var(--accent-violet);
  background: rgba(139, 92, 246, 0.08);
  transform: translateY(-2px);
  color: var(--text-primary);
}

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  letter-spacing: 0.15em;
  animation: pulse 2s ease-in-out infinite;
}

.hero__scroll .arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
}

/* ---------- About ---------- */
.about__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about__text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.85;
}

.about__text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.about__highlights {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.highlight-card {
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}

.highlight-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-violet);
  box-shadow: var(--glow-violet);
  transform: translateX(4px);
}

.highlight-card__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.25rem;
}

.highlight-card__value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------- Research Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 2.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-blue), var(--accent-violet), transparent);
  border-radius: 2px;
}

.timeline__item {
  position: relative;
  margin-bottom: 2.5rem;
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}

.timeline__item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
  box-shadow: var(--glow-blue);
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: -2.85rem;
  top: 1.8rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 3px solid var(--bg-deep);
  box-shadow: 0 0 12px rgba(79, 142, 255, 0.5);
}

.timeline__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.timeline__role {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  white-space: nowrap;
}

.timeline__org {
  font-size: 0.9rem;
  color: var(--accent-violet);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.timeline__details {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline__details li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.6;
}

.timeline__details li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent-blue);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.4;
}

/* ---------- Projects ---------- */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  backdrop-filter: blur(12px);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
  box-shadow: var(--glow-blue);
}

.project-card:hover::before {
  opacity: 0.03;
}

.project-card > * {
  position: relative;
  z-index: 1;
}

.project-card__icon {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  display: inline-block;
}

.project-card__title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.project-card__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.project-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.stat-badge {
  padding: 0.3rem 0.75rem;
  background: rgba(79, 142, 255, 0.1);
  border: 1px solid rgba(79, 142, 255, 0.2);
  border-radius: var(--pill-radius);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-cyan);
  font-weight: 500;
}

.project-card__link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ---------- Skills ---------- */
.skills__group {
  margin-bottom: 2rem;
}

.skills__group-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}

.skills__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.skill-pill {
  padding: 0.5rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--pill-radius);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
  cursor: default;
}

.skill-pill:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
  background: rgba(79, 142, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: var(--glow-blue);
}

.skill-pill--proficient {
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--text-primary);
}

/* ---------- Education ---------- */
.edu-card {
  padding: 2rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  backdrop-filter: blur(12px);
  margin-bottom: 2rem;
}

.edu-card__institution {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.edu-card__degree {
  font-size: 0.95rem;
  color: var(--accent-violet);
  margin-bottom: 0.5rem;
}

.edu-card__date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.edu-card__detail {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.coursework__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* ---------- Publications ---------- */
.pub-card {
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  backdrop-filter: blur(12px);
  margin-bottom: 1.25rem;
  transition: all 0.3s ease;
}

.pub-card:hover {
  border-color: var(--accent-violet);
  box-shadow: var(--glow-violet);
}

.pub-card__type {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-pink);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}

.pub-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.pub-card__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---------- Contact / Footer ---------- */
.contact {
  text-align: center;
  padding-bottom: 4rem;
}

.contact__heading {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.contact__sub {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.contact__links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--pill-radius);
  font-size: 0.9rem;
  color: var(--text-secondary);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.contact__link:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--glow-blue);
}

.footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

/* ---------- Animations ---------- */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav__links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    flex-direction: column;
    background: rgba(6, 6, 15, 0.97);
    backdrop-filter: blur(24px);
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    transition: right 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    border-left: 1px solid var(--border-subtle);
  }

  .nav__links.open {
    right: 0;
  }

  .nav__toggle {
    display: flex;
    z-index: 110;
  }

  .nav__toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav__toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .nav__toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .about__content {
    grid-template-columns: 1fr;
  }

  .hero__name {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .projects__grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 3rem 1.25rem;
  }

  .timeline {
    padding-left: 1.75rem;
  }

  .timeline__header {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .nav {
    padding: 0.75rem 1rem;
  }

  .hero__cta {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    justify-content: center;
  }

  .contact__links {
    flex-direction: column;
    align-items: center;
  }
}
