/* ========== Base: Neat + Elegant Theme ========== */
:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --text: #0f172a; /* slate-900 */
  --muted: #6b7280; /* gray-500 */
  --border: #e5e7eb; /* gray-200 */
  --accent: #4f46e5; /* indigo-600 */
  --accent-700: #4338ca;
  --accent-50: #eef2ff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 20px rgba(15, 23, 42, 0.06);
}

/* Dark theme tokens */
[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #0f172a; /* slate-900 */
  --text: #e5e7eb; /* gray-200 */
  --muted: #9ca3af; /* gray-400 */
  --border: #1f2937; /* slate-800 */
  --accent: #818cf8; /* indigo-400 */
  --accent-700: #6366f1;
  --accent-50: rgba(99, 102, 241, 0.15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.35);
}

/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { max-width: 100%; display: block; }

/* Typography */
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: local("Inter"), url(https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQt.woff2) format("woff2"); }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: clamp(2rem, 3vw, 3rem); line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 2.2vw, 2rem); }
h3 { font-size: clamp(1.125rem, 1.6vw, 1.375rem); font-weight: 600; }
p { color: var(--muted); }

/* Layout */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}
.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo { text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.125rem; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-links { list-style: none; display: flex; gap: 12px; }
.nav-links a {
  text-decoration: none; color: var(--text);
  padding: 8px 12px; border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-links a:hover { background: var(--accent-50); color: var(--accent); }
.nav-links a.active { color: var(--accent); background: var(--accent-50); }

main { margin-top: 64px; }
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px;
}
.section { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; box-shadow: var(--shadow-sm); }
.stack-24 > * + * { margin-top: 24px; }
.stack-16 > * + * { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; border-radius: 10px; padding: 10px 12px; border: 1px solid var(--border); color: var(--text); background: var(--surface); transition: all 0.2s ease; box-shadow: var(--shadow-sm); cursor: pointer; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn-primary:hover { background: var(--accent-700); }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--border); color: var(--accent); }
.btn-ghost:hover { background: var(--accent-50); }

/* Toggle Button */
.theme-toggle { width: 40px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }

/* Hero */
.hero { text-align: center; }
.hero-img { width: 160px; height: 160px; border-radius: 9999px; object-fit: cover; border: 4px solid var(--surface); box-shadow: var(--shadow-md); margin: 0 auto; }
.hero-title { margin-top: 16px; }
.hero-sub { max-width: 720px; margin: 12px auto 0; }
.hero-actions { margin-top: 18px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; box-shadow: var(--shadow-sm); }
.badge { display: inline-block; padding: 4px 10px; border-radius: 9999px; background: var(--accent-50); color: var(--accent); font-size: 12px; font-weight: 600; border: 1px solid var(--border); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 12px; padding: 6px 10px; border-radius: 9999px; background: var(--bg); border: 1px solid var(--border); color: var(--text); }

/* Project card */
.project-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.project-top { display: flex; align-items: center; justify-content: center; height: 160px; background: var(--bg); border-bottom: 1px solid var(--border); font-size: 44px; }
.project-body { padding: 18px; }
.project-title { margin-bottom: 6px; }
.project-meta { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; }

/* Forms */
.form { display: grid; gap: 16px; }
.label { font-weight: 600; color: var(--text); font-size: 0.95rem; }
.input, .textarea { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; transition: border-color .2s, box-shadow .2s; }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12); }
.textarea { min-height: 120px; resize: vertical; }

/* Footer */
footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 32px; }
.footer-wrap { max-width: 1100px; margin: 0 auto; padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.footer-links { display: flex; gap: 12px; }
.footer-links a { text-decoration: none; color: var(--muted); border: 1px solid var(--border); padding: 8px 10px; border-radius: 8px; }
.footer-links a:hover { color: var(--accent); background: var(--accent-50); }

/* Utilities */
.center { text-align: center; }
.muted { color: var(--muted); }
.lead { font-size: 1.05rem; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }

/* Responsive */
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .nav { padding: 12px 16px; }
  main { margin-top: 60px; }
  .section { padding: 20px; }
}