:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1a2230;
  --muted: #5b6677;
  --border: #e3e7ee;
  --accent: #1e3a5f;
  --accent-strong: #2f6fb3;
  --accent-soft: #e8eef7;
  --ok: #1f7a4d;
  --ok-soft: #e4f4ec;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(16 24 40 / .04), 0 4px 16px rgb(16 24 40 / .05);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1420; --surface: #141d2c; --text: #e6ebf2; --muted: #9aa6b8; --border: #243042;
    --accent: #9cc4f0; --accent-strong: #7fb3ec; --accent-soft: #1b2a40; --ok: #5fd39a; --ok-soft: #12301f;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
  }
}
:root[data-theme="dark"] {
  --bg: #0d1420; --surface: #141d2c; --text: #e6ebf2; --muted: #9aa6b8; --border: #243042;
  --accent: #9cc4f0; --accent-strong: #7fb3ec; --accent-soft: #1b2a40; --ok: #5fd39a; --ok-soft: #12301f;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
img { max-width: 100%; display: block; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 16px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.5) blur(10px); -webkit-backdrop-filter: saturate(1.5) blur(10px); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -.01em; margin-right: auto; }
.brand span { color: var(--accent-strong); }
.nav { display: flex; gap: 4px; list-style: none; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .94rem; }
.nav a:hover { color: var(--text); background: var(--accent-soft); }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .sun { display: none; }
:root[data-theme="dark"] .icon-btn .sun { display: block; }
:root[data-theme="dark"] .icon-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .moon { display: none; }
}
@media (max-width: 720px) { .nav { display: none; } }

/* Hero */
.hero { padding: 64px 0 48px; }
.hero .wrap { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center; }
.avatar { width: 168px; height: 168px; border-radius: 50%; object-fit: cover; border: 4px solid var(--surface); box-shadow: var(--shadow); background: var(--accent-soft); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--ok); background: var(--ok-soft); padding: 4px 12px; border-radius: 999px; margin-bottom: 14px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); letter-spacing: -.03em; }
.role { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--accent-strong); font-weight: 600; margin: 6px 0 14px; }
.lead { color: var(--muted); max-width: 58ch; font-size: 1.05rem; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .92rem; margin: 4px 0 22px; list-style: none; }
.meta li { display: inline-flex; align-items: center; gap: 6px; }
.meta svg { width: 16px; height: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font-weight: 600; text-decoration: none; border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.btn svg { width: 18px; height: 18px; }
.btn:hover { border-color: var(--accent-strong); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
@media (max-width: 720px) {
  .hero { padding: 40px 0 24px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 24px; }
  .avatar { width: 128px; height: 128px; }
}

/* Sections */
section { padding: 40px 0; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

/* About highlights */
.highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 20px; list-style: none; }
.highlights li { background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; }
.highlights strong { display: block; font-size: 1.3rem; color: var(--accent); letter-spacing: -.02em; }
.highlights span { color: var(--muted); font-size: .9rem; }

/* Timeline */
.timeline { list-style: none; position: relative; }
.job { position: relative; padding-left: 28px; padding-bottom: 28px; }
.job:last-child { padding-bottom: 0; }
.job::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: -8px; width: 2px; background: var(--border); }
.job:last-child::before { display: none; }
.job::after { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent-strong); }
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; }
.job h3 { font-size: 1.1rem; }
.job .company { color: var(--accent-strong); font-weight: 600; }
.job time, .dates { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.job p { color: var(--muted); margin: 8px 0 10px; }
.job ul { padding-left: 18px; }
.job li { margin-bottom: 4px; }
.job li::marker { color: var(--accent-strong); }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 6px; margin-left: 6px; vertical-align: middle; }

/* Skills */
.skills h3 { font-size: .95rem; margin-bottom: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.tags li { font-family: var(--mono); font-size: .82rem; padding: 4px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); }

/* Projects */
.project h3 { font-size: 1.05rem; margin-bottom: 6px; }
.project p { color: var(--muted); font-size: .95rem; }
.project .tags { margin-bottom: 14px; }
.project-links { display: flex; gap: 14px; font-weight: 600; font-size: .92rem; }
.wip { font-size: .75rem; font-weight: 600; color: #8a5a00; background: #fdf1d8; padding: 2px 8px; border-radius: 6px; margin-left: 6px; vertical-align: middle; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wip { color: #f5c76b; background: #3a2c0c; } }
:root[data-theme="dark"] .wip { color: #f5c76b; background: #3a2c0c; }

/* Cert / education */
.cert { display: flex; gap: 16px; align-items: flex-start; }
.cert-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.cert-icon svg { width: 24px; height: 24px; }
.cert h3 { font-size: 1rem; margin-bottom: 4px; }
.cert p { color: var(--muted); font-size: .92rem; margin-bottom: 6px; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.card-title { font-size: 1rem; margin-bottom: 8px; }
.langs { list-style: none; }
.langs li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.langs li:last-child { border-bottom: 0; }
.langs span { color: var(--muted); }

/* Contact */
.contact { text-align: center; padding: 40px 24px; }
.contact h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.02em; margin-bottom: 10px; }
.contact p { color: var(--muted); max-width: 52ch; margin: 0 auto 22px; }
.contact .actions { justify-content: center; }

footer { padding: 32px 0 48px; color: var(--muted); font-size: .88rem; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

@media print {
  .site-header, .actions, .icon-btn, footer { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card { box-shadow: none; border-color: #ccc; }
  section { padding: 12px 0; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}
