/* ─── Variables ─────────────────────────────────────────────────── */
:root {
  --bg:           #060b18;
  --bg-secondary: #0d1424;
  --bg-card:      rgba(255, 255, 255, 0.025);
  --border:       rgba(255, 255, 255, 0.07);
  --border-hover: rgba(59, 130, 246, 0.45);
  --text:         #e2e8f0;
  --text-muted:   #64748b;
  --text-subtle:  #94a3b8;
  --accent:       #3b82f6;
  --accent-light: #60a5fa;
  --accent-glow:  rgba(59, 130, 246, 0.1);
  --green:        #10b981;
  --green-glow:   rgba(16, 185, 129, 0.45);
  --radius:       12px;
  --radius-sm:    8px;
  --nav-height:   64px;
  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
  --ease:         0.2s ease;
  --ease-slow:    0.4s ease;
}

/* ─── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ─── Container ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all var(--ease);
  border: 1px solid transparent;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  box-shadow: 0 0 28px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  color: var(--text-subtle);
  border-color: var(--border);
}
.btn--ghost:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--accent-glow);
}
.btn--lg { padding: 16px 32px; font-size: 15px; }

/* ─── Navigation ────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-height);
  transition: background var(--ease-slow), box-shadow var(--ease-slow);
}
.nav.scrolled {
  background: rgba(6, 11, 24, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}
.nav__logo {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav__links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__cta {
  color: var(--accent) !important;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 6px 16px;
  border-radius: var(--radius-sm);
}
.nav__cta:hover {
  background: var(--accent-glow) !important;
  border-color: var(--accent) !important;
}
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-subtle);
  border-radius: 2px;
  transition: all var(--ease);
}
.nav__mobile {
  display: none;
  flex-direction: column;
  padding: 16px 24px;
  background: rgba(6, 11, 24, 0.96);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
}
.nav__mobile.open { display: flex; }
.nav__mobile-link {
  padding: 14px 0;
  font-size: 15px;
  color: var(--text-subtle);
  border-bottom: 1px solid var(--border);
  transition: color var(--ease);
}
.nav__mobile-link:last-child { border-bottom: none; }
.nav__mobile-link:hover { color: var(--text); }

/* ─── Hero ──────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: var(--nav-height) 24px 80px;
}

/* dot grid */
.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(59, 130, 246, 0.13) 1px, transparent 0);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at center, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at center, black 20%, transparent 70%);
  animation: gridPulse 8s ease-in-out infinite;
}
/* ambient glow */
.hero::after {
  content: '';
  position: absolute;
  top: 45%; left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 65%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}
.hero__eyebrow {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.2s;
}
.hero__name {
  font-size: clamp(52px, 10vw, 96px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 28px;
  background: linear-gradient(135deg, #ffffff 0%, #bfdbfe 45%, #60a5fa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.35s;
}
.hero__role {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: clamp(15px, 2.8vw, 20px);
  font-family: var(--font-mono);
  color: var(--text-subtle);
  margin-bottom: 32px;
  min-height: 1.5em;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.5s;
}
.hero__role-prefix { color: var(--accent); }
.hero__cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}
.hero__tagline {
  font-size: clamp(15px, 2.4vw, 18px);
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 44px;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.65s;
}
.hero__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.8s;
}
.hero__scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeIn 1s ease forwards 1.6s;
}
.hero__scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollDrop 2s ease-in-out infinite;
}

/* ─── Sections ──────────────────────────────────────────────────── */
.section { padding: 108px 0; }
.section--alt { background: var(--bg-secondary); }
.section__header {
  max-width: 640px;
  margin: 0 auto 64px;
  text-align: center;
}
.section__title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
  color: var(--text);
}
.section__subtitle {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ─── About ─────────────────────────────────────────────────────── */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}
.about__text h2 { margin-bottom: 24px; }
.about__text p {
  color: var(--text-subtle);
  line-height: 1.8;
  margin-bottom: 16px;
}
.about__degree {
  color: var(--accent-light) !important;
  font-style: italic;
}
.about__contact-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
  transition: gap var(--ease);
}
.about__contact-link:hover { gap: 10px; }

.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 22px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--ease), background var(--ease);
}
.stat-card:hover {
  border-color: var(--border-hover);
  background: var(--accent-glow);
}
.stat-card__value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.stat-card__label {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Engineering Stack Grid ────────────────────────────────────── */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 16px;
}
.stack-card {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--ease), transform var(--ease), background var(--ease);
}
.stack-card:hover {
  border-color: var(--border-hover);
  background: var(--accent-glow);
  transform: translateY(-3px);
}
.stack-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.stack-card__status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green-glow);
  flex-shrink: 0;
  animation: statusPulse 3s ease-in-out infinite;
}
.stack-card__name {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.stack-card__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 16px;
}
.stack-card__tag {
  display: inline-block;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--accent-light);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ─── Projects Grid ─────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  align-items: start;
}

/* Project card */
.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
  cursor: pointer;
  color: inherit;
}
.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(59, 130, 246, 0.1);
}

/* Image area */
.project-card__image {
  width: 100%;
  aspect-ratio: 16 / 8;
  overflow: hidden;
  background: #0a1628;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}
.project-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.project-card:hover .project-card__image img {
  transform: scale(1.03);
}

/* Active project badge */
.project-card__status--active {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

/* Mystique pipeline preview */
.project-card__image--pipeline {
  background: #080f1e;
  padding: 0 20px;
  flex-direction: column;
  gap: 4px;
}
.pipeline-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.pp-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: rgba(59, 130, 246, 0.07);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  flex: 1;
}
.pp-step--accent {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.5);
}
.pp-step__num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.pp-step__name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
  white-space: nowrap;
}
.pp-arrow {
  color: var(--text-muted);
  font-size: 14px;
  flex-shrink: 0;
}

/* AlgoViz mini bar preview */
.project-card__image--bars {
  background: #0d1424;
  padding: 12px 16px 0;
  align-items: flex-end;
}
.algoviz-preview {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  width: 100%;
  height: 100%;
}
.ap-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  background: #1e3a5f;
  transition: background 0.3s ease;
}
.ap-bar--comparing { background: #f59e0b; }
.ap-bar--swapping  { background: #ef4444; }
.ap-bar--pivot     { background: #8b5cf6; }
.ap-bar--sorted    { background: #10b981; }

/* Body */
.project-card__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.project-card__body--centered {
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: var(--text-muted);
  font-size: 14px;
  gap: 14px;
}

/* Meta row */
.project-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.project-card__status {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--green);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.project-card__type {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Title */
.project-card__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
}

/* Description */
.project-card__desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Tech tags */
.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.project-card__tags span {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-subtle);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

/* Visit link */
.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin-top: 4px;
  transition: gap var(--ease);
}
.project-card:hover .project-card__link { gap: 10px; }

/* Placeholder card */
.project-card--placeholder {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.07);
  cursor: default;
}
.project-card--placeholder:hover {
  border-color: rgba(255, 255, 255, 0.1);
  transform: none;
  box-shadow: none;
}

/* ─── Contact ───────────────────────────────────────────────────── */
.contact {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}
.contact__text {
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.75;
  margin-bottom: 36px;
}
.contact__links {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin-top: 24px;
}
.contact__link {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--ease);
}
.contact__link:hover { color: var(--accent); }

/* ─── Footer ────────────────────────────────────────────────────── */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer p {
  font-size: 13px;
  color: var(--text-muted);
}
.footer a {
  color: var(--accent);
  transition: opacity var(--ease);
}
.footer a:hover { opacity: 0.75; }

/* ─── Scroll Reveal ─────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Animations ────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
@keyframes gridPulse {
  0%, 100% { opacity: 0.55; }
  50%       { opacity: 1;    }
}
@keyframes scrollDrop {
  0%   { transform: scaleY(1);   opacity: 1;   }
  50%  { transform: scaleY(0.5); opacity: 0.4; }
  100% { transform: scaleY(1);   opacity: 1;   }
}
@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 6px  var(--green-glow); }
  50%       { box-shadow: 0 0 14px var(--green-glow); }
}

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav__links      { display: none; }
  .nav__hamburger  { display: flex; }
  .about__grid     { grid-template-columns: 1fr; gap: 44px; }
  .section         { padding: 80px 0; }
  .hero__scroll-hint { display: none; }
}
@media (max-width: 480px) {
  .hero__actions    { flex-direction: column; align-items: center; }
  .about__stats     { grid-template-columns: 1fr 1fr; }
  .stack-grid       { grid-template-columns: 1fr; }
  .section__header  { margin-bottom: 48px; }
}
