:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --text: #14181f;
  --text-muted: #5b6472;
  --accent: #3457d5;
  --accent-strong: #23408f;
  --border: #e3e7ef;
  --card-bg: #ffffff;
  --shadow: 0 10px 30px -12px rgba(20, 24, 31, 0.15);
  --radius: 14px;
  --max-width: 960px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d1117;
  --bg-alt: #11161f;
  --text: #e6e9ef;
  --text-muted: #9aa4b2;
  --accent: #6c8bff;
  --accent-strong: #93a9ff;
  --border: #232a36;
  --card-bg: #151b25;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: -0.02em;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}
.nav-menu a:hover { color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
}
.theme-toggle svg { width: 18px; height: 18px; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

/* Hero */
.hero {
  padding: 120px 0 100px;
}
.hero-inner { text-align: left; }
.eyebrow {
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  margin: 0 0 12px;
}
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.hero-tagline {
  color: var(--text-muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  max-width: 620px;
  margin: 0 0 32px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.hero-links {
  display: flex;
  gap: 18px;
}
.hero-links a {
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.hero-links a:hover { color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Sections */
.section { padding: 90px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 800;
  margin: 0 0 40px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-num {
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  font-weight: 500;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text { color: var(--text-muted); font-size: 1.05rem; margin: 0; }
.about-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.about-facts li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  font-size: 0.95rem;
}
.about-facts li span {
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.skill-card h3 {
  margin: 0 0 16px;
  font-size: 1.05rem;
  color: var(--accent);
}
.skill-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.project-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--accent);
  margin-bottom: 18px;
}
.project-links { display: flex; gap: 12px; }
.project-links a { color: var(--text-muted); }
.project-links a:hover { color: var(--accent); }
.project-card h3 { margin: 0 0 10px; font-size: 1.15rem; }
.project-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 18px;
}
.project-card-placeholder { opacity: 0.65; border-style: dashed; }
.project-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.project-tags li {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-muted);
}

/* Contact */
.contact-inner { text-align: center; }
.contact-inner .section-title { justify-content: center; }
.contact-text {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 28px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-inner p { margin: 0; }
.back-to-top { color: var(--text-muted); text-decoration: none; }
.back-to-top:hover { color: var(--accent); }

/* Responsive */
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 20px;
    transform: translateY(-130%);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .nav-menu.open { transform: translateY(0); opacity: 1; }
  .nav-menu li { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .hero { padding: 90px 0 70px; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-links { justify-content: center; }
}
