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

:root {
  --bg: #09090b;
  --bg-alt: #0f0f12;
  --surface: #141418;
  --surface2: #1c1c22;
  --border: #27272f;
  --border-hover: #7c6af7;
  --text: #f0f0f8;
  --text-muted: #71717a;
  --text-soft: #a1a1b5;
  --accent: #7c6af7;
  --accent-dim: rgba(124,106,247,0.12);
  --accent2: #4fc3f7;
  --green: #4ade80;
  --red: #f87171;
  --yellow: #fbbf24;
  --font: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── NAV ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  height: 64px;
  background: rgba(9,9,11,0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.nav.scrolled { border-bottom-color: var(--border); }

.nav-logo { flex-shrink: 0; }

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
  transition: background 0.2s;
}

.logo-mark:hover { background: rgba(124,106,247,0.2); }

.nav-links {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); }

.btn-nav {
  background: var(--accent) !important;
  color: #fff !important;
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem !important;
  transition: opacity 0.2s !important;
}

.btn-nav:hover { opacity: 0.85 !important; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── HERO ── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 80px clamp(1rem, 4vw, 2.5rem) 4rem;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(124,106,247,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,106,247,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 0%, black 40%, transparent 100%);
  pointer-events: none;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,106,247,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.hero-content { flex: 1; min-width: 0; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.2);
  color: var(--green);
  font-size: 0.8rem;
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  font-family: var(--mono);
}

.badge-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 1.2rem;
}

.hero-sub {
  color: var(--text-soft);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  max-width: 460px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.hero-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hero-stack span {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
}

/* ── CODE BLOCK ── */
.hero-code {
  flex: 1;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 11px; height: 11px;
  border-radius: 50%;
}
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }

.code-filename {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.hero-code pre,
.oss-code pre {
  padding: 1.4rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.9;
  overflow-x: auto;
}

/* ── SYNTAX ── */
.kw      { color: #c792ea; }
.fn      { color: #82aaff; }
.str     { color: #c3e88d; }
.comment { color: #4a5568; font-style: italic; }
.accent  { color: var(--accent); }

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}

.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

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

/* ── SECTIONS ── */
.section { padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 4vw, 2.5rem); }
.section-alt { background: var(--bg-alt); }

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

.section h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

/* ── ABOUT ── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about-text p {
  color: var(--text-soft);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.about-text strong { color: var(--text); font-weight: 500; }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  text-align: center;
  transition: border-color 0.2s;
}

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

.stat-num {
  display: block;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--mono);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
}

/* ── SKILLS ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.skill-card:hover {
  border-color: var(--accent);
  background: var(--surface2);
  transform: translateY(-3px);
}

.skill-icon { font-size: 1.6rem; margin-bottom: 0.9rem; }

.skill-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.skill-card p { color: var(--text-muted); font-size: 0.85rem; line-height: 1.6; }

/* ── PROJECTS ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

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

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.project-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.project-icon-fallback {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 1.4rem;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-type {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent2);
  background: rgba(79,195,247,0.08);
  border: 1px solid rgba(79,195,247,0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  white-space: nowrap;
}

.project-card h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-tags span {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--accent);
  font-family: var(--mono);
  margin-top: 0.2rem;
  transition: opacity 0.2s;
}

.project-link:hover { opacity: 0.7; }

/* ── OPEN SOURCE ── */
.oss-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow);
}

.oss-desc {
  color: var(--text-soft);
  margin-bottom: 1.4rem;
  font-size: 0.95rem;
}

.oss-desc strong { color: var(--text); font-weight: 500; }

.oss-features {
  list-style: none;
  margin-bottom: 1.8rem;
}

.oss-features li {
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 0.3rem 0;
  padding-left: 1.2rem;
  position: relative;
}

.oss-features li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.oss-install {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.5rem;
}

.install-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.oss-install code {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent2);
  word-break: break-all;
}

.oss-links { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.oss-code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  align-self: start;
}

/* ── CONTACT ── */
.contact-container { text-align: center; }

.contact-sub {
  color: var(--text-soft);
  max-width: 500px;
  margin: 0 auto 2.5rem;
  font-size: 0.95rem;
}

.contact-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.6rem;
  font-size: 0.9rem;
  transition: border-color 0.2s, transform 0.2s;
  color: var(--text-soft);
}

.contact-item:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
}

/* ── FOOTER ── */
.footer {
  text-align: center;
  padding: 1.8rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}

/* ── REVEAL ANIMATION ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero-stack { justify-content: center; }
  .hero-code { max-width: 100%; width: 100%; }
  .about-grid { grid-template-columns: 1fr; }
  .oss-card { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    background: rgba(9,9,11,0.97);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem clamp(1rem, 4vw, 2.5rem);
    gap: 1rem;
    backdrop-filter: blur(16px);
  }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 400px) {
  .skills-grid { grid-template-columns: 1fr; }
}
