/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0b0b0f;
  --bg-alt: #101015;
  --surface: #16161d;
  --surface-hi: #1e1e27;
  --border: #26262f;
  --border-hi: #38384a;
  --text: #e9e8ee;
  --text-muted: #9a98a8;
  --accent: #7c8cff;
  --accent-dim: #2a2e5c;
  --accent-text: #0b0b0f;
  --radius: 10px;
  --maxw: 1040px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Nav ── */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  background: rgba(11,11,15,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text);
  font-size: 1.05rem;
}
.nav-links {
  display: flex; gap: 28px;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--accent); }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ── Hero ── */
.hero {
  min-height: 78vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 64px 24px;
  max-width: 720px;
  margin: 0 auto;
}
.hero-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 14px;
}
.hero-name {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text);
  margin-bottom: 14px;
}
.hero-bio {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 560px;
  margin: 0 auto 32px;
}
.hero-ctas {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 9px 18px; font-size: 0.82rem; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover { background: #93a1ff; }
.btn-secondary {
  background: transparent;
  border-color: var(--border-hi);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ── Sections ── */
.section {
  padding: 88px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.section-alt { background: var(--bg-alt); max-width: none; }
.section-alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 8px;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 40px;
  letter-spacing: -0.01em;
}

/* ── Featured project ── */
.project-featured {
  display: grid;
  grid-template-columns: minmax(260px, 40%) 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 32px;
}
.project-featured-media {
  background: #050505;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  border-right: 1px solid var(--border);
}
.project-featured-body {
  padding: 36px 40px;
}
.project-kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--proj-accent, var(--accent));
  margin-bottom: 10px;
}
.project-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.project-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 20px;
}
.project-stats {
  display: flex; flex-wrap: wrap; gap: 20px;
  margin-bottom: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.project-stats strong { color: var(--text); display: block; font-size: 1rem; }
.project-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 24px;
}
.tag {
  font-size: 0.74rem;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  color: var(--text-muted);
}
.project-links { display: flex; gap: 12px; flex-wrap: wrap; }
.project-note {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.project-note a { color: var(--accent); text-decoration: none; }
.project-note a:hover { text-decoration: underline; }

/* ── Project lineage (secondary featured) ── */
.project-lineage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 36px;
  margin-bottom: 32px;
}
.lineage-strip {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 24px;
}
.lineage-step {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.lineage-step-current { color: var(--text); border-color: #c9a24a; }
.lineage-step-lang {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.lineage-arrow { color: var(--text-muted); font-size: 0.9rem; }

/* ── Project grid (smaller cards) ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.15s, transform 0.15s;
}
.project-card:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.project-card .project-title { font-size: 1.05rem; margin-bottom: 8px; }
.project-card .project-desc { font-size: 0.86rem; margin-bottom: 14px; }
.project-card-placeholder { border-style: dashed; color: var(--text-muted); }
.lang-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}

/* ── About ── */
.about-text {
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 28px;
  font-size: 0.95rem;
}
.skills-grid { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Contact ── */
.contact-links {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.contact-link {
  padding: 12px 22px;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.88rem;
  transition: border-color 0.15s, color 0.15s;
}
.contact-link:hover { border-color: var(--accent); color: var(--accent); }

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 28px 24px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ── Code viewer modal ── */
.code-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.code-modal[hidden] { display: none; }
.code-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(5,5,7,0.75);
  backdrop-filter: blur(2px);
}
.code-modal-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  width: 100%; max-width: 860px;
  max-height: 82vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.code-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-hi);
}
.code-modal-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.code-modal-close {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 1.4rem; line-height: 1;
  cursor: pointer; padding: 4px 8px;
}
.code-modal-close:hover { color: var(--text); }
.code-modal-body {
  margin: 0;
  padding: 20px 22px;
  overflow: auto;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre;
}

/* ── Responsive ── */
@media (max-width: 760px) {
  .nav-links {
    position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 24px; border-top: 1px solid var(--border); }
  .nav-toggle { display: flex; }
  .project-featured { grid-template-columns: 1fr; }
  .project-featured-media { border-right: none; border-bottom: 1px solid var(--border); }
  .project-featured-body { padding: 28px 24px; }
}
