/* === CV DESIGN TOKENS === */
:root {
  --cv-bg: #edf0f5;
  --cv-paper: #ffffff;
  --cv-ink: #15171b;
  --cv-muted: #626873;
  --cv-faint: #68707d;
  --cv-line: #dfe3ea;
  --cv-line-strong: #cdd3dd;
  --cv-accent: #006de5;
  --cv-accent-soft: #e8f2ff;
  --cv-deep: #11233c;
  --cv-shadow: 0 24px 70px rgba(22, 33, 50, 0.13);
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 109, 229, 0.11), transparent 27rem),
    linear-gradient(180deg, #f6f8fb 0, var(--cv-bg) 32rem);
  color: var(--cv-ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

a:focus-visible {
  outline: 2px solid var(--cv-accent);
  outline-offset: 4px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  inset: 10px auto auto 10px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--cv-deep);
  color: #fff;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

/* === TOOLBAR === */
.cv-toolbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(205, 211, 221, 0.8);
  background: rgba(246, 248, 251, 0.82);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.toolbar-inner {
  width: min(1180px, calc(100% - 40px));
  height: 68px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.back-link,
.download-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  text-decoration: none;
}

.back-link {
  color: var(--cv-muted);
  font-size: 14px;
  transition: color 180ms ease, transform 180ms ease;
}

.back-link:hover {
  color: var(--cv-ink);
  transform: translateX(-2px);
}

.toolbar-actions {
  display: flex;
  align-items: center;
}

.download-button {
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--cv-accent);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 7px 20px rgba(0, 109, 229, 0.2);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.download-button:hover {
  background: #005fc9;
  box-shadow: 0 9px 24px rgba(0, 109, 229, 0.28);
  transform: translateY(-1px);
}

/* === PAPER === */
.cv-main {
  width: min(1180px, calc(100% - 40px));
  margin: 54px auto 80px;
}

.cv-document {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(205, 211, 221, 0.88);
  border-radius: 24px;
  background: var(--cv-paper);
  box-shadow: var(--cv-shadow);
}

.cv-document::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--cv-accent), #63aaff 58%, #bfddff);
}

.cv-hero {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 230px;
  gap: 30px;
  align-items: start;
  padding: 64px 68px 48px;
}

.cv-monogram {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--cv-deep);
  color: #fff;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.04em;
  box-shadow: 0 10px 25px rgba(17, 35, 60, 0.2);
}

.cv-kicker,
.snapshot-label,
.section-index,
.work-meta,
.feature-link-label {
  color: var(--cv-accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cv-kicker { margin-bottom: 8px; }

.cv-heading h1 {
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 750;
  letter-spacing: -0.052em;
  line-height: 0.98;
}

.cv-title {
  margin-top: 13px;
  color: var(--cv-deep);
  font-size: clamp(19px, 2vw, 25px);
  font-weight: 650;
  letter-spacing: -0.025em;
}

.cv-intro {
  max-width: 690px;
  margin-top: 22px;
  color: var(--cv-muted);
  font-size: 16px;
  line-height: 1.72;
}

.contact-list {
  padding-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  color: var(--cv-muted);
  font-size: 12.5px;
  font-style: normal;
  line-height: 1.4;
  text-align: right;
}

.contact-list > * {
  padding-block: 4px;
}

.contact-list a {
  text-decoration-color: var(--cv-line-strong);
  text-underline-offset: 3px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

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

.cv-snapshot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
  margin-inline: 68px;
  border-block: 1px solid var(--cv-line);
}

.snapshot-item {
  padding: 22px 28px 23px 0;
}

.snapshot-item + .snapshot-item {
  padding-left: 28px;
  border-left: 1px solid var(--cv-line);
}

.snapshot-item span,
.snapshot-item strong { display: block; }

.snapshot-item strong {
  margin-top: 4px;
  color: var(--cv-deep);
  font-size: 14px;
  font-weight: 680;
}

.cv-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 64px;
  padding: 54px 68px 68px;
}

.cv-primary,
.cv-aside { min-width: 0; }

.cv-section + .cv-section { margin-top: 58px; }

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 29px;
}

.section-heading h2,
.aside-section > h2 {
  color: var(--cv-deep);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.section-index { color: var(--cv-faint); }

/* === EXPERIENCE === */
.role {
  position: relative;
  padding: 0 0 29px 27px;
  border-left: 1px solid var(--cv-line-strong);
}

.role:last-child { padding-bottom: 0; }

.role::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  inset: 7px auto auto -5px;
  border: 2px solid var(--cv-paper);
  border-radius: 50%;
  background: var(--cv-line-strong);
  box-shadow: 0 0 0 1px var(--cv-line-strong);
}

.role-featured::before {
  background: var(--cv-accent);
  box-shadow: 0 0 0 1px var(--cv-accent);
}

.role-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.role-header h3 {
  color: var(--cv-ink);
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.role-header time {
  flex: 0 0 auto;
  color: var(--cv-faint);
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}

.role-company {
  margin-top: 2px;
  color: var(--cv-accent);
  font-size: 12.5px;
  font-weight: 650;
}

.role-company a {
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 109, 229, 0.25);
}

.role-summary {
  margin-top: 11px;
  color: var(--cv-muted);
  font-size: 13px;
  line-height: 1.6;
}

.role-points {
  margin: 13px 0 0 17px;
  color: var(--cv-muted);
  font-size: 12.8px;
  line-height: 1.58;
}

.role-points li { padding-left: 4px; }
.role-points li + li { margin-top: 5px; }
.role-points li::marker { color: var(--cv-accent); }

.role-note {
  margin-top: 12px;
  color: var(--cv-faint);
  font-size: 11.5px;
  font-weight: 600;
}

.progression {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
  list-style: none;
}

.progression li {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--cv-line);
  border-radius: 8px;
  background: #fafbfc;
}

.progression strong,
.progression span { display: block; }

.progression strong {
  font-size: 10.5px;
  line-height: 1.35;
}

.progression span {
  margin-top: 3px;
  color: var(--cv-faint);
  font-size: 9.5px;
  font-weight: 650;
}

/* === SELECTED WORK === */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.work-card {
  position: relative;
  min-height: 192px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--cv-line);
  border-radius: 13px;
  background: linear-gradient(145deg, #fff 35%, #f6f9fd);
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.work-card:hover {
  border-color: #a8caf2;
  box-shadow: 0 12px 30px rgba(17, 35, 60, 0.09);
  transform: translateY(-2px);
}

.work-number {
  position: absolute;
  inset: 7px 12px auto auto;
  color: #edf1f6;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 1;
}

.work-meta {
  position: relative;
  display: block;
  padding-right: 28px;
  font-size: 8.5px;
  letter-spacing: 0.08em;
}

.work-card strong {
  position: relative;
  display: block;
  margin-top: 10px;
  color: var(--cv-deep);
  font-size: 17px;
  letter-spacing: -0.025em;
}

.work-card p {
  position: relative;
  margin-top: 8px;
  color: var(--cv-muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.work-link {
  position: absolute;
  inset: auto 20px 17px;
  color: var(--cv-accent);
  font-size: 10.5px;
  font-weight: 700;
}

/* === ASIDE === */
.cv-aside {
  padding-left: 30px;
  border-left: 1px solid var(--cv-line);
}

.aside-section {
  padding-bottom: 31px;
  break-inside: avoid;
}

.aside-section + .aside-section {
  padding-top: 31px;
  border-top: 1px solid var(--cv-line);
}

.aside-section > h2 { margin-bottom: 18px; }

.capability-group + .capability-group { margin-top: 22px; }

.capability-group h3 {
  margin-bottom: 7px;
  color: var(--cv-faint);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.capability-group p,
.aside-copy,
.feature-link span {
  color: var(--cv-muted);
  font-size: 11.5px;
  line-height: 1.58;
}

.aside-copy { color: var(--cv-deep); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}

.tag-list li {
  padding: 5px 8px;
  border: 1px solid #d8e7fa;
  border-radius: 6px;
  background: var(--cv-accent-soft);
  color: #20517f;
  font-size: 10px;
  font-weight: 650;
}

.feature-link {
  display: block;
  text-decoration: none;
}

.feature-link + .feature-link { margin-top: 16px; }

.feature-link-label {
  display: block;
  margin-bottom: 7px;
  font-size: 8.5px !important;
}

.feature-link strong {
  display: block;
  margin-bottom: 7px;
  color: var(--cv-deep);
  font-size: 13px;
  line-height: 1.4;
}

.feature-link:hover strong { color: var(--cv-accent); }

.cv-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 68px;
  border-top: 1px solid var(--cv-line);
  background: #fafbfc;
  color: var(--cv-faint);
  font-size: 9.5px;
  font-weight: 620;
  letter-spacing: 0.025em;
}

/* === RESPONSIVE === */
@media (max-width: 940px) {
  .cv-hero {
    grid-template-columns: 64px minmax(0, 1fr);
    padding: 52px 48px 42px;
  }

  .contact-list {
    grid-column: 2;
    padding-top: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 7px;
    align-items: start;
    text-align: left;
  }

  .cv-snapshot { margin-inline: 48px; }

  .cv-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 42px;
    padding: 48px;
  }

  .cv-footer { padding-inline: 48px; }
}

@media (max-width: 740px) {
  .cv-main {
    width: min(100% - 24px, 620px);
    margin-block: 24px 48px;
  }

  .cv-document { border-radius: 18px; }

  .cv-hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 40px 28px 34px;
  }

  .cv-monogram { width: 54px; height: 54px; border-radius: 15px; }

  .contact-list {
    grid-column: auto;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .cv-snapshot {
    grid-template-columns: 1fr;
    margin-inline: 28px;
  }

  .snapshot-item { padding: 16px 0; }

  .snapshot-item + .snapshot-item {
    padding-left: 0;
    border-top: 1px solid var(--cv-line);
    border-left: 0;
  }

  .cv-layout {
    grid-template-columns: 1fr;
    gap: 52px;
    padding: 40px 28px;
  }

  .cv-aside {
    padding: 0;
    border: 0;
  }

  .aside-section + .aside-section { padding-top: 26px; }

  .cv-footer {
    flex-direction: column;
    gap: 3px;
    padding: 16px 28px;
  }
}

@media (max-width: 520px) {
  .toolbar-inner { width: calc(100% - 28px); height: 62px; }

  /* Only the arrow is left here, which on its own is a 13x22px target. Give it a
     44x44 box and grow it rightward, so the arrow keeps its optical position at
     the gutter without the box - or its focus ring - crossing the viewport edge. */
  .back-link {
    min-width: 44px;
    min-height: 44px;
    justify-content: flex-start;
  }

  .back-link span:last-child { display: none; }
  .download-button { padding: 9px 13px; }
  .cv-heading h1 { font-size: 39px; }
  .cv-title { font-size: 18px; }
  .cv-intro { font-size: 14px; }
  .role-header { align-items: flex-start; flex-direction: column; gap: 5px; }
  .progression { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* === PRINT / PDF === */
@page {
  size: A4;
  margin: 10mm;
}

@media print {
  :root {
    --cv-ink: #101216;
    --cv-muted: #4d535d;
    --cv-faint: #5f6671;
    --cv-line: #d8dce3;
    --cv-line-strong: #c5cad3;
    --cv-accent: #0067d8;
    --cv-accent-soft: #edf5ff;
    --cv-deep: #102039;
  }

  html, body {
    width: 210mm;
    min-width: 0;
    background: #fff;
  }

  body {
    font-size: 9pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .skip-link,
  .cv-toolbar { display: none !important; }

  .cv-main {
    width: auto;
    margin: 0;
  }

  .cv-document {
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .cv-document::before { height: 2.5mm; }

  .cv-hero {
    grid-template-columns: 15mm minmax(0, 1fr) 50mm;
    gap: 5mm;
    padding: 8mm 8mm 5mm;
  }

  .cv-monogram {
    width: 13mm;
    height: 13mm;
    border-radius: 3.5mm;
    font-size: 12pt;
    box-shadow: none;
  }

  .cv-kicker { margin-bottom: 1mm; font-size: 6.5pt; }
  .cv-heading h1 { font-size: 27pt; }
  .cv-title { margin-top: 1.5mm; font-size: 12.5pt; }

  .cv-intro {
    margin-top: 3mm;
    font-size: 8pt;
    line-height: 1.5;
  }

  .contact-list {
    padding-top: 5mm;
    gap: 1.2mm;
    font-size: 6.8pt;
  }

  .contact-list > * { padding-block: 0; }

  .cv-snapshot { margin-inline: 8mm; }
  .snapshot-item { padding: 3mm 4mm 3mm 0; }
  .snapshot-item + .snapshot-item { padding-left: 4mm; }
  .snapshot-label { font-size: 6pt; }
  .snapshot-item strong { margin-top: 0.5mm; font-size: 7.5pt; }

  .cv-layout {
    grid-template-columns: minmax(0, 1fr) 54mm;
    gap: 8mm;
    padding: 5mm 8mm;
  }

  .cv-section + .cv-section { margin-top: 5mm; }
  .section-heading { gap: 2mm; margin-bottom: 4mm; }
  .section-heading h2, .aside-section > h2 { font-size: 11pt; }
  .section-index { font-size: 6pt; }

  .role {
    padding: 0 0 3mm 4.5mm;
    break-inside: avoid;
  }

  .role::before { inset-block-start: 1.2mm; }
  .role-header { gap: 3mm; }
  .role-header h3 { font-size: 8.8pt; }
  .role-header time { font-size: 6.4pt; }
  .role-company { margin-top: 0.3mm; font-size: 6.8pt; }
  .role-summary { margin-top: 1.5mm; font-size: 7pt; line-height: 1.45; }
  .role-points { margin: 1.8mm 0 0 3.5mm; font-size: 6.8pt; line-height: 1.42; }
  .role-points li + li { margin-top: 0.7mm; }
  .role-note { margin-top: 1.5mm; font-size: 6.3pt; }

  .progression { gap: 1.2mm; margin-top: 1.7mm; }
  .progression div { padding: 1.6mm; border-radius: 1.5mm; }
  .progression strong { font-size: 5.9pt; }
  .progression span { margin-top: 0.4mm; font-size: 5.4pt; }

  .work-grid { gap: 2mm; }
  .work-card { min-height: 32mm; padding: 3mm; border-radius: 2mm; break-inside: avoid; }
  .work-number { inset: 1mm 2mm auto auto; font-size: 22pt; }
  .work-meta { font-size: 5.2pt; }
  .work-card strong { margin-top: 1.5mm; font-size: 9pt; }
  .work-card p { margin-top: 1mm; font-size: 6.3pt; line-height: 1.4; }
  .work-link { inset: auto 3mm 2.5mm; font-size: 5.8pt; }

  .cv-aside { padding-left: 5mm; }
  .aside-section { padding-bottom: 4.5mm; }
  .aside-section + .aside-section { padding-top: 4.5mm; }
  .aside-section > h2 { margin-bottom: 3mm; }
  .capability-group + .capability-group { margin-top: 3.5mm; }
  .capability-group h3 { margin-bottom: 1mm; font-size: 5.8pt; }
  .capability-group p, .aside-copy, .feature-link span { font-size: 6.5pt; line-height: 1.45; }
  .tag-list { gap: 1mm; }
  .tag-list li { padding: 0.8mm 1.2mm; border-radius: 1mm; font-size: 5.8pt; }
  .feature-link-label { margin-bottom: 1mm; font-size: 5.2pt !important; }
  .feature-link strong { margin-bottom: 1mm; font-size: 7.2pt; }
  .cv-footer {
    display: none;
  }

  a { text-decoration: none; }
}
