/* ==========================================================================
   GIOVANI IMPRENDITORI TRENTINO — design system
   Confcommercio Trentino · Gruppo Giovani Imprenditori del Terziario
   Editoriale: Newsreader (display) + Inter (testo). Chiaro/scuro automatico.
   ========================================================================== */

/* ------------------------------------------------------------------ token */
:root {
  /* superfici */
  --paper:        #fbf9f6;
  --paper-warm:   #f4efe7;
  --surface:      #ffffff;
  --surface-2:    #f7f4ef;
  --navy:         #0c2e52;
  --navy-deep:    #061626;
  --rule:         #e7e0d5;
  --rule-strong:  #d5cbbb;

  /* inchiostri */
  --ink:          #111c28;
  --ink-soft:     #3a4a5b;
  --mute:         #5c6875;
  --on-navy:      #fbf9f6;
  --on-navy-soft: #b6c6d8;

  /* accenti */
  --azure:        #0b4fbf;
  --azure-hover:  #093f9c;
  --azure-light:  #a9d2f5;
  --amber:        #9a5b12;
  --amber-bright: #e9b564;

  /* forma */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;

  /* ritmo */
  --shell:   min(100% - 2.5rem, 78rem);
  --shell-w: min(100% - 2.5rem, 64rem);
  --gap:     clamp(1.25rem, 0.8rem + 1.8vw, 2.5rem);
  --section: clamp(4.5rem, 3rem + 7vw, 9.5rem);

  /* tipografia fluida */
  --t-display: clamp(2.9rem, 1.1rem + 7.4vw, 6.75rem);
  --t-h1:      clamp(2.35rem, 1.3rem + 4.4vw, 4.4rem);
  --t-h2:      clamp(1.85rem, 1.25rem + 2.6vw, 3.1rem);
  --t-h3:      clamp(1.35rem, 1.1rem + 1.1vw, 1.9rem);
  --t-h4:      clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  --t-lead:    clamp(1.08rem, 1rem + 0.5vw, 1.32rem);
  --t-body:    1.0625rem;
  --t-small:   0.9375rem;
  --t-micro:   0.78rem;

  /* famiglie */
  --ff-display: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Palatino,
                'Times New Roman', serif;
  --ff-text:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto,
                'Helvetica Neue', Arial, sans-serif;

  /* movimento */
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:   cubic-bezier(0.55, 0, 0.45, 1);
  --dur:       0.55s;
  --dur-fast:  0.22s;

  /* ombre: morbide, mai grigio puro */
  --sh-1: 0 1px 2px rgb(12 46 82 / 0.05), 0 2px 8px rgb(12 46 82 / 0.04);
  --sh-2: 0 2px 6px rgb(12 46 82 / 0.06), 0 12px 30px rgb(12 46 82 / 0.08);
  --sh-3: 0 6px 16px rgb(12 46 82 / 0.08), 0 28px 60px rgb(12 46 82 / 0.12);

  --header-h: 76px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper:        #0a131d;
    --paper-warm:   #0f1b27;
    --surface:      #121e2c;
    --surface-2:    #172636;
    --navy:         #0a1928;
    --navy-deep:    #060f19;
    --rule:         #243447;
    --rule-strong:  #33465d;
    --ink:          #e9eef4;
    --ink-soft:     #c2ceda;
    --mute:         #97a6b6;
    --on-navy:      #e9eef4;
    --on-navy-soft: #9fb3c8;
    --azure:        #7fb2ff;
    --azure-hover:  #a3c8ff;
    --azure-light:  #2b4f7d;
    --amber:        #e5a94f;
    --amber-bright: #f0c684;
    --sh-1: 0 1px 2px rgb(0 0 0 / 0.3), 0 2px 8px rgb(0 0 0 / 0.25);
    --sh-2: 0 2px 6px rgb(0 0 0 / 0.35), 0 12px 30px rgb(0 0 0 / 0.35);
    --sh-3: 0 6px 16px rgb(0 0 0 / 0.4), 0 28px 60px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --paper:        #0a131d;
  --paper-warm:   #0f1b27;
  --surface:      #121e2c;
  --surface-2:    #172636;
  --navy:         #0a1928;
  --navy-deep:    #060f19;
  --rule:         #243447;
  --rule-strong:  #33465d;
  --ink:          #e9eef4;
  --ink-soft:     #c2ceda;
  --mute:         #97a6b6;
  --on-navy:      #e9eef4;
  --on-navy-soft: #9fb3c8;
  --azure:        #7fb2ff;
  --azure-hover:  #a3c8ff;
  --azure-light:  #2b4f7d;
  --amber:        #e5a94f;
  --amber-bright: #f0c684;
  --sh-1: 0 1px 2px rgb(0 0 0 / 0.3), 0 2px 8px rgb(0 0 0 / 0.25);
  --sh-2: 0 2px 6px rgb(0 0 0 / 0.35), 0 12px 30px rgb(0 0 0 / 0.35);
  --sh-3: 0 6px 16px rgb(0 0 0 / 0.4), 0 28px 60px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}

/* ------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-text);
  font-size: var(--t-body);
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }

/* elementi nascosti dal JS (filtri dell'archivio news): deve battere i
   display: flex/grid dei componenti, altrimenti restano visibili. */
[hidden] { display: none !important; }
img { height: auto; }
/* il colore di attesa sta sul contenitore della foto, non sull'immagine:
   sull'<img> farebbe da fondo anche ai PNG trasparenti, cioè al marchio */
.media, .person__photo, .tl__media { background: var(--surface-2); }
.sect--navy .media, .site-footer .media, .hero__bg { background: var(--navy-deep); }
input, button, textarea, select { font: inherit; color: inherit; }
p, h1, h2, h3, h4, h5, h6, li { overflow-wrap: break-word; }

::selection { background: var(--navy); color: var(--on-navy); }

:where(a):focus-visible,
:where(button):focus-visible,
:where(input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2.5px solid var(--azure);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* -------------------------------------------------------------- tipografia */
h1, h2, h3, h4, .display, .t-display {
  font-family: var(--ff-display);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.021em;
  text-wrap: balance;
}
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); line-height: 1.18; letter-spacing: -0.015em; }
h4 { font-size: var(--t-h4); line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; }

.t-display {
  font-size: var(--t-display);
  line-height: 0.96;
  letter-spacing: -0.033em;
  font-weight: 500;
}
.lead {
  font-size: var(--t-lead);
  line-height: 1.55;
  color: var(--ink-soft);
  text-wrap: pretty;
  max-width: 62ch;
}
.small { font-size: var(--t-small); }
.mute  { color: var(--mute); }

/* occhiello: piccolo, maiuscoletto, con filetto */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  font-family: var(--ff-text);
}
.eyebrow::before {
  content: '';
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  flex: none;
}
.eyebrow--plain::before { display: none; }
.on-dark .eyebrow,
.sect--navy .eyebrow,
.hero--page .eyebrow,
.hero--home .eyebrow,
.site-footer .eyebrow { color: var(--amber-bright); }

/* numero/anno in evidenza */
.figure-num {
  font-family: var(--ff-display);
  font-weight: 400;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}

a { color: inherit; }
.link {
  color: var(--azure);
  text-decoration: none;
  font-weight: 500;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size var(--dur-fast) var(--ease), color var(--dur-fast);
}
.link:hover { background-size: 100% 1.5px; color: var(--azure-hover); }

/* link con freccia, il pattern ricorrente del sito */
.arrow-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 550;
  font-size: var(--t-small);
  color: var(--azure);
  text-decoration: none;
  letter-spacing: -0.005em;
}
.arrow-link span:last-child {
  transition: transform var(--dur-fast) var(--ease);
  display: inline-block;
}
.arrow-link:hover span:last-child { transform: translateX(4px); }
.arrow-link:hover span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.on-dark .arrow-link, .sect--navy .arrow-link { color: var(--amber-bright); }

/* -------------------------------------------------------------- primitive */
.shell { width: var(--shell); margin-inline: auto; }
.shell-narrow { width: var(--shell-w); margin-inline: auto; }

.sect { padding-block: var(--section); position: relative; }
.sect--tight { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem); }
.sect--paper { background: var(--paper-warm); }
.sect--surface { background: var(--surface); }
.sect--navy {
  background: var(--navy);
  color: var(--on-navy);
}
.sect--navy h1, .sect--navy h2, .sect--navy h3 { color: var(--on-navy); }
.sect--navy .lead, .sect--navy .mute { color: var(--on-navy-soft); }

.rule { height: 1px; background: var(--rule); border: 0; }

/* intestazione di sezione: occhiello + titolo + lead + link */
.sect-head {
  display: grid;
  gap: 1rem;
  margin-bottom: clamp(2.25rem, 1.5rem + 2.5vw, 3.75rem);
  max-width: 54rem;
}
.sect-head__text { display: grid; gap: 1rem; max-width: 54rem; }
.sect-head--split {
  max-width: none;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
}
@media (min-width: 62rem) {
  .sect-head--split {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: clamp(1.5rem, 1rem + 3vw, 4rem);
  }
  .sect-head--split > .sect-head__aside { justify-self: end; white-space: nowrap; }
}

.grid { display: grid; gap: var(--gap); }
.g-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.g-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.g-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr)); }

.stack > * + * { margin-top: 1.15em; }
.stack-lg > * + * { margin-top: 2rem; }
.flow p + p { margin-top: 1.1em; }

/* --------------------------------------------------------------- immagini */
.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--surface-2);
  isolation: isolate;
}
.media > picture, .hero__bg > picture { display: block; width: 100%; height: 100%; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--16-9  { aspect-ratio: 16 / 9; }
.media--16-10 { aspect-ratio: 16 / 10; }
.media--4-3   { aspect-ratio: 4 / 3; }
.media--4-5   { aspect-ratio: 4 / 5; }
.media--1-1   { aspect-ratio: 1; }

/* velo per il testo sopra foto */
.media--veil::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgb(6 22 38 / 0.82) 0%,
    rgb(6 22 38 / 0.46) 38%,
    rgb(6 22 38 / 0.08) 72%,
    rgb(6 22 38 / 0) 100%
  );
}
.media--zoom img { transition: transform 0.9s var(--ease); }
a:hover .media--zoom img, .card:hover .media--zoom img { transform: scale(1.045); }

figure.fig { display: grid; gap: 0.75rem; }
figure.fig figcaption {
  font-size: var(--t-small);
  color: var(--mute);
  line-height: 1.5;
  padding-left: 0.9rem;
  border-left: 2px solid var(--rule-strong);
}

/* ---------------------------------------------------------------- bottoni */
.btn {
  --btn-bg: var(--navy);
  --btn-fg: var(--on-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background-color var(--dur-fast), color var(--dur-fast),
              border-color var(--dur-fast);
  box-shadow: var(--sh-1);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.btn:active { transform: translateY(0); }
.btn--accent { --btn-bg: var(--azure); --btn-fg: #fff; }
:root[data-theme='dark'] .btn--accent,
:root:not([data-theme='light']) .btn--accent { --btn-fg: #06182c; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) .btn--accent { --btn-fg: #fff; }
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--rule-strong);
  box-shadow: none;
}
.btn--ghost:hover { border-color: var(--ink); box-shadow: var(--sh-1); }
.btn--light { --btn-bg: var(--on-navy); --btn-fg: var(--navy-deep); }
.btn--outline-light {
  --btn-bg: transparent;
  --btn-fg: var(--on-navy);
  border-color: rgb(255 255 255 / 0.32);
  box-shadow: none;
}
.btn--outline-light:hover { border-color: rgb(255 255 255 / 0.72); }
.btn--sm { padding: 0.6rem 1.15rem; font-size: 0.86rem; }
.btn--block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* ------------------------------------------------------------------ pill  */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
.pill--accent { border-color: transparent; background: var(--navy); color: var(--on-navy); }
.pill--amber  { border-color: transparent; background: color-mix(in srgb, var(--amber) 16%, var(--paper)); color: var(--amber); }
a.pill { transition: border-color var(--dur-fast), background-color var(--dur-fast), color var(--dur-fast); }
a.pill:hover { border-color: var(--ink); color: var(--ink); }
a.pill[aria-pressed='true'], a.pill.is-on {
  background: var(--navy); color: var(--on-navy); border-color: transparent;
}

/* ------------------------------------------------------------------ card  */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              border-color var(--dur-fast);
}
.card--flat { background: transparent; border: 0; padding: 0; }
.card--media { padding: 0; overflow: hidden; }
.card--media > .card__body { padding: 1.4rem 1.5rem 1.6rem; display: grid; gap: 0.7rem; }
.card:hover { border-color: var(--rule-strong); box-shadow: var(--sh-2); transform: translateY(-3px); }
.card--flat:hover { box-shadow: none; transform: none; }

/* tutta la card cliccabile senza annidare <a> */
.card__link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.card__link { text-decoration: none; color: inherit; }
.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--mute);
}
.card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.card h3 a { text-decoration: none; }

/* card numerata (servizi, moduli) */
.card--num { padding-top: 1.35rem; }
.card--num .figure-num {
  font-size: 2.4rem;
  color: var(--amber);
  opacity: 0.85;
  margin-bottom: -0.25rem;
}

/* ---------------------------------------------------------------- persona */
.person { display: grid; gap: 0.9rem; }
.person__photo {
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--surface-2);
  position: relative;
}
.person__photo > picture { display: block; width: 100%; height: 100%; }
.person__photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.92) contrast(1.02);
  transition: transform 0.8s var(--ease), filter var(--dur) var(--ease);
}
.person:hover .person__photo img { transform: scale(1.04); filter: saturate(1) contrast(1.04); }
.person__role {
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--amber);
}
.person__name { font-size: 1.3rem; line-height: 1.15; }
.person__sector { font-size: var(--t-small); color: var(--mute); }

/* ------------------------------------------------------------------ quote */
.quote {
  font-family: var(--ff-display);
  font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.9rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  font-weight: 400;
  text-wrap: balance;
}
.quote--italic { font-style: italic; }
.quote__by {
  display: block;
  margin-top: 1.5rem;
  font-family: var(--ff-text);
  font-size: var(--t-small);
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--amber);
}
.sect--navy .quote__by { color: var(--amber-bright); }

/* --------------------------------------------------------------- timeline */
.tl { display: grid; gap: 0; position: relative; }
.tl__item {
  display: grid;
  gap: 1.25rem;
  padding-block: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  border-top: 1px solid var(--rule);
  position: relative;
}
.tl__item:last-child { border-bottom: 1px solid var(--rule); }
@media (min-width: 52rem) {
  .tl__item {
    grid-template-columns: 7.5rem minmax(0, 1fr) minmax(0, 0.85fr);
    gap: clamp(1.5rem, 1rem + 2vw, 3rem);
    align-items: start;
  }
}
.tl__year {
  font-family: var(--ff-display);
  font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.7rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  color: var(--amber);
  font-weight: 400;
}
.tl__body { display: grid; gap: 0.8rem; }
.tl__media { border-radius: var(--r-md); overflow: hidden; aspect-ratio: 16/10; }
.tl__media > picture { display: block; width: 100%; height: 100%; }
.tl__media img { width: 100%; height: 100%; object-fit: cover; }

/* -------------------------------------------------------------- accordion */
details.acc {
  border-top: 1px solid var(--rule);
  padding-block: 0.35rem;
}
details.acc:last-of-type { border-bottom: 1px solid var(--rule); }
details.acc > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-block: 1.15rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.008em;
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after {
  content: '';
  flex: none;
  width: 0.65rem; height: 0.65rem;
  border-right: 1.8px solid var(--mute);
  border-bottom: 1.8px solid var(--mute);
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--dur-fast) var(--ease);
}
details.acc[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
details.acc > .acc__body { padding-bottom: 1.35rem; color: var(--ink-soft); max-width: 62ch; }

/* ------------------------------------------------------------------ stats */
.stat { display: grid; gap: 0.35rem; }
.stat__n {
  font-family: var(--ff-display);
  font-size: clamp(2.6rem, 1.8rem + 3vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 400;
}
.stat__label {
  font-size: var(--t-small);
  color: var(--mute);
  line-height: 1.4;
  max-width: 22ch;
}
.sect--navy .stat__label { color: var(--on-navy-soft); }

/* ------------------------------------------------------------------ input */
.field { display: grid; gap: 0.4rem; }
.field > label {
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: -0.005em;
}
.field > .hint { font-size: var(--t-micro); color: var(--mute); }
.input, input[type='text'], input[type='email'], input[type='password'],
input[type='search'], input[type='tel'], textarea, select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--t-small);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input:focus, input:focus, textarea:focus, select:focus {
  border-color: var(--azure);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--azure) 18%, transparent);
  outline: none;
}
textarea { min-height: 8rem; resize: vertical; line-height: 1.6; }
::placeholder { color: var(--mute); opacity: 1; }

.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--r-sm);
  font-size: var(--t-small);
  border: 1px solid;
}
.alert--ok  { border-color: color-mix(in srgb, #1a7f4b 40%, transparent); background: color-mix(in srgb, #1a7f4b 10%, var(--surface)); color: color-mix(in srgb, #1a7f4b 80%, var(--ink)); }
.alert--err { border-color: color-mix(in srgb, #b3261e 40%, transparent); background: color-mix(in srgb, #b3261e 10%, var(--surface)); color: color-mix(in srgb, #b3261e 80%, var(--ink)); }

/* ----------------------------------------------------------------- header */
.skip {
  position: absolute;
  left: 1rem; top: 0.6rem;
  transform: translateY(-160%);
  z-index: 200;
  background: var(--navy);
  color: var(--on-navy);
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-size: var(--t-small);
  font-weight: 600;
  transition: transform var(--dur-fast) var(--ease);
}
.skip:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.site-header.is-stuck { border-bottom-color: var(--rule); }
@supports not (backdrop-filter: blur(1px)) { .site-header { background: var(--paper); } }

.nav {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  flex: none;
  min-width: 0;
}
.brand__logo { display: block; flex: none; }
/* il marchio è bianco per natura: sui fondi chiari si mostra la versione navy,
   sui fondi scuri quella originale. Una sola delle due è visibile alla volta. */
.brand__logo--scuro { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .brand__logo--chiaro { display: none; }
  :root:not([data-theme='light']) .brand__logo--scuro  { display: block; }
}
:root[data-theme='dark'] .brand__logo--chiaro { display: none; }
:root[data-theme='dark'] .brand__logo--scuro  { display: block; }
:root[data-theme='light'] .brand__logo--chiaro { display: block; }
:root[data-theme='light'] .brand__logo--scuro  { display: none; }
/* dentro il menu mobile e il footer il fondo è sempre navy */
.menu .brand__logo--chiaro, .site-footer .brand__logo--chiaro { display: none; }
.menu .brand__logo--scuro,  .site-footer .brand__logo--scuro  { display: block; }
.brand__logo img {
  display: block;
  width: auto;
  height: 30px;
  max-width: none;
}
@media (min-width: 40rem) { .brand__logo img { height: 34px; } }
.brand__sep {
  width: 1px;
  height: 26px;
  background: var(--rule-strong);
  flex: none;
}
.brand--negativo .brand__sep,
.site-footer .brand__sep { background: rgb(255 255 255 / 0.3); }
.brand__loc {
  font-family: var(--ff-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  white-space: nowrap;
}
.brand--negativo .brand__loc { color: var(--on-navy); }
@media (max-width: 24rem) {
  .brand__logo img { height: 26px; }
  .brand__sep, .brand__loc { display: none; }
}

.nav__links { display: none; }
@media (min-width: 64rem) {
  .nav__links {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    margin-inline: auto;
  }
}
.nav__link {
  position: relative;
  padding: 0.5rem 0.8rem;
  border-radius: var(--r-sm);
  font-size: 0.925rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: color var(--dur-fast), background-color var(--dur-fast);
}
.nav__link:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav__link[aria-current='page'] { color: var(--ink); font-weight: 650; }
.nav__link[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 0.8rem; right: 0.8rem; bottom: 0.18rem;
  height: 2px;
  border-radius: 2px;
  background: var(--amber);
}

.nav__actions { display: flex; align-items: center; gap: 0.5rem; flex: none; }
.icon-btn {
  width: 40px; height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: transparent;
  cursor: pointer;
  color: var(--ink-soft);
  transition: border-color var(--dur-fast), color var(--dur-fast), background-color var(--dur-fast);
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.nav__cta { display: none; }
@media (min-width: 48rem) { .nav__cta { display: inline-flex; } }
.nav__burger { display: inline-grid; }
@media (min-width: 64rem) { .nav__burger { display: none; } }

/* fra 1024 e 1248 px otto voci + marchio + azioni non ci stanno: si stringe */
@media (min-width: 64rem) and (max-width: 77.99rem) {
  .nav__link { padding: 0.5rem 0.55rem; font-size: 0.87rem; }
  .brand__sep, .brand__loc { display: none; }
  .brand__logo img { height: 30px; }
  .nav__cta { display: none; }
}
@media (min-width: 78rem) {
  .nav__links { gap: 0.25rem; }
}


/* menu mobile */
.menu {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--navy);
  color: var(--on-navy);
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-fast) var(--ease), visibility var(--dur-fast);
}
.menu[data-open='true'] { opacity: 1; visibility: visible; }
.menu__top { display: flex; align-items: center; justify-content: space-between; }
.menu__top .icon-btn { border-color: rgb(255 255 255 / 0.25); color: var(--on-navy); }
.menu__body {
  align-content: start;
  display: grid;
  gap: 0.15rem;
  padding-block: 1.5rem 3rem;
  overflow-y: auto;
}
.menu__link {
  font-family: var(--ff-display);
  font-size: clamp(1.7rem, 1.2rem + 2.6vw, 2.5rem);
  letter-spacing: -0.025em;
  text-decoration: none;
  color: var(--on-navy);
  padding-block: 0.38rem;
  opacity: 0;
  transform: translateY(14px);
}
.menu[data-open='true'] .menu__link {
  animation: menuIn 0.5s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 45ms + 60ms);
}
@keyframes menuIn { to { opacity: 1; transform: none; } }
.menu__foot {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 0.16);
  display: grid;
  gap: 0.6rem;
  font-size: var(--t-small);
  color: var(--on-navy-soft);
}
body.is-locked { overflow: hidden; }

/* ----------------------------------------------------------------- footer */
.site-footer {
  background: var(--navy-deep);
  color: var(--on-navy);
  padding-block: clamp(3.5rem, 2.5rem + 4vw, 6rem) 2.5rem;
}
.site-footer a:not(.btn) { color: var(--on-navy-soft); text-decoration: none; }
.site-footer a:not(.btn):hover { color: var(--on-navy); text-decoration: underline; text-underline-offset: 3px; }
.footer__grid {
  display: grid;
  gap: clamp(2rem, 1.5rem + 3vw, 3.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
.footer__grid h2 {
  font-family: var(--ff-text);
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--on-navy-soft);
  margin-bottom: 1rem;
}
.footer__list { list-style: none; padding: 0; display: grid; gap: 0.55rem; font-size: var(--t-small); }
.footer__bottom {
  margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
  padding-top: 1.75rem;
  border-top: 1px solid rgb(255 255 255 / 0.14);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  justify-content: space-between;
  align-items: center;
  font-size: var(--t-micro);
  color: var(--on-navy-soft);
}
.footer__brand {
  margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  padding-top: clamp(2rem, 1.5rem + 2vw, 3rem);
  border-top: 1px solid rgb(255 255 255 / 0.14);
}
.footer__brand .brand__logo img { height: 42px; width: auto; max-width: 100%; }
@media (min-width: 48rem) { .footer__brand .brand__logo img { height: 54px; } }

/* ------------------------------------------------------------------- hero */
.hero { position: relative; overflow: clip; isolation: isolate; }
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 32%; }
.hero__bg::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(105deg, rgb(6 22 38 / 0.94) 0%, rgb(6 22 38 / 0.78) 42%, rgb(6 22 38 / 0.42) 100%),
    linear-gradient(to top, rgb(6 22 38 / 0.65), rgb(6 22 38 / 0) 55%);
}
.hero--home {
  color: var(--on-navy);
  background: var(--navy-deep);
  padding-block: clamp(5rem, 3rem + 11vw, 10.5rem) clamp(3.5rem, 2.5rem + 6vw, 7rem);
  min-height: min(92svh, 58rem);
  display: grid;
  align-items: end;
}
.hero__inner { position: relative; z-index: 1; display: grid; gap: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
@media (min-width: 62rem) {
  .hero__inner { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr); align-items: end; column-gap: clamp(2rem, 1rem + 4vw, 5rem); }
}
.hero__title { color: var(--on-navy); max-width: 16ch; }
.hero__aside { display: grid; gap: 1.5rem; align-content: end; }
.hero__lead { color: var(--on-navy-soft); font-size: var(--t-lead); line-height: 1.55; max-width: 44ch; }

/* hero interna, compatta */
.hero--page {
  background: var(--navy);
  color: var(--on-navy);
  padding-block: clamp(4rem, 2.5rem + 7vw, 8rem) clamp(2.75rem, 2rem + 4vw, 5rem);
  position: relative;
  overflow: clip;
}
.hero--page > * { position: relative; z-index: 1; }
.hero--page .lead { color: var(--on-navy-soft); }
.hero--page h1 { max-width: 18ch; }
.hero__meta {
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem;
  font-size: var(--t-small);
  color: var(--on-navy-soft);
}

/* punto accento: ambra scura sui fondi chiari (contrasto 4.29), chiara sui fondi scuri */
.dot-accent { color: #a8681a; }
.sect--navy .dot-accent,
.hero--page .dot-accent,
.hero--home .dot-accent,
.site-footer .dot-accent { color: var(--amber-bright); }
:root[data-theme='dark'] .dot-accent { color: var(--amber-bright); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .dot-accent { color: var(--amber-bright); }
}

/* briciole */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--mute);
  list-style: none; padding: 0;
}
.crumbs a { text-decoration: none; color: inherit; }
.crumbs a:hover { color: var(--ink); }
.crumbs li + li::before { content: '/'; margin-right: 0.5rem; opacity: 0.5; }
.hero--page .crumbs { color: var(--on-navy-soft); }
.hero--page .crumbs a:hover { color: var(--on-navy); }

/* ------------------------------------------------------------- articolo   */
.prose { max-width: 40rem; font-size: 1.1rem; line-height: 1.72; color: var(--ink-soft); }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-size: var(--t-h3); color: var(--ink); margin-top: 2.2em; }
.prose h3 { font-size: var(--t-h4); color: var(--ink); margin-top: 1.9em; font-family: var(--ff-text); font-weight: 700; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose a { color: var(--azure); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose ul, .prose ol { padding-left: 1.3em; display: grid; gap: 0.5em; }
.prose li::marker { color: var(--amber); }
.prose blockquote {
  margin: 2em 0;
  padding-left: 1.4em;
  border-left: 3px solid var(--amber);
  font-family: var(--ff-display);
  font-size: 1.32em;
  line-height: 1.4;
  font-style: italic;
  color: var(--ink);
}
.prose figure { margin-block: 2em; }
.prose img { border-radius: var(--r-md); width: 100%; }
.prose figcaption { font-size: var(--t-small); color: var(--mute); margin-top: 0.7rem; }
.prose .lede {
  font-size: 1.28em;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 400;
  font-family: var(--ff-display);
}

/* ------------------------------------------------------------------ altro */
.tag-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.split {
  display: grid;
  gap: clamp(1.75rem, 1rem + 4vw, 4.5rem);
  align-items: center;
}
@media (min-width: 58rem) {
  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split--wide-left { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
  .split--wide-right { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
  .split--flip > :first-child { order: 2; }
}

.marquee {
  overflow: hidden;
  border-block: 1px solid var(--rule);
  padding-block: 1.15rem;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  gap: 3.5rem;
  width: max-content;
  animation: slide 46s linear infinite;
  font-family: var(--ff-display);
  font-size: clamp(1.15rem, 0.9rem + 0.9vw, 1.6rem);
  color: var(--mute);
  letter-spacing: -0.015em;
  white-space: nowrap;
  align-items: center;
}
.marquee__track > span::after { content: '·'; margin-left: 3.5rem; opacity: 0.45; }
@keyframes slide { to { transform: translateX(-50%); } }
.marquee:hover .marquee__track { animation-play-state: paused; }

/* rivelazione allo scroll */
[data-reveal] { opacity: 0; transform: translateY(18px); }
[data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0ms);
}
.no-js [data-reveal] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .marquee__track { animation: none; }
}

/* barra di avanzamento lettura */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2.5px;
  background: var(--amber);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 110;
}

/* il focus programmatico su <main> non deve disegnare un contorno gigante */
main:focus { outline: none; }
main:focus-visible { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.center { text-align: center; }
.center .lead, .center .sect-head { margin-inline: auto; }
.maxw-sm { max-width: 34rem; }
.maxw-md { max-width: 46rem; }
.maxw-lg { max-width: 58rem; }
