/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:        #0a0a0f;
  --bg2:       #111118;
  --surface:   #16161f;
  --border:    #252535;
  --text:      #e2e2f0;
  --muted:     #8888aa;
  --accent:    #7c6af7;
  --accent2:   #a78bfa;
  --highlight: #22d3ee;
  --radius:    12px;
  --font:      'Inter', sans-serif;
  --mono:      'JetBrains Mono', monospace;
  --nav-h:     64px;
  --transition: 0.25s ease;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img { display: block; max-width: 100%; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ============================================================
   SELECTION
   ============================================================ */
::selection {
  background: var(--accent);
  color: #fff;
}

/* ============================================================
   UTILITY
   ============================================================ */
.accent    { color: var(--accent); }
.highlight { color: var(--highlight); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 106, 247, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-outline:hover {
  background: rgba(124, 106, 247, 0.1);
  transform: translateY(-2px);
}

/* ============================================================
   NAVBAR
   ============================================================ */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  transition: background var(--transition), box-shadow var(--transition);
}

#navbar.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.5px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 0.9rem;
  font-family: var(--mono);
  color: var(--muted);
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

.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); }

.mobile-menu {
  display: none;
  list-style: none;
  flex-direction: column;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 16px 32px;
  gap: 4px;
}

.mobile-menu.open { display: flex; }

.mobile-link {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--muted);
  padding: 10px 0;
  display: block;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}

.mobile-link:last-child { border-bottom: none; }
.mobile-link:hover { color: var(--accent); }

/* ============================================================
   SECTIONS — shared
   ============================================================ */
section {
  padding: 100px 0;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.section-title::after {
  content: '';
  display: block;
  height: 1px;
  background: var(--border);
  flex: 1;
  min-width: 40px;
}

.section-title .accent {
  font-family: var(--mono);
  font-size: 0.85em;
  font-weight: 400;
}

/* ============================================================
   HERO
   ============================================================ */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 0 32px;
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-greeting {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 12px;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.2s;
}

.hero-name {
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -2px;
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.35s;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.5s;
}

.hero-sub .highlight {
  font-weight: 500;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.65s;
}

/* Blob */
.hero-blob {
  position: absolute;
  top: -10%;
  right: -5%;
  width: min(600px, 60vw);
  height: min(600px, 60vw);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 40%, rgba(124, 106, 247, 0.18), transparent 70%);
  pointer-events: none;
  animation: pulse 6s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1) rotate(0deg); }
  to   { transform: scale(1.08) rotate(5deg); }
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  animation: fadeIn 1s ease forwards 1.2s;
}

.scroll-indicator span {
  display: block;
  width: 20px;
  height: 30px;
  border: 2px solid var(--border);
  border-radius: 12px;
  position: relative;
  margin: 0 auto;
}

.scroll-indicator span::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 6px;
  background: var(--accent);
  border-radius: 2px;
  animation: scroll-dot 1.5s ease infinite;
}

@keyframes scroll-dot {
  0%   { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 10px); }
}

/* ============================================================
   ABOUT
   ============================================================ */
#about {
  background: var(--bg2);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 64px;
  align-items: start;
}

.about-text p {
  color: var(--muted);
  margin-bottom: 16px;
  font-size: 1.05rem;
  max-width: 580px;
}

.about-text p strong {
  color: var(--text);
  font-weight: 600;
}

.about-card {
  min-width: 220px;
}

.about-card-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--mono);
}

/* ============================================================
   SKILLS
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}

.skill-category h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-family: var(--mono);
  margin-bottom: 16px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 6px;
  transition: all var(--transition);
  cursor: default;
}

.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ============================================================
   PROJECTS
   ============================================================ */
#projects {
  background: var(--bg2);
}

.section-sub {
  color: var(--muted);
  margin-top: -32px;
  margin-bottom: 40px;
  font-size: 0.95rem;
}

.inline-link {
  color: var(--accent);
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  text-decoration: underline;
  transition: color var(--transition);
}

.inline-link:hover { color: var(--accent2); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition);
  cursor: default;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(124, 106, 247, 0.12);
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.folder-icon {
  color: var(--accent);
}

.project-link {
  color: var(--muted);
  transition: color var(--transition);
  display: flex;
  align-items: center;
}

.project-link:hover { color: var(--accent); }

.project-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.project-desc {
  font-size: 0.88rem;
  color: var(--muted);
  flex: 1;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.project-tags span {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.projects-more {
  margin-top: 40px;
  text-align: center;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-inner {
  text-align: center;
}

.contact-inner .section-title {
  justify-content: center;
}

.contact-inner .section-title::after { display: none; }

.contact-sub {
  color: var(--muted);
  max-width: 480px;
  margin: -24px auto 48px;
  font-size: 1.05rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  transition: all var(--transition);
  color: var(--text);
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(124, 106, 247, 0.12);
  color: var(--accent);
}

.contact-card span {
  font-weight: 600;
  font-size: 1rem;
}

.contact-card small {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 32px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Scroll-reveal */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  section { padding: 72px 0; }

  .nav-links { display: none; }
  .hamburger { display: flex; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-card { min-width: unset; }
  .about-card-inner { flex-direction: row; flex-wrap: wrap; gap: 20px; }

  .hero-cta { flex-direction: column; max-width: 280px; }
  .btn { justify-content: center; }

  .section-inner { padding: 0 20px; }
  #hero { padding: 0 20px; }
}

@media (max-width: 480px) {
  .hero-name { letter-spacing: -1px; }
  .projects-grid { grid-template-columns: 1fr; }
}
