/* ============================================================
   Presentation layer — layout & styling only.
   All CV content lives in cv-data.js.
   ============================================================ */

:root {
  --ink: #1f2430;
  --ink-soft: #4a5160;
  --ink-muted: #8a91a0;
  --accent: #ea580c; /* bright orange: company names, links, button */
  --plum: #6d28d9; /* purple for the name & job titles */
  --rule: #d9dde3;
  --paper: #ffffff;
  --backdrop: #eceef1;

  --font-title: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body: "IBM Plex Serif", "Iowan Old Style", Palatino, Georgia, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--backdrop);
}

body {
  font-family: var(--font-body);
  font-size: 10.5pt;
  line-height: 1.55;
  color: var(--ink);
}

/* ---------- Page sheet ---------- */

.page {
  background: var(--paper);
  max-width: 210mm; /* A4 width */
  margin: 2rem auto;
  padding: 18mm 16mm;
  box-shadow: 0 2px 24px rgba(31, 36, 48, 0.14);
}

/* ---------- Header ---------- */

.cv-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0 1.4rem;
  align-items: center;
  margin-bottom: 1.6rem;
}

.cv-photo img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.cv-name {
  font-family: var(--font-body);
  font-size: 26pt;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--plum);
  line-height: 1.15;
}

.cv-pronouns {
  font-family: var(--font-title);
  font-size: 10pt;
  font-weight: 400;
  color: var(--ink-muted);
}

.cv-title {
  font-family: var(--font-title);
  font-size: 13pt;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

.cv-contact {
  list-style: none;
  font-size: 9.5pt;
  color: var(--ink-soft);
  border-left: 1px solid var(--rule);
  padding-left: 1.1rem;
  align-self: center;
}

.cv-contact li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.25rem 0;
  white-space: nowrap;
}

.cv-contact svg {
  width: 11px;
  height: 11px;
  fill: var(--ink-muted);
  flex-shrink: 0;
}

.cv-contact a {
  color: var(--accent);
  text-decoration: none;
}

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

.cv-section {
  margin-bottom: 1.4rem;
}

.cv-section-title {
  font-family: var(--font-body);
  font-size: 15pt;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
  break-after: avoid-page;
}

.cv-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.cv-section-body {
  padding-left: 1.4rem;
}

/* ---------- Text blocks ---------- */

.cv-paragraph {
  margin-bottom: 0.55rem;
  color: var(--ink-soft);
}

.cv-paragraph strong,
.cv-bullets strong {
  color: var(--ink);
}

.cv-paragraph a {
  color: var(--accent);
}

.cv-bullets {
  list-style: disc;
  padding-left: 1.2rem;
  color: var(--ink-soft);
}

.cv-bullets li {
  margin-bottom: 0.55rem;
}

/* ---------- Entries (experience / education) ---------- */

.cv-entry {
  margin-bottom: 2.5rem;
  /* Prefer page breaks between entries, never inside one — this also
     keeps the absolutely-positioned logo from being sliced in half. */
  break-inside: avoid-page;
}

/* The logo is absolutely positioned (not flex) so long entries can
   still break across pages when printing. It is pulled left by the
   section-body indent so it aligns with the section title's gutter. */
.cv-entry--with-logo {
  position: relative;
  padding-left: calc(58px - 1.4rem);
}

.cv-entry-logo {
  position: absolute;
  left: -1.4rem;
  top: 2px;
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: contain;
  border: 1px solid var(--rule);
  background: #fff;
}

.cv-entry-head {
  margin-bottom: 0.4rem;
  break-inside: avoid-page;
  break-after: avoid-page;
}

.cv-entry-title {
  font-family: var(--font-title);
  font-size: 11.5pt;
  font-weight: 700;
  color: var(--plum);
}

.cv-entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 1rem;
}

.cv-entry-org {
  font-family: var(--font-title);
  font-size: 10.5pt;
  color: var(--ink-muted);
}

.cv-entry-org-name {
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

a.cv-entry-org-name:hover {
  text-decoration: underline;
}

.cv-entry-period {
  font-family: var(--font-title);
  font-size: 10pt;
  color: var(--ink-muted);
  white-space: nowrap;
  margin-left: auto;
}

.cv-entry-duration {
  font-size: 9pt;
}

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

#print-button {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  padding: 0.55rem 1rem;
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(31, 36, 48, 0.25);
}

#print-button:hover {
  filter: brightness(1.1);
}

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

@media (max-width: 640px) {
  .page {
    margin: 0;
    padding: 1.4rem 1.2rem;
    box-shadow: none;
  }

  .cv-header {
    grid-template-columns: auto 1fr;
    gap: 0.4rem 1rem;
  }

  .cv-contact {
    grid-column: 1 / -1;
    border-left: none;
    padding-left: 0;
    margin-top: 0.6rem;
  }
}

/* ---------- Print / PDF export ---------- */

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

@media print {
  html {
    background: none;
  }

  body {
    font-size: 10pt;
  }

  .page {
    max-width: none;
    margin: 0;
    padding: 0 16mm;
    box-shadow: none;
  }

  #print-button {
    display: none;
  }

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

  .cv-paragraph,
  .cv-bullets li {
    break-inside: avoid-page;
  }
}
