:root {
  --ink: #111;
  --muted: #333;
  --line: #222;
  --paper: #fff;
  --screen: #fff;
  --page-padding-x: 15mm;
  --page-padding-y: 13mm;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--screen);
  color: var(--ink);
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.55;
}

body {
  margin: 0;
  min-width: 320px;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

.toolbar {
  background: #111827;
  color: #fff;
  font-family: inherit;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.toolbar__inner {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.toolbar a,
.toolbar button,
.toolbar select {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font: 700 13px/1 "Times New Roman", Times, serif;
  min-height: 36px;
  padding: 10px 12px;
}

.toolbar button {
  background: #fff;
  color: #111827;
}

.role-picker {
  align-items: center;
  display: flex;
  gap: 8px;
}

.role-picker span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 700;
}

.toolbar select {
  background: #111827;
  min-width: 230px;
}

.toolbar select:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.resume {
  background: var(--paper);
  box-shadow: none;
  margin: 0 auto;
  min-height: auto;
  padding: 44px 24px 64px;
  width: min(920px, 100%);
}

.resume__header {
  margin-bottom: 22px;
  text-align: center;
}

.resume__photo {
  display: none;
}

h1,
h2,
h3,
p,
ul,
dl {
  margin: 0;
}

h1 {
  font-size: clamp(1.85rem, 4.4vw, 2.75rem);
  letter-spacing: 0;
  line-height: 1.08;
  text-transform: uppercase;
}

.title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 8px;
}

.contact {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.92rem;
  font-style: normal;
  gap: 4px 8px;
  justify-content: center;
  margin-top: 12px;
}

.contact > * {
  white-space: nowrap;
}

section {
  break-inside: avoid;
  margin-top: 24px;
  page-break-inside: avoid;
}

h2 {
  border-bottom: 1px solid var(--line);
  break-after: avoid;
  font-size: 0.82rem;
  letter-spacing: 0;
  line-height: 1.25;
  margin-bottom: 10px;
  padding-bottom: 6px;
  page-break-after: avoid;
  text-transform: uppercase;
}

section > p,
.item p,
li,
dd {
  font-size: 1rem;
}

.skills {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}

.skills + p {
  margin-top: 12px;
}

.skills div {
  align-items: baseline;
  display: flex;
  column-gap: 8px;
}

dt {
  flex: 0 0 auto;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
}

dt::after {
  content: ":";
}

dd {
  color: var(--muted);
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
}

.item + .item {
  margin-top: 16px;
}

.item {
  break-inside: avoid;
  page-break-inside: avoid;
}

.item-header,
.item__heading {
  align-items: baseline;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.item-title {
  flex: 1 1 auto;
  min-width: 0;
}

h3 {
  break-after: avoid;
  font-size: 1rem;
  font-weight: 700;
  page-break-after: avoid;
}

.item-date,
time {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 0.92rem;
  text-align: right;
  white-space: nowrap;
}

ul {
  margin-top: 6px;
  padding-left: 22px;
}

li {
  margin-top: 4px;
}

@media (max-width: 720px) {
  .resume {
    box-shadow: none;
    margin: 0;
    min-height: auto;
    padding: 32px 18px 48px;
    width: 100%;
  }

  .skills div {
    display: block;
  }

  .item-header,
  .item__heading {
    gap: 10px;
  }

  .contact > * {
    white-space: normal;
  }

  .role-picker {
    flex: 1 1 100%;
    justify-content: center;
  }

  .role-picker span {
    flex: 0 0 auto;
  }

  .toolbar select {
    min-width: 0;
    width: min(100%, 260px);
  }
}

@page {
  size: A4;
  margin: 0;
}

@media print {
  * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  html,
  body {
    background: #fff;
    height: auto;
    width: 210mm;
  }

  html {
    font-family: "Times New Roman", Times, serif;
    font-size: 10.25pt;
    line-height: 1.34;
  }

  .no-print,
  .toolbar,
  button {
    display: none !important;
  }

  .resume {
    background: #fff;
    box-shadow: none;
    margin: 0;
    min-height: 296mm;
    padding: 10mm 13mm;
    width: 210mm;
  }

  a {
    color: #111;
    text-decoration: none;
  }

  a::after {
    content: "";
  }

  h1 {
    font-size: 15.5pt;
  }

  .title {
    font-size: 9.7pt;
    margin-top: 4px;
  }

  .contact,
  section > p,
  .item p,
  li,
  dd,
  dt {
    font-size: 8.8pt;
  }

  .contact {
    gap: 2px 5px;
    margin-top: 7px;
  }

  h2 {
    font-size: 9pt;
    margin-bottom: 6px;
    padding-bottom: 3px;
  }

  h3 {
    font-size: 9.15pt;
  }

  time {
    font-size: 8.25pt;
  }

  section {
    break-inside: avoid;
    margin-top: 11px;
    page-break-inside: avoid;
  }

  .resume__header,
  .item {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .resume__header {
    margin-bottom: 10px;
  }

  .item-header,
  .item__heading {
    gap: 10px;
  }

  .item + .item {
    margin-top: 8px;
  }

  .skills {
    gap: 2px;
    margin-top: 6px;
  }

  .skills + p {
    margin-top: 6px;
  }

  .skills div {
    column-gap: 5px;
  }

  ul {
    margin-top: 5px;
    padding-left: 15px;
  }

  li {
    margin-top: 3px;
  }
}

/* ============================================
   Harvard Resume Style Template Overrides
   ============================================ */

.resume--harvard .resume__header {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  text-align: left;
  gap: 28px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.resume--harvard .resume__photo {
  display: block;
  width: 100px;
  height: 120px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 4px;
  flex-shrink: 0;
}

.resume--harvard .resume__header-info {
  flex-grow: 1;
}

.resume--harvard .contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  text-align: left;
  margin-top: 8px;
  gap: 4px 10px;
}

.resume--harvard .contact span {
  display: inline;
}

@media (max-width: 600px) {
  .resume--harvard .resume__header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    border-bottom-width: 1px;
  }
  .resume--harvard .contact {
    justify-content: center;
    text-align: center;
  }
}

@media print {
  .resume--harvard .resume__header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    border-bottom-width: 1.5pt;
    padding-bottom: 6px;
    margin-bottom: 10px;
  }
  .resume--harvard .resume__photo {
    display: block;
    width: 68px;
    height: 82px;
  }
}
