:root{
  --navy:#0b1220; --blue:#2563eb; --blue-soft:#4f8ef7; --ink:#111827; --text:#374151;
  --muted:#6b7280; --line:#e5e7eb; --card:#f8fafc; --chip:#eef1f6; --pill:#e8effd; --pill-ink:#2250c8;
  --head:'Space Grotesk','Inter','Segoe UI',system-ui,sans-serif;
  --body:'Inter','Segoe UI',system-ui,-apple-system,sans-serif;
}
*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-print-color-adjust:exact;print-color-adjust:exact}
body{background:#eef1f5;font-family:var(--body);color:var(--text);font-size:12px;line-height:1.5}
a{color:inherit;text-decoration:none}

.page{width:210mm;margin:24px auto;background:#fff;box-shadow:0 6px 30px rgba(15,23,42,.12);border-radius:0 0 14px 14px;overflow:hidden}

/* ---------- header ---------- */
.hero{background:var(--navy);color:#fff;padding:28px 30px 20px;border-bottom:3px solid var(--blue)}
.hero h1{font-family:var(--head);font-size:36px;line-height:1.05;font-weight:700;letter-spacing:.01em;text-transform:uppercase}
.hero .title{font-family:var(--head);color:var(--blue-soft);font-size:18px;margin-top:6px;font-weight:500}
.contact{display:flex;flex-wrap:wrap;gap:8px 26px;margin-top:18px;padding-top:15px;border-top:1px solid rgba(255,255,255,.1);font-size:12.5px;color:#cbd5e1}
.contact span,.contact a{display:inline-flex;align-items:center;gap:8px}
.contact svg{width:14px;height:14px;stroke:var(--blue-soft);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.contact a.site{text-decoration:underline;text-underline-offset:3px}

/* ---------- layout ---------- */
.grid{display:grid;grid-template-columns:1fr 236px;gap:24px;padding:22px 26px 26px}
.main>section,.side>section{margin-bottom:20px}
h2{break-after:avoid;display:flex;align-items:center;gap:10px;font-family:var(--head);font-size:11px;font-weight:700;letter-spacing:.17em;text-transform:uppercase;color:var(--ink);padding-bottom:9px;border-bottom:1px solid var(--line);margin-bottom:14px}
h2::after{content:"";flex:1;height:1.5px;background:linear-gradient(90deg,var(--blue),rgba(37,99,235,0))}
p.summary{color:var(--text);font-size:12px;line-height:1.6}

/* ---------- experience ---------- */
.timeline{position:relative;padding-left:20px;border-left:2px solid #cfdcf6;margin-left:4px}
.job{position:relative;margin-bottom:16px;break-inside:avoid}
.job:last-child{margin-bottom:0}
.job::before{content:"";position:absolute;left:-27px;top:5px;width:10px;height:10px;border-radius:50%;background:var(--blue);box-shadow:0 0 0 3px #fff}
.row{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.job h3{font-family:var(--head);font-size:15px;color:var(--ink);font-weight:600}
.pill{flex:none;background:var(--pill);color:var(--pill-ink);font-size:10.5px;font-weight:500;padding:3px 10px;border-radius:999px;white-space:nowrap}
.org{font-size:12px;color:var(--muted);margin:3px 0 7px}
.org b{color:var(--ink);font-weight:600}
.org i{display:inline-block;width:4px;height:4px;border-radius:50%;background:#c3c9d4;margin:0 8px 2px}
.blurb{font-style:italic;color:var(--muted);font-size:12.5px;margin-bottom:8px}
ul{list-style:disc;padding-left:16px}
li{margin-bottom:3px;padding-left:1px}
li::marker{color:#6b7280;font-size:11px}

/* ---------- projects ---------- */
.card{background:var(--card);border:1px solid #e8edf3;border-radius:10px;padding:12px 14px;margin-bottom:11px;break-inside:avoid}
.card h3{font-family:var(--head);font-size:14px;color:var(--ink);font-weight:600}
.card .date{font-size:11px;color:var(--muted);white-space:nowrap}
.card a.view{display:inline-flex;align-items:center;gap:4px;color:var(--blue);font-size:11.5px;margin:5px 0 6px}
.card a.view svg{width:11px;height:11px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.card p{margin-bottom:7px}
.card ul{font-size:11px;color:#4b5563}

/* ---------- sidebar ---------- */
.side{background:var(--card);border:1px solid #e8edf3;border-radius:14px;padding:18px 16px 4px;align-self:start}
.side h2{margin-bottom:12px}
.group{font-family:var(--head);font-size:10.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--ink);margin:0 0 7px}
.chips{display:flex;flex-wrap:wrap;gap:5px}
.chip{background:var(--chip);border:1px solid #e3e8ef;border-radius:6px;font-size:10px;font-weight:500;color:#374151;padding:2px 7px;line-height:1.5}
.skillgroup{break-inside:avoid;margin-top:11px}
.skillgroup:first-of-type{margin-top:0}

.edu{border-left:2px solid #d5dce8;padding-left:10px;margin-bottom:10px;break-inside:avoid}
.edu h4{font-family:var(--head);font-size:12px;line-height:1.35;color:var(--ink);font-weight:700}
.edu .school{font-size:11px;color:var(--text);margin-top:3px}
.edu .meta{display:flex;flex-direction:column;gap:1px;font-size:9.5px;color:var(--muted);margin-top:3px}

.langs{font-size:11px;color:var(--ink);display:grid;gap:9px}
.linkrow{display:flex;justify-content:space-between;align-items:center;background:#fff;border:1px solid var(--line);border-radius:6px;padding:5px 9px;margin-bottom:5px;font-size:11px;font-weight:700;color:var(--ink);break-inside:avoid}
.linkrow small{font-weight:400;color:#9ca3af;margin-left:6px;font-size:10px}
.linkrow svg{width:13px;height:13px;stroke:#9ca3af;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.ref{background:#fff;border:1px solid var(--line);border-radius:6px;padding:10px 11px;margin-bottom:9px;break-inside:avoid}
.ref b{display:block;font-size:11px;color:var(--ink)}
.ref em{display:block;font-size:10.5px;color:var(--muted);margin-top:3px;line-height:1.45}

/* ---------- print / PDF ---------- */
@page{size:A4;margin:9mm 0 9mm}
@page:first{margin-top:0}
@media print{
  body{background:#fff}
  .page{margin:0;box-shadow:none;border-radius:0;width:auto}
}
@media screen and (max-width:820px){
  .page{width:auto;margin:0}
  .grid{grid-template-columns:1fr}
}
