:root {
  --accent: #b34700;
  --accent-soft: #f3ede7;
  --ink: #1f2328;
  --muted: #5b636b;
  --line: #e4e0db;
  --bg: #faf8f6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 28px 64px;
}

/* ---- Header ---- */
header.cv-head {
  text-align: center;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
header.cv-head h1 {
  margin: 0;
  font-size: 2.2rem;
  letter-spacing: 0.5px;
}
header.cv-head .subtitle {
  margin-top: 6px;
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
}
header.cv-head .contact {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}
header.cv-head .contact span { white-space: nowrap; }

/* ---- Summary ---- */
.summary {
  margin-bottom: 36px;
  font-size: 1.02rem;
}

/* ---- Sections ---- */
section { margin-bottom: 40px; }
h2.section-title {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  border-bottom: 2px solid var(--line);
  padding-bottom: 6px;
  margin: 0 0 20px;
}

/* ---- Job entries ---- */
.entry { margin-bottom: 26px; }
.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.entry-head .org { font-weight: 700; }
.entry-head .role { color: var(--muted); }
.entry-head .dates {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.entry .lead {
  margin: 6px 0 4px;
  color: var(--muted);
}
.entry ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
.entry ul li { margin-bottom: 4px; }

/* ---- Sub-roles (multiple roles within one company) ---- */
.subrole { margin: 14px 0 0 18px; }
.subrole-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.subrole-head .role {
  font-weight: 600;
  color: var(--ink);
}
.subrole-head .role .parallel {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--muted);
}
.subrole-head .dates {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.subrole .lead { margin: 4px 0; color: var(--muted); }
.subrole ul { margin: 6px 0 0; padding-left: 20px; }
.subrole ul li { margin-bottom: 4px; }

/* ---- Education ---- */
.edu .entry-head .org { font-weight: 700; }
.edu .entry-head .role { color: var(--muted); }

/* ---- Two-column footer (languages + interests) ---- */
.two-col {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}
.two-col > section { flex: 1 1 280px; margin-bottom: 0; }
.langs ul { list-style: none; padding: 0; margin: 0; }
.langs li { margin-bottom: 6px; }
.langs .lvl { color: var(--muted); }
.interests ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.interests li {
  background: var(--accent-soft);
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 0.92rem;
}

@media (max-width: 540px) {
  .page { padding: 28px 18px 48px; }
  .entry-head .dates { margin-left: 0; width: 100%; }
}

/* ---- Print / PDF ---- */
@media print {
  :root { --bg: #fff; }
  body {
    background: #fff;
    font-size: 11pt;
    line-height: 1.4;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .page { max-width: none; margin: 0; padding: 0; }
  a { color: var(--ink); }
  /* Keep small blocks together, but NEVER a whole section (it spans pages,
     which would force the entire section onto a fresh page). */
  .subrole, .entry-head { break-inside: avoid; page-break-inside: avoid; }
  .entry-head, h2.section-title { break-after: avoid; }
  .summary { font-size: 11pt; }
  @page { margin: 1.4cm; }
}
