@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600&family=Source+Sans+3:ital,wght@0,400;0,600;1,400&display=swap");

:root {
  --ink: #0b1220;
  --paper: #ffffff;
  --muted: #3d4450;
  --amber: #b07a2e;
  --rule: #d7c4a3;
  --font-display: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

@page {
  size: letter;
  margin: 0.52in 0.58in 0.62in;
}

@page condensed {
  size: letter;
  margin: 0.25in 0.28in 0.32in;
}

@page {
  @bottom-center {
    content: counter(page) " / " counter(pages);
    font-family: var(--font-body);
    font-size: 8pt;
    color: #6b7280;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 10.25pt;
  line-height: 1.35;
}

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

a[href^="http"] {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h1 {
  margin: 0;
  font-size: 26pt;
  line-height: 1;
}

h2 {
  margin: 0 0 0.4rem;
  font-size: 11pt;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.2rem;
}

h3 {
  margin: 0;
  font-size: 11.5pt;
}

#print-controls {
  display: none;
}

.print-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.4in;
  row-gap: 0.12in;
  align-items: start;
  margin-bottom: 0.14in;
}

.print-identity {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.print-title {
  margin: 0.2rem 0 0;
  font-size: 12pt;
  color: var(--amber);
}

.print-summary {
  margin: 0.28rem 0 0;
  color: var(--muted);
}

.print-contact {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.06in 0;
  margin: 0;
  color: var(--muted);
  font-size: 9pt;
  line-height: 1.4;
  text-align: left;
}

.print-contact-item {
  white-space: nowrap;
}

.print-contact-item:not(:last-child)::after {
  content: " · ";
  white-space: pre;
}

.print-contact strong {
  font-weight: 600;
  color: var(--ink);
}

.print-portrait {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 1.05in;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--amber);
  overflow: hidden;
  background: #f6f1e6;
}

.print-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.print-portrait.is-empty {
  display: block;
}

.print-portrait.is-empty img {
  display: none;
}

.is-condensed {
  page: condensed;
}

.is-condensed .print-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.08in;
  text-align: center;
}

.is-condensed .print-identity {
  width: 100%;
  text-align: center;
}

.is-condensed .print-contact {
  justify-content: center;
  text-align: center;
  grid-column: auto;
  grid-row: auto;
}

.is-condensed .print-portrait {
  grid-column: auto;
  grid-row: auto;
}

.is-condensed .print-section {
  margin-bottom: 0.08in;
}

.is-condensed .print-job,
.is-condensed .print-edu,
.is-condensed .print-project {
  margin-bottom: 0.06in;
}

.print-section {
  margin-bottom: 0.2in;
}

.print-job,
.print-edu,
.print-project {
  margin-bottom: 0.14in;
  break-inside: avoid;
}

.print-job:nth-child(n + 3),
.print-long {
  break-inside: auto;
}

.print-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
  font-size: 9pt;
  color: var(--muted);
}

.print-company {
  font-weight: 600;
  color: var(--ink);
}

.print-job ul,
.print-edu ul {
  margin: 0.12rem 0 0;
  padding-left: 1rem;
}

.print-job li,
.print-edu li {
  margin-bottom: 0.08rem;
}

.print-certs {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 9pt;
  line-height: 1.4;
}

.print-certs li {
  display: inline;
}

.print-certs li:not(:last-child)::after {
  content: " · ";
  white-space: pre;
}

.print-skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem 0.7rem;
}

.print-skills h3 {
  font-size: 10pt;
  margin-bottom: 0.15rem;
}

.print-skills p {
  margin: 0;
  color: var(--muted);
}

.print-highlighted-skills {
  margin: 0;
  color: var(--muted);
}

.print-project p {
  margin: 0.12rem 0 0;
  color: var(--muted);
}

@media screen {
  html,
  body {
    background: #1c212c;
  }

  #print-controls {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background: #0b1220;
    color: #f3ede1;
    font-size: 15px;
    line-height: 1.4;
  }

  .print-controls-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
  }

  .print-mode-toggle {
    display: inline-flex;
    border: 1px solid color-mix(in srgb, #e8b86d 45%, transparent);
    border-radius: 999px;
    overflow: hidden;
  }

  .print-mode-option {
    color: #e8b86d;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0.4rem 0.85rem;
    font: inherit;
    text-decoration: none;
  }

  .print-mode-option + .print-mode-option {
    border-left: 1px solid color-mix(in srgb, #e8b86d 45%, transparent);
  }

  .print-mode-option.is-active {
    background: color-mix(in srgb, #e8b86d 18%, transparent);
    color: #f3ede1;
  }

  #print-controls a,
  #print-controls button {
    color: #e8b86d;
    background: transparent;
    border: 1px solid color-mix(in srgb, #e8b86d 45%, transparent);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
  }

  #print-controls a:hover,
  #print-controls button:hover,
  .print-mode-option:hover {
    background: color-mix(in srgb, #e8b86d 14%, transparent);
  }

  #print-controls .print-mode-toggle {
    border-radius: 999px;
  }

  #print-controls .print-mode-option {
    border: 0;
  }

  #preview {
    padding: 5.25rem 1rem 2rem;
  }

  .pagedjs_pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
  }

  .pagedjs_page {
    background: #fff;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.38);
  }
}

@media print {
  #print-controls,
  #preview:empty {
    display: none !important;
  }

  html,
  body {
    background: #fff;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
