:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1c2330;
  --muted: #5a6270;
  --accent: #1d4e89;
  --border: #dfe3ea;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151c;
    --surface: #1a202a;
    --text: #e4e8ee;
    --muted: #9aa4b2;
    --accent: #7fb0ec;
    --border: #2a3240;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 60rem;
  padding: 2.5rem 1rem 2rem;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

.header {
  display: flex;
  gap: 1.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
}
.photo {
  width: 140px;
  height: 140px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border);
  border: 3px solid var(--accent);
}
h1 { margin: 0; font-size: 2.1rem; line-height: 1.15; }
.role { margin: .3rem 0 .8rem; color: var(--accent); font-weight: 500; }
.links { display: flex; flex-wrap: wrap; gap: .5rem; }
.links a {
  padding: .3rem .8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  text-decoration: none;
  font-size: .9rem;
}
.links a:hover { border-color: var(--accent); }

.summary { font-size: 1.05rem; }

h2 {
  margin: 2rem 0 .75rem;
  padding-bottom: .3rem;
  border-bottom: 2px solid var(--accent);
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
h3 { margin: 0 0 .35rem; font-size: 1rem; }
h3 a { text-decoration: none; }
h3 a:hover { text-decoration: underline; }

.entry { margin-bottom: .6rem; }
.entry p { margin: .2rem 0 0; }
.row { display: flex; flex-wrap: wrap; column-gap: .4rem; }
.place { color: var(--muted); }
.place::before { content: "· "; }
.dates { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: .9rem;
}
.card {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.card p { margin: 0; font-size: .93rem; }
.card .stack { margin-top: auto; padding-top: .6rem; color: var(--muted); font-size: .82rem; }
.note { color: var(--muted); font-size: .93rem; }

.skills {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .45rem 1.2rem;
  margin: 0;
}
.skills dt { font-weight: 600; }
.skills dd { margin: 0; }

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
}

@media (max-width: 40rem) {
  body { padding-top: 1.5rem; }
  .header { flex-direction: column; text-align: center; gap: 1rem; }
  .links { justify-content: center; }
  h1 { font-size: 1.75rem; }
  .place, .dates { margin-left: 0; width: 100%; }
  .place::before { content: none; }
  .skills { grid-template-columns: 1fr; }
  .skills dd { margin-bottom: .5rem; }
}

@media print {
  body { max-width: none; padding: 0; background: #fff; color: #000; }
  .links { display: none; }
  .card { break-inside: avoid; }
}
