:root {
  --bg: #E8EDF2;
  --ink: #1A2330;
  --muted: #5A6573;
  --line: #C5CED6;
  --accent: #2F5D7C;
  --accent-soft: #4A7FA3;
  --sans: "Helvetica Neue", Helvetica, "Nimbus Sans", Arial, sans-serif;
  --heavy: "Helvetica Neue", Helvetica, "Arial Black", "Nimbus Sans", Arial, sans-serif;
  --header-h: 3.4rem;
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

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

::selection { background: var(--accent); color: #fff; }

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 30;
  padding: 0.4rem 0.7rem;
  background: var(--ink);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.8rem;
  text-decoration: none;
}

.skip:focus { top: 0.75rem; }

.progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

@supports (animation-timeline: scroll()) {
  .progress {
    animation: progress linear;
    animation-timeline: scroll();
  }
  @keyframes progress { to { transform: scaleX(1); } }
}

/* ── Sticky nav ────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
  padding: 0.7rem 1.5rem;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-family: var(--heavy);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem 1.35rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.1rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav a:hover,
.nav a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav a.is-hover {
  color: var(--accent);
  border-bottom-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

/* ── Page ──────────────────────────────────────────────────────── */

.cv {
  max-width: 54rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

.masthead { margin-bottom: 3.2rem; }

.credentials {
  margin: 0 0 0.85rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.name {
  margin: 0;
  font-family: var(--heavy);
  font-size: clamp(3.2rem, 9vw, 5.2rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.035em;
}

.headline {
  margin: 1rem 0 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ink);
}

.contact {
  margin: 1rem 0 0;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.86rem;
  color: var(--muted);
}

.contact .dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 0.65em;
  border-radius: 50%;
  background: var(--accent-soft);
  vertical-align: middle;
}

.contact a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

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

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

.section {
  margin: 0 0 3rem;
  scroll-margin-top: calc(var(--header-h) + 0.8rem);
}

.section-title {
  margin: 0 0 1.2rem;
  font-family: var(--heavy);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede {
  margin: 0;
  max-width: 40rem;
  font-size: 1.12rem;
  line-height: 1.65;
}

.expertise {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.35rem 2.5rem;
}

.expertise > div {
  padding: 0.6rem 0.85rem 0.7rem;
  margin: -0.6rem -0.85rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.expertise h3 {
  margin: 0 0 0.25rem;
  font-family: var(--heavy);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  transition: color 0.25s ease;
}

.expertise > div:hover h3 { color: var(--accent); }

.expertise p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ── Timeline ──────────────────────────────────────────────────── */

.role {
  display: grid;
  grid-template-columns: 9.2rem minmax(0, 1fr);
  column-gap: 0.4rem;
  margin: -0.8rem -1.1rem 1.55rem;
  padding: 0.8rem 1.1rem 0.95rem;
  align-items: start;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.role:hover,
.expertise > div:hover {
  border-color: var(--line);
  background: color-mix(in srgb, #fff 55%, var(--bg));
}

.dates {
  margin: 0.45rem 1rem 0 0;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--accent);
  transition: color 0.25s ease;
}

.role-body {
  position: relative;
  padding-left: 1.7rem;
  border-left: 1px solid var(--line);
}

.role-body::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0.55rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.role:hover > .dates { color: var(--ink); }

.role:hover .role-body::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.employer {
  margin: 0;
  font-family: var(--heavy);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.division {
  margin: 0.2rem 0 0;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
}

.role-title {
  margin: 0.4rem 0 0.6rem;
  font-size: 0.98rem;
  font-weight: 600;
}

.progression {
  margin: 0.4rem 0 0.75rem;
  padding: 0;
  list-style: none;
}

.progression li { font-size: 0.92rem; padding: 0.08rem 0; }

.progression span {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
}

.progression span::before { content: "  –  "; color: var(--line); }

.subheading {
  margin: 1.05rem 0 0.35rem;
  font-family: var(--heavy);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.secondment {
  margin-top: 1.15rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--line);
}

.secondment-intro {
  margin: 0 0 0.5rem;
  font-style: italic;
  font-size: 0.95rem;
}

.bullets {
  margin: 0.15rem 0 0;
  padding: 0;
  list-style: none;
}

.bullets li {
  position: relative;
  margin: 0 0 0.45rem;
  padding-left: 1.05rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.bullets li:last-child { margin-bottom: 0; }

.bullets li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--accent-soft);
}

.edu-line { margin: 0.2rem 0 0; font-size: 0.95rem; }
.edu-line strong { font-weight: 600; }

.close {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.25rem;
}

.body-text { margin: 0; font-size: 0.92rem; }

.cv-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 44rem) {
  .site-header { padding: 0.65rem 1rem; }
  .cv { padding: 2rem 1.15rem 3.5rem; }
  .name { font-size: 2.7rem; }
  .expertise, .close { grid-template-columns: 1fr; }
  .role { grid-template-columns: 1fr; row-gap: 0.2rem; }
  .dates { text-align: left; margin: 0; }
  .role-body { padding-left: 0; border-left: none; }
  .role-body::before { display: none; }
  .nav { gap: 0.15rem 0.9rem; font-size: 0.64rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .progress { animation: none; }
  .nav a, .expertise h3, .role-body::before, .role > .dates,
  .role, .expertise > div { transition: none; }
}

@media print {
  @page { size: A4; margin: 14mm 16mm; }
  .skip, .progress, .site-header { display: none; }
  html { scroll-behavior: auto; }
  body { background: #fff; }
  .cv { max-width: none; padding: 0; }

  /* Flow long roles across pages; keep small units intact */
  .role {
    break-inside: auto;
    margin: 0 0 0.4rem;
    padding: 0 0 1.6rem;
    border: none;
    border-radius: 0;
  }
  .expertise > div { margin: 0; padding: 0; border: none; }
  .bullets li, .progression li, .edu-line, .expertise > div { break-inside: avoid; }
  .secondment { break-inside: avoid; }
  p { orphans: 2; widows: 2; }

  /* Never strand a heading at the bottom of a page */
  .section-title, .subheading, .employer, .role-title, .secondment-intro {
    break-after: avoid;
  }
  .section { margin-bottom: 2.4rem; }
  .masthead { margin-bottom: 2.4rem; }

  .contact a { border-bottom: none; color: var(--ink); }
  .role-body { border-left-color: #D8DEE5; }
}
