/* alessandroalfieri.com — "La scheda"
   Paper and ink, Geist for display type, Inter for text, hairlines instead of shadows.
   One accent colour that changes with the lens ("Guarda il profilo come…"): site.js sets --accent. */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: optional; /* labels only: never swap late and shift the layout */
}

:root {
  --paper: #FCFCFA;
  --surface: #FFFFFF;
  --tint: #F4F3EF;
  --ink: #121212;
  --text: #1A1A1A;
  --muted: #55555A;
  --subtle: #66666B;
  --line: #E6E5E0;
  --line-strong: #CFCEC7;
  --ok: #0F7A4F;
  --accent: #4F46E5;
  --accent-soft: color-mix(in srgb, var(--accent) 9%, #FFFFFF);
  --accent-ink: color-mix(in srgb, var(--accent) 82%, #000000);
  --on-accent: #FFFFFF;

  --font-display: "Geist", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --measure: 700px;
  --radius: 18px;
  --radius-sm: 12px;
  --section-y: clamp(36px, 4.5vw, 64px);
  --header-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --lift: 0 1px 2px rgb(18 18 18 / .04), 0 10px 30px -18px rgb(18 18 18 / .22);

  color-scheme: light;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.03em; }
h3, h4 { font-weight: 650; letter-spacing: -0.01em; }
p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
code { font-family: var(--font-mono); font-size: .9em; }
.mono { font-family: var(--font-mono); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  left: 16px; top: -64px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top .15s var(--ease);
}
.skip-link:focus { top: 12px; }
main:focus { outline: none; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 14px; height: 14px; }

/* ---------- buttons & links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-lg { min-height: 52px; padding: 14px 24px; font-size: 1rem; }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: .875rem; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--accent); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--accent-soft); }
.btn-outline-light { border-color: rgb(255 255 255 / .4); color: #fff; }
.btn-outline-light:hover { border-color: #fff; background: rgb(255 255 255 / .08); }

.text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--accent-ink); font-weight: 600; }
.text-link .icon { transition: transform .2s var(--ease); }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.text-link:hover .icon { transform: translateX(3px); }
.text-link-back:hover .icon { transform: translateX(-3px); }
.prose a, .xp-body a:not(.text-link), .contact-details a, .form-status a, .book-note a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  /* Near-solid instead of backdrop-filter: the blur cost ~300 ms of main-thread time on mobile. */
  background: rgb(252 252 250 / .97);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease);
}
.site-header.is-scrolled, .site-header.is-open { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-right: auto; font-weight: 650; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.brand-sep { display: none; }
.brand-name { font-size: 1rem; letter-spacing: -0.01em; }

.primary-nav { display: flex; align-items: center; gap: 4px; }
.nav-list { display: flex; align-items: center; gap: 2px; }
.nav-list a, .nav-external {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: .9375rem;
  font-weight: 500;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.nav-list a:hover, .nav-external:hover { color: var(--text); background: var(--tint); }
.nav-list a[aria-current="page"] { color: var(--text); background: var(--tint); }
.nav-external { margin-left: 4px; }
.nav-panel-extra { display: none; }
.header-actions { display: flex; align-items: center; gap: 2px; }
.header-social { display: flex; }
.icon-link { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--muted); }
.icon-link:hover { color: var(--text); background: var(--tint); }
.lang-link {
  display: inline-grid;
  place-items: center;
  min-width: 44px; min-height: 44px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .8125rem;
}
.lang-link:hover { color: var(--text); background: var(--tint); }
.header-cv { margin-left: 6px; }
.menu-toggle { display: none; place-items: center; width: 44px; height: 44px; margin-right: -8px; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.menu-toggle:hover { background: var(--tint); }
.menu-icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .menu-icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .menu-icon-close { display: block; }

@media (max-width: 1139px) { .header-social, .lang-link-compact { display: none; } }
@media (max-width: 979px) {
  .menu-toggle { display: grid; }
  .header-cv { display: none; }
  .primary-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s linear .2s;
  }
  .primary-nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list a, .nav-external { min-height: 52px; padding: 0 4px; border-radius: 0; border-bottom: 1px solid var(--line); color: var(--text); font-size: 1.0625rem; }
  .nav-list a:hover, .nav-list a[aria-current="page"], .nav-external:hover { background: none; color: var(--accent-ink); }
  .nav-external { margin: 0; }
  .nav-panel-extra { display: grid; gap: 16px; padding-top: 20px; }
  .nav-panel-extra .btn { width: 100%; }
  .nav-panel-row { display: flex; align-items: center; gap: 4px; }
  .nav-panel-row .lang-link { margin-left: auto; font-family: var(--font-sans); font-size: .9375rem; }
}

/* ---------- sections ---------- */

.section { padding-block: var(--section-y); }
.section-tight { padding-block: calc(var(--section-y) / 2); }
.section-first { padding-top: clamp(16px, 2.5vw, 28px); }
.section-head { margin-bottom: clamp(20px, 3vw, 32px); max-width: var(--measure); }
.section-head-split { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 24px; max-width: none; }
.section-head-split > div { max-width: var(--measure); }
.section-head-split > .text-link, .section-head-split > .head-links { flex: none; }
.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.kicker::before { content: ""; width: 18px; height: 1px; background: var(--accent); }
.section-title { font-size: clamp(1.75rem, 3.2vw, 2.5rem); line-height: 1.08; }
.section-lead { margin-top: 10px; max-width: 60ch; color: var(--muted); }
.sub-title { margin-bottom: 10px; color: var(--muted); font-family: var(--font-mono); font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-title { font-size: 1.125rem; }
.card-body { margin-top: 8px; color: var(--muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list li { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-family: var(--font-mono); font-size: .75rem; }
.head-links { display: flex; flex-wrap: wrap; gap: 0 20px; }

/* ---------- the sheet (homepage hero) ---------- */

.sheet { padding-top: clamp(28px, 5vw, 64px); padding-bottom: clamp(20px, 3vw, 32px); }
.sheet-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: clamp(28px, 5vw, 72px); align-items: end; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--muted); font-size: .9375rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 16%, transparent); }
.sheet-name { font-size: clamp(2.75rem, 5.6vw, 4.75rem); line-height: 1; letter-spacing: -0.045em; }
.sheet-role { margin-top: 14px; font-size: clamp(1.0625rem, 1.6vw, 1.3125rem); font-weight: 500; color: var(--muted); }
.sheet-role em { font-family: var(--font-display); font-style: normal; font-weight: 700; color: var(--accent); transition: color .3s var(--ease); }
.sheet-headline { margin-top: 18px; max-width: 40ch; font-family: var(--font-display); font-size: clamp(1.25rem, 2vw, 1.625rem); font-weight: 500; line-height: 1.3; letter-spacing: -0.02em; color: var(--ink); }
.sheet-headline[hidden] { display: none; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.sheet-card {
  position: relative;
  padding: 22px 24px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--lift);
}
.sheet-card::before { content: ""; position: absolute; inset: -1px -1px auto; height: 3px; border-radius: var(--radius) var(--radius) 0 0; background: var(--accent); transition: background-color .3s var(--ease); }
.sheet-card-head { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.sheet-portrait { width: 64px; flex: none; }
.sheet-portrait img { border-radius: 50%; aspect-ratio: 1; object-fit: cover; object-position: 50% 30%; }
.sheet-card-label { color: var(--muted); font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; }
.sheet-card-name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.sheet-stats div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding-block: 11px; border-bottom: 1px solid var(--line); }
.sheet-stats div:last-child { border-bottom: 0; }
.sheet-stats dt { padding-top: 2px; color: var(--muted); font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase; }
.sheet-stats dd { font-size: .9375rem; font-weight: 550; line-height: 1.45; }

/* The lens */
.lens { grid-column: 1 / -1; margin-top: clamp(4px, 1.5vw, 12px); padding-top: 18px; border-top: 1px solid var(--line); }
.lens-label { margin-bottom: 12px; color: var(--muted); font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.lens-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.lens-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), transform .2s var(--ease);
}
.lens-btn:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.lens-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.lens-emblem { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--tint); color: var(--ink); transition: background-color .2s var(--ease), color .2s var(--ease); }
.lens-emblem .icon { width: 21px; height: 21px; }
.lens-btn[aria-pressed="true"] .lens-emblem { background: var(--accent); color: #fff; }
.lens-text { display: grid; min-width: 0; }
.lens-name { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.lens-role { color: var(--muted); font-size: .8125rem; line-height: 1.3; }
.lens-btn[aria-pressed="true"] .lens-role { color: var(--accent-ink); }

/* ---------- projects on the homepage ---------- */

.missions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.missions > li:nth-child(n + 5) { display: none; }
.mission article {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.mission article:hover { border-color: var(--line-strong); box-shadow: var(--lift); }
.mission.is-relevant article { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.mission-meta { padding-right: 120px; color: var(--muted); font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.mission-title { margin-top: 8px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1.15; letter-spacing: -0.03em; }
.mission-role { margin-top: 12px; font-size: .9375rem; font-weight: 600; line-height: 1.45; }
.mission-role-label {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.mission-text { margin-top: 8px; color: var(--muted); }
.mission-result { display: flex; gap: 8px; margin-top: 10px; font-size: .9375rem; line-height: 1.45; }
.mission-result .icon { margin-top: 3px; color: var(--ok); }
.mission-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; margin-top: auto; padding-top: 16px; }
.mission-tech { color: var(--subtle); font-family: var(--font-mono); font-size: .8125rem; }
.mission-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; color: var(--accent-ink); }
.mission-link .icon { transition: transform .2s var(--ease); }
.mission-link:hover .icon { transform: translateX(3px); }
.mission-flag {
  position: absolute;
  top: 20px; right: 20px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
}
.mission-flag[hidden] { display: none; }

/* ---------- rows (timeline, projects list) & disclosures ---------- */

.row-list { display: grid; gap: 10px; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) auto;
  gap: 6px 28px;
  align-items: start;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .2s var(--ease), background-color .3s var(--ease);
}
.row[hidden] { display: none; }
.row:hover, .row.has-open { border-color: var(--line-strong); }
.xp-row { grid-template-columns: 170px minmax(0, 1fr) auto; }
.xp-row.is-relevant { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 4%, #FFFFFF); }
.xp-row.is-relevant .row-date { background: var(--accent); color: #fff; }
.row .disclosure-panel { grid-column: 1 / -1; }
.row-meta { margin-bottom: 4px; color: var(--accent-ink); font-family: var(--font-mono); font-size: .75rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.row-title { font-size: 1.0625rem; line-height: 1.3; }
.row-sub { margin-top: 2px; font-size: .9375rem; font-weight: 600; }
.row-text { margin-top: 4px; color: var(--muted); font-size: .9375rem; }
.row-date { justify-self: start; padding: 2px 10px; border-radius: 999px; background: var(--tint); font-family: var(--font-mono); font-size: .8125rem; white-space: nowrap; transition: background-color .3s var(--ease), color .3s var(--ease); }
.row-side { display: grid; gap: 6px; padding-top: 2px; }
.row-result { display: flex; gap: 8px; font-size: .9375rem; line-height: 1.45; }
.row-result .icon { margin-top: 3px; color: var(--ok); }
.row-tech { color: var(--subtle); font-family: var(--font-mono); font-size: .8125rem; }
.row-toggle { justify-self: end; }

.disclosure-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s var(--ease), background-color .15s var(--ease), color .15s var(--ease);
}
.disclosure-toggle:hover { border-color: var(--ink); }
.disclosure-toggle[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.disclosure-icon { transition: transform .24s var(--ease); }
.disclosure-toggle[aria-expanded="true"] .disclosure-icon { transform: rotate(180deg); }
/* Closed = zero rows and hidden from Tab/AT; open = measured height via grid rows. */
.disclosure-panel { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .24s var(--ease), visibility 0s linear .24s; }
.disclosure-panel.is-open { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .24s var(--ease), visibility 0s linear 0s; }
.disclosure-inner { min-height: 0; overflow: hidden; opacity: 0; transition: opacity .14s ease; }
.disclosure-panel.is-open > .disclosure-inner { opacity: 1; transition: opacity .16s ease .08s; }
.disclosure-inner > :first-child { margin-top: 16px; }
.disclosure-inner > :last-child { margin-bottom: 4px; }

.detail-list { display: grid; gap: 12px; max-width: 900px; }
.detail-list div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; }
.detail-list dt { padding-top: 3px; color: var(--muted); font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.detail-list dd { font-size: .9375rem; }
.detail-list-inline { margin-top: 12px; }
.detail-text { max-width: 70ch; color: var(--muted); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 8px; }
.dash-list { display: grid; gap: 6px; max-width: 80ch; font-size: .9375rem; }
.dash-list li, .xp-bullets li, .cs-list li, .prose ul li { position: relative; padding-left: 20px; }
.dash-list li::before, .xp-bullets li::before, .cs-list li::before, .prose ul li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 8px; height: 2px; background: var(--accent); }

.clients { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px 28px; margin-top: 28px; align-items: baseline; }
.clients-title { color: var(--muted); font-family: var(--font-mono); font-size: .75rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; line-height: 1.5; }
.clients-list { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.clients-list li { font-family: var(--font-display); font-size: clamp(1.125rem, 1.7vw, 1.3125rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.35; color: var(--muted); }
.clients-note { grid-column: 2; color: var(--muted); font-size: .875rem; }

/* ---------- skills & credentials ---------- */

.skill-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.skill-group { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color .3s var(--ease); }
.skill-group.is-relevant { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.skill-group-title { font-family: var(--font-display); font-size: 1.3125rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
.skill-group-text { margin-top: 6px; color: var(--muted); font-size: .9375rem; }
.skill-top { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.skill-top li { padding: 3px 10px; border-radius: 999px; background: var(--tint); font-size: .8125rem; font-weight: 500; }
.skill-group .disclosure-toggle { margin-top: 14px; }
.skill-items { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .9375rem; }
.credentials { margin-top: 32px; }
.cred-list { border-top: 1px solid var(--line); }
.cred-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 24px; padding-block: 12px; border-bottom: 1px solid var(--line); }
.cred-title { font-weight: 600; }
.cred-meta { color: var(--muted); font-size: .9375rem; }
[data-disclosure-group] > .disclosure-toggle { margin-top: 12px; }

/* ---------- latest ---------- */

.spotlight {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: center;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.spotlight-media img { width: 132px; height: auto; border-radius: 26px; }
.spotlight-media.is-cover img { width: auto; height: 200px; border-radius: 4px; box-shadow: 0 2px 4px rgb(0 0 0 / .08), 0 18px 36px -18px rgb(0 0 0 / .45); }
.spotlight-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: .9375rem; }
.spotlight-badge { padding: 2px 10px; border-radius: 999px; background: var(--accent); color: #fff; font-family: var(--font-mono); font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.spotlight-title { margin-top: 10px; font-family: var(--font-display); font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.12; }
.spotlight-text { margin-top: 8px; max-width: 64ch; color: var(--muted); }
.spotlight-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 18px; }
.latest-list { margin-top: 8px; border-top: 1px solid var(--line); }
.latest-item { display: grid; grid-template-columns: 160px 170px minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; min-height: 54px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.latest-item:hover .latest-title { color: var(--accent-ink); }
.latest-item:hover .latest-arrow { transform: translateX(3px); color: var(--accent); }
.latest-date { color: var(--muted); font-family: var(--font-mono); font-size: .8125rem; }
.latest-type { color: var(--muted); font-size: .875rem; }
.latest-title { font-weight: 600; }
.latest-arrow { color: var(--subtle); transition: transform .2s var(--ease), color .2s var(--ease); }

/* ---------- closing (the one dark panel) ---------- */

.closing {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 40px;
  padding: clamp(28px, 5vw, 56px);
  border-radius: calc(var(--radius) + 6px);
  background: var(--ink);
  color: #fff;
}
.closing-title { font-size: clamp(2.25rem, 4.5vw, 3.5rem); line-height: 1.02; letter-spacing: -0.04em; }
.closing-text { margin-top: 12px; max-width: 46ch; color: rgb(255 255 255 / .78); }
.closing-text strong { color: #fff; }
.closing-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.closing :focus-visible { outline-color: #fff; }

/* Other pages keep a lighter call to action */
.cta-panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; padding: clamp(22px, 3vw, 32px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cta-title { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.cta-body { margin-top: 6px; max-width: 52ch; color: var(--muted); }
.cta-body strong { color: var(--text); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- page intro, prose, about ---------- */

.page-intro { padding-top: clamp(32px, 5vw, 72px); padding-bottom: clamp(12px, 2vw, 20px); }
.page-title { max-width: 20ch; font-size: clamp(2.25rem, 4.6vw, 3.5rem); line-height: 1.04; letter-spacing: -0.04em; }
.page-lead { max-width: 62ch; margin-top: 14px; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.125rem); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 24px; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: clamp(28px, 5vw, 72px); align-items: end; }
.about-intro .page-title { max-width: 26ch; font-size: clamp(1.75rem, 3.4vw, 2.75rem); line-height: 1.12; }
.portrait-small img { aspect-ratio: 1; border-radius: 50%; object-fit: cover; object-position: 50% 30%; }
.prose-grid { display: grid; }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 44px; margin-bottom: 12px; font-size: 1.625rem; }
.prose h2:first-child { margin-top: 0; }
.prose p + p { margin-top: 14px; }
.prose p, .prose li { font-size: 1.0625rem; }
.prose ul { display: grid; gap: 10px; margin-top: 14px; }
.prose-actions { margin-top: 20px; }
.prose-lang { margin-top: 52px; padding-top: 8px; border-top: 1px solid var(--line); }
.doc-meta { margin-top: 36px; color: var(--muted); font-family: var(--font-mono); font-size: .8125rem; }
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-block: 40px; }
.pillars .card { padding: 22px; }
.pillars .card-title { font-family: var(--font-display); font-size: 1.3125rem; font-weight: 600; letter-spacing: -0.025em; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 5vw, 64px); }

/* ---------- experience page ---------- */

.xp-list { display: grid; }
.xp-item { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 32px; padding-block: 28px; border-top: 1px solid var(--line); }
.xp-item:last-child { border-bottom: 1px solid var(--line); }
.xp-period { padding-top: 6px; color: var(--muted); font-family: var(--font-mono); font-size: .8125rem; }
.xp-body { max-width: var(--measure); }
.xp-role { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.xp-company { margin-top: 4px; font-weight: 600; }
.xp-location { color: var(--muted); font-weight: 400; }
.xp-summary { margin-top: 10px; color: var(--muted); }
.xp-bullets { display: grid; gap: 8px; margin-top: 14px; }
.xp-tech { margin-top: 14px; color: var(--subtle); font-size: .8125rem; }
.xp-meta { display: grid; gap: 10px; margin-top: 18px; padding: 16px 20px; border-radius: var(--radius-sm); background: var(--tint); }
.xp-meta div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; font-size: .9375rem; }
.xp-meta dt { padding-top: 3px; color: var(--muted); font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.xp-meta dd.mono { padding-top: 2px; font-size: .8125rem; }
.xp-body .text-link { margin-top: 8px; margin-right: 24px; }

/* ---------- projects page, visuals, filters ---------- */

.project-visual { aspect-ratio: 16 / 10; overflow: hidden; background: var(--tint); }
.project-visual-image { display: grid; place-items: center; }
.project-visual-image img { width: 38%; max-width: 200px; border-radius: 22%; }
.diagram { width: 100%; height: 100%; }
.d-dot { fill: var(--line-strong); }
.d-box { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1; }
.d-box-accent { stroke: var(--accent); stroke-width: 1.5; }
.d-label { fill: var(--text); font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.d-arrow { fill: none; stroke: var(--subtle); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Space is reserved from the first paint (no layout shift); it becomes usable once site.js runs. */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; visibility: hidden; }
.js .filter-bar { visibility: visible; }
.filter-btn {
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease), background-color .15s var(--ease);
}
.filter-btn:hover { color: var(--text); border-color: var(--ink); }
.filter-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter-status { margin-left: auto; color: var(--muted); font-size: .875rem; }

/* ---------- case study ---------- */

.cs-back { margin-bottom: 12px; margin-left: -2px; }
.cs-intro .page-title { max-width: 18ch; }
.cs-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 36px; border-top: 1px solid var(--line); }
.cs-facts div { padding: 18px 18px 0 0; }
.cs-facts div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.cs-facts dt { color: var(--muted); font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.cs-facts dd { margin-top: 6px; font-weight: 600; }
.cs-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.cs-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.cs-visual { position: sticky; top: calc(var(--header-h) + 24px); }
.cs-visual .project-visual { border: 1px solid var(--line); border-radius: var(--radius); }
.cs-content { max-width: var(--measure); }
.cs-block + .cs-block { margin-top: 44px; }
.cs-block h2 { margin-bottom: 12px; color: var(--muted); font-family: var(--font-mono); font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.cs-block p { font-size: 1.125rem; line-height: 1.65; }
.cs-list { display: grid; gap: 10px; }
.cs-list li { font-size: 1.0625rem; }
.next-project { display: grid; gap: 4px; margin-top: clamp(56px, 8vw, 96px); padding-top: 28px; border-top: 1px solid var(--line); }
.next-project .kicker { margin-bottom: 0; }
.next-title { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: clamp(1.75rem, 3.6vw, 2.75rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1.08; }
.next-title .icon { width: 28px; height: 28px; color: var(--accent); transition: transform .2s var(--ease); }
.next-project:hover .next-title { color: var(--accent-ink); }
.next-project:hover .icon { transform: translateX(6px); }

/* ---------- contact ---------- */

.contact-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.contact-side .contact-actions { flex-direction: column; align-items: stretch; }
.contact-side .contact-actions .btn { justify-content: flex-start; }
.contact-details { display: grid; gap: 16px; margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.contact-details dt { color: var(--muted); font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.contact-details dd { margin-top: 2px; overflow-wrap: anywhere; }
.contact-form { display: grid; gap: 20px; padding: clamp(24px, 4vw, 40px); }
.form-title { font-family: var(--font-display); font-size: 1.625rem; font-weight: 600; letter-spacing: -0.03em; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; font-size: .9375rem; }
.field input, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 1rem;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field textarea { resize: vertical; min-height: 160px; }
.field input:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field [aria-invalid="true"] { border-color: #C2283C; }
.field-error { color: #B42336; font-size: .875rem; font-weight: 500; }
.contact-form .btn { justify-self: start; }
.form-note { color: var(--muted); font-size: .875rem; }
.form-status:empty { display: none; }
.form-status { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); font-size: .9375rem; }

/* ---------- CV page ---------- */

.cv-doc { max-width: 880px; padding: clamp(24px, 5vw, 56px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: .9375rem; }
.cv-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; padding-bottom: 22px; border-bottom: 2px solid var(--ink); }
.cv-name { font-family: var(--font-display); font-size: 2.25rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.cv-role { margin-top: 6px; color: var(--accent-ink); font-weight: 600; }
.cv-contacts { display: grid; gap: 2px; color: var(--muted); font-size: .875rem; text-align: right; }
.cv-contacts a:hover { color: var(--accent-ink); }
.cv-block { margin-top: 26px; }
.cv-block h2 { margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--muted); font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.cv-entry + .cv-entry { margin-top: 16px; }
.cv-entry-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.cv-entry h3 { font-size: 1rem; }
.cv-date { flex: none; color: var(--muted); font-family: var(--font-mono); font-size: .75rem; }
.cv-sub { color: var(--muted); font-size: .875rem; }
.cv-entry ul { display: grid; gap: 3px; margin-top: 6px; }
.cv-entry li { position: relative; padding-left: 16px; }
.cv-entry li::before { content: "–"; position: absolute; left: 0; color: var(--subtle); }
.cv-entry-compact + .cv-entry-compact { margin-top: 8px; }
.cv-skills { display: grid; gap: 6px; }
.cv-skills div { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; }
.cv-skills dt { font-weight: 600; }

/* ---------- footer ---------- */

.site-footer { padding-block: 48px 32px; background: var(--tint); }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px 48px; }
.footer-name { font-family: var(--font-display); font-size: 1.375rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.footer-roles { margin-top: 6px; color: var(--muted); font-size: .9375rem; }
.footer-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer-nav a { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; color: var(--muted); font-size: .9375rem; }
.footer-nav a:hover { color: var(--text); }
.footer-copy { grid-column: 1 / -1; padding-top: 22px; border-top: 1px solid var(--line-strong); color: var(--subtle); font-size: .8125rem; }

/* ---------- books (/libri/) — same system, a warm fixed accent ---------- */

/* Derived colours are recomputed here: custom properties resolve where they are declared. */
.page-books {
  --accent: #9A3412;
  --accent-soft: color-mix(in srgb, var(--accent) 9%, #FFFFFF);
  --accent-ink: color-mix(in srgb, var(--accent) 82%, #000000);
}
.books-header .brand { margin-right: 0; }
.books-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.books-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; color: var(--muted); font-size: .9375rem; font-weight: 500; }
.books-nav a:hover { color: var(--text); background: var(--tint); }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); grid-auto-flow: row dense; gap: 12px; align-items: stretch; }
.book { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); scroll-margin-top: calc(var(--header-h) + 16px); transition: border-color .2s var(--ease); }
.book:hover { border-color: var(--line-strong); }
.book[hidden] { display: none; }
.book.has-open { grid-column: 1 / -1; border-color: var(--line-strong); }
.book .disclosure-panel { grid-column: 1 / -1; }
.book-cover { width: auto; height: 140px; border-radius: 4px; background: var(--tint); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 8px 18px -10px rgb(0 0 0 / .35); }
.book-body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.book-cat { color: var(--accent-ink); font-family: var(--font-mono); font-size: .75rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.book-badge { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; letter-spacing: .04em; }
.book-title { margin-top: 6px; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; overflow-wrap: anywhere; }
.book-langs { margin-top: 4px; color: var(--muted); font-family: var(--font-mono); font-size: .8125rem; }
.book-body .disclosure-toggle { margin-top: auto; }
.book-body .book-langs + .disclosure-toggle { margin-top: 12px; }
.book-meta-full { color: var(--muted); font-size: .9375rem; }
.book-credit { margin-top: 2px; font-weight: 600; font-size: .9375rem; }
.book-desc { margin-top: 10px; max-width: 72ch; }
.book-sub { margin-top: 14px; margin-bottom: 6px; color: var(--muted); font-family: var(--font-mono); font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.edition-list { display: flex; flex-wrap: wrap; gap: 8px; }
.edition-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .9375rem; font-weight: 600; }
.edition-link:hover { border-color: var(--accent); color: var(--accent-ink); }
.edition-store { color: var(--muted); font-weight: 400; }
.book-note { margin-top: 10px; color: var(--muted); font-size: .9375rem; }
.books-footnote { margin-top: 16px; color: var(--muted); font-size: .875rem; }
.eden-panel { padding: clamp(20px, 3vw, 28px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--accent-soft); }
.eden-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.eden-head .kicker { margin-bottom: 8px; }
.eden-head .card-body { margin-top: 6px; max-width: 62ch; }
.reading-order { border-top: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.reading-order li, .ro-alt { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; align-items: baseline; padding-block: 8px; border-bottom: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.ro-label { color: var(--muted); font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.reading-order a, .ro-alt a { font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.reading-order a:hover, .ro-alt a:hover { color: var(--accent-ink); }
.ro-alt { display: block; margin-top: 12px; border: 0; }
.ro-alt .ro-label { display: block; margin-bottom: 2px; }
.ro-play { display: grid; margin-top: 8px; }
.ro-play span { color: var(--muted); font-size: .9375rem; }
.author { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; align-items: start; }
.author-portrait img { border-radius: 50%; }
.author .text-link { min-height: 36px; margin-top: 4px; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation-duration: 0s !important; }
}

/* ---------- responsive ---------- */

@media (max-width: 1023px) {
  .sheet-grid { grid-template-columns: minmax(0, 1fr); }
  .sheet-card { max-width: 560px; }
  .lens-options { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row .row-side { grid-column: 1; grid-row: 2; }
  .row .row-toggle { grid-column: 2; grid-row: 1; }
  .xp-row { grid-template-columns: 170px minmax(0, 1fr) auto; }
  .xp-row .row-toggle { grid-column: 3; }
  .skill-groups { grid-template-columns: minmax(0, 1fr); }
  .cs-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-facts div:nth-child(3) { padding-left: 0; border-left: 0; }
  .latest-item { grid-template-columns: 150px minmax(0, 1fr) auto; }
  .latest-type { display: none; }
}

@media (max-width: 767px) {
  :root { --header-h: 60px; }
  .sheet-name { font-size: clamp(2.375rem, 11.5vw, 3rem); }
  .sheet-actions .btn { flex: 1 1 auto; }
  .sheet-stats div { grid-template-columns: 96px minmax(0, 1fr); }
  .lens { order: 2; margin-top: 0; }
  .sheet-card { order: 3; }
  .lens-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lens-options > :first-child { grid-column: 1 / -1; }
  .lens-btn { min-height: 56px; gap: 10px; padding: 8px 10px 8px 8px; }
  .lens-emblem { width: 36px; height: 36px; }
  .lens-name { font-size: 1rem; }
  .lens-role { font-size: .75rem; }
  .section-head-split { flex-direction: column; align-items: flex-start; }
  .missions { grid-template-columns: minmax(0, 1fr); }
  .missions > li:nth-child(n + 4) { display: none; }
  .mission article { padding: 20px 18px 16px; }
  .mission-meta { padding-right: 0; }
  .mission-title { font-size: 1.3125rem; }
  .mission-flag { position: static; align-self: flex-start; order: -1; margin-bottom: 10px; }
  .row, .xp-row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 16px; }
  .row .row-side, .row .row-toggle, .xp-row .row-toggle { grid-column: 1; grid-row: auto; justify-self: start; }
  .detail-list div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .clients { grid-template-columns: minmax(0, 1fr); }
  .clients-note { grid-column: 1; }
  .spotlight { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .spotlight-media.is-cover img { height: 150px; }
  .spotlight-media img { width: 96px; }
  .spotlight-actions .btn { flex: 1 1 100%; }
  .latest-item { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 2px; }
  .latest-date, .latest-title { grid-column: 1; }
  .latest-arrow { grid-column: 2; grid-row: 1 / span 2; }
  .closing { flex-direction: column; align-items: stretch; }
  .closing-actions { flex-direction: column; }
  .cta-panel { flex-direction: column; align-items: stretch; }
  .contact-actions { flex-direction: column; align-items: stretch; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .xp-item { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .xp-meta div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .contact-form .btn { justify-self: stretch; }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .about-grid .portrait-small { order: -1; width: 112px; }
  .pillars { grid-template-columns: minmax(0, 1fr); }
  .cs-layout { grid-template-columns: minmax(0, 1fr); }
  .cs-visual { position: static; }
  .cs-facts { grid-template-columns: minmax(0, 1fr); }
  .cs-facts div, .cs-facts div + div { padding: 14px 0 0; border-left: 0; }
  .filter-status { flex-basis: 100%; margin: 4px 0 0; }
  .cv-head { flex-direction: column; }
  .cv-contacts { text-align: left; }
  .cv-entry-head { flex-direction: column; gap: 0; }
  .cv-skills div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-nav a { min-height: 44px; }
  .books-header .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .books-header .header-inner { gap: 4px; }
  .books-nav a { padding: 0 10px; }
  .book { padding: 12px; gap: 0 12px; }
  .book-cover { width: 72px; height: auto; }
  .reading-order li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .author { grid-template-columns: 56px minmax(0, 1fr); }
}

@media (max-width: 360px) {
  .books-nav a { padding: 0 7px; font-size: .875rem; }
  .books-header .lang-link { min-width: 40px; padding: 0 4px; }
}

/* ---------- print (the /cv/ page) ---------- */

@media print {
  @page { size: A4; margin: 14mm 15mm; }
  :root { --paper: #fff; --tint: #fff; --surface: #fff; --text: #111; --muted: #555; --subtle: #666; --line: #ddd; --accent: #2447C9; }
  body { font-size: 10pt; line-height: 1.45; background: #fff; }
  .site-header, .site-footer, .skip-link, .cv-toolbar { display: none !important; }
  .section, .section-first { padding: 0; }
  .container { max-width: none; padding: 0; }
  .cv-doc { max-width: none; padding: 0; border: 0; border-radius: 0; font-size: 9.5pt; }
  .cv-name { font-size: 24pt; }
  .cv-block { margin-top: 14pt; }
  .cv-entry { break-inside: avoid; }
  .cv-entry + .cv-entry { margin-top: 9pt; }
  .cv-sub, .cv-date { font-size: 8.5pt; }
  a { color: inherit; }
}
