:root {
  color-scheme: dark;
  --bg: #080808;
  --paper: #101010;
  --text: #f2f2f0;
  --muted: #aaa9a4;
  --line: #343434;
  --accent: #afd0e8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.48 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: .2em; }
a:focus-visible,
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }

.resume-tools {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(100% - 2rem, 52rem);
  margin: 1.25rem auto;
  color: var(--muted);
  font-size: .76rem;
}

.resume-tools span { text-align: center; }

.resume-tools a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.resume-tools button {
  justify-self: end;
  min-height: 2.75rem;
  padding: .55rem .9rem;
  border: 0;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.resume-tools button:active { scale: .96; }

.resume-page {
  width: min(100% - 2rem, 52rem);
  margin: 0 auto 3rem;
  padding: 2.6rem 3rem 2rem;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgb(255 255 255 / .08);
}

.resume-header {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}

h1 {
  margin-top: .25rem;
  font-size: 2.15rem;
  letter-spacing: -.045em;
  line-height: 1.05;
}

h2 {
  margin-bottom: .62rem;
  color: var(--accent);
  font-size: .7rem;
  letter-spacing: .12em;
  line-height: 1.2;
  text-transform: uppercase;
}

h3 { font-size: .87rem; line-height: 1.2; }

.eyebrow {
  color: var(--muted);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.role {
  margin-top: .48rem;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 650;
}

address {
  color: var(--muted);
  font-size: .74rem;
  font-style: normal;
  line-height: 1.65;
  text-align: right;
}

.resume-page > section,
.resume-grid { padding-top: 1.15rem; }
.profile p { color: var(--muted); line-height: 1.55; }

.resume-role {
  padding: .72rem 0;
  border-top: 1px solid var(--line);
}

.resume-role header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.resume-role header p,
.resume-role time {
  color: var(--muted);
  font-size: .69rem;
}

.resume-role time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

ul { margin: .48rem 0 0; padding-left: 1rem; color: var(--muted); }
li + li { margin-top: .2rem; }

.resume-grid {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: 2rem;
}

.capability {
  padding: .45rem 0;
  border-top: 1px solid var(--line);
}

.capability p {
  margin-top: .22rem;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.45;
}

.education {
  margin-top: 0;
  padding: 0;
  list-style: none;
}

.education li {
  display: grid;
  gap: .06rem;
  padding: .38rem 0;
  border-top: 1px solid var(--line);
  font-size: .76rem;
}

.education span { color: var(--muted); font-size: .67rem; }

.projects { padding-top: 1rem !important; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.project-grid p {
  display: grid;
  gap: .16rem;
  padding: .55rem .65rem .25rem 0;
}

.project-grid p + p {
  padding-left: .65rem;
  border-left: 1px solid var(--line);
}

.project-grid strong { font-size: .76rem; }
.project-grid span { color: var(--muted); font-size: .66rem; line-height: 1.35; }

@media (max-width: 40rem) {
  .resume-tools {
    grid-template-columns: 1fr auto;
  }

  .resume-tools span { display: none; }
  .resume-page { padding: 1.5rem; }
  .resume-header,
  .resume-role header { display: grid; }
  address { text-align: left; }
  .resume-grid,
  .project-grid { grid-template-columns: 1fr; }

  .project-grid p + p {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media print {
  :root {
    color-scheme: light;
    --bg: #fff;
    --paper: #fff;
    --text: #111;
    --muted: #444;
    --line: #c7c7c7;
    --accent: #111;
  }

  @page {
    size: A4;
    margin: 9mm 10mm;
  }

  body { font-size: 9.2pt; line-height: 1.42; }
  .resume-tools { display: none; }

  .resume-page {
    width: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  .resume-header { padding-bottom: 9pt; }
  h1 { font-size: 21pt; }
  h2 { margin-bottom: 5pt; font-size: 7pt; }
  h3 { font-size: 8.6pt; }
  .role { margin-top: 3pt; font-size: 8.6pt; }
  .eyebrow { font-size: 6.2pt; }
  address { font-size: 7pt; }
  .resume-page > section,
  .resume-grid { padding-top: 9pt; }
  .profile p { line-height: 1.46; }

  .resume-role {
    break-inside: avoid;
    padding: 5.5pt 0;
  }

  .resume-role header p,
  .resume-role time { font-size: 6.7pt; }
  ul { margin-top: 4pt; padding-left: 11pt; }
  li + li { margin-top: 1.8pt; }
  .resume-grid { gap: 17pt; break-inside: avoid; }
  .capability { padding: 4pt 0; }
  .capability p { margin-top: 2pt; font-size: 6.9pt; }
  .education li { padding: 3.5pt 0; font-size: 7.3pt; }
  .education span { font-size: 6.5pt; }
  .projects { padding-top: 8pt !important; break-inside: avoid; }
  .project-grid p { padding-top: 4.5pt; }
  .project-grid strong { font-size: 7.3pt; }
  .project-grid span { font-size: 6.3pt; }
}
