:root {
  --bg: #0a0e17;
  --bg-alt: #0f1420;
  --surface: #131a29;
  --surface-border: #232c3f;
  --text: #d7dde8;
  --text-muted: #8b93a7;
  --accent: #5eead4;
  --accent-soft: rgba(94, 234, 212, 0.12);
  --accent-strong: #2dd4bf;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --container-w: 1080px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

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

h1, h2, h3 {
  font-family: var(--font-mono);
  line-height: 1.2;
  margin: 0 0 16px;
  color: #fff;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.05rem; margin-bottom: 8px; }

p { color: var(--text-muted); margin: 0 0 16px; }

.accent { color: var(--accent); }

/* Background decoration */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

.bg-glow {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(94,234,212,0.14), transparent);
  pointer-events: none;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--surface-border);
  background: rgba(10, 14, 23, 0.9);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 32px;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.nav-link:hover { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #06231f;
}

.btn-primary:hover { background: var(--accent-strong); }

.btn-ghost {
  border-color: var(--surface-border);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-small { padding: 9px 18px; font-size: 0.85rem; }
.btn-large { padding: 16px 32px; font-size: 1rem; }

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 72px;
}

.eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}

.hero-subtitle {
  max-width: 560px;
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Sections */
.section {
  padding: 120px 24px;
  border-top: 1px solid var(--surface-border);
}

.section-label {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.section-intro { max-width: 560px; }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: start;
  margin-top: 24px;
}

.about-stats {
  display: grid;
  gap: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label { color: var(--text-muted); margin: 0; font-size: 0.9rem; }

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-top: 32px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

/* Portfolio */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.project-thumb {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  background:
    linear-gradient(135deg, rgba(94,234,212,0.14), rgba(94,234,212,0.02));
}

.project-body { padding: 22px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
}

.project-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.project-link:hover { color: var(--accent); }

/* Contact */
.contact-box {
  text-align: center;
  max-width: 620px;
  margin: 24px auto 0;
}

.contact-box .btn { margin-top: 8px; }

.social-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 28px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.social-links a:hover { color: var(--accent); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--surface-border);
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom, 0px));
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.back-to-top:hover { color: var(--accent); }

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

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--surface-border);
    padding: 8px 24px 20px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-links li { width: 100%; padding: 12px 0; border-bottom: 1px solid var(--surface-border); }
  .nav-links li:last-child { border-bottom: none; padding-top: 16px; }
  .nav-links .btn { width: 100%; }

  .section { padding: 80px 20px; }
}
