/*  Variables  */
:root {
  --bg:         #0a0c10;
  --bg-2:       #111318;
  --bg-card:    #161920;
  --accent:     #00e5a0;
  --accent-dim: rgba(0,229,160,0.1);
  --accent-2:   #5b6bff;
  --text:       #e8eaf0;
  --text-muted: #6a7080;
  --border:     rgba(255,255,255,0.06);
  --sidebar-w:  220px;
  --radius:     10px;
}

body.light-mode {
  --bg:         #f4f5f7;
  --bg-2:       #eceef2;
  --bg-card:    #ffffff;
  --text:       #111318;
  --text-muted: #555b6e;
  --border:     rgba(0,0,0,0.07);
}

/* Reset */
*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}
html { 
  scroll-behavior: smooth; 
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/*  Sidebar  */
#navbar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem 2rem;
  border-right: 1px solid var(--border);
  background: var(--bg);
  z-index: 100;
}

.nav-top { display: flex; flex-direction: column; gap: 3rem; }

.nav-logo {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.nav-logo span { color: var(--text-muted); }

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.nav-links a {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.6rem;
  display: block;
  transition: color 0.2s, padding-left 0.2s, border-left-color 0.2s;
  border-left: 2px solid transparent;
}
.nav-links a:hover {
  color: var(--accent);
  border-left-color: var(--accent);
  padding-left: 1rem;
}

.nav-bottom { display: flex; flex-direction: column; gap: 1rem; }

.nav-socials {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.nav-socials a {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-socials a:hover { color: var(--accent); }

#theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
  transition: border-color 0.2s, color 0.2s;
  width: fit-content;
}
#theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Hide toggle on desktop */
#menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: inherit;
}

/* MOBILE */
@media (max-width: 768px) {
  #navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    flex-direction: row;
    justify-content: space-between;
    padding: 0 1rem;
  }
}
#menu-toggle {
  display: block;
}
/*  Main Content  */
.main { margin-left: var(--sidebar-w); }

/*  Hero  */
#welcome-section {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 0 6vw;
  position: relative;
  overflow: hidden;
  gap: 4rem;
}
#welcome-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity: 0.6;
}
#welcome-section::after {
  content: '';
  position: absolute;
  top: 40%; left: 30%;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,229,160,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-left { position: relative; z-index: 1; }

.hero-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.hero-tag::before {
  content: '';
  display: inline-block;
  width: 24px; height: 1px;
  background: var(--accent);
  opacity: 0.6;
}

.hero-name {
  font-family: 'Syne', sans-serif;
  font-size: clamp(3rem, 6vw, 6.5rem);
  font-weight: 200;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.2rem;
}
.hero-name .first { display: block; }
.hero-name .last  { display: block; color: var(--accent); font-weight: 700; }

.hero-role {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}

.hero-ctas { display: flex; gap: 0.8rem; flex-wrap: wrap; }

.hero-right { position: relative; z-index: 1; }

.hero-about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.hero-about-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}
.hero-about-card p:last-child { margin-bottom: 0; }
.hero-about-card p strong { color: var(--text); font-weight: 500; }

.scroll-hint {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  z-index: 1;
  animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}
.scroll-hint svg { opacity: 0.4; }

/* ─── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: all 0.25s;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: #0a0c10;
  font-weight: 500;
  border: 2px solid var(--accent);
}
.btn-primary:hover { background: transparent; color: var(--accent); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 2px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Section Shared ────────────────────────────────── */
.section {
  padding: 100px 6vw;
  max-width: 1000px;
}
.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.section-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.8rem;
}
.section-divider {
  width: 40px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  margin-bottom: 3rem;
}

/* ─── About ─────────────────────────────────────────── */
#about { background: var(--bg-2); }
#about .section { max-width: 100%; }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  font-size: 0.95rem;
}
.about-text p strong { color: var(--text); font-weight: 500; }

.skills-grid { display: flex; flex-direction: column; gap: 0.9rem; }
.skill-item { display: flex; align-items: center; gap: 0.75rem; }
.skill-name {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 110px;
}
.skill-bar {
  flex: 1; height: 3px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transform-origin: left;
  animation: growBar 1.2s cubic-bezier(0.16,1,0.3,1) forwards;
  transform: scaleX(0);
}
@keyframes growBar { to { transform: scaleX(1); } }
.skill-fill.lang-html     { width: 88%; animation-delay: 0.1s; }
.skill-fill.lang-css      { width: 78%; animation-delay: 0.2s; }
.skill-fill.lang-python   { width: 55%; animation-delay: 0.3s; }
.skill-fill.lang-js       { width: 32%; animation-delay: 0.4s; }
.skill-fill.lang-git      { width: 65%; animation-delay: 0.5s; }
.skill-fill.lang-security { width: 60%; animation-delay: 0.6s; }

/* ─── Projects ──────────────────────────────────────── */
#project-section { padding: 100px 6vw; }
#project-section .inner { max-width: 1000px; }
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.2rem;
}
.project-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
.project-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
.project-tile:hover {
  border-color: rgba(0,229,160,0.2);
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.35);
}
.project-tile:hover::before { transform: scaleX(1); }
.project-tile.featured {
  grid-column: span 2;
  background: linear-gradient(135deg, #161920, #1a1f2c);
  border-color: rgba(0,229,160,0.15);
}
.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.project-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.project-badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent);
}
.project-badge.coming {
  background: rgba(91,107,255,0.1);
  color: var(--accent-2);
}
.project-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.project-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.63rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.12rem 0.45rem;
}
.project-links { display: flex; gap: 0.8rem; margin-top: auto; }
.project-link {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap 0.2s;
}
.project-link:hover { gap: 0.5rem; }
.project-link.disabled {
  color: var(--text-muted);
  cursor: default;
  pointer-events: none;
}

/* ─── Contact ───────────────────────────────────────── */
#contact { background: var(--bg-2); }
#contact .section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
}
.contact-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 440px;
  margin-bottom: 2rem;
}
.contact-links { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

/* ─── Footer ────────────────────────────────────────── */
footer {
  padding: 1.8rem 6vw;
  text-align: center;
  border-top: 1px solid var(--border);
}
footer p {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
}
footer span { color: var(--accent); }

/* ─── Fade-in ───────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ─── Media Queries ─────────────────────────────────── */
@media (max-width: 1024px) {
  #welcome-section {
    grid-template-columns: 1fr;
    padding-top: 5rem;
    text-align: center;
  }
  .hero-tag { justify-content: center; }
  .hero-ctas { justify-content: center; }
  .hero-right { display: none; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  #navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    width: 100%;
    height: 56px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 5vw;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .nav-top { flex-direction: row; align-items: center; gap: 1.5rem; }
  .nav-links { flex-direction: row; gap: 1.2rem; }
  .nav-links a {
    border-left: none;
    border-bottom: 1px solid transparent;
    padding-left: 0;
    padding-bottom: 2px;
  }
  .nav-links a:hover {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
    padding-left: 0;
  }
  .nav-bottom { flex-direction: row; gap: 0.8rem; align-items: center; }
  .nav-socials { flex-direction: row; }
  .nav-socials a span { display: none; }

  .main { margin-left: 0; padding-top: 56px; }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .project-tile.featured { grid-column: span 1; }
  .hero-name { font-size: 2.8rem; }
}

@media (max-width: 500px) {
  .nav-links { display: none; }
  .hero-name { font-size: 2.2rem; }
  .projects-grid { grid-template-columns: 1fr; }
}