:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1c2330;
  --muted: #5b6577;
  --line: #e2e6ed;
  --accent: #0b6bcb;
  --accent-soft: #e6f0fb;
  --hero-from: #0a2540;
  --hero-to: #0b6bcb;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131b;
    --card: #161d28;
    --text: #e6eaf0;
    --muted: #97a3b6;
    --line: #263041;
    --accent: #5aa9f5;
    --accent-soft: #1a2a40;
    --hero-from: #0a1626;
    --hero-to: #12406f;
  }
}
:root[data-theme="dark"] {
  --bg: #0e131b;
  --card: #161d28;
  --text: #e6eaf0;
  --muted: #97a3b6;
  --line: #263041;
  --accent: #5aa9f5;
  --accent-soft: #1a2a40;
  --hero-from: #0a1626;
  --hero-to: #12406f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.hero {
  background: linear-gradient(135deg, var(--hero-from), var(--hero-to));
  color: #fff;
  padding: 56px 16px 48px;
}
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.hero .wrap { padding: 0; }
.hero-grid { display: flex; gap: 32px; align-items: center; }
.photo {
  width: 160px; height: 160px; flex: none;
  border-radius: 50%; object-fit: cover; object-position: 50% 25%;
  border: 4px solid rgba(255,255,255,.85);
  box-shadow: 0 6px 24px rgba(0,0,0,.3);
}
@media (max-width: 640px) {
  .hero-grid { flex-direction: column; align-items: flex-start; gap: 20px; }
  .photo { width: 120px; height: 120px; }
}
.badge {
  display: inline-block;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .03em;
  margin-bottom: 14px;
}
.hero h1 { margin: 0 0 6px; font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; }
.hero .role { margin: 0 0 22px; font-size: 1.1rem; opacity: .92; }
.contact { display: flex; flex-wrap: wrap; gap: 8px 10px; list-style: none; padding: 0; margin: 0; }
.contact a, .contact span {
  display: inline-block;
  color: #fff;
  background: rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 4px 12px;
  font-size: .92rem;
}
.contact a:hover { background: rgba(255,255,255,.24); text-decoration: none; }
.actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  border: 1px solid rgba(255,255,255,.5);
  color: #fff;
  background: transparent;
  border-radius: 8px;
  padding: 8px 16px;
  font: inherit;
  font-size: .92rem;
  cursor: pointer;
}
.btn:hover { background: rgba(255,255,255,.15); text-decoration: none; }
.btn.primary { background: #fff; color: #0a2540; border-color: #fff; font-weight: 600; }
.btn.primary:hover { background: #e9f2fd; }

nav.toc {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
nav.toc .wrap { display: flex; gap: 4px; overflow-x: auto; padding-top: 8px; padding-bottom: 8px; }
nav.toc a {
  white-space: nowrap; color: var(--muted); font-size: .9rem;
  padding: 4px 12px; border-radius: 999px;
}
nav.toc a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }

main { padding: 28px 0 56px; }
section { margin-bottom: 20px; scroll-margin-top: 56px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
}
h2 {
  margin: 0 0 16px; font-size: .85rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent);
}
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

.skills { display: grid; gap: 14px; margin: 0; }
.skills div { display: grid; grid-template-columns: 200px 1fr; gap: 4px 20px; }
.skills dt { font-weight: 600; }
.skills dd { margin: 0; color: var(--muted); }

.job { padding: 0 0 22px 22px; border-left: 2px solid var(--line); position: relative; margin-left: 4px; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: ""; position: absolute; left: -7px; top: 7px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--accent);
}
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; align-items: baseline; }
.job h3 { margin: 0; font-size: 1.05rem; }
.job h3 span { font-weight: 400; color: var(--muted); }
.date { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.job .intro { color: var(--muted); font-size: .94rem; margin: 4px 0 0; }
ul { margin: 8px 0 0; padding-left: 20px; }
li { margin-bottom: 5px; }
li::marker { color: var(--accent); }

.certs { list-style: none; padding: 0; margin: 0; }
.certs li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 0; margin: 0; border-bottom: 1px solid var(--line);
}
.certs li:last-child { border-bottom: 0; }
.certs li.star { font-weight: 600; }
.certs .date { align-self: flex-start; padding-top: 2px; }

footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 0 16px 40px; }

@media (max-width: 640px) {
  .card { padding: 20px 18px; }
  .skills div { grid-template-columns: 1fr; }
  .certs li { flex-direction: column; gap: 0; }
}

@media print {
  :root { --bg: #fff; --card: #fff; --text: #000; --muted: #444; --line: #ccc; --accent: #0b4f99; }
  body { font-size: 10.5pt; line-height: 1.45; }
  .hero { background: none !important; color: #000; padding: 0 0 12px; border-bottom: 2px solid #000; }
  .hero .badge { border-color: #000; background: none; color: #000; }
  .contact a, .contact span { color: #000; background: none; padding: 0 12px 0 0; }
  .actions, nav.toc, footer { display: none; }
  .photo { width: 80px; height: 80px; border: 0; box-shadow: none; }
  .hero-grid { gap: 16px; }
  main { padding: 12px 0 0; }
  .card { border: 0; padding: 0; }
  section { margin-bottom: 14px; }
  .job { break-inside: avoid; }
  a { color: inherit; }
}
