/* ============================================================
   Adnan Khan — adnankhan.me
   Dark-first premium design · single file · zero JS frameworks
   ============================================================ */

/* ---------- Reset & base ---------- */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: #e5e7eb;
  background: #0a0a0f;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- Animated background ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 140, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 140, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at top, #000 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at top, #000 40%, transparent 80%);
}
.bg-glow {
  position: fixed; top: -300px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 900px; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(168, 85, 247, 0.08) 40%, transparent 70%);
  filter: blur(60px);
}

/* ---------- Container ---------- */
.container { max-width: 1040px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  background: rgba(10, 10, 15, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.5rem;
}
.brand {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600; font-size: 1rem;
  color: #f0f0f5; letter-spacing: -0.01em;
}
.brand-accent {
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav-links { display: flex; gap: 1.8rem; }
.nav-links a {
  color: #a1a1aa; font-size: 0.92rem; font-weight: 500;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: #f0f0f5; }
@media (max-width: 640px) { .nav-links { display: none; } }

/* ---------- Typography ---------- */
h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem); margin: 1rem 0 1.2rem;
  line-height: 1.05; letter-spacing: -0.035em; font-weight: 800;
  color: #f8fafc;
}
h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin: 0 0 0.6rem;
  letter-spacing: -0.025em; font-weight: 700; color: #f8fafc;
}
h3 { font-size: 1.2rem; font-weight: 600; margin: 0; color: #f0f0f5; letter-spacing: -0.01em; }
h4 { font-size: 1rem; font-weight: 600; margin: 0 0 0.4rem; color: #f8fafc; text-transform: uppercase; letter-spacing: 0.06em; }
p { margin: 0.6rem 0; }

.grad {
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.85em; }

a { color: #a5b4fc; text-decoration: none; transition: color 0.2s ease; }
a:hover { color: #c7d2fe; }

/* ---------- Hero ---------- */
.hero { padding: 6rem 0 5rem; position: relative; }
.hero-inner {
  display: grid; grid-template-columns: 1fr auto;
  gap: 3rem; align-items: center;
}
.hero-text { min-width: 0; }
.hero-photo { display: flex; justify-content: center; align-items: center; }
.photo-ring {
  position: relative;
  width: 220px; height: 220px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  box-shadow: 0 10px 40px rgba(99, 102, 241, 0.35);
  animation: float 6s ease-in-out infinite;
}
.photo-ring::before {
  content: ""; position: absolute; inset: -2px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
  filter: blur(18px); opacity: 0.5; z-index: -1;
}
.photo-ring img {
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; object-position: center 30%;
  display: block; background: #0a0a0f;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-photo { order: -1; }
  .photo-ring { width: 150px; height: 150px; }
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.45rem 0.9rem; border-radius: 999px;
  background: rgba(99, 102, 241, 0.1); border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe; font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.01em; margin: 0;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 12px #4ade80;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}
.tagline { font-size: 1.1rem; color: #a1a1aa; margin: 0 0 1rem; font-weight: 500; }
.badges {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.4rem;
}
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.75rem; border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d4d4d8; font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.01em;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.badge:hover {
  border-color: rgba(129, 140, 248, 0.4);
  background: rgba(129, 140, 248, 0.08);
}
.pitch { font-size: 1.15rem; max-width: 40rem; color: #cbd5e1; line-height: 1.7; }
.pitch strong { color: #f0f0f5; font-weight: 600; }

/* ---------- Buttons ---------- */
.cta { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 0.7rem; }
.btn {
  display: inline-block; padding: 0.75rem 1.3rem; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.04);
  color: #f0f0f5; font-weight: 500; font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover {
  text-decoration: none; background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18); transform: translateY(-2px); color: #fff;
}
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #7c7ff4, #9b6df8);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.45);
}
.btn-ghost { background: transparent; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px; padding: 1.4rem 1.5rem;
  transition: transform 0.2s ease, border-color 0.25s ease, background 0.25s ease;
}
.card:hover {
  border-color: rgba(129, 140, 248, 0.3);
  background: linear-gradient(180deg, rgba(129, 140, 248, 0.04), rgba(129, 140, 248, 0.01));
}

/* ---------- Stat grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem; margin-top: 1rem;
}
.stat:hover { transform: translateY(-3px); }
.stat-num {
  font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1;
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 0.5rem;
}
.stat-num .times { font-weight: 600; }
.stat-num .mono { font-size: 1.3rem; }
.stat-label { font-size: 0.92rem; color: #a1a1aa; line-height: 1.5; }
.muted { color: #71717a; font-style: italic; }

/* ---------- Section heads ---------- */
.section-head { margin: 5rem 0 2rem; }
.kicker {
  display: inline-block; font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem; font-weight: 500;
  color: #a5b4fc; background: rgba(99, 102, 241, 0.1);
  padding: 0.3rem 0.7rem; border-radius: 6px;
  margin-bottom: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.section-intro { color: #a1a1aa; max-width: 42rem; font-size: 1.02rem; margin-top: 0.6rem; }

/* ---------- Projects ---------- */
.project { margin-bottom: 1.4rem; padding: 0; overflow: hidden; }
.project-demo {
  margin: -1px -1px 0; background: #000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  max-height: 380px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.project-demo img {
  width: 100%; height: auto; display: block;
  max-height: 380px; object-fit: cover; object-position: top;
}
.project-body { padding: 1.4rem 1.5rem 1.5rem; }
.project-head {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.3rem;
}
.project-head h3 { display: flex; align-items: center; gap: 0.5rem; font-size: 1.35rem; }
.project-head .icon { font-size: 1.4rem; }
.pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.pill {
  display: inline-block; padding: 0.25rem 0.7rem; font-size: 0.72rem;
  font-weight: 500; color: #c7d2fe; background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2); border-radius: 999px;
  letter-spacing: 0.02em;
}
.project-sub {
  font-weight: 500; color: #d4d4d8; margin: 0.7rem 0 0.8rem;
  font-size: 1rem; line-height: 1.5;
}
.project p { color: #a1a1aa; }
.project strong, .project em { color: #e5e7eb; }
.project-links { margin-top: 1.1rem; display: flex; gap: 0.6rem; flex-wrap: wrap; }
.link-btn {
  padding: 0.55rem 1rem; border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  font-weight: 500; font-size: 0.9rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.link-btn:hover {
  text-decoration: none; transform: translateY(-2px); color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}
.link-btn-ghost {
  background: transparent; color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.link-btn-ghost:hover { background: rgba(99, 102, 241, 0.1); }

/* ---------- Press & Recognition ---------- */
.press-card {
  display: block; padding: 1.6rem 1.8rem; border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.04));
  border: 1px solid rgba(129, 140, 248, 0.25);
  text-decoration: none; color: inherit;
  transition: transform 0.2s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.press-card:hover {
  text-decoration: none; color: inherit;
  transform: translateY(-3px);
  border-color: rgba(129, 140, 248, 0.5);
  box-shadow: 0 10px 40px rgba(99, 102, 241, 0.18);
}
.press-meta {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.6rem;
}
.press-source {
  font-family: 'JetBrains Mono', monospace; font-size: 0.78rem;
  color: #c7d2fe; letter-spacing: 0.04em;
  background: rgba(99, 102, 241, 0.15); padding: 0.3rem 0.7rem; border-radius: 6px;
}
.press-date {
  font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: #71717a;
}
.press-title {
  font-size: 1.25rem; line-height: 1.35; margin: 0.2rem 0 0.9rem;
  color: #f8fafc; font-weight: 600;
}
.press-quote {
  margin: 0.6rem 0 1rem; padding: 0.8rem 1rem;
  border-left: 3px solid #818cf8;
  background: rgba(255, 255, 255, 0.02);
  color: #cbd5e1; font-style: italic; font-size: 0.98rem;
  border-radius: 0 8px 8px 0;
}
.press-quote cite {
  display: block; margin-top: 0.5rem; font-style: normal;
  color: #a1a1aa; font-size: 0.85rem;
}
.press-link {
  display: inline-block; margin-top: 0.3rem;
  color: #a5b4fc; font-weight: 500; font-size: 0.92rem;
}
.press-card:hover .press-link { color: #c7d2fe; }

/* ---------- Writing ---------- */
.writing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem; margin-top: 1rem;
}
.writing-card {
  display: flex; flex-direction: column;
  padding: 1.4rem 1.5rem; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none; color: inherit;
  transition: transform 0.2s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.writing-card:hover {
  text-decoration: none; color: inherit;
  transform: translateY(-3px);
  border-color: rgba(129, 140, 248, 0.35);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15);
}
.writing-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.8rem;
}
.writing-type {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72rem;
  color: #c7d2fe; background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 0.2rem 0.55rem; border-radius: 999px;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.writing-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; color: #71717a;
}
.writing-title {
  font-size: 1.08rem; line-height: 1.35; margin: 0 0 0.6rem;
  color: #f8fafc; font-weight: 600;
}
.writing-excerpt {
  color: #a1a1aa; font-size: 0.92rem; line-height: 1.55;
  margin: 0 0 1rem; flex-grow: 1;
}
.writing-link {
  font-size: 0.9rem; font-weight: 500; color: #a5b4fc;
  margin-top: auto;
}
.writing-card:hover .writing-link { color: #c7d2fe; }

/* ---------- Experience timeline ---------- */
.role {
  margin: 1.4rem 0; padding: 1.4rem 1.5rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid rgba(129, 140, 248, 0.4);
  border-radius: 10px;
  transition: border-left-color 0.25s ease, background 0.25s ease;
}
.role:hover {
  border-left-color: #818cf8;
  background: linear-gradient(180deg, rgba(129, 140, 248, 0.03), transparent);
}
.role-head {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.4rem;
}
.role h3 { font-size: 1.1rem; }
.at { color: #71717a; font-weight: 400; margin: 0 0.15rem; }
.company { color: #a5b4fc; font-weight: 600; }
.role-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem; color: #71717a; white-space: nowrap;
}
.role-meta { color: #a1a1aa; font-size: 0.9rem; margin: 0 0 0.7rem; font-style: italic; }
.role ul { margin: 0.6rem 0 0; padding-left: 1.2rem; color: #a1a1aa; }
.role li { margin-bottom: 0.5rem; line-height: 1.55; }
.role li::marker { color: #818cf8; }
.role strong { color: #e5e7eb; font-weight: 600; }

/* ---------- Skills ---------- */
.skill-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem; margin-top: 1rem;
}
.skill-card {
  padding: 1.3rem 1.4rem; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, border-color 0.25s ease;
}
.skill-card:hover { transform: translateY(-3px); border-color: rgba(129, 140, 248, 0.3); }
.skill-card h4 {
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.skill-card p { color: #a1a1aa; font-size: 0.95rem; margin: 0; line-height: 1.7; }

/* ---------- Education ---------- */
.edu-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.edu-list li {
  padding: 1rem 1.3rem; margin-bottom: 0.6rem; border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #a1a1aa;
}
.edu-list strong { color: #f0f0f5; font-weight: 600; }

/* ---------- Contact ---------- */
.contact-intro { font-size: 1.05rem; color: #cbd5e1; max-width: 40rem; }
.contact-links { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ---------- Footer ---------- */
footer {
  margin-top: 6rem; padding: 2.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #71717a; font-size: 0.88rem; text-align: center;
}
footer a { color: #a1a1aa; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .hero { padding: 4rem 0 3rem; }
  .cta { gap: 0.5rem; }
  .btn { padding: 0.65rem 1rem; font-size: 0.9rem; }
  .role-head { flex-direction: column; gap: 0.2rem; }
  .section-head { margin: 4rem 0 1.5rem; }
}

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
