:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --text: #1a1d21;
  --muted: #5b6470;
  --accent: #2f6f9f;
  --accent-strong: #24587f;
  --border: #e3e6ea;
  --maxw: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #171b21;
    --text: #e7eaee;
    --muted: #9aa4b0;
    --accent: #6db1e0;
    --accent-strong: #8cc3ec;
    --border: #262c34;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  line-height: 1.6;
  font-size: 17px;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: 0 0 6px 0;
  z-index: 10;
}
.skip-link:focus { left: 0; }

/* Hero */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 56px 0 40px;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 2.9rem);
  letter-spacing: -0.02em;
}
.tagline {
  margin: 6px 0 20px;
  color: var(--muted);
  font-size: 1.15rem;
}
.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}
.contact a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
}
.contact a:hover,
.contact a:focus { border-bottom-color: var(--accent); }

/* Sections */
main { padding: 8px 0 24px; }
section { margin-top: 40px; }
h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
h3 { margin: 0 0 6px; font-size: 1.05rem; }
p { margin: 0 0 14px; }

/* Experience timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 2px 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.timeline li:last-child { border-bottom: none; }
.period { color: var(--muted); font-variant-numeric: tabular-nums; }
.role { font-weight: 600; }
.org { grid-column: 2; color: var(--muted); font-size: 0.95rem; }

/* Highlight cards */
.cards { display: grid; gap: 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}
.card p { margin: 0; color: var(--text); }

/* Skills chips */
.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chips li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.92rem;
}

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

@media (max-width: 520px) {
  .timeline li { grid-template-columns: 1fr; }
  .org { grid-column: 1; }
}

@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #333; --border: #ccc; }
  .skip-link, .hero { border: none; }
  .hero { padding: 0 0 16px; background: none; }
  body { font-size: 12pt; }
  a { color: #000; text-decoration: none; }
  .card, .chips li { break-inside: avoid; }
}
