/* ==========================================================================
   CV — print-ready single-page resume
   ========================================================================== */

:root {
  --cv-bg: #f7f1e3;
  --cv-card: #ffffff;
  --cv-ink: #1a1a1a;
  --cv-muted: #555a5e;
  --cv-faint: #828a90;
  --cv-line: #e1d8c5;
  --cv-accent: #8b0000;
  --cv-accent-soft: #d96354;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.cv-body {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 10.5pt;
  line-height: 1.5;
  color: var(--cv-ink);
  background: var(--cv-bg);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* --------------------------------------------------------------------------
   Toolbar (screen only)
   -------------------------------------------------------------------------- */

.cv-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(247, 241, 227, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--cv-line);
}

.cv-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #fff;
  background: var(--cv-accent);
  border: 1px solid var(--cv-accent);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.cv-toolbar-btn:hover {
  filter: brightness(1.08);
}

.cv-toolbar-btn--ghost {
  color: var(--cv-ink);
  background: transparent;
  border-color: var(--cv-line);
}

.cv-toolbar-btn--ghost:hover {
  background: var(--cv-card);
  border-color: var(--cv-ink);
}

.cv-toolbar-hint {
  flex: 1 1 100%;
  margin: 0;
  padding: 10px 14px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--cv-muted);
  background: var(--cv-card);
  border: 1px solid var(--cv-line);
  border-radius: 6px;
}

.cv-toolbar-hint code {
  font-family: "Space Grotesk", ui-monospace, monospace;
  font-size: 10px;
}

/* --------------------------------------------------------------------------
   Page (A4)
   -------------------------------------------------------------------------- */

.cv-page {
  width: 210mm;
  min-height: 297mm;
  margin: 24px auto;
  padding: 16mm 14mm;
  background: var(--cv-card);
  box-shadow: 0 18px 60px -20px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 10mm;
}

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

.cv-header {
  padding-bottom: 6mm;
  border-bottom: 2px solid var(--cv-ink);
}

.cv-name {
  font-family: "Newsreader", "Times New Roman", serif;
  font-size: 32pt;
  line-height: 1;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--cv-ink);
  letter-spacing: -0.01em;
}

.cv-role {
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 11pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--cv-accent);
  margin: 0;
}

.cv-location {
  font-size: 10pt;
  color: var(--cv-muted);
  margin: 4px 0 0;
}

/* --------------------------------------------------------------------------
   Intro paragraph
   -------------------------------------------------------------------------- */

.cv-intro {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cv-intro p {
  margin: 0;
  font-size: 10.5pt;
  line-height: 1.55;
  color: var(--cv-muted);
}

/* --------------------------------------------------------------------------
   Body grid
   -------------------------------------------------------------------------- */

.cv-body-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8mm;
  align-items: stretch;
  flex: 1 1 auto;
}

.cv-col {
  display: flex;
  flex-direction: column;
  gap: 7mm;
}

.cv-col--side {
  position: relative;
  background: #fbf7ec;
  border-left: 3px solid var(--cv-accent);
  padding: 6mm 6mm 6mm 7mm;
  margin: 0;
  gap: 6mm;
}

.cv-col--side > #cv-side {
  display: flex;
  flex-direction: column;
  gap: 6mm;
}

/* --------------------------------------------------------------------------
   Section heading
   -------------------------------------------------------------------------- */

.cv-section-heading {
  font-family: "Newsreader", "Times New Roman", serif;
  font-size: 14pt;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--cv-ink);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--cv-line);
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Experience block
   -------------------------------------------------------------------------- */

.cv-experience-list {
  display: flex;
  flex-direction: column;
  gap: 5mm;
}

.cv-experience {
  page-break-inside: avoid;
  break-inside: avoid;
}

.cv-experience-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 2px;
}

.cv-experience-role {
  font-family: "Newsreader", "Times New Roman", serif;
  font-size: 12.5pt;
  font-weight: 700;
  margin: 0;
  color: var(--cv-ink);
}

.cv-experience-period {
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 9pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--cv-muted);
  white-space: nowrap;
}

.cv-experience-meta {
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 9pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--cv-accent-soft);
  margin: 0 0 6px;
}

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

.cv-project-list {
  display: flex;
  flex-direction: column;
  gap: 5mm;
}

.cv-project {
  page-break-inside: avoid;
  break-inside: avoid;
}

.cv-project-title {
  font-family: "Newsreader", "Times New Roman", serif;
  font-size: 12.5pt;
  font-weight: 700;
  margin: 0 0 2px;
  color: var(--cv-ink);
}

.cv-project-meta {
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 9pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--cv-accent-soft);
  margin: 0 0 6px;
}

.cv-project-bullets {
  margin: 0;
  padding-left: 16px;
  font-size: 10pt;
  color: var(--cv-muted);
}

.cv-project-bullets li {
  margin: 0 0 3px;
  line-height: 1.45;
}

.cv-project-bullets li::marker {
  color: var(--cv-accent);
}

/* --------------------------------------------------------------------------
   Side column — contact
   -------------------------------------------------------------------------- */

.cv-contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cv-contact-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 9.5pt;
  line-height: 1.3;
  color: var(--cv-ink);
  min-width: 0;
}

.cv-contact-item > .cv-contact-link {
  min-width: 0;
  flex: 1 1 auto;
}

.cv-contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--cv-accent);
}

.cv-contact-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.cv-contact-link {
  color: var(--cv-ink);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.cv-contact-link:hover {
  color: var(--cv-accent);
  border-bottom-color: var(--cv-accent);
}

/* --------------------------------------------------------------------------
   Side column — skills, tools, education
   -------------------------------------------------------------------------- */

.cv-side-section {
  page-break-inside: avoid;
  break-inside: avoid;
}

.cv-skill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  font-size: 10pt;
}

.cv-skill-list li {
  position: relative;
  padding-left: 14px;
  color: var(--cv-ink);
}

.cv-skill-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: var(--cv-accent);
  transform: translateY(-50%);
}

.cv-tool-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cv-tool {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10pt;
  color: var(--cv-ink);
  white-space: nowrap;
}

.cv-tool-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(0) saturate(100%);
}

.cv-edu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cv-edu-list li {
  border-left: 2px solid var(--cv-accent);
  padding-left: 10px;
}

.cv-edu-title {
  margin: 0;
  font-weight: 700;
  font-size: 10pt;
  color: var(--cv-ink);
  line-height: 1.3;
}

.cv-edu-meta {
  margin: 2px 0 0;
  font-size: 9pt;
  color: var(--cv-muted);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.cv-footer {
  margin-top: auto;
  padding-top: 6mm;
  border-top: 1px solid var(--cv-line);
  text-align: center;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 8.5pt;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--cv-faint);
}

.cv-footer p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Responsive (small screens — preview only, doesn't affect print)
   -------------------------------------------------------------------------- */

@media screen and (max-width: 820px) {
  .cv-page {
    width: 100%;
    margin: 0;
    padding: 24px 18px;
    box-shadow: none;
  }
  .cv-body-grid {
    grid-template-columns: 1fr;
  }
  .cv-col--side {
    border-left: none;
    border-top: 3px solid var(--cv-accent);
    padding: 6mm 0 0;
  }
  .cv-name {
    font-size: 28pt;
  }
}

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

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

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

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

@media print {
  .cv-toolbar {
    display: none !important;
  }
  .cv-toolbar-hint {
    display: none !important;
  }
  body.cv-body {
    background: #fff;
  }
  .cv-page {
    width: 210mm;
    min-height: auto;
    max-height: none;
    margin: 0;
    padding: 12mm 11mm;
    box-shadow: none;
    gap: 5mm;
  }
  .cv-body-grid {
    display: grid !important;
    grid-template-columns: 1.4fr 1fr !important;
    gap: 6mm !important;
    align-items: start !important;
  }
  .cv-col--side {
    border-left: 3px solid var(--cv-accent) !important;
    border-top: none !important;
    background: #fbf7ec !important;
    padding: 5mm 5mm 5mm 6mm !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .cv-intro p {
    font-size: 9.5pt;
    line-height: 1.45;
  }
  .cv-contact-link {
    border-bottom-color: transparent;
  }
}
