/* ==========================================================================
   Resume page — screen presentation plus a print/PDF layout on US Letter.
   ========================================================================== */

:root {
  --paper:      #ffffff;
  --ink:        #16202e;
  --ink-muted:  #4b5666;
  --ink-subtle: #6b7686;
  --rule:       #dfe3ea;
  --accent:     #37368a;
  --page-bg:    #eef0f4;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

body {
  margin: 0;
  padding: 0 16px 64px;
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.015em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Screen chrome (hidden when printing) ---------- */

.page-actions {
  max-width: 8.5in;
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid #cfd5de;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.action:hover { border-color: #9aa3b0; background: #f7f8fa; text-decoration: none; }

.action-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.action-primary:hover { background: #2b2a70; border-color: #2b2a70; }

.action svg { width: 15px; height: 15px; }

/* ---------- The sheet ---------- */

.sheet {
  max-width: 8.5in;
  margin: 0 auto;
  padding: 0.62in 0.7in 0.7in;
  background: var(--paper);
  box-shadow: 0 10px 34px -10px rgba(16, 24, 40, 0.22);
  border-radius: 3px;
}

/* ---------- Masthead ---------- */

.masthead {
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--ink);
}

.masthead h1 {
  font-size: 1.95rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.masthead .title {
  margin-top: 3px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--accent);
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--ink-muted);
}
.contact-row .sep { color: var(--rule); }

/* ---------- Sections ---------- */

.block { margin-bottom: 19px; }
.block:last-child { margin-bottom: 0; }

.block > h2 {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 5px;
  margin-bottom: 11px;
  border-bottom: 1px solid var(--rule);
}

.summary {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

/* ---------- Roles ---------- */

.role { margin-bottom: 15px; }
.role:last-child { margin-bottom: 0; }

.role-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 16px;
}

.role-head h3 { font-size: 0.96rem; font-weight: 700; }

.role-when {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-subtle);
  white-space: nowrap;
}

.role-org {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.bullets li {
  position: relative;
  padding-left: 15px;
  margin-bottom: 4px;
  font-size: 0.86rem;
  color: var(--ink-muted);
  break-inside: avoid;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}
.bullets li:last-child { margin-bottom: 0; }

/* ---------- Skills ---------- */

.skills-table {
  display: grid;
  grid-template-columns: 8.2rem 1fr;
  gap: 6px 14px;
  font-size: 0.85rem;
}

.skills-table dt {
  font-weight: 700;
  color: var(--ink);
}

.skills-table dd {
  margin: 0;
  color: var(--ink-muted);
}

/* ---------- Education ---------- */

.edu-row { margin-bottom: 10px; }
.edu-row:last-child { margin-bottom: 0; }

.edu-row .school-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 16px;
}

.edu-row h3 { font-size: 0.92rem; font-weight: 700; }

.edu-row .degree {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.edu-row .coursework {
  font-size: 0.8rem;
  color: var(--ink-subtle);
  margin-top: 2px;
}

/* ---------- Projects ---------- */

.proj {
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--ink-muted);
  break-inside: avoid;
}
.proj:last-child { margin-bottom: 0; }
.proj strong { color: var(--ink); font-weight: 700; }

/* ---------- Print ---------- */

@page {
  size: letter;
  margin: 0.45in 0.55in;
}

@media print {
  body {
    background: #fff;
    padding: 0;
    font-size: 10pt;
    line-height: 1.34;
  }

  .page-actions { display: none !important; }

  .sheet {
    max-width: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
  }

  a { color: var(--ink); text-decoration: none; }

  .masthead {
    padding-bottom: 8pt;
    margin-bottom: 11pt;
  }
  .masthead h1 { font-size: 19pt; }
  .masthead .title { font-size: 10pt; }
  .contact-row { font-size: 8.2pt; gap: 2px 6px; margin-top: 5pt; }

  .block { margin-bottom: 9pt; }
  .block > h2 {
    font-size: 7.8pt;
    padding-bottom: 3pt;
    margin-bottom: 6pt;
  }

  .summary,
  .bullets li,
  .skills-table,
  .proj,
  .role-org { font-size: 9pt; }

  .role { margin-bottom: 8pt; }
  .role-org { margin-bottom: 3pt; }
  .bullets li { margin-bottom: 2.5pt; }

  .role-head h3 { font-size: 10pt; }
  .role-when { font-size: 8.2pt; }

  .skills-table { gap: 3pt 12pt; }
  .edu-row { margin-bottom: 6pt; }
  .edu-row h3 { font-size: 9.6pt; }
  .edu-row .coursework { font-size: 8.4pt; }
  .proj { margin-bottom: 4pt; }

  .role, .edu-row { break-inside: avoid; }
  .block > h2 { break-after: avoid; }
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  body { font-size: 14px; }
  .sheet { padding: 28px 22px; }
  .role-when { white-space: normal; }
  .skills-table { grid-template-columns: 1fr; gap: 2px; }
  .skills-table dd { margin-bottom: 8px; }
}
