/* A GROUP — site styles. Plan: docs/design.md */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --notte: #0a1a33;
  --notte-2: #10264a;
  --notte-3: #071327;
  --inchiostro: #14233d;
  --grigio: #5a6678;
  --blu: #1e5bd8;
  --arancio: #f28c28;
  --arancio-2: #ffa04a;
  --carta: #f3f5f8;
  --linea: #d9dee6;
  --bianco: #fff;

  --wrap: 1320px;
  --pad: clamp(20px, 5vw, 64px);
  --sec: clamp(88px, 11vw, 156px);
  --notch: clamp(28px, 4vw, 56px);
  --header-h: 84px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.125rem;
  font-stretch: 100%;
  line-height: 1.6;
  color: var(--inchiostro);
  background: var(--bianco);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; text-wrap: pretty; }
ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }

h1, h2, h3 {
  margin: 0;
  font-stretch: 118%;
  font-weight: 760;
  line-height: 1.04;
  letter-spacing: -.02em;
  text-wrap: balance;
}

/* Blue ring on light grounds (orange is under 3:1 on white); orange on navy. */
:focus-visible { outline: 3px solid var(--blu); outline-offset: 3px; }
.hero :focus-visible,
.dark :focus-visible,
.site-footer :focus-visible,
.site-header:not(.is-solid) :focus-visible,
body.nav-open .site-header :focus-visible { outline-color: var(--arancio); }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--pad));
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip {
  position: absolute;
  left: 16px;
  top: -120px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--arancio);
  color: var(--notte);
  font-weight: 650;
  text-decoration: none;
}
.skip:focus { top: 16px; }
/* The skip link moves focus to main (tabindex="-1"); the region itself needs no ring. */
main[tabindex="-1"]:focus { outline: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 14px 28px;
  border: 1.5px solid transparent;
  font: inherit;
  font-size: 1rem;
  font-stretch: 108%;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.btn--primary { background: var(--arancio); color: var(--notte); }
.btn--primary:hover { background: var(--arancio-2); }
.btn--ghost { color: var(--bianco); border-color: rgba(255, 255, 255, .55); }
.btn--ghost:hover { border-color: var(--bianco); background: rgba(255, 255, 255, .08); }
.btn--dark { background: var(--notte); color: var(--bianco); }
.btn--dark:hover { background: var(--notte-2); }

/* ---------- Header ---------- */

.top-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 32px; pointer-events: none; }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  color: var(--bianco);
  transition: background-color .3s, color .3s, box-shadow .3s;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 -48px;
  background: linear-gradient(rgba(7, 19, 39, .6), rgba(7, 19, 39, 0));
  pointer-events: none;
  transition: opacity .3s;
}
.site-header.is-solid {
  background: var(--bianco);
  color: var(--notte);
  box-shadow: 0 1px 0 var(--linea);
}
.site-header.is-solid::before { opacity: 0; }

.site-header__in {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.brand__logo { width: auto; height: 42px; }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.2vw, 34px); }
.nav__link,
.nav__drop-btn {
  padding: 8px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 1rem;
  font-weight: 560;
  text-decoration: none;
  cursor: pointer;
}
.nav__link:hover,
.nav__drop-btn:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1.5px; }
.nav .btn { min-height: 46px; padding: 10px 22px; }

.nav__item { position: relative; }
.nav__drop-btn { display: inline-flex; align-items: center; gap: 8px; }
.nav__drop-btn svg { width: 12px; height: 12px; transition: transform .2s; }
.nav__drop-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.nav__menu {
  position: absolute;
  top: calc(100% + 16px);
  left: -24px;
  min-width: 300px;
  padding: 10px 0;
  background: var(--bianco);
  color: var(--notte);
  box-shadow: 0 28px 56px -16px rgba(10, 26, 51, .32), 0 0 0 1px rgba(10, 26, 51, .06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.nav__menu::before { content: ""; position: absolute; inset: -18px 0 auto; height: 18px; }
.nav__menu.is-open { opacity: 1; visibility: visible; transform: none; }
.nav__menu a { display: block; padding: 10px 24px; font-size: 1rem; font-weight: 520; text-decoration: none; }
.nav__menu a:hover { background: var(--carta); color: var(--blu); }

/* The desktop list is white even under the transparent header. */
@media (min-width: 1041px) {
  .site-header .nav__menu a:focus-visible { outline-color: var(--blu); outline-offset: -3px; }
}

@media (hover: hover) and (min-width: 1041px) {
  .nav__item:hover .nav__menu { opacity: 1; visibility: visible; transform: none; }
  /* After a pick, hover does not reopen the list until the pointer leaves (main.js). */
  .nav__item.is-picked:hover .nav__menu:not(.is-open) { opacity: 0; visibility: hidden; transform: translateY(-6px); }
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-right: -12px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.nav-toggle svg { width: 26px; height: 26px; }
.nav-toggle .i-close { display: none; }
.nav-toggle[aria-expanded="true"] .i-open { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: block; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: grid;
  /* Without an explicit 0 minimum the track grows to the h1's longest word and the hero runs past a 320 px screen. */
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  color: var(--bianco);
  background: var(--notte);
}
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media picture, .dark__media picture { display: contents; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 19, 39, .9) 0%, rgba(7, 19, 39, .7) 36%, rgba(7, 19, 39, .2) 70%, rgba(7, 19, 39, .06) 100%),
    linear-gradient(0deg, rgba(7, 19, 39, .7) 0%, rgba(7, 19, 39, 0) 46%);
}
.hero__in { padding-block: calc(var(--header-h) + 72px) clamp(72px, 12vh, 136px); }
.hero h1 {
  max-width: 15.5ch;
  /* «Progettiamo» is 7.43em wide: below 375 px a fixed 2.6rem floor would push it off screen. */
  font-size: clamp(min(2.6rem, 11vw), 1.1rem + 5.2vw, 5.6rem);
  font-stretch: 125%;
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.025em;
}
.hero__lead {
  max-width: 58ch;
  margin-top: 30px;
  font-size: clamp(1.06rem, .96rem + .4vw, 1.3rem);
  color: rgba(255, 255, 255, .86);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 42px; }

@media (prefers-reduced-motion: no-preference) {
  .hero__media img { animation: settle 2.6s var(--ease) both; }
  .hero__in > * { animation: rise 1s var(--ease) both; }
  .hero__in > :nth-child(2) { animation-delay: .14s; }
  .hero__in > :nth-child(3) { animation-delay: .28s; }
}
@keyframes settle { from { transform: scale(1.07); } to { transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */

.section { padding-block: var(--sec); }
.section--carta { background: var(--carta); }

.h2 { font-size: clamp(2.05rem, 1.25rem + 2.7vw, 3.6rem); }
.intro { max-width: 50ch; margin-top: 26px; font-size: 1.15rem; color: var(--grigio); }

.notch { clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% 100%, 0 100%); }

/* Attività: overview */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 104px);
  align-items: start;
}
.split__head { position: sticky; top: calc(var(--header-h) + 40px); container-type: inline-size; }
/* «comunicazione.» is 8.8em wide: cap the heading to its column so the longest word never overflows. */
.split__head .h2 { font-size: min(clamp(2.05rem, 1.25rem + 2.7vw, 3.6rem), 10.9cqi); }

.areas { border-top: 1px solid var(--linea); container-type: inline-size; }
.areas li { border-bottom: 1px solid var(--linea); }
.areas a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 12px 32px;
  align-items: baseline;
  padding: 30px 0;
  text-decoration: none;
}
.areas__t {
  font-size: clamp(1.3rem, 1.02rem + .95vw, 1.8rem);
  /* The title column is (width - 32px) / 2.2: the cap keeps «Comunicazione» and «Organizzazione» inside it. */
  font-size: min(clamp(1.3rem, 1.02rem + .95vw, 1.8rem), 4.6cqi);
  font-stretch: 116%;
  font-weight: 720;
  line-height: 1.15;
  letter-spacing: -.012em;
  transition: color .2s;
}
.areas__d { font-size: 1rem; color: var(--grigio); }
.areas a:hover .areas__t { color: var(--blu); }

/* Chi siamo */
.about {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(40px, 6vw, 104px);
  align-items: center;
}
.about__txt p { margin-top: 20px; color: var(--grigio); }
.about__txt .h2 + p { margin-top: 30px; color: var(--inchiostro); font-size: 1.2rem; }
.about__txt .btn { margin-top: 38px; }

/* Area detail */
.area { padding-block: clamp(64px, 8vw, 120px); }
.area + .area { padding-top: 0; }
.area__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 104px);
  align-items: center;
}
.area--flip .area__media { order: 2; }
.area__title { font-size: clamp(1.8rem, 1.25rem + 1.8vw, 2.75rem); }
.area__txt p { max-width: 52ch; margin-top: 22px; color: var(--grigio); }
.ticks { display: grid; gap: 12px; margin-top: 30px; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .78em;
  width: 16px;
  height: 2px;
  background: var(--blu);
}

/* Metodo */
.dark {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: var(--bianco);
  background: var(--notte);
}
.dark__media { position: absolute; inset: 0; z-index: -2; }
.dark__media img { width: 100%; height: 100%; object-fit: cover; }
.dark::before { content: ""; position: absolute; inset: 0; z-index: -1; }
.metodo::before { background: linear-gradient(180deg, rgba(10, 26, 51, .93), rgba(10, 26, 51, .8)); }
.dark .intro { color: rgba(255, 255, 255, .74); }

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 48px);
  margin-top: clamp(56px, 7vw, 96px);
}
.steps li { padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, .24); }
.steps__n {
  display: block;
  font-size: clamp(2.6rem, 2rem + 2vw, 4.2rem);
  font-stretch: 125%;
  font-weight: 800;
  line-height: 1;
}
.steps h3 { margin-top: 22px; font-size: 1.45rem; font-stretch: 112%; }
.steps p { margin-top: 12px; font-size: 1rem; color: rgba(255, 255, 255, .74); }

/* Lavora con noi */
.join {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 6vw, 104px);
  align-items: center;
}
.join__txt p { margin-top: 22px; color: var(--grigio); }
.join__txt .h2 + p { margin-top: 30px; color: var(--inchiostro); font-size: 1.2rem; }
.join__txt .btn { margin-top: 38px; }
.fine { font-size: .92rem; }
.fine a { color: var(--blu); }

/* Contatti */
.contatti::before { background: linear-gradient(90deg, rgba(7, 19, 39, .94) 0%, rgba(7, 19, 39, .84) 50%, rgba(7, 19, 39, .66) 100%); }
.contatti h2 {
  max-width: 13ch;
  font-size: clamp(2.5rem, 1.2rem + 4.6vw, 5.4rem);
  font-stretch: 125%;
  font-weight: 800;
  line-height: .98;
}
.contatti .intro { font-size: 1.25rem; }
/* Flex wrap: an entry moves to the next line instead of running into its neighbour. */
.contatti__list {
  display: flex;
  flex-wrap: wrap;
  gap: 28px clamp(32px, 5vw, 88px);
  margin-top: 56px;
}
.contatti__list dt { font-size: .95rem; font-weight: 560; color: rgba(255, 255, 255, .66); }
.contatti__list dd { margin-top: 6px; font-size: 1.15rem; font-weight: 600; }
.contatti__list a { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .4); text-underline-offset: 5px; }
.contatti__list a:hover { text-decoration-color: currentColor; }
.contatti .btn { margin-top: 52px; }

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 80px 36px;
  font-size: .95rem;
  color: rgba(255, 255, 255, .78);
  background: var(--notte-3);
}
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.6fr);
  gap: 48px;
}
.site-footer .brand { color: var(--bianco); }
.footer__claim { max-width: 30ch; margin-top: 22px; }
.footer__h {
  margin-bottom: 18px;
  font-size: 1rem;
  font-stretch: 108%;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--bianco);
}
.site-footer li + li { margin-top: 8px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--bianco); text-decoration: underline; text-underline-offset: 4px; }
/* Links inside running text keep an underline (the nav lists read as links already). */
.legal a,
.footer__bottom a { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .4); text-underline-offset: 4px; }
.legal a:hover,
.footer__bottom a:hover { text-decoration-color: currentColor; }
.legal__name { font-weight: 700; color: var(--bianco); }
.legal__form { margin-top: 4px; }
.legal dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 18px; margin-top: 18px; }
.legal dt { color: rgba(255, 255, 255, .58); }
.legal dd { overflow-wrap: anywhere; }
/* Stack label and value when the column is too narrow for the PEC address on one line
   (widest label 115 px + 18 px gap + PEC 157 px = 290 px, 19.1em; 20em leaves a margin). */
.legal { container-type: inline-size; }
@container (max-width: 20em) {
  .legal dl { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
  .legal dd + dt { margin-top: 10px; }
}
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  margin-top: 64px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: .88rem;
  color: rgba(255, 255, 255, .6);
}

/* ---------- Simple pages (privacy, 404) ---------- */

.page { padding-block: calc(var(--header-h) + clamp(56px, 8vw, 112px)) var(--sec); }
.page h1 { max-width: 18ch; font-size: clamp(2.4rem, 1.4rem + 3.4vw, 4.4rem); font-stretch: 125%; font-weight: 800; }
.page__lead { max-width: 60ch; margin-top: 24px; font-size: 1.2rem; color: var(--grigio); }
.page .btn { margin-top: 40px; }

.doc { max-width: 70ch; }
.doc h2 { margin-top: 56px; font-size: 1.6rem; font-stretch: 112%; }
.doc p, .doc ul { margin-top: 16px; }
.doc ul { padding-left: 1.2em; list-style: disc; }
.doc li + li { margin-top: 8px; }
.doc a { color: var(--blu); }
.doc__date { margin-top: 56px; font-size: .95rem; color: var(--grigio); }
/* Keeps a short term such as «EU-U.S.» or an article range from breaking at its dash. */
.nowrap { white-space: nowrap; }

/* ---------- Responsive ---------- */

/* 1040.98 so a fractional width (zoom) never falls between this and min-width: 1041px. */
@media (max-width: 1040.98px) {
  :root { --header-h: 72px; }
  .brand__logo { height: 36px; }
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px var(--pad) 40px;
    overflow-y: auto;
    color: var(--bianco);
    background: var(--notte);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .32s var(--ease), visibility .32s;
  }
  .nav > * { border-bottom: 1px solid rgba(255, 255, 255, .14); }
  .nav > .btn { border: 0; }
  .nav__link,
  .nav__drop-btn {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 18px 0;
    font-size: 1.35rem;
    font-stretch: 112%;
  }
  .nav__drop-btn svg { width: 16px; height: 16px; }
  .nav__menu {
    position: static;
    display: none;
    min-width: 0;
    padding: 0 0 14px;
    color: inherit;
    background: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav__menu::before { display: none; }
  .nav__menu.is-open { display: block; }
  .nav__menu a { padding: 10px 0 10px 18px; font-size: 1.08rem; color: rgba(255, 255, 255, .82); }
  .nav__menu a:hover { background: none; color: var(--bianco); }
  .nav .btn { width: 100%; min-height: 56px; margin-top: 28px; }
  body.nav-open { overflow: hidden; }
  /* Opening: visibility switches at once, so the links can take focus as soon as the menu opens.
     Closing: the base rule's visibility transition keeps them visible until the slide ends. */
  body.nav-open .nav { transform: none; visibility: visible; transition: transform .32s var(--ease); }
  body.nav-open .site-header { color: var(--bianco); background: var(--notte); box-shadow: none; }
  body.nav-open .site-header::before { opacity: 0; }

  .split, .about, .area__grid, .join { grid-template-columns: minmax(0, 1fr); }
  .split__head { position: static; }
  .area--flip .area__media { order: 0; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .areas a { grid-template-columns: minmax(0, 1fr); padding: 24px 0; }
  /* One column here, so the title takes the full row: drop the column cap. */
  .areas__t { font-size: clamp(1.3rem, 1.02rem + .95vw, 1.8rem); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .contatti__list { flex-direction: column; }
  .footer__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}
