:root {
  color-scheme: dark;
  --bg: #0b0f0e;
  --bg-elevated: #121715;
  --bg-card: #151b19;
  --border: #223028;
  --text: #edf5e1;
  --text-muted: #9fb3aa;
  --accent: #5cdb95;
  --accent-strong: #379683;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --max-width: 960px;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f7faf8;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --border: #dbe6e0;
    --text: #0b1f18;
    --text-muted: #4b5f56;
    --accent: #1f9d63;
    --accent-strong: #05386b;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

a { color: var(--accent); }

h1, h2, h3 { line-height: 1.2; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 15, 14, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
@media (prefers-color-scheme: light) {
  .site-header { background: rgba(247, 250, 248, 0.85); }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}
.logo-dot { color: var(--accent); }

.primary-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.primary-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.primary-nav a:hover { color: var(--text); }

.nav-cta {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px;
  color: var(--text) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  display: block;
}

/* ---------- Hero ---------- */

.hero {
  padding: 96px 0 64px;
}

.eyebrow {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  margin: 0;
}

.hero-role {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: var(--text-muted);
  margin: 4px 0 24px;
}

.hero-lede {
  max-width: 620px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-terminal {
  max-width: 480px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elevated);
  margin: 28px 0 32px;
}

.terminal-bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.terminal-body {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  min-height: 1.4em;
}
.terminal-prompt { color: var(--accent); margin-right: 8px; }
.terminal-cursor { animation: blink 1s steps(1) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #05230f;
}
.btn-primary:hover { background: var(--accent-strong); color: #edf5e1; }
.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Sections ---------- */

.section { padding: 72px 0; }
.section-alt { background: var(--bg-elevated); }

.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 1.6rem;
  margin: 0 0 32px;
}
.section-num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1rem;
}

.about-grid p {
  max-width: 720px;
  color: var(--text-muted);
}
.about-grid p:first-child { color: var(--text); }

/* ---------- Timeline ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding: 0 0 40px 28px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-when {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.timeline-content h3 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}
.timeline-org {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.95rem;
}

.timeline-content ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
}
.timeline-content li { margin-bottom: 8px; }

/* ---------- Skills ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

.skill-group h3 {
  font-size: 1rem;
  margin: 0 0 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-list li {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.88rem;
  background: var(--bg-card);
}

.chip-list-cert li {
  border-radius: 8px;
  background: transparent;
  border-color: var(--accent-strong);
  color: var(--text);
}

/* ---------- Projects ---------- */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
}

.project-card-featured {
  border-color: var(--accent-strong);
  grid-column: 1 / -1;
}

.project-card h3 { margin: 0 0 10px; }
.project-card p { color: var(--text-muted); flex-grow: 1; margin: 0 0 16px; }
.project-link { font-weight: 600; text-decoration: none; font-size: 0.92rem; }
.project-link:hover { text-decoration: underline; }

/* ---------- Contact ---------- */

.contact-section { text-align: center; }
.contact-lede {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 28px;
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .primary-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px 20px;
    display: none;
  }
  .primary-nav.open { display: flex; }
  .primary-nav a { padding: 10px 0; width: 100%; }

  .hero { padding: 56px 0 40px; }
  .section { padding: 48px 0; }
  .project-card-featured { grid-column: auto; }
}
