:root {
  --bg:           #0f1117;
  --surface:      #1e2130;
  --border:       #2a2f45;
  --text:         #f1f5f9;
  --text-muted:   #64748b;
  --accent:       #818cf8;
  --accent-dark:  #6366f1;
  --radius:       10px;
  --max-w:        1200px;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text); }

/* ── Nav ── */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}
.nav-brand { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.nav-brand:hover { color: var(--text); }
.nav-links { display: flex; gap: 2rem; font-size: 0.9rem; }
.nav-links a { color: var(--text-muted); }
.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

/* ── Main ── */
main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ── Footer ── */
.footer {
  display: flex;
  gap: 2rem;
  justify-content: center;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--accent); }

/* ── Hero ── */
.hero { margin-bottom: 2.5rem; }
.hero-label {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}
.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}
.hero-sub { color: var(--text-muted); font-size: 1.05rem; }

/* ── Filter tabs ── */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.filter-tab {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.filter-tab:hover { border-color: var(--accent); color: var(--accent); }
.filter-tab.active {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
  font-weight: 600;
}

/* ── Project grid ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
@media (max-width: 1100px) { .project-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .project-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .project-grid { grid-template-columns: 1fr; } }

/* ── Project card ── */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: inherit;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  color: inherit;
}
.project-card.hidden { display: none; }

.card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: #2a2f45;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb-placeholder { color: var(--text-muted); font-size: 0.75rem; }

.card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.card-tag {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.35rem;
}
.card-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
.card-summary { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; flex: 1; }

/* ── Project detail ── */
.project-back {
  display: inline-block;
  color: var(--accent);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}
.project-back:hover { color: var(--text); }

.project-detail {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 768px) { .project-detail { grid-template-columns: 1fr; } }

.project-tag {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}
.project-title { font-size: 2rem; font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.project-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.tech-stack { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem; }
.tech-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
}

.github-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: border-color 0.15s;
}
.github-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Screenshot gallery ── */
.screenshot-hero {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.screenshot-hero img { width: 100%; height: 100%; object-fit: cover; }
.screenshot-placeholder { color: var(--text-muted); font-size: 0.875rem; }

.screenshot-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}
.screenshot-thumb {
  aspect-ratio: 16/9;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.screenshot-thumb:hover,
.screenshot-thumb.active { border-color: var(--accent); }
.screenshot-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── About ── */
.page-title { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.page-subtitle { color: var(--text-muted); margin-bottom: 2.5rem; }

.about-bio {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 680px;
  margin-bottom: 3rem;
}
.skills-section { margin-bottom: 2rem; }
.skills-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.skills-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
}

/* ── Contact ── */
.contact-form { max-width: 560px; }
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; }
.form-input,
.form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.form-input:focus,
.form-textarea:focus { outline: none; border-color: var(--accent); }
.form-textarea { min-height: 140px; resize: vertical; }
.form-submit {
  background: var(--accent-dark);
  color: #fff;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.form-submit:hover { opacity: 0.85; }
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.alert-success { background: var(--surface); border: 1px solid #22c55e; color: #22c55e; }
.alert-error   { background: var(--surface); border: 1px solid #ef4444; color: #ef4444; }

/* ── 404 ── */
.not-found { text-align: center; padding: 5rem 0; }
.not-found-code { font-size: 6rem; font-weight: 900; color: var(--accent); line-height: 1; margin-bottom: 1rem; }
.not-found-msg  { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.not-found-link { font-size: 0.9rem; }

/* ── Responsive misc ── */
@media (max-width: 480px) {
  .nav { padding: 1rem; }
  .nav-links { gap: 1.25rem; }
  main { padding: 2rem 1rem; }
  .hero-title { font-size: 1.75rem; }
  .project-title { font-size: 1.5rem; }
}
