:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --accent-text: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --surface: #111a2e; --text: #e2e8f0; --muted: #94a3b8;
    --line: #1e293b; --accent: #818cf8; --accent-soft: #1e1b4b; --accent-text: #0b1120;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1120; --surface: #111a2e; --text: #e2e8f0; --muted: #94a3b8;
  --line: #1e293b; --accent: #818cf8; --accent-soft: #1e1b4b; --accent-text: #0b1120;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 Inter, 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; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
[hidden] { display: none !important; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
mark.todo { background: #fde68a; color: #78350f; padding: 0 4px; border-radius: 4px; font-size: .8em; font-weight: 700; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { font-weight: 800; font-size: 20px; color: var(--text); letter-spacing: -.02em; }
nav { display: flex; gap: 20px; margin-left: auto; }
nav a { color: var(--muted); font-size: 14px; font-weight: 500; }
nav a:hover { color: var(--text); text-decoration: none; }
.actions { display: flex; gap: 8px; align-items: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-text); padding: 10px 18px; border-radius: 10px;
  font: 600 15px/1 inherit; font-family: inherit; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Hero */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: start; padding-top: 64px; padding-bottom: 32px; }
.avatar { width: 132px; height: 132px; border-radius: 28px; object-fit: cover; box-shadow: var(--shadow); background: var(--surface); }
.badge { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 4px 12px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
h1 { font-size: clamp(34px, 6vw, 52px); font-weight: 800; letter-spacing: -.03em; }
.title { font-size: 20px; font-weight: 600; margin: 8px 0 4px; }
.loc { color: var(--muted); margin: 0 0 16px; }
.summary { max-width: 62ch; margin: 0 0 24px; font-size: 17px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat strong { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 14px; }

/* Sections */
.block { padding-top: 48px; }
.block h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 20px; font-weight: 700; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.job { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.job-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.job h3 { font-size: 18px; }
.org { margin: 4px 0 0; font-weight: 500; }
.period { margin: 0; color: var(--muted); font-size: 14px; white-space: nowrap; }
.job ul { margin: 14px 0 0; padding-left: 20px; }
.job li { margin: 4px 0; }

.skill-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.skill { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.skill h3 { font-size: 15px; margin-bottom: 12px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--accent-soft); color: var(--text); border-radius: 8px; padding: 4px 10px; font-size: 14px; }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; color: var(--text); transition: transform .15s, border-color .15s; }
a.card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.card h3 { font-size: 17px; }
.card p { margin: 0; color: var(--muted); }
.tag { align-self: flex-start; font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.more { margin-top: auto; padding-top: 8px; font-size: 14px; font-weight: 600; color: var(--accent); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.plain li { display: flex; flex-direction: column; }
.plain span { color: var(--muted); font-size: 14px; }

.contact-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.contact-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; }
.contact-list span { font-size: 13px; }
.contact-list a { font-weight: 600; word-break: break-word; }

.footer { padding: 48px 16px; color: var(--muted); font-size: 14px; text-align: center; }

/* Responsive */
@media (max-width: 760px) {
  nav { display: none; }
  .actions { margin-left: auto; }
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 20px; }
  .avatar { width: 96px; height: 96px; border-radius: 22px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .skill-grid, .cards, .two-col { grid-template-columns: 1fr; }
}

/* Print → clean one-column PDF */
@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --text: #000; --muted: #444; --line: #ddd; --accent: #1e3a8a; --accent-soft: #f1f5f9; }
  .topbar, .cta, .skip, .footer, mark.todo { display: none !important; }
  body { font-size: 11pt; }
  .hero { padding-top: 0; }
  .block { padding-top: 18px; }
  .job, .skill, .card, .stat, .contact-list li { box-shadow: none; break-inside: avoid; }
  a { color: inherit; }
}
