/* ===== Theme tokens ===== */
:root {
  --bg: #0a0e14;
  --bg-alt: #111722;
  --card: #131a26;
  --card-hover: #182131;
  --text: #c7d0dc;
  --text-strong: #e6edf5;
  --muted: #7d8aa0;
  --accent: #64ffda;
  --accent-dim: rgba(100, 255, 218, 0.1);
  --border: #222d3d;
  --shadow: rgba(2, 6, 12, 0.6);
  --nav-h: 72px;
  --maxw: 1080px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

[data-theme="light"] {
  --bg: #f5f7fa;
  --bg-alt: #ffffff;
  --card: #ffffff;
  --card-hover: #f0f4f8;
  --text: #45536b;
  --text-strong: #0f1b2d;
  --muted: #6b7a90;
  --accent: #0ca678;
  --accent-dim: rgba(12, 166, 120, 0.1);
  --border: #dbe2ea;
  --shadow: rgba(15, 27, 45, 0.08);
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
}

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

a { color: inherit; text-decoration: none; }
.accent { color: var(--accent); }
strong { color: var(--text-strong); font-weight: 600; }

/* ===== Navbar ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h);
  display: flex; align-items: center; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.nav--scrolled { border-color: var(--border); box-shadow: 0 8px 30px -12px var(--shadow); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.nav__logo { font-family: var(--mono); font-weight: 700; font-size: 1.3rem; color: var(--text-strong); }
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 32px; }
.nav__links a {
  font-size: 0.9rem; color: var(--text); position: relative; font-weight: 500;
  transition: color 0.2s;
}
.nav__links a::after {
  content: ''; position: absolute; left: 0; bottom: -6px; width: 0; height: 2px;
  background: var(--accent); transition: width 0.25s ease;
}
.nav__links a:hover { color: var(--accent); }
.nav__links a:hover::after { width: 100%; }
.nav__right { display: flex; align-items: center; gap: 16px; }
.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  width: 40px; height: 40px; cursor: pointer; font-size: 1.1rem;
  display: grid; place-items: center; transition: border-color 0.2s, transform 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-2px); }
.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; }
.nav__burger span { width: 26px; height: 2px; background: var(--accent); transition: 0.3s; }

/* ===== Hero ===== */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; position: relative; }
.hero__inner { padding-top: var(--nav-h); }
.hero__eyebrow { font-family: var(--mono); color: var(--accent); font-size: 1rem; margin-bottom: 20px; }
.hero__name { font-size: clamp(2.5rem, 8vw, 5rem); font-weight: 800; color: var(--text-strong); line-height: 1.05; letter-spacing: -0.02em; }
.hero__title { font-size: clamp(1.8rem, 6vw, 3.6rem); font-weight: 700; color: var(--muted); line-height: 1.1; margin-top: 6px; }
.hero__desc { max-width: 580px; margin-top: 26px; font-size: 1.1rem; }
.hero__cta { display: flex; gap: 18px; margin-top: 40px; flex-wrap: wrap; }
.hero__socials { display: flex; gap: 24px; list-style: none; margin-top: 48px; }
.hero__socials a { font-family: var(--mono); font-size: 0.9rem; color: var(--muted); transition: color 0.2s; }
.hero__socials a:hover { color: var(--accent); }
.hero__scroll {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 8px; letter-spacing: 2px;
}
.hero__scroll span { width: 1px; height: 40px; background: linear-gradient(var(--accent), transparent); animation: scroll 2s infinite; }
@keyframes scroll { 0% { opacity: 0; transform: scaleY(0); transform-origin: top; } 50% { opacity: 1; } 100% { opacity: 0; transform: scaleY(1); transform-origin: bottom; } }

/* ===== Buttons ===== */
.btn {
  display: inline-block; padding: 14px 26px; border-radius: 8px; font-weight: 600;
  font-size: 0.95rem; transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  cursor: pointer;
}
.btn--primary { background: var(--accent); color: var(--bg); }
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 12px 24px -10px var(--accent); }
.btn--ghost { border: 1px solid var(--accent); color: var(--accent); }
.btn--ghost:hover { background: var(--accent-dim); transform: translateY(-3px); }
.btn--lg { padding: 18px 40px; font-size: 1.05rem; }

/* ===== Sections ===== */
.section { padding: 100px 0; }
.section__title {
  display: flex; align-items: center; gap: 14px; font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--text-strong); font-weight: 700; margin-bottom: 48px; white-space: nowrap;
}
.section__title::after {
  content: ''; height: 1px; width: 100%; max-width: 300px; background: var(--border);
}
.section__num { font-family: var(--mono); color: var(--accent); font-size: 1.1rem; font-weight: 500; }

/* reveal animation */
.section, .project, .job, .skill-card { opacity: 0; transform: translateY(24px); }
.reveal { animation: reveal 0.7s ease forwards; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }

/* ===== About ===== */
.about { display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; align-items: start; }
.about__text p { margin-bottom: 16px; }
.about__meta { margin-top: 28px; display: grid; gap: 12px; font-family: var(--mono); font-size: 0.9rem; }
.about__card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
}
.about__stat { display: flex; flex-direction: column; gap: 4px; }
.about__num { font-size: 2.2rem; font-weight: 800; color: var(--accent); font-family: var(--mono); }
.about__stat span:last-child { font-size: 0.85rem; color: var(--muted); }

/* ===== Skills ===== */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.skill-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 26px;
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
}
.skill-card:hover { transform: translateY(-6px); border-color: var(--accent); background: var(--card-hover); }
.skill-card h3 { color: var(--text-strong); font-size: 1.1rem; margin-bottom: 16px; }
.skill-card ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.skill-card li {
  font-family: var(--mono); font-size: 0.8rem; color: var(--accent);
  background: var(--accent-dim); padding: 5px 11px; border-radius: 6px;
}

/* ===== Experience ===== */
.timeline { display: flex; flex-direction: column; gap: 40px; }
.job {
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 0 14px 14px 0; padding: 30px 32px; transition: transform 0.25s, background 0.25s;
}
.job:hover { transform: translateX(6px); background: var(--card-hover); }
.job__head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.job__head h3 { color: var(--text-strong); font-size: 1.25rem; }
.job__date { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.job__list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.job__list li { position: relative; padding-left: 24px; font-size: 0.98rem; }
.job__list li::before { content: '▹'; position: absolute; left: 0; color: var(--accent); }

/* ===== Projects ===== */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.project {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 30px;
  display: flex; flex-direction: column; transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.project:hover { transform: translateY(-8px); box-shadow: 0 20px 40px -18px var(--shadow); border-color: var(--accent); }
.project__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.project__links { display: flex; gap: 16px; align-items: center; }
.project__folder { font-size: 2rem; }
.project__link { color: var(--muted); font-size: 1.3rem; transition: color 0.2s, transform 0.2s; }
.project__link:hover { color: var(--accent); transform: translateY(-2px); }
.project h3 { color: var(--text-strong); font-size: 1.25rem; margin-bottom: 14px; }
.project p { font-size: 0.95rem; flex-grow: 1; }
.project__tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.project__tags li { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }

/* ===== Contact ===== */
.section--contact { text-align: center; max-width: 640px; margin: 0 auto; padding: 120px 0; }
.contact__num { font-family: var(--mono); color: var(--accent); margin-bottom: 16px; }
.contact__title { font-size: clamp(2.2rem, 6vw, 3.2rem); color: var(--text-strong); font-weight: 800; margin-bottom: 22px; }
.contact__desc { margin-bottom: 40px; font-size: 1.05rem; }
.contact__socials { list-style: none; display: flex; justify-content: center; gap: 28px; margin-top: 44px; }
.contact__socials a { font-family: var(--mono); font-size: 0.9rem; color: var(--muted); transition: color 0.2s; }
.contact__socials a:hover { color: var(--accent); }

/* ===== Footer ===== */
.footer { text-align: center; padding: 30px 0; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); border-top: 1px solid var(--border); }

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .about { grid-template-columns: 1fr; }
  .nav__links {
    position: fixed; top: var(--nav-h); right: -100%; width: 70%; max-width: 320px;
    height: calc(100vh - var(--nav-h)); flex-direction: column; gap: 28px;
    background: var(--bg-alt); padding: 48px 32px; transition: right 0.35s ease;
    border-left: 1px solid var(--border);
  }
  .nav__links.open { right: 0; }
  .nav__burger { display: flex; }
  .nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__burger.open span:nth-child(2) { opacity: 0; }
  .nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .section { padding: 70px 0; }
  .section__title::after { display: none; }
}
