/* ─── CV Page ─── */
/* Loaded after style.css on cv.html only; reuses its tokens */

.cv-page .container {
  max-width: 640px;
}

/* ─── CV Header ─── */

.cv-page .cv-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
}

.cv-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 36px;
  padding: 4px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.cv-back:hover {
  color: var(--text);
}

.cv-back-arrow {
  display: inline-block;
  transition: transform 0.25s ease;
}

.cv-back:hover .cv-back-arrow {
  transform: translateX(-3px);
}

.cv-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 18px;
}

.cv-header h1 {
  font-size: 42px;
  line-height: 1.1;
  margin-bottom: 4px;
}

.cv-header .cv-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: 22px;
  line-height: 1.3;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.cv-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  white-space: nowrap;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.cv-download svg {
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.cv-download:hover {
  color: var(--text);
  border-color: var(--accent);
}

.cv-download:hover svg {
  transform: translateY(1px);
}

.cv-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 4px;
  list-style: none;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.cv-contact li + li::before {
  content: '·';
  content: '·' / '';
  margin: 0 10px;
  color: var(--text-muted);
}

.cv-contact a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.25s ease;
}

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

/* ─── CV Sections ─── */

.cv-page .cv-section {
  margin-bottom: 48px;
}

.cv-section h2 {
  margin-bottom: 22px;
}

.cv-profile {
  font-size: 15px;
}

.cv-profile,
.cv-bullets li,
.cv-grid dd {
  text-wrap: pretty;
}

/* ─── Entries (Roles & Education) ─── */

.cv-entry + .cv-entry {
  margin-top: 32px;
}

.cv-entry h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--text);
}

.cv-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  margin-top: 2px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.cv-meta > span {
  white-space: nowrap;
}

.cv-meta .cv-org {
  font-weight: 600;
}

.cv-meta .cv-sep {
  margin: 0 8px;
  color: var(--text-muted);
}

.cv-bullets {
  list-style: none;
  margin-top: 12px;
}

.cv-bullets li {
  position: relative;
  padding-left: 20px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.cv-bullets li + li {
  margin-top: 6px;
}

.cv-bullets li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: calc(0.8em - 2.5px);
  width: 5px;
  height: 5px;
  border: 2.5px solid var(--accent);
  border-radius: 50%;
}

/* ─── Term / Description Grid ─── */

.cv-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  font-size: 14px;
  line-height: 1.6;
}

.cv-grid dt,
.cv-grid dd {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.cv-grid dt:first-of-type,
.cv-grid dt:first-of-type + dd {
  padding-top: 0;
  border-top: 0;
}

.cv-grid dt {
  padding-right: 20px;
  font-weight: 600;
  color: var(--text);
}

.cv-grid dd {
  color: var(--text-secondary);
}

/* ─── CV Entrance Stagger ─── */

header.fade-in.visible .cv-back { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both; opacity: 0; }
header.fade-in.visible .cv-download { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.28s both; opacity: 0; }
header.fade-in.visible .cv-contact { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.36s both; opacity: 0; }

/* style.css resets its own stagger targets under reduced motion; these are the CV ones */
@media (prefers-reduced-motion: reduce) {
  header.fade-in .cv-back,
  header.fade-in .cv-download,
  header.fade-in .cv-contact {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ─── CV Responsive ─── */

@media (max-width: 480px) {
  .cv-back {
    margin-bottom: 28px;
  }

  .cv-header h1 {
    font-size: 36px;
  }

  .cv-header .cv-title {
    font-size: 20px;
  }

  .cv-contact {
    flex-direction: column;
    align-items: flex-start;
    row-gap: 2px;
  }

  .cv-contact li + li::before {
    content: none;
  }

  /* Organisation on its own line so no separator is left dangling */
  .cv-meta .cv-org {
    flex-basis: 100%;
  }

  .cv-meta .cv-org + .cv-sep {
    display: none;
  }

  .cv-page .cv-section {
    margin-bottom: 40px;
  }

  .cv-bullets li {
    font-size: 14px;
  }

  .cv-grid {
    grid-template-columns: 1fr;
  }

  .cv-grid dt {
    padding-right: 0;
    padding-bottom: 2px;
  }

  .cv-grid dd {
    padding-top: 0;
    border-top: 0;
  }
}

/* ─── Print (A4) ─── */

@media print {
  @page {
    size: A4;
    margin: 14mm 15mm;
  }

  :root,
  :root.light,
  :root.dark,
  :root:not(.light) {
    --bg: #FFFFFF;
    --text: #141414;
    --text-secondary: #3D3935;
    --text-muted: #8A847D;
    --accent: #2A8C87;
    --accent-text: #2A8C87;
    --accent-text-hover: #2A8C87;
    --border: #D9D4CC;
    --surface: transparent;
    --noise-opacity: 0;
    color-scheme: light;
  }

  body {
    display: block;
    min-height: 0;
    padding: 0;
    background: #FFFFFF;
    color: var(--text);
    transition: none;
  }

  body::before,
  .site-controls,
  .cv-back,
  .cv-download,
  .footer {
    display: none !important;
  }

  /* Neutralise the fade-in system (incl. header stagger rules) */
  .fade-in,
  .fade-in *,
  .fade-in.visible,
  .fade-in.visible * {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  .cv-page .container {
    max-width: none;
  }

  /* Header: name left, contact stacked right */
  .cv-page .cv-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12pt;
    margin-bottom: 11pt;
    padding-bottom: 9pt;
    border-bottom: 0.75pt solid var(--border);
  }

  .cv-heading {
    display: block;
    margin-bottom: 0;
  }

  .cv-header h1 {
    font-size: 27pt;
    line-height: 1;
    margin-bottom: 3pt;
  }

  .cv-header .cv-title {
    font-size: 13.5pt;
    line-height: 1.2;
  }

  .cv-contact {
    flex-direction: column;
    align-items: flex-end;
    row-gap: 0;
    font-size: 9pt;
    line-height: 1.5;
  }

  .cv-contact li + li::before {
    content: none;
  }

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

  /* Sections: serif heading with a hairline rule */
  .cv-page .cv-section {
    margin-bottom: 11pt;
  }

  .cv-page .cv-section:last-child {
    margin-bottom: 0;
  }

  .cv-section h2 {
    display: flex;
    align-items: center;
    gap: 8pt;
    font-size: 13.5pt;
    line-height: 1.15;
    margin-bottom: 5pt;
    break-after: avoid;
    page-break-after: avoid;
  }

  .cv-section h2::after {
    position: static;
    flex: 1;
    width: auto;
    height: 0;
    background: none;
    border-top: 0.75pt solid var(--border);
    opacity: 1;
  }

  .cv-profile {
    font-size: 9.5pt;
    line-height: 1.42;
  }

  /* Entries: title left, org · dates · location right */
  .cv-entry {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    column-gap: 12pt;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .cv-entry + .cv-entry {
    margin-top: 8pt;
  }

  .cv-entry h3 {
    font-size: 10.25pt;
    line-height: 1.35;
    break-after: avoid;
    page-break-after: avoid;
  }

  .cv-meta {
    justify-content: flex-end;
    margin-top: 0;
    font-size: 8.75pt;
    line-height: 1.35;
    text-align: right;
  }

  .cv-entry .cv-bullets {
    grid-column: 1 / -1;
  }

  .cv-meta .cv-sep {
    margin: 0 5pt;
  }

  .cv-bullets {
    margin-top: 3pt;
  }

  .cv-bullets li {
    padding-left: 12pt;
    font-size: 9.5pt;
    line-height: 1.4;
    orphans: 2;
    widows: 2;
  }

  .cv-bullets li + li {
    margin-top: 0.5pt;
  }

  .cv-bullets li::before {
    left: 2.5pt;
    top: calc(0.71em - 1.5pt);
    width: 3pt;
    height: 3pt;
    border-width: 1.5pt;
  }

  .cv-grid {
    grid-template-columns: 35mm 1fr;
    font-size: 9.5pt;
    line-height: 1.4;
  }

  .cv-grid dt,
  .cv-grid dd,
  .cv-grid dt:first-of-type,
  .cv-grid dt:first-of-type + dd {
    padding: 1pt 0;
    border-top: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .cv-grid dt {
    padding-right: 10pt;
  }
}
