/* ============ Base ============ */
html { -webkit-font-smoothing: antialiased; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; color: var(--body-text); background: var(--ink); transition: background-color 0.35s ease, color 0.35s ease; }
section, .card, .info-card, #main-nav, #mobile-menu, footer, .form-input, .glass, .glass-strong {
  transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.2s ease, color 0.35s ease, transform 0.2s ease;
}

:root {
  --ink: #0B1220;       /* near-black navy — nav, hero, footer */
  --ink-2: #131C2E;
  --accent: #7C3AED;      /* primary purple */
  --accent-from: #4F46E5; /* indigo — gradient start */
  --accent-to: #9333EA;   /* purple — gradient end */
  --accent-light: #C4B5FD;/* light lavender for text-on-dark */
  --accent-2: #C084FC;    /* secondary accent for highlights/live */
  --line-dark: #223049;
  --grad: linear-gradient(90deg, var(--accent-from), var(--accent-to));

  --body-text: #CBD5E1;
  --heading-text: #F8FAFC;
  --body-muted: #94A3B8;
  --glass-bg: rgba(19, 28, 46, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --nav-bg: rgba(11, 18, 32, 0.7);
}

/* ============ Light theme ============ */
html.light {
  --ink: #F5F6FB;
  --ink-2: #FFFFFF;
  --accent-light: #6D28D9;
  --line-dark: #E2E1F5;
  --body-text: #33364A;
  --heading-text: #17182B;
  --body-muted: #5B5E76;
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(17, 17, 40, 0.08);
  --nav-bg: rgba(255, 255, 255, 0.7);
}
html.light body { color: var(--body-text); }
html.light .h-section,
html.light .h-card,
html.light .nav-brand,
html.light .footer-heading { color: var(--heading-text); }
html.light .body-lg,
html.light .body-md,
html.light .footer-link,
html.light .footer-contact-item { color: var(--body-muted); }
html.light .hero-dark h1 { color: var(--heading-text) !important; }
html.light #main-nav .nav-link { color: var(--body-text); }
html.light .btn-secondary { color: var(--heading-text); }
html.light .pill { color: var(--body-text); background: rgba(17,17,40,0.05); }
html.light .form-input { color: var(--heading-text); }
html.light .social-circle { color: var(--body-text); }
html.light ::selection { background: rgba(124,58,237,0.25); }

/* ============ Type scale ============ */
.h-display   { font-size: 2.75rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.h-role      { font-size: 1.5rem;  line-height: 1.3;  font-weight: 500; color: var(--accent-light); }
.h-section   { font-size: 2rem;    line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; color: #F8FAFC; }
.h-card      { font-size: 1.0625rem; line-height: 1.4; font-weight: 600; color: #F1F5F9; }
.body-lg     { font-size: 1.0625rem; line-height: 1.65; color: #94A3B8; font-weight: 400; }
.body-md     { font-size: 0.9375rem; line-height: 1.6; color: #94A3B8; font-weight: 400; }
.label-sm    { font-size: 0.75rem; color: #64748B; font-weight: 500; }

@media (min-width: 768px) {
  .h-display { font-size: 3.75rem; }
  .h-section { font-size: 2.5rem; }
}

/* ============ Eyebrow chips (replaces bare floating small-caps text) ============ */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(196,181,253,0.1);
  color: var(--accent-light);
  border: 1px solid rgba(196,181,253,0.28);
}
.tag-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-light); }
.tag-chip.on-dark {
  background: rgba(196,181,253,0.1);
  color: var(--accent-light);
  border-color: rgba(196,181,253,0.28);
}
.tag-chip.on-dark .dot { background: var(--accent-light); }

/* ============ Fade-in on scroll ============ */
.fade-in { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.show { opacity: 1; transform: translateY(0); }

/* ============ Glassmorphism ============ */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.glass-strong {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 20px 45px rgba(0,0,0,0.25);
}

/* ============ Nav — glass, always readable ============ */
#main-nav {
  background: var(--nav-bg);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--line-dark);
  transition: box-shadow 0.2s ease, padding 0.2s ease, background-color 0.35s ease;
}
#main-nav.scrolled { box-shadow: 0 8px 24px rgba(0,0,0,0.25); }

/* ============ Theme toggle ============ */
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line-dark);
  color: var(--accent-light); cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover { transform: translateY(-2px) rotate(12deg); border-color: var(--accent-light); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
html.light .theme-toggle .icon-sun { display: none; }
html.light .theme-toggle .icon-moon { display: block; }

/* ============ Particle canvas ============ */
#particle-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; opacity: 0.55;
}

/* ============ Micro-interactions ============ */
.btn:active { transform: translateY(0) scale(0.97); }
.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px;
  background: var(--grad); border-radius: 2px; transition: width 0.25s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.icon-badge {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; box-shadow: 0 10px 24px rgba(124,58,237,0.32);
  transition: transform 0.25s ease;
}
.card:hover .icon-badge { transform: scale(1.08) rotate(-4deg); }
.nav-inner { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.nav-link { font-size: 0.95rem; font-weight: 500; color: #CBD5E1; transition: color 0.2s ease; }
.nav-link:hover { color: var(--accent-light); }
.nav-link.active { color: var(--accent-light); }
.nav-brand { font-size: 1.25rem; font-weight: 700; color: #ffffff; }
.nav-brand .dot-accent { color: var(--accent-2); }

/* ============ Buttons ============ */
.btn {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.8rem 1.65rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(124,58,237,0.28); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 10px 26px rgba(124,58,237,0.38); }
.btn-secondary { background: transparent; color: #E2E8F0; border: 1px solid #334155; }
.btn-secondary:hover { border-color: var(--accent-light); color: var(--accent-light); background: rgba(196,181,253,0.06); }
.btn-secondary-light { background: var(--ink-2); color: var(--accent-light); border: 1px solid var(--line-dark); }
.btn-secondary-light:hover { border-color: var(--accent-light); background: rgba(196,181,253,0.08); }
.btn-sm { font-size: 0.85rem; padding: 0.6rem 1.2rem; }

/* ============ Cards ============ */
.card {
  background: var(--ink-2);
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { box-shadow: 0 16px 32px rgba(124,58,237,0.16); border-color: rgba(196,181,253,0.35); transform: translateY(-2px); }

/* ============ Tag pills (project tech tags) ============ */
.pill {
  font-size: 0.75rem;
  font-weight: 500;
  color: #CBD5E1;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line-dark);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

/* ============ Profile photo ============ */
.profile-photo { box-shadow: 0 20px 45px rgba(0,0,0,0.35); }

/* ============ Hero — dark, developer-toned, with subtle dot-grid ============ */
.hero-dark {
  background: radial-gradient(circle at 15% 20%, rgba(79,70,229,0.20), transparent 45%),
              radial-gradient(circle at 85% 75%, rgba(192,132,252,0.14), transparent 45%),
              var(--ink);
  position: relative;
  overflow: hidden;
}
.hero-dark::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 75%);
  pointer-events: none;
}

/* ============ Project thumbnail ============ */
.proj-thumb {
  position: relative;
  height: 168px;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background: var(--ink-2);
}
.proj-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.card:hover .proj-thumb img { transform: scale(1.05); }
.proj-thumb-fallback { width: 100%; height: 100%; display: flex; flex-direction: column; }
.browser-bar { height: 26px; background: rgba(255,255,255,0.06); display: flex; align-items: center; gap: 6px; padding: 0 10px; flex-shrink: 0; border-bottom: 1px solid var(--line-dark); }
.browser-bar span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.18); }
.proj-thumb-body { flex: 1; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #131C2E 0%, #1B2740 100%); }
.proj-thumb-body .mono-badge { font-size: 1.5rem; font-weight: 700; color: var(--accent-light); letter-spacing: 0.06em; font-family: 'JetBrains Mono', monospace; }

/* ============ Live badge ============ */
.live-badge {
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em;
  color: #4ADE80; background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3);
  padding: 0.2rem 0.55rem; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.live-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #22C55E; }

/* ============ Footer ============ */
footer { background: var(--ink); color: #94A3B8; border-top: 1px solid var(--line-dark); }
.footer-heading { color: #fff; font-size: 1rem; font-weight: 700; margin-bottom: 1rem; position: relative; padding-bottom: 0.6rem; }
.footer-heading::after { content: ""; position: absolute; left: 0; bottom: 0; width: 28px; height: 2px; background: var(--grad); border-radius: 2px; }
.footer-link { color: #94A3B8; font-size: 0.9rem; transition: color 0.2s ease, padding-left 0.2s ease; display: inline-block; }
.footer-link:hover { color: var(--accent-light); padding-left: 4px; }
.social-circle {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line-dark);
  color: #CBD5E1; transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.social-circle:hover { background: var(--grad); color: #fff; border-color: transparent; transform: translateY(-2px); }
.footer-contact-item { display: flex; align-items: flex-start; gap: 0.7rem; color: #CBD5E1; font-size: 0.9rem; }
.footer-contact-item .icon-wrap {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(147,51,234,0.14); color: var(--accent-light);
}

/* ============ Gradient text ============ */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ============ Hero stats row ============ */
.stat-num { font-size: 1.75rem; font-weight: 700; }
.stat-label { font-size: 0.75rem; color: #64748B; font-weight: 500; }

/* ============ Contact info cards ============ */
.info-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--ink-2); border: 1px solid var(--line-dark); border-radius: 12px;
  padding: 1.1rem 1.25rem; transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.info-card:hover { box-shadow: 0 16px 32px rgba(124,58,237,0.16); border-color: rgba(196,181,253,0.35); transform: translateY(-2px); }
.info-card .icon-wrap {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff;
}

/* ============ Contact form ============ */
.form-label { font-size: 0.85rem; font-weight: 600; color: #CBD5E1; margin-bottom: 0.4rem; display: block; }
.form-input {
  width: 100%; font-size: 0.9rem; color: #F1F5F9;
  background: var(--ink); border: 1px solid var(--line-dark); border-radius: 10px;
  padding: 0.7rem 0.9rem; transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input::placeholder { color: #64748B; }
.form-input:focus { outline: none; border-color: var(--accent-light); box-shadow: 0 0 0 3px rgba(196,181,253,0.15); }
.form-status { font-size: 0.85rem; font-weight: 500; margin-top: 0.75rem; }
.form-status.success { color: #4ADE80; }
.form-status.error { color: #F87171; }

@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 768px) {
  section { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  .hero-dark { min-height: auto; padding-top: 6.5rem; padding-bottom: 3rem; }
  .h-display { font-size: 2.25rem; }
}

/* ============ About snapshot list ============ */
.snapshot-item { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line-dark); }
.snapshot-item:last-child { border-bottom: none; }
.snapshot-item .dot-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); margin-top: 6px; flex-shrink: 0; }

/* ============ Highlight stat tiles (About) ============ */
.stat-tile { background: var(--ink); border: 1px solid var(--line-dark); border-radius: 12px; padding: 1rem; transition: transform 0.2s ease, border-color 0.2s ease; }
.stat-tile:hover { transform: translateY(-3px); border-color: rgba(196,181,253,0.35); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
