/* CV stylesheet: screen preview + A4 print.
   Page 1 is a fixed A4 sheet (sidebar + main column), later pages flow. */

@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: block;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: block;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: italic;
  font-display: block;
}

:root {
  --navy: #0d2b5e;        /* sidebar */
  --ink-strong: #13254b;  /* name, titles */
  --accent: #1f4f99;      /* target role, organisation */
  --ink: #2c3444;
  --ink-soft: #4b5466;
  --muted: #727b8c;
  --line: #dde3ec;
  --tile: #edf1f8;
  --lime: #9bc53d;        /* bottom accent bar */

  /* PAR markers: problem / action / result */
  --p-ink: #b3263f; --p-bg: #fbe1e5;
  --a-ink: #1f4f99; --a-bg: #dce7fb;
  --r-ink: #2b7a3b; --r-bg: #dcf1df;

  --todo-ink: #7a4b00; --todo-bg: #ffe9a8;

  --side-w: 66mm;
  --sheet-pad: 16mm;

  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

* { box-sizing: border-box; }

html { font-size: 9.2pt; }

body {
  margin: 0;
  background: #e6eaf1;
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.45;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

p, ul, dl, h1, h2, h3 { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
strong { font-weight: 650; }
.muted { color: var(--muted); font-weight: 400; }

mark.todo {
  background: var(--todo-bg);
  color: var(--todo-ink);
  outline: 0.25mm dashed #d39b00;
  border-radius: 0.6mm;
  padding: 0 0.6mm;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- screen chrome ---------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.toolbar-group { display: flex; gap: 6px; align-items: center; }
.toolbar a, .toolbar button {
  font: inherit;
  color: var(--ink-strong);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.toolbar a:hover, .toolbar button:hover { border-color: var(--accent); }
.toolbar [aria-current="page"], .toolbar [aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.overflow-warning {
  max-width: 210mm;
  margin: 8mm auto 0;
  padding: 10px 14px;
  border-radius: 6px;
  background: #fde2e1;
  color: #8f1d1d;
  font-size: 13px;
}

.sheet {
  width: 210mm;
  margin: 8mm auto;
  background: #fff;
  box-shadow: 0 2px 18px rgba(13, 43, 94, 0.14);
}

/* ---------- page 1 ---------- */

.sheet--first {
  position: relative;
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  height: 297mm;
  overflow: hidden;
}
.sheet--first::after {        /* lime bar along the bottom of the main column */
  content: "";
  position: absolute;
  left: var(--side-w);
  right: 0;
  bottom: 0;
  height: 2mm;
  background: var(--lime);
}

.sidebar {
  background: var(--navy);
  color: #fff;
  padding: 10mm 7mm 8mm 8mm;
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.4;
}
.sidebar .muted { color: rgba(255, 255, 255, 0.62); }
.sidebar a { text-decoration: none; }
.sidebar a:hover { text-decoration: underline; }

.photo {
  display: block;
  width: 36mm;
  height: 36mm;
  margin: 0 auto 6mm;
  border-radius: 50%;
  object-fit: cover;
  border: 1.4mm solid #fff;
  box-shadow: 0 0 0 1mm #5c7fbf;
}

.side-section + .side-section { margin-top: 4.4mm; }
.side-section h3 {
  margin-bottom: 1.6mm;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.side-list li + li { margin-top: 0.7mm; }
.contact { overflow-wrap: anywhere; }

.skills li + li { margin-top: 1.2mm; }
.skill {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 2mm;
}
.skill-note {
  grid-column: 1 / -1;
  font-size: 0.74rem;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.6);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8mm 3mm;
  margin-top: 2mm;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.6);
}
.legend .dots { gap: 0.5mm; margin-right: 1mm; vertical-align: 0.1mm; }
.legend .dots i { width: 1.1mm; height: 1.1mm; }
.dots { display: inline-flex; gap: 0.8mm; }
.dots i {
  width: 1.55mm;
  height: 1.55mm;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
}
.dots i.on { background: #fff; }

.main {
  padding: 13mm 12mm 10mm 11mm;
  overflow: hidden;
}

.name {
  font-size: 2.95rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
}
.role {
  margin-top: 2.2mm;
  font-size: 1.36rem;
  font-weight: 650;
  line-height: 1.25;
  color: var(--accent);
}
.tagline {
  margin-top: 1.6mm;
  font-size: 1.1rem;
  line-height: 1.45;
  color: var(--ink);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3mm;
  margin: 6mm 0 7mm;
}
.kpi {
  display: flex;
  flex-direction: column;
  padding: 3mm 3.4mm;
  border-radius: 2mm;
  background: var(--tile);
}
.kpi-value {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink-strong);
}
.kpi-label {
  margin-top: 1mm;
  font-size: 0.8rem;
  line-height: 1.3;
  color: var(--muted);
}

.section-title {
  margin-bottom: 3mm;
  padding-bottom: 1.5mm;
  border-bottom: 0.3mm solid var(--line);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-title .muted { letter-spacing: 0.04em; text-transform: none; }
section + section { margin-top: 6mm; }

.profile {
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ---------- projects (PAR) ---------- */

.project { break-inside: avoid; }
.project + .project { margin-top: 5.5mm; }

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4mm;
}
.project-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-strong);
}
.project-period {
  white-space: nowrap;
  font-size: 0.86rem;
  color: var(--muted);
}
.project-org {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}
.project-facts {
  margin: 0.4mm 0 2mm;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--muted);
}

/* Problem, action and result run as one paragraph; the highlighter colours mark the parts. */
.par {
  font-size: 0.96rem;
  line-height: 1.55;
}
.par > span {
  border-radius: 0.6mm;
  padding: 0.15mm 0.3mm;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.par-on .par-problem { background: var(--p-bg); }
.par-on .par-action  { background: var(--a-bg); }
.par-on .par-result  { background: var(--r-bg); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2mm;
  margin-top: 2.2mm;
}
.tags li {
  padding: 0.35mm 2mm;
  border: 0.25mm solid var(--line);
  border-radius: 99px;
  background: #f6f8fb;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

/* ---------- following pages ---------- */

.sheet--cont {
  min-height: 297mm;
  padding: 14mm var(--sheet-pad) 16mm;
}

.running-head {
  display: flex;
  justify-content: space-between;
  gap: 6mm;
  margin-bottom: 7mm;
  padding-bottom: 2mm;
  border-bottom: 0.7mm solid var(--navy);
  font-size: 0.84rem;
  color: var(--muted);
}
.running-head strong { color: var(--ink-strong); }

.earlier { break-inside: avoid; }
.section-title { break-after: avoid; }

/* period + one line of text: "earlier" one-liners and sections of kind "lines" */
.lines li {
  display: grid;
  grid-template-columns: 30mm 1fr;
  gap: 3mm;
  font-size: 0.94rem;
  color: var(--ink-soft);
  break-inside: avoid;
}
.lines li + li { margin-top: 1.6mm; }
.lines-period { color: var(--muted); white-space: nowrap; }

/* sections of kind "entries": positions or degrees with bullets */
.entry { break-inside: avoid; }
.entry + .entry { margin-top: 4.5mm; }
.entry .project-title { font-size: 1rem; }
.entry-text {
  margin-top: 1mm;
  font-size: 0.94rem;
  color: var(--ink-soft);
}
.bullets {
  margin-top: 1.2mm;
  padding-left: 4mm;
  list-style: disc;
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.bullets li::marker { color: var(--accent); }
.bullets li + li { margin-top: 0.6mm; }

/* sections of kind "groups": label + list, e.g. the skills inventory */
.groups {
  display: grid;
  grid-template-columns: 38mm 1fr;
  gap: 1.8mm 4mm;
  font-size: 0.94rem;
  line-height: 1.5;
}
.groups dt { font-weight: 650; color: var(--ink-strong); break-after: avoid; }
.groups dd { margin: 0; color: var(--ink-soft); }

.quote {
  margin: 7mm 0 0;
  padding-left: 4mm;
  border-left: 0.8mm solid var(--line);
  break-inside: avoid;
}
.extra[data-kind="quotes"] .quote { margin-top: 0; }
.extra[data-kind="quotes"] .quote + .quote { margin-top: 4mm; }
.quote p { font-size: 1.05rem; font-style: italic; font-weight: 600; color: var(--ink-strong); }
.quote footer { margin-top: 1mm; font-size: 0.84rem; color: var(--muted); }

/* ---------- landing page ---------- */

.landing { max-width: 720px; margin: 0 auto; padding: 48px 20px; font-size: 15px; }
.landing h1 { font-size: 30px; color: var(--ink-strong); }
.landing > p { margin-top: 6px; color: var(--muted); }
.landing ul { margin-top: 28px; display: grid; gap: 12px; }
.landing li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(13, 43, 94, 0.1);
}
.landing li span { font-weight: 650; color: var(--ink-strong); }
.landing li nav { display: flex; gap: 8px; }
.landing li a {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
}

/* ---------- small screens: single column (print is unaffected) ---------- */

@media screen and (max-width: 840px) {
  html { font-size: 10.5pt; }
  .toolbar { gap: 10px; flex-wrap: wrap; }
  .sheet { width: auto; margin: 0; box-shadow: none; }
  .sheet--first { display: flex; flex-direction: column; height: auto; }
  .sheet--first::after { display: none; }
  .sheet--first > .main { order: -1; padding: 8mm 6mm; }
  .sidebar { padding: 8mm 6mm; }
  .sheet--cont { min-height: 0; padding: 8mm 6mm; }
  .kpis { grid-template-columns: 1fr; }
  .project-head { flex-wrap: wrap; }
  .running-head { flex-direction: column; }
  .lines li, .groups { grid-template-columns: 1fr; gap: 0; }
  .groups dd + dt { margin-top: 2mm; }
}

/* ---------- print ---------- */

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

@media print {
  html, body { background: #fff; }
  .toolbar, .overflow-warning { display: none !important; }
  .sheet { margin: 0; box-shadow: none; }
  .sheet--first { break-after: page; }
  .sheet--cont { min-height: 0; padding: 0 var(--sheet-pad); }
  a { text-decoration: none; }
}
