/* ==========================================================================
   Vittorio Iacovoni — foglio di stile unico del sito
   Design system: concetto "ledger" (filetti sottili, date in monospaziato)
   ========================================================================== */

/* ---------- Font self-hosted (licenza OFL, vedi /assets/fonts/) ---------- */
@font-face {
  font-family: 'Fraunces';
  src: url('/assets/fonts/fraunces-opsz-normal.woff2') format('woff2');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/assets/fonts/fraunces-opsz-italic.woff2') format('woff2');
  font-weight: 400 500;
  font-style: italic;
  font-display: swap;
}
@font-face { font-family: 'IBM Plex Sans'; src: url('/assets/fonts/plex-sans-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('/assets/fonts/plex-sans-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('/assets/fonts/plex-sans-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/fonts/plex-mono-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/fonts/plex-mono-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }

/* ---------- Variabili (unico punto in cui si definiscono i colori) ---------- */
:root {
  --navy-950: #0B1B33;
  --navy-800: #14284A;
  --paper: #EEF1F5;
  --ink: #13223B;
  --slate: #5A6B84;
  --gold: #A98338;        /* decorativo: filetti, ombre, bordi */
  --gold-ink: #85672A;    /* oro per il testo piccolo su carta (contrasto AA) */
  --gold-light: #D4B87A;  /* oro su fondo navy */
  --rule: #C9D0DA;
  --maxw: 1200px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 96px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.num, time { font-variant-numeric: tabular-nums; }

.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: -100px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-size: 14px;
  text-decoration: none;
}
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + 12px); }

/* ---------- Header ---------- */
header.topnav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: var(--paper);
}
.nav-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 22px 0 14px;
  border-bottom: 1.5px solid var(--ink);
  position: relative;
}
.brand { text-decoration: none; }
.brand .name {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.brand .sub {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--slate);
  margin-top: 3px;
}
nav.links { display: flex; gap: 28px; font-size: 14px; padding-bottom: 2px; }
nav.links a {
  text-decoration: none;
  color: var(--slate);
  padding-bottom: 3px;
  border-bottom: 1.5px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
nav.links a:hover { color: var(--ink); }
nav.links a[aria-current] { color: var(--ink); border-bottom-color: var(--gold); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink);
  width: 40px; height: 36px;
  font-size: 16px;
  cursor: pointer;
}
@media (max-width: 720px) {
  .nav-inner { align-items: center; }
  .js nav.links {
    position: absolute;
    top: calc(100% + 1.5px);
    left: -24px; right: -24px;
    background: var(--paper);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height .25s ease, visibility 0s linear .25s;
    box-shadow: 0 12px 24px rgba(11,27,51,0.08);
  }
  .js nav.links.open { max-height: 360px; visibility: visible; transition: max-height .25s ease; }
  .js nav.links a { padding: 14px 24px; border-bottom: 1px solid var(--rule); }
  .js nav.links a[aria-current] { border-left: 3px solid var(--gold); padding-left: 21px; border-bottom-color: var(--rule); }
  .js .nav-toggle { display: block; }
  /* senza JavaScript il menu resta visibile, su più righe */
  html:not(.js) .nav-inner { flex-wrap: wrap; gap: 12px; }
  html:not(.js) nav.links { flex-wrap: wrap; gap: 8px 20px; }
}

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  /* pannello navy che parte a destra e arriva al bordo della finestra */
  background: linear-gradient(90deg, var(--paper) 0 calc(50% + 190px), var(--navy-950) calc(50% + 190px) 100%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
  padding: 72px 0 80px;
}
.hero-kicker {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--slate);
  margin: 0 0 22px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 5.2vw, 58px);
  line-height: 1.07;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
  max-width: 15ch;
}
.hero-seek {
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 30px;
  max-width: 44ch;
}
.hero-seek strong { font-weight: 600; }
.degrees { margin: 0; padding: 0; list-style: none; max-width: 520px; }
.degrees li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}
.degrees li:last-child { border-bottom: 1px solid var(--rule); }
.degrees strong { display: block; font-size: 15px; font-weight: 600; }
.degrees span.school { display: block; font-size: 13.5px; color: var(--slate); margin-top: 2px; }
.degrees .when { font-family: var(--mono); font-size: 11.5px; color: var(--gold-ink); white-space: nowrap; }
.degrees-note {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--slate);
  margin: 12px 0 34px;
}
.actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 12px 22px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { border-color: var(--ink); }
.btn .fmt { font-family: var(--mono); font-size: 11px; opacity: .75; margin-left: 6px; }

/* ---------- Foto ---------- */
.portrait { margin: 0; position: relative; justify-self: end; width: 100%; max-width: 380px; }
.photo {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--navy-800);
  overflow: hidden;
  box-shadow: -18px 18px 0 0 var(--gold);
}
.photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}
.portrait figcaption {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: rgba(238,241,245,0.7);
  padding-left: 12px;
  border-left: 1.5px solid var(--gold);
}
/* su desktop la didascalia sta tutta sul pannello navy (a destra), altrimenti l'inizio finirebbe sul fondo chiaro */
@media (min-width: 861px) {
  .portrait figcaption { width: fit-content; max-width: 300px; margin-left: auto; margin-top: 30px; }
}
@media (max-width: 860px) {
  .hero { background: var(--paper); }
  .hero-grid { grid-template-columns: 1fr; gap: 44px; padding: 44px 0 56px; }
  .portrait { justify-self: start; max-width: 340px; margin-left: 18px; }
  .portrait figcaption { color: var(--slate); }
}

/* ---------- Fascia "prove" ---------- */
.proofs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin: 0;
  padding: 0;
  list-style: none;
}
.proofs li { background: var(--paper); padding: 20px 20px 18px; }
.proofs .fig {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  margin-bottom: 6px;
}
.proofs .lbl { display: block; font-size: 13.5px; color: var(--slate); line-height: 1.45; }
@media (max-width: 860px) { .proofs { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .proofs .fig { font-size: 19px; } .proofs li { padding: 16px 14px; } }

/* ---------- Sezioni ---------- */
.section { padding: 64px 0; border-top: 1px solid var(--rule); }
.section.first { border-top: 0; padding-top: 48px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 26px;
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  margin: 0;
}
.section-head .meta { font-family: var(--mono); font-size: 12px; color: var(--slate); }
.section-head a.meta { text-decoration: none; border-bottom: 1px solid var(--rule); }
.section-head a.meta:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- Righe "ledger" ---------- */
.ledger { margin: 0; padding: 0; list-style: none; }
.ledger-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 20px;
  align-items: baseline;
  padding: 17px 0;
  border-top: 1px solid var(--rule);
}
.ledger-row:last-child { border-bottom: 1px solid var(--rule); }
.ledger-row .period { font-family: var(--mono); font-size: 12px; color: var(--gold-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ledger-row strong, .ledger-row h2, .ledger-row h3 { display: block; font-size: 15.5px; font-weight: 600; margin: 0; }
.ledger-row h2 a, .ledger-row h3 a { text-decoration: none; }
.ledger-row h2 a:hover, .ledger-row h3 a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--gold); }
.ledger-row .desc > span, .ledger-row .desc > p { display: block; font-size: 14px; color: var(--slate); margin: 4px 0 0; line-height: 1.55; max-width: 62ch; }
.ledger-row .tag { font-family: var(--mono); font-size: 11.5px; color: var(--slate); text-align: right; white-space: nowrap; }
.ledger-row ul.points { margin: 10px 0 0; padding: 0; list-style: none; max-width: 64ch; }
.ledger-row ul.points li {
  position: relative;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.55;
  padding-left: 16px;
  margin-top: 5px;
}
.ledger-row ul.points li::before {
  content: "";
  position: absolute;
  left: 0; top: .72em;
  width: 7px; height: 1px;
  background: var(--gold);
}
.ledger-row .desc > .skills { display: block; margin-top: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--gold-ink); }
@media (max-width: 600px) {
  .ledger-row { grid-template-columns: 1fr; gap: 5px; }
  .ledger-row .tag { text-align: left; }
}

/* ---------- Aree di lavoro ---------- */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.focus-item { background: var(--paper); padding: 26px 22px 24px; display: flex; flex-direction: column; }
.focus-item h3 { font-family: var(--serif); font-size: 19px; font-weight: 500; margin: 0 0 10px; }
.focus-item p { font-size: 14px; color: var(--slate); margin: 0 0 18px; line-height: 1.6; }
.focus-item .tools { margin-top: auto; font-family: var(--mono); font-size: 11.5px; color: var(--gold-ink); }
.focus-item.lead { background: var(--navy-950); color: var(--paper); }
.focus-item.lead p { color: rgba(238,241,245,0.72); }
.focus-item.lead .tools { color: var(--gold-light); }
@media (max-width: 860px) { .focus-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .focus-grid { grid-template-columns: 1fr; } }

/* ---------- Scheda (etichetta a sinistra, contenuto a destra) ---------- */
.spec { margin: 0; }
.spec-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
}
.spec-row:last-child { border-bottom: 1px solid var(--rule); }
.spec-row dt, .spec-row h2 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--gold-ink);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 2px 0 0;
}
.spec-row dd { margin: 0; }
.spec-row .body p, .spec-row dd p { margin: 0 0 12px; font-size: 15.5px; line-height: 1.65; max-width: 64ch; }
.spec-row .body p:last-child, .spec-row dd p:last-child { margin-bottom: 0; }
.spec-row .body ul, .spec-row dd ul { margin: 0; padding-left: 18px; font-size: 15.5px; line-height: 1.65; max-width: 62ch; }
.spec-row .body li, .spec-row dd li { margin-bottom: 6px; }
.spec-row a { text-underline-offset: 3px; text-decoration-color: var(--gold); }
@media (max-width: 640px) { .spec-row { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- Pagine interne ---------- */
.page-head { padding: 64px 0 40px; }
.page-head .crumbs { font-family: var(--mono); font-size: 12px; color: var(--slate); margin: 0 0 18px; }
.page-head .crumbs a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.page-head .crumbs a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.page-head h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 5vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  max-width: 20ch;
}
.page-head .lede { font-size: 17px; line-height: 1.6; color: var(--slate); margin: 0; max-width: 58ch; }
.page-head .meta-line { font-family: var(--mono); font-size: 12px; color: var(--gold-ink); margin: 18px 0 0; }

.prose { max-width: 64ch; }
.prose p { font-size: 16.5px; line-height: 1.7; margin: 0 0 18px; }
.prose p:last-child { margin-bottom: 0; }

.note {
  font-size: 13.5px;
  color: var(--slate);
  line-height: 1.6;
  border-left: 1.5px solid var(--gold);
  padding-left: 14px;
  max-width: 64ch;
  margin: 28px 0 0;
}

.event-photo { margin: 40px 0 0; max-width: 640px; }
.event-photo img { display: block; width: 100%; height: auto; }
.event-photo figcaption {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--slate);
  padding-left: 12px;
  border-left: 1.5px solid var(--gold);
}

/* ---------- Chiusura ---------- */
.close-cta {
  padding: 72px 0 88px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}
.close-cta p {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.2;
  margin: 0;
  max-width: 22ch;
}

/* ---------- Footer ---------- */
footer { background: var(--navy-950); color: rgba(238,241,245,0.7); }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px 24px;
  padding: 26px 0 calc(30px + env(safe-area-inset-bottom, 0px));
  font-family: var(--mono);
  font-size: 11.5px;
}
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Movimento sobrio ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
