:root {
  --bg: #0f1216;
  --panel: #171b21;
  --line: #262c35;
  --text: #e8ecf1;
  --muted: #9aa5b3;
  --accent: #4fb3ff;
  --max: 960px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
}

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

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

/* Header */
header.site {
  position: sticky; top: 0; z-index: 10;
  background: rgba(15, 18, 22, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.brand { color: var(--text); font-weight: 700; letter-spacing: 0.2px; }
.brand:hover { text-decoration: none; }
nav a { color: var(--muted); margin-left: 22px; font-size: 0.95rem; }
nav a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero {
  padding: 96px 0 72px;
  display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center;
}
.hero .portrait {
  width: 260px; height: 260px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--line); box-shadow: 0 0 0 6px rgba(79, 179, 255, 0.12);
}
.eyebrow { color: var(--accent); font-size: 0.9rem; letter-spacing: 1.5px; text-transform: uppercase; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.1; margin: 12px 0 18px; }
.hero p.lead { color: var(--muted); font-size: 1.15rem; max-width: 640px; }
.cta { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 10px 20px; border-radius: 8px;
  border: 1px solid var(--line); color: var(--text); font-weight: 600;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #07131f; }
.btn:hover { text-decoration: none; filter: brightness(1.1); }

/* Sections */
section { padding: 56px 0; border-top: 1px solid var(--line); }
section h2 { font-size: 1.6rem; margin: 0 0 24px; }

/* Project cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 22px; color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.card p { margin: 0 0 14px; color: var(--muted); font-size: 0.95rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.78rem; color: var(--muted); border: 1px solid var(--line);
  padding: 2px 10px; border-radius: 999px;
}

/* Skills */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.skills h3 { font-size: 0.95rem; color: var(--accent); margin: 0 0 8px; text-transform: uppercase; letter-spacing: 1px; }
.skills ul { margin: 0; padding-left: 18px; color: var(--muted); }

/* Experience */
.job { margin-bottom: 22px; }
.job h3 { margin: 0; font-size: 1.05rem; }
.job .meta { color: var(--muted); font-size: 0.9rem; }

/* Project pages */
.project { padding: 64px 0 40px; }
.project h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 8px 0 10px; line-height: 1.15; }
.project .summary { color: var(--muted); font-size: 1.1rem; max-width: 700px; }
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin: 32px 0; padding: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.facts dt { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.project h2 { font-size: 1.3rem; margin: 36px 0 10px; }
.project p, .project li { color: #cfd6df; }
.placeholder {
  border: 1px dashed var(--line); border-radius: 12px; padding: 36px;
  text-align: center; color: var(--muted); margin: 16px 0;
}
.back { display: inline-block; margin-bottom: 8px; color: var(--muted); }
.project ul, .project ol { padding-left: 22px; }
.project h3 { font-size: 1.05rem; margin: 22px 0 6px; }

/* Figures */
figure { margin: 24px 0; }
figure img {
  display: block; width: 100%; height: auto; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
}
figure.photo img { background: var(--panel); }
figcaption { color: var(--muted); font-size: 0.88rem; margin-top: 8px; }
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0; }
.figs figure { margin: 0; }
.hero-img { max-width: 640px; }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 20px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat b { display: block; font-size: 1.5rem; color: var(--text); line-height: 1.2; }
.stat span { color: var(--muted); font-size: 0.85rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 16px 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.8px; }
td { color: #cfd6df; }

.note {
  border-left: 3px solid var(--accent); background: var(--panel);
  padding: 12px 16px; border-radius: 0 8px 8px 0; color: #cfd6df; margin: 20px 0;
}

/* Footer */
footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: 0.9rem; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero .portrait { order: -1; width: 160px; height: 160px; }
}

@media (max-width: 560px) {
  nav a { margin-left: 14px; font-size: 0.88rem; }
  .hero { padding: 48px 0 48px; }
}
