/* CV templates — drawn by js/cv-render.js on /cv and in the admin CV Studio.
   Everything is sized in physical units (mm/pt) so the screen preview matches the PDF. */

.cvx {
  --pt: 11mm; --px: 12.5mm; --g: 1; --side-w: 57mm;
  --ink: #15171c; --ink-2: #353a45; --mute: #6b7180; --rule: #d8dbe2; --paper: #fff;
  --ac: #c8102e; --ac-rgb: 200, 16, 46; --sc: 1;
  --fh: "Space Grotesk"; --fb: "Space Grotesk"; --fm: "JetBrains Mono";
  position: relative; isolation: isolate;
  box-sizing: border-box; width: 210mm; min-height: 297mm; padding: var(--pt) var(--px);
  color: var(--ink); background: transparent; text-align: left;
  font-family: var(--fb), system-ui, sans-serif; font-size: calc(8.8pt * var(--sc)); line-height: 1.38; font-weight: 400;
  overflow-wrap: break-word; -webkit-font-smoothing: antialiased;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  print-color-adjust: exact; -webkit-print-color-adjust: exact;
}
.cvx *, .cvx *::before, .cvx *::after { box-sizing: border-box; }
.cvx :where(h1, h2, h3, p, ul, li, section, header, footer, aside) { margin: 0; padding: 0; font: inherit; letter-spacing: normal; text-transform: none; color: inherit; border: 0; background: none; }
.cvx :where(a) { color: inherit; text-decoration: none; }
.cvx :where(img) { max-width: none; }
.cvx b { font-weight: 700; color: var(--ink); }
.cvx.paper-letter { width: 215.9mm; min-height: 279.4mm; page: letter; }
.cvx.dn-compact { --pt: 9mm; --px: 10mm; --g: .72; line-height: 1.3; }
.cvx.dn-airy { --pt: 15mm; --px: 16mm; --g: 1.3; line-height: 1.5; }

/* paper layer: absolute on screen, fixed in print so it repeats on every page */
.x-bg { position: absolute; inset: 0; z-index: -1; background: var(--paper); pointer-events: none; }

/* ---------- header ---------- */
.x-head { position: relative; padding-bottom: calc(5mm * var(--g)); margin-bottom: calc(6mm * var(--g)); border-bottom: .45mm solid var(--ink); }
.x-headin { position: relative; display: flex; align-items: center; gap: 6mm; }
.x-photo { flex: none; width: 24mm; height: 29mm; object-fit: cover; object-position: 50% 20%; border-radius: 3mm; background: #eceef2; }
.ph-circle .x-photo { width: 27mm; height: 27mm; border-radius: 50%; }
.ph-square .x-photo { border-radius: 0; }
.x-id { flex: 1; min-width: 0; }
.x-name { font-family: var(--fh), var(--fb), sans-serif; font-weight: 800; font-size: 2.5em; line-height: 1.04; letter-spacing: -.02em; color: var(--ink); }
.x-headline { margin-top: .35em; font-size: 1.2em; font-weight: 600; color: var(--ac); line-height: 1.25; }
.x-contact { display: flex; flex-wrap: wrap; gap: .3em 1.5em; margin-top: .85em; font-family: var(--fm), monospace; font-size: .84em; color: var(--ink-2); }
.x-contact a, .x-contact span { display: inline-flex; align-items: center; gap: .45em; }
.x-ico { flex: none; width: 1.2em; height: 1.2em; color: var(--ac); }
.x-qr { flex: none; width: 19mm; height: 19mm; background: #fff; padding: .8mm; border-radius: 1mm; }

/* ---------- columns ---------- */
.x-body { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); gap: 8mm; align-items: start; }
.sd-left .x-body { grid-template-columns: var(--side-w) minmax(0, 1fr); }
.sd-left .x-side { order: -1; }
.no-side .x-body, .c1 .x-body { display: block; }
.c1 .x-side { margin-top: calc(5.5mm * var(--g)); columns: 2; column-gap: 9mm; }
.c1 .x-side .x-sec { break-inside: avoid; margin: 0 0 calc(5mm * var(--g)); }
.c1 .x-side .x-sec + .x-sec { margin-top: 0; }
.c1 .x-langs { display: grid; grid-template-columns: 1fr 1fr; column-gap: 6mm; }

/* ---------- section headings ---------- */
.x-sec + .x-sec { margin-top: calc(5mm * var(--g)); }
/* pagination: a heading always travels with its first block (see render()), a role's header
   keeps ~2 bullets of room below it, and small blocks never split across pages */
.x-keep, .x-jh, .x-job li, .x-skill, .x-cred, .x-edu, .x-lang, .x-langs, .x-talks li { break-inside: avoid; page-break-inside: avoid; }
.x-experience .x-keep::after, .x-jh::after { content: ""; display: block; height: 13mm; margin-bottom: -13mm; }
.x-summary, .x-inline { orphans: 3; widows: 3; }
.x-h {
  display: flex; align-items: center; gap: 3mm; margin-bottom: calc(2.8mm * var(--g));
  font-family: var(--fm), monospace; font-size: .8em; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--ac);
  break-after: avoid; page-break-after: avoid;
}
.hs-rule .x-h::after { content: ""; flex: 1; height: .25mm; background: var(--rule); }
.hs-bar .x-h { font-family: var(--fh), var(--fb), sans-serif; font-size: 1.12em; font-weight: 700; letter-spacing: .01em; text-transform: none; color: var(--ink); gap: 2.2mm; }
.hs-bar .x-h::before { content: ""; width: 1.3mm; height: 1.05em; border-radius: .7mm; background: var(--ac); }
.hs-caps .x-h { display: block; font-family: var(--fh), var(--fb), sans-serif; font-size: .86em; font-weight: 700; letter-spacing: .22em; color: var(--ink); }
.hs-caps .x-h::after { content: ""; display: block; width: 9mm; height: .7mm; margin-top: 1.3mm; background: var(--ac); }
.hs-box .x-h span { background: var(--ac); color: #fff; padding: .3em .75em; border-radius: .6mm; letter-spacing: .16em; }
.hs-underline .x-h { display: block; font-family: var(--fh), var(--fb), serif; font-size: 1.18em; font-weight: 700; letter-spacing: .06em; text-transform: none; font-variant: small-caps; color: var(--ink); padding-bottom: 1.2mm; border-bottom: .3mm solid var(--ac); }

/* ---------- experience ---------- */
.x-job + .x-job { margin-top: calc(4.2mm * var(--g)); }
.x-job-top { display: flex; justify-content: space-between; align-items: baseline; gap: 3mm; }
.x-job h3 { font-size: 1.16em; font-weight: 700; color: var(--ink); line-height: 1.25; }
.x-when { font-family: var(--fm), monospace; font-size: .8em; color: var(--mute); white-space: nowrap; }
.x-when i { font-style: normal; color: var(--ac); }
.x-role { margin-top: .1em; font-weight: 500; color: var(--ink-2); }
.x-sector { color: var(--mute); font-weight: 400; }
.x-where { margin-top: .12em; font-family: var(--fm), monospace; font-size: .78em; color: var(--mute); }
.x-job ul { margin-top: .5em; padding-left: 1.15em; color: var(--ink-2); }
.x-job li { margin: .2em 0; }
.x-job li::marker { color: var(--ac); }
.x-tags { margin-top: .4em; font-family: var(--fm), monospace; font-size: .76em; color: var(--ac); }
.x-summary { color: var(--ink-2); }
.x-talks { padding-left: 1.1em; color: var(--ink-2); }
.x-talks li { margin: .25em 0; }
.x-talks li::marker { color: var(--ac); }

/* ---------- credentials & education ---------- */
.x-cred, .x-edu { display: grid; grid-template-columns: 8.5mm minmax(0, 1fr); gap: 2.6mm; align-items: center; margin-bottom: calc(2.4mm * var(--g)); break-inside: avoid; }
.x-cred:not(:has(.x-mark)), .x-edu:not(:has(.x-mark)) { display: block; }
.x-edu { grid-template-columns: 10mm minmax(0, 1fr); align-items: start; }
.x-cred b, .x-edu b { display: block; font-size: .97em; line-height: 1.26; }
.x-cred div > span, .x-edu div > span { display: block; font-size: .85em; line-height: 1.32; color: var(--mute); }
.x-mark { width: 8.5mm; height: 8.5mm; display: grid; place-items: center; border-radius: 1.6mm; overflow: hidden; }
.x-edu .x-mark { width: 10mm; height: 10mm; }
.x-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.x-mark.plate { background: #fff; padding: .5mm; box-shadow: inset 0 0 0 .2mm #e3e5ea; }
.x-mark.mono { background: rgba(var(--ac-rgb), .1); color: var(--ac); font-family: var(--fm), monospace; font-size: .58em; font-weight: 700; text-align: center; line-height: 1.05; letter-spacing: -.01em; }
.x-edu div > .x-schol { display: flex; align-items: center; gap: 1.6mm; margin-top: .35em; color: var(--ink-2); }
.x-schol img { height: 1.7em; width: auto; background: #fff; border-radius: .8mm; padding: .3mm; }

/* ---------- skills, languages, inline lists ---------- */
.x-skill + .x-skill { margin-top: calc(2.3mm * var(--g)); }
.x-skill > b { display: block; margin-bottom: .35em; font-family: var(--fm), monospace; font-size: .72em; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.x-inline { color: var(--ink-2); line-height: 1.5; }
.x-inline i { font-style: normal; color: var(--ac); }
.x-chips { display: flex; flex-wrap: wrap; gap: 1.2mm; }
.x-chips span { font-size: .84em; padding: .22em .6em; border-radius: 1.2mm; background: rgba(var(--ac-rgb), .09); color: var(--ink-2); }
.x-cols { columns: 2; column-gap: 4mm; padding-left: 1em; font-size: .93em; color: var(--ink-2); }
.x-cols li::marker { color: var(--ac); }
.x-lang { display: flex; justify-content: space-between; gap: 3mm; margin-bottom: .3em; }
.x-lang span { color: var(--mute); font-size: .9em; text-align: right; }

/* out of the flow, in the bottom padding of the last page, so it can never spill onto a page by itself */
.x-foot { position: absolute; right: var(--px); bottom: calc(var(--pt) * .35); font-family: var(--fm), monospace; font-size: .72em; color: var(--mute); }

/* =================== templates =================== */

/* Signature: the site's own look */
.t-signature .x-name { font-size: 2.15em; letter-spacing: -.03em; }

/* Midnight Sidebar */
.t-midnight { --side-w: 58mm; --dark: color-mix(in srgb, var(--ac) 16%, #0b1016); }
.t-midnight .x-bg { background: linear-gradient(to right, var(--dark) 0 calc(var(--px) + var(--side-w) + 4.5mm), var(--paper) 0); }
.t-midnight.sd-right .x-bg { background: linear-gradient(to left, var(--dark) 0 calc(var(--px) + var(--side-w) + 4.5mm), var(--paper) 0); }
.t-midnight .x-head { border: 0; padding-bottom: 0; }
.t-midnight .x-headin { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); gap: 9mm; }
.t-midnight.sd-right .x-headin { grid-template-columns: minmax(0, 1fr) var(--side-w); }
.t-midnight.sd-right .x-photo { order: 2; }
.t-midnight .x-photo { justify-self: center; box-shadow: 0 0 0 .8mm var(--dark), 0 0 0 1.3mm var(--ac); }
.t-midnight.ph-none .x-headin { grid-template-columns: 1fr; }
.t-midnight.ph-none.sd-left .x-id { padding-left: calc(var(--side-w) + 9mm); }
.t-midnight.ph-none.sd-right .x-id { padding-right: calc(var(--side-w) + 9mm); }
.t-midnight .x-qr { position: absolute; right: 0; top: 0; }
.t-midnight.sd-right .x-qr { right: auto; left: calc(100% - var(--side-w) - 21mm); }
.t-midnight .x-side { --ink: #fff; --ink-2: #d5dde6; --mute: #93a1b2; --rule: rgba(255,255,255,.16); color: var(--ink-2); }
.t-midnight .x-side .x-chips span { background: rgba(255,255,255,.08); color: #e5ebf1; }
.t-midnight .x-side .x-mark.mono { background: rgba(255,255,255,.08); }

/* Executive */
.t-executive .x-head { text-align: center; border-bottom: .9mm double var(--ink); }
.t-executive .x-headin { flex-direction: column; gap: 3mm; }
.t-executive .x-contact { justify-content: center; }
.t-executive .x-name { font-size: 2.7em; letter-spacing: 0; font-weight: 700; }
.t-executive .x-headline { font-style: italic; font-weight: 500; }
.t-executive .x-qr { position: absolute; right: 0; top: 0; }
.t-executive .x-job h3 { font-family: var(--fh), serif; font-size: 1.22em; }

/* Red Team Terminal */
.t-terminal .x-head { background: #0d1117; color: #e6edf3; border: 0; border-radius: 2.6mm; overflow: hidden; padding: 0 0 5mm; }
.t-terminal .x-termbar { display: flex; align-items: center; gap: 1.6mm; padding: 2.2mm 3.6mm; background: #161b22; font-family: var(--fm), monospace; font-size: .74em; color: #8b949e; }
.t-terminal .x-termbar i { width: 2.6mm; height: 2.6mm; border-radius: 50%; background: #ff5f56; }
.t-terminal .x-termbar i + i { background: #ffbd2e; }
.t-terminal .x-termbar i + i + i { background: #27c93f; }
.t-terminal .x-termbar span { margin-left: auto; margin-right: auto; padding-right: 10mm; }
.t-terminal .x-headin { padding: 4.5mm 5.5mm 0; }
.t-terminal .x-prompt { font-family: var(--fm), monospace; font-size: .95em; color: var(--ac); margin-bottom: 1mm; }
.t-terminal .x-prompt b { color: #8b949e; font-weight: 400; }
.t-terminal .x-name { color: #fff; font-family: var(--fm), monospace; font-size: 2.1em; letter-spacing: -.03em; }
.t-terminal .x-headline { color: color-mix(in srgb, var(--ac) 65%, #fff); }
.t-terminal .x-contact { color: #c9d1d9; }
.t-terminal .x-photo { box-shadow: 0 0 0 .5mm var(--ac); filter: saturate(.9) contrast(1.05); }
.t-terminal .x-h { font-family: var(--fm), monospace; text-transform: lowercase; letter-spacing: 0; font-size: 1.02em; }
.t-terminal .x-h span::before { content: "// "; opacity: .55; }
.t-terminal .x-job h3 { font-family: var(--fm), monospace; font-size: 1.08em; letter-spacing: -.02em; }
.t-terminal .x-job li::marker { content: "› "; }

/* Swiss Grid */
.t-swiss .x-head { border: 0; padding-bottom: 2mm; }
.t-swiss .x-name { font-size: 3.3em; letter-spacing: -.045em; font-weight: 700; line-height: .98; }
.t-swiss .x-name::after { content: "."; color: var(--ac); }
.t-swiss .x-headline { text-transform: uppercase; letter-spacing: .14em; font-size: .9em; }
.t-swiss .x-side { columns: auto; }
.t-swiss .x-side .x-sec { margin: 0; }
.t-swiss .x-sec { display: grid; grid-template-columns: 33mm minmax(0, 1fr); gap: 0 6mm; padding-top: calc(3.6mm * var(--g)); border-top: .25mm solid var(--rule); }
.t-swiss .x-sec + .x-sec, .t-swiss .x-side .x-sec { margin-top: calc(3.6mm * var(--g)); }
.t-swiss .x-h { display: block; margin: 0; padding-top: 1.6mm; border-top: .9mm solid var(--ac); font-family: var(--fh), sans-serif; font-size: .74em; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); background: none; border-bottom: 0; font-variant: normal; }
.t-swiss .x-h::before, .t-swiss .x-h::after { display: none; }
.t-swiss .x-h span { background: none; color: inherit; padding: 0; }
.t-swiss .x-h + * { min-width: 0; }
.t-swiss .x-sec > :not(.x-hw):not(.x-keep), .t-swiss .x-keep > :not(.x-hw) { grid-column: 2; }
.t-swiss .x-keep { display: contents; }
.t-swiss .x-hw { grid-row: 1 / span 60; }
.t-swiss .x-hw::after { display: none; }
.t-swiss .x-langs { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8mm; }

/* Timeline */
.t-timeline .x-head, .t-banner .x-head {
  margin: calc(var(--pt) * -1) calc(var(--px) * -1) calc(7mm * var(--g)); padding: var(--pt) var(--px) calc(7mm * var(--g));
  border: 0; color: #fff;
}
.t-timeline .x-head { background: linear-gradient(118deg, var(--ac), color-mix(in srgb, var(--ac) 45%, #05060a)); }
.t-timeline .x-name, .t-banner .x-name { color: #fff; }
.t-timeline .x-headline, .t-banner .x-headline { color: rgba(255,255,255,.92); }
.t-timeline .x-contact, .t-banner .x-contact { color: rgba(255,255,255,.9); }
.t-timeline .x-ico, .t-banner .x-ico { color: #fff; }
.t-timeline .x-photo, .t-banner .x-photo { box-shadow: 0 0 0 1mm rgba(255,255,255,.85); }
.t-timeline .x-experience .x-job { position: relative; margin: 0 0 0 1.6mm; padding: calc(2.2mm * var(--g)) 0 calc(2.2mm * var(--g)) 6mm; border-left: .5mm solid rgba(var(--ac-rgb), .28); }
.t-timeline .x-experience .x-job::before { content: ""; position: absolute; left: -1.85mm; top: calc(2.2mm * var(--g) + .3em); width: 3.2mm; height: 3.2mm; border-radius: 50%; background: var(--paper); border: .7mm solid var(--ac); }
.t-timeline .x-experience .x-job.now::before { background: var(--ac); box-shadow: 0 0 0 1mm rgba(var(--ac-rgb), .2); }

/* Classified Dossier */
.t-dossier { --paper: #f5f0e6; --rule: #cfc6b4; --ink-2: #2f2c27; --mute: #6d665b; }
.t-dossier .x-head { border-bottom: .3mm solid var(--ink); }
.t-dossier .x-strip { display: flex; justify-content: space-between; gap: 4mm; align-items: center; margin-bottom: 5mm; padding: 1.4mm 0; border-top: 1.2mm solid var(--ac); border-bottom: .3mm solid var(--ink); font-family: var(--fm), monospace; font-size: .7em; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.t-dossier .x-photo { padding: 1mm; background: #fff; border: .25mm solid #b9b1a2; transform: rotate(-2deg); box-shadow: 0 .6mm 1.4mm rgba(0,0,0,.15); }
.t-dossier .x-name { font-family: var(--fm), monospace; text-transform: uppercase; letter-spacing: .02em; font-size: 2.05em; }
.t-dossier .x-stamp {
  position: absolute; right: 1mm; top: 50%; transform: translateY(-50%) rotate(-11deg);
  padding: 1.6mm 3.4mm; border: .8mm solid var(--ac); border-radius: 1.2mm; color: var(--ac);
  font-family: var(--fm), monospace; font-weight: 700; font-size: 1.05em; line-height: 1.15; letter-spacing: .16em; text-transform: uppercase; text-align: center; opacity: .82;
}
.t-dossier.sd-left .x-side { padding-right: 5mm; border-right: .3mm dashed var(--rule); }
.t-dossier.sd-right .x-side { padding-left: 5mm; border-left: .3mm dashed var(--rule); }
.t-dossier .x-qr { margin-right: 32mm; }

/* Spotlight Banner */
.t-banner .x-head { background: var(--ac); }
.t-banner .x-side { padding: 4.5mm; border-radius: 2mm; background: rgba(var(--ac-rgb), .06); }

/* ATS Plain */
.t-ats .x-head { border-bottom: .3mm solid var(--ink); }
.t-ats .x-name { font-size: 2.1em; letter-spacing: 0; }
.t-ats .x-headline { color: var(--ink-2); }
.t-ats .x-contact { font-family: var(--fb), sans-serif; }
.t-ats .x-side { columns: auto; }
.t-ats .x-job li::marker, .t-ats .x-inline i { color: var(--ink); }

/* ---------- screen stage ---------- */
.cvx-fit { position: relative; margin: 0 auto; }
.cvx-fit > .cvx { transform-origin: 0 0; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.06); }
.cvx-guide { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed rgba(255,45,85,.55); pointer-events: none; z-index: 3; }
.cvx-guide span { position: absolute; right: 6px; top: 3px; font: 600 9px/1 "JetBrains Mono", monospace; letter-spacing: .1em; color: #ff2d55; background: rgba(7,8,11,.8); padding: 3px 5px; border-radius: 3px; }

/* ---------- printing ---------- */
#cvx-print { display: none; }
@page letter { size: letter; margin: 0; }
@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  body > *:not(#cvx-print) { display: none !important; }
  #cvx-print { display: block !important; }
  #cvx-print .cvx { transform: none !important; box-shadow: none !important; margin: 0 !important; min-height: 0; }
  #cvx-print .x-bg { position: fixed; }
}
.t-dossier .x-redact { flex: 1; max-width: 34mm; height: 2.4mm; background: var(--ink); opacity: .85; }
.t-dossier .x-id { padding-right: 30mm; }
.t-dossier .x-stamp { top: 0; transform: rotate(-11deg); }
/* mono-heavy template runs long: tighten slightly so it lands on two pages like the others */
.t-terminal { font-size: calc(8.5pt * var(--sc)); --g: .9; }
/* licence issuers are wide wordmarks (NACSA, MBOT): give them a wider plate than the square badges */
.x-licences .x-cred { grid-template-columns: 15mm minmax(0, 1fr); }
.x-licences .x-mark { width: 15mm; }

/* ---------- phones: the sheet reflows (printing still uses the A4 layout) ---------- */
.cvx.fluid { --pt: 22px; --px: 16px; width: 100%; min-height: 0; font-size: 14px; border-radius: 12px; overflow: hidden; }
.cvx.fluid.dn-compact, .cvx.fluid.dn-airy { --pt: 22px; --px: 16px; }
.cvx.fluid .x-body { display: block; }
.cvx.fluid .x-side { margin-top: 26px; columns: auto; }
.cvx.fluid .x-side .x-sec { margin: 0 0 22px; }
.cvx.fluid .x-headin { display: flex; flex-wrap: wrap; gap: 14px; }
.cvx.fluid .x-photo { width: 76px; height: 92px; }
.cvx.fluid.ph-circle .x-photo { width: 84px; height: 84px; }
.cvx.fluid .x-name { font-size: 1.85em; }
.cvx.fluid .x-contact { flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.cvx.fluid .x-qr, .cvx.fluid .x-redact { display: none; }
.cvx.fluid .x-job-top { flex-wrap: wrap; }
.cvx.fluid .x-foot { position: static; margin-top: 18px; text-align: right; }
.cvx.fluid .x-cols { columns: 1; }
.cvx.fluid.t-midnight .x-bg { background: var(--paper); }
.cvx.fluid.t-midnight .x-side { padding: 18px; border-radius: 12px; background: var(--dark); }
.cvx.fluid.t-midnight .x-headin { display: flex; }
.cvx.fluid.t-midnight.ph-none.sd-left .x-id, .cvx.fluid.t-midnight.ph-none.sd-right .x-id { padding: 0; }
.cvx.fluid.t-swiss .x-sec { display: block; }
.cvx.fluid.t-swiss .x-hw { margin-bottom: 10px; }
.cvx.fluid.t-dossier .x-id { padding-right: 0; }
.cvx.fluid.t-dossier .x-stamp { position: static; display: inline-block; transform: rotate(-6deg); margin-top: 4px; }
.cvx.fluid.t-dossier .x-side { border: 0; padding: 0; }
.cvx.fluid .x-strip { flex-wrap: wrap; }
.cvx.fluid.t-terminal .x-headin { padding: 14px 14px 0; }
.cvx.fluid .x-id { flex: 1 1 200px; min-width: 0; }
