/* ===== Design tokens ===== */
:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e6e8ee;
  --accent: #1e3a8a;        /* navy — single restrained accent */
  --accent-dark: #172554;
  --ring: rgba(30, 58, 138, 0.22);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 6px 20px rgba(17, 24, 39, 0.08);
  --radius: 14px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(248, 249, 251, 0.85);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; letter-spacing: -0.01em; font-size: 1.02rem; }
.nav { display: flex; align-items: center; gap: 24px; font-weight: 500; font-size: 0.94rem; }
.nav a { color: var(--muted); transition: color 0.15s ease; }
.nav a:hover { color: var(--text); }
.nav-cta { color: var(--accent) !important; font-weight: 600; }

/* ===== Hero ===== */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 76px 24px 60px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero-text { text-align: left; }
.eyebrow {
  display: inline-block;
  margin: 0 0 18px;
  padding: 5px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
}
.hero-role {
  margin: 10px 0 22px;
  font-size: clamp(1.02rem, 1.9vw, 1.28rem);
  font-weight: 500;
  color: var(--muted);
}
.lede {
  max-width: 56ch;
  margin: 0 0 30px;
  font-size: clamp(0.98rem, 1.4vw, 1.1rem);
  color: var(--muted);
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.94rem;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: #c9cdd8; }
.socials {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}
.socials a { font-weight: 500; transition: color 0.15s ease; }
.socials a:hover { color: var(--accent); }

/* Headshot */
.hero-photo { display: flex; justify-content: center; }
.hero-photo img {
  width: 100%;
  max-width: 260px;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: block;
}

/* ===== Projects ===== */
.projects {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 36px 24px 80px;
}
.section-head { text-align: center; margin-bottom: 38px; }
.section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  font-weight: 700;
}
.section-head p { margin: 0 auto; max-width: 54ch; color: var(--muted); font-size: 0.97rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #d4d8e2;
}

.card-banner {
  display: block;
  height: 150px;
  background: #eef0f4;          /* neutral placeholder while screenshot loads */
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.card-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 20px;
}
.card-body h3 { margin: 0 0 7px; font-size: 1.12rem; letter-spacing: -0.01em; font-weight: 700; }
.card-body > p { margin: 0 0 15px; color: var(--muted); font-size: 0.92rem; }

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
}
.tags li {
  font-size: 0.74rem;
  font-weight: 500;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 3px 9px;
  border-radius: 6px;
}

.card-links {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.card-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  transition: color 0.15s ease;
}
.card-link:hover { color: var(--accent-dark); }
.card-link.code { color: var(--muted); }
.card-link.code:hover { color: var(--text); }

/* ===== Demo button on cards ===== */
.card-link.demo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  cursor: pointer;
}
.card-link.demo::before { content: "▶"; font-size: 0.62rem; }
.card-link.demo:hover { color: var(--accent-dark); }

/* ===== Lightbox slideshow ===== */
.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  background: rgba(8, 10, 15, 0.93);
  backdrop-filter: blur(4px);
}
.lb-overlay.lb-open { display: flex; }
.lb-stage { display: flex; flex-direction: column; align-items: center; max-width: 92vw; }
.lb-media { display: flex; justify-content: center; }
.lb-img {
  max-height: 72vh;
  max-width: 86vw;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  background: #000;
}
.lb-cap {
  margin: 16px auto 8px;
  max-width: 46ch;
  text-align: center;
  color: #e8eaf0;
  font-size: 0.98rem;
  line-height: 1.5;
}
.lb-meta { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lb-counter { color: #9aa0ad; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.lb-dots { display: flex; gap: 7px; }
.lb-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); }
.lb-dot.on { background: #fff; }
.lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lb-close:hover { background: rgba(255, 255, 255, 0.22); }
.lb-nav {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lb-nav:hover { background: rgba(255, 255, 255, 0.22); }
@media (max-width: 640px) {
  .lb-nav { width: 40px; height: 40px; font-size: 1.5rem; }
  .lb-img { max-width: 80vw; }
}

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 32px 24px; text-align: center; }
.footer-name { margin: 0 0 10px; font-weight: 700; }
.footer-links { display: flex; gap: 18px; justify-content: center; margin: 0 0 12px; }
.footer-links a { color: var(--muted); font-weight: 500; font-size: 0.9rem; transition: color 0.15s ease; }
.footer-links a:hover { color: var(--accent); }
.footer-meta { margin: 0; color: var(--muted); font-size: 0.83rem; }

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 52px 20px 44px;
    text-align: center;
  }
  .hero-text { text-align: center; }
  .hero-actions, .socials { justify-content: center; }
  .lede { margin-left: auto; margin-right: auto; }
  .hero-photo { order: -1; }
  .hero-photo img { max-width: 170px; border-radius: 14px; }
}
@media (max-width: 640px) {
  .nav { gap: 16px; }
  .nav a:not(.nav-cta) { display: none; }
  .grid { grid-template-columns: 1fr; }
}

/* ===== Accessibility ===== */
a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 8px;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
