:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --text: #1c1c1e;
  --muted: #5f6368;
  --border: #e6e4df;
  --accent: #2f5bd3;
  --accent-contrast: #ffffff;
  --tag-bg: #f1efea;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.05);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --surface: #18191c;
    --text: #ececec;
    --muted: #a0a3a8;
    --border: #2b2d31;
    --accent: #8aa8ff;
    --accent-contrast: #0d1220;
    --tag-bg: #222429;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }

code {
  font: 500 0.85em "JetBrains Mono", ui-monospace, monospace;
  background: var(--tag-bg);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

.container { width: min(960px, 100% - 32px); margin-inline: auto; }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav-links a:hover { color: var(--text); }

/* Hero */
.hero { padding: 88px 0 56px; }
.eyebrow { margin: 0 0 14px; color: var(--muted); font-weight: 500; font-size: 15px; }
.hero h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  max-width: 18ch;
}
.lede { margin: 22px 0 0; max-width: 62ch; color: var(--muted); font-size: 18px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.btn:hover { border-color: var(--muted); transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.08); }

/* Sections */
.section { padding: 40px 0; }
.section-title {
  margin: 0 0 22px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Projects */
.project {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 28px;
}
.project-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.project h3 { margin: 0; font-size: 24px; letter-spacing: -0.015em; }
.tagline { margin: 2px 0 0; color: var(--muted); }
.project-links { padding-top: 6px; font-size: 15px; }
.link { font-weight: 500; text-decoration: none; }
.link:hover { text-decoration: underline; }
.summary { margin: 16px 0 0; max-width: 70ch; }

.media { margin: 22px 0 0; }
.media img,
.media video {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #000;
}
/* Near-square screen recordings: keep them from filling the whole viewport */
.media .demo-loop { max-width: 640px; margin-inline: auto; background: var(--surface); }
.media:has(.demo-loop) figcaption { text-align: center; }
.media figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }

.highlights { margin: 22px 0 0; padding-left: 20px; }
.highlights li { margin: 6px 0; }
.highlights li::marker { color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 20px 0 0; padding: 0; }
.tags li {
  background: var(--tag-bg);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.muted { color: var(--muted); }

/* Skills */
.skills { display: grid; gap: 14px; margin: 0; }
.skills div { display: grid; grid-template-columns: 170px 1fr; gap: 16px; }
.skills dt { font-weight: 600; }
.skills dd { margin: 0; color: var(--muted); }

/* Education */
.edu { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.edu h3 { margin: 0; font-size: 18px; }
.edu p { margin: 4px 0 0; }
.when { color: var(--muted); white-space: nowrap; }

/* Contact & footer */
.contact p { margin: 0 0 8px; }
.email { font-size: 20px; font-weight: 600; }
.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}
.footer p { margin: 0; }
.footer a { color: var(--muted); }

@media (max-width: 640px) {
  .nav-links { gap: 14px; }
  .nav-links li:nth-child(3) { display: none; }
  .hero { padding: 56px 0 36px; }
  .lede { font-size: 17px; }
  .project { padding: 20px; }
  .skills div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
