:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1917;
  --muted: #57534e;
  --border: #e7e5e4;
  --accent: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.1);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0f14;
    --surface: #141922;
    --text: #e7e9ee;
    --muted: #9aa3b2;
    --border: #232a36;
    --accent: #2dd4bf;
    --accent-soft: rgba(45, 212, 191, 0.12);
    --shadow: 0 8px 24px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --bg: #0c0f14;
  --surface: #141922;
  --text: #e7e9ee;
  --muted: #9aa3b2;
  --border: #232a36;
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --shadow: 0 8px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.small { font-size: .85rem; color: var(--muted); }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem clamp(1rem, 5vw, 3rem);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.logo { font-family: "JetBrains Mono", monospace; font-weight: 500; color: var(--text); font-size: 1.1rem; }
.logo span { color: var(--accent); }
.nav nav { display: flex; gap: 1.25rem; align-items: center; }
.nav nav a { color: var(--muted); font-size: .95rem; }
.nav nav a:hover { color: var(--text); text-decoration: none; }
#theme-toggle {
  background: none; border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 1rem;
}

/* Layout */
main { max-width: 960px; margin: 0 auto; padding: 0 clamp(1rem, 5vw, 2rem); }
section { padding: 5rem 0; }

.hero { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; padding-top: 2rem; }
.kicker { color: var(--accent); margin: 0 0 .5rem; }
.hero h1 { font-size: clamp(2.5rem, 8vw, 4.5rem); line-height: 1.05; margin: 0; letter-spacing: -0.03em; }
.hero h2 { font-size: clamp(1.6rem, 5vw, 3rem); line-height: 1.1; margin: .25rem 0 1.25rem; color: var(--muted); letter-spacing: -0.02em; font-weight: 600; }
.lede { max-width: 560px; color: var(--muted); font-size: 1.1rem; }
.cta { display: flex; gap: .75rem; margin-top: 1.5rem; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: .7rem 1.25rem; border-radius: 10px;
  border: 1px solid var(--border); color: var(--text); font-weight: 500;
  transition: transform .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.section-title { font-size: 1.6rem; margin: 0 0 2rem; display: flex; align-items: center; gap: .75rem; }
.section-title .mono { color: var(--accent); font-size: 1.1rem; font-weight: 400; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Projects */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.5rem; display: flex; flex-direction: column; gap: .75rem;
  box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card h4 { margin: 0; font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0; list-style: none; }
.tags li { font-family: "JetBrains Mono", monospace; font-size: .75rem; padding: .2rem .55rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.links { display: flex; gap: 1rem; font-size: .9rem; }

/* About */
.about { display: grid; grid-template-columns: 3fr 2fr; gap: 2.5rem; }
.about p { color: var(--muted); margin-top: 0; }
.skills { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.skills li::before { content: "▹ "; color: var(--accent); }

/* Contact */
.contact { text-align: center; }
.contact .section-title { justify-content: center; }
.contact .section-title::after { display: none; }
.contact p { color: var(--muted); max-width: 480px; margin: 0 auto 1.5rem; }
.socials { display: flex; justify-content: center; gap: 1.5rem; margin-top: 2rem; }

footer { text-align: center; padding: 2rem 1rem; border-top: 1px solid var(--border); }

@media (max-width: 640px) {
  .about { grid-template-columns: 1fr; }
  .nav nav { gap: .85rem; }
  .nav nav a { font-size: .875rem; }
  section { padding: 3.5rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
