/* ============================================================
   Khaleil Pirmohamed — resume site
   Dark theme · particle canvas · scroll reveals · hover tilt
   ============================================================ */

:root {
  --bg: #0a0e17;
  --bg-2: #0e1422;
  --surface: rgba(20, 28, 46, 0.6);
  --border: rgba(120, 160, 255, 0.12);
  --text: #dbe2f1;
  --text-dim: #8b97b0;
  --accent: #7c6cff;
  --accent-2: #38d6ff;
  --accent-3: #ff6cbd;
  --gradient: linear-gradient(120deg, var(--accent), var(--accent-2));
  --radius: 14px;
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
}

::selection { background: rgba(124, 108, 255, 0.4); }

/* scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent), var(--accent-2));
  border-radius: 6px;
}

/* ---------- particle canvas ---------- */
#particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: block;
}

/* ambient gradient blobs */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -2;
  width: 55vw;
  height: 55vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.10;
  pointer-events: none;
}
body::before { top: -25vw; right: -20vw; background: var(--accent); animation: drift 22s ease-in-out infinite alternate; }
body::after  { bottom: -25vw; left: -20vw; background: var(--accent-2); animation: drift 26s ease-in-out infinite alternate-reverse; }

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(6vw, 4vh) scale(1.15); }
}

a { color: inherit; text-decoration: none; }

strong { color: #fff; font-weight: 600; }

/* ============================================================
   NAV
   ============================================================ */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  transition: background 0.35s ease, backdrop-filter 0.35s ease, padding 0.35s ease, box-shadow 0.35s ease;
}
#nav.scrolled {
  background: rgba(10, 14, 23, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--border);
  padding: 0.7rem 2rem;
}

.nav-logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}
.nav-logo .dot { color: var(--accent-2); }

#nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
#nav-links a {
  color: var(--text-dim);
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.25s ease;
}
#nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px; width: 100%;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
#nav-links a:hover, #nav-links a.active { color: #fff; }
#nav-links a:hover::after, #nav-links a.active::after { transform: scaleX(1); }

.nav-cta {
  border: 1px solid var(--accent) !important;
  border-radius: 8px;
  padding: 0.45rem 1rem !important;
  color: var(--accent-2) !important;
}
.nav-cta::after { display: none; }
.nav-cta:hover {
  background: rgba(124, 108, 255, 0.12);
  box-shadow: 0 0 18px rgba(124, 108, 255, 0.35);
}

#nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 110;
}
#nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
#nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#nav-toggle.open span:nth-child(2) { opacity: 0; }
#nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.8rem 1.6rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
  will-change: transform;
}
.btn-primary {
  background: var(--gradient);
  color: #05070d;
  font-weight: 600;
  box-shadow: 0 4px 24px rgba(124, 108, 255, 0.25);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(124, 108, 255, 0.45);
}
.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}
.btn-ghost:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(124, 108, 255, 0.2);
}
.btn-small { padding: 0.55rem 1.1rem; font-size: 0.8rem; }
.btn-big { font-size: 1.05rem; padding: 1rem 2.2rem; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 7rem 2rem 4rem;
  position: relative;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 4.5rem;
  max-width: 1050px;
  width: 100%;
}

.hero-photo {
  position: relative;
  flex-shrink: 0;
  animation: float 6s ease-in-out infinite;
}
.hero-photo img {
  width: 240px;
  height: auto;
  border-radius: 18px;
  display: block;
  position: relative;
  z-index: 1;
  filter: saturate(1.05);
  transition: filter 0.4s ease;
}
.hero-photo:hover img { filter: saturate(1.2) brightness(1.05); }

.photo-ring {
  position: absolute;
  inset: -10px;
  border-radius: 24px;
  background: var(--gradient);
  filter: blur(24px);
  opacity: 0.35;
  animation: pulse 4s ease-in-out infinite;
  z-index: 0;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(1.05); }
}

.hero-hi {
  font-family: var(--font-mono);
  color: var(--accent-2);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.hero-name {
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
}
.hero-name .accent {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-family: var(--font-head);
  font-size: clamp(1.15rem, 2.8vw, 1.7rem);
  font-weight: 500;
  color: var(--text-dim);
  margin: 0.6rem 0 1.2rem;
  min-height: 1.6em;
}
#typed { color: var(--text); }
.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
  font-weight: 400;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-bio {
  max-width: 560px;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: flex;
  gap: 3rem;
  list-style: none;
  font-family: var(--font-mono);
}
.hero-stats li { display: flex; align-items: baseline; gap: 0.15rem; }
.stat-num {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-plus { font-size: 1.1rem; color: var(--accent-2); font-weight: 600; }
.stat-label { color: var(--text-dim); font-size: 0.75rem; margin-left: 0.4rem; align-self: center; }

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  color: var(--text-dim);
  animation: bob 1.8s ease-in-out infinite;
  transition: color 0.3s ease;
}
.scroll-hint:hover { color: var(--accent-2); }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(8px); }
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  max-width: 950px;
  margin: 0 auto;
  padding: 5.5rem 2rem 2rem;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  letter-spacing: -0.01em;
}
.section-title .num {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--accent);
}
.section-title::after {
  content: "";
  flex: 1;
  max-width: 280px;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
  margin-left: 0.5rem;
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 3rem;
}
.about-grid p { margin-bottom: 1.1rem; color: var(--text-dim); }

.about-facts {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  height: fit-content;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.about-facts:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 108, 255, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 24px rgba(124, 108, 255, 0.12);
}
.about-facts h3 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}
.about-facts ul { list-style: none; }
.about-facts li {
  display: flex;
  gap: 0.6rem;
  padding: 0.45rem 0;
  font-size: 0.92rem;
  color: var(--text-dim);
  border-bottom: 1px dashed rgba(120, 160, 255, 0.1);
}
.about-facts li:last-child { border-bottom: none; }
.about-facts a { color: var(--accent-2); }
.about-facts a:hover { text-decoration: underline; }

/* ---------- timeline ---------- */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
  border-radius: 2px;
}

.t-item { position: relative; padding-bottom: 2.2rem; }
.t-item:last-child { padding-bottom: 0; }

.t-dot {
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 12px rgba(124, 108, 255, 0.6);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.t-item:hover .t-dot {
  transform: scale(1.3);
  box-shadow: 0 0 20px rgba(56, 214, 255, 0.8);
}

.t-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.7rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.t-card:hover {
  transform: translateX(6px);
  border-color: rgba(124, 108, 255, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.t-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-2);
  display: block;
  margin-bottom: 0.4rem;
}
.t-card h3 {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
}
.t-card h3 em {
  font-style: normal;
  color: var(--accent-3);
  font-size: 0.95rem;
}
.t-tag {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0.25rem 0 0.7rem;
}
.t-card ul { list-style: none; }
.t-card ul li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
  color: var(--text-dim);
}
.t-card ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), rgba(124, 108, 255, 0.12), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.project-card:hover::before { opacity: 1; }
.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(124, 108, 255, 0.4);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 30px rgba(124, 108, 255, 0.1);
}

.project-card.featured {
  background: linear-gradient(145deg, rgba(124, 108, 255, 0.14), rgba(56, 214, 255, 0.07));
  border-color: rgba(124, 108, 255, 0.3);
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.p-icon { font-size: 2rem; }
.p-links a {
  color: var(--text-dim);
  transition: color 0.25s ease, transform 0.25s ease;
  display: inline-flex;
}
.p-links a:hover { color: var(--accent-2); transform: translateY(-2px); }

.project-card h3 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.6rem;
}
.project-card p {
  color: var(--text-dim);
  font-size: 0.92rem;
  flex-grow: 1;
  margin-bottom: 1rem;
}

.p-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin-bottom: 1.2rem;
}
.p-tags li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent-2);
  background: rgba(56, 214, 255, 0.05);
  transition: background 0.25s ease, border-color 0.25s ease;
}
.project-card:hover .p-tags li {
  border-color: rgba(56, 214, 255, 0.35);
  background: rgba(56, 214, 255, 0.1);
}

/* ---------- awards ---------- */
.awards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
.award-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.award-card:hover {
  transform: translateY(-6px) rotate(-0.5deg);
  border-color: rgba(255, 108, 189, 0.35);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}
.award-medal { font-size: 1.8rem; }
.award-card h3 {
  font-family: var(--font-head);
  font-size: 0.98rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
}
.award-card p { font-size: 0.82rem; color: var(--text-dim); }

/* ---------- skills ---------- */
.skills-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.skill {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: default;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}
.skill em { font-style: normal; color: var(--text-dim); font-size: 0.75rem; }
.skill:hover {
  transform: translateY(-4px) scale(1.05);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px rgba(124, 108, 255, 0.25);
}

/* ---------- contact ---------- */
.contact { text-align: center; padding-bottom: 3rem; }
.contact-box { max-width: 620px; margin: 0 auto; }
.contact-lead {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 2.2rem 2rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 0.7rem;
}
.footer-links a { color: var(--accent-2); transition: color 0.25s ease; }
.footer-links a:hover { color: #fff; text-decoration: underline; }

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
/* stagger siblings */
.reveal.visible:nth-child(2) { transition-delay: 0.1s; }
.reveal.visible:nth-child(3) { transition-delay: 0.2s; }
.reveal.visible:nth-child(4) { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero-inner {
    flex-direction: column-reverse;
    text-align: center;
    gap: 2.5rem;
  }
  .hero-bio { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero-stats { justify-content: center; gap: 2rem; }
  .about-grid { grid-template-columns: 1fr; }
  .project-grid, .awards-grid { grid-template-columns: 1fr; }

  #nav-toggle { display: flex; }
  #nav-links {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    background: rgba(8, 11, 19, 0.96);
    backdrop-filter: blur(18px);
    font-size: 1.2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
  }
  #nav-links.open {
    opacity: 1;
    pointer-events: auto;
  }
}