/* =========================================================================
   Mandati Internazionali — design system
   Single stylesheet, no framework, no webfont requests.
   ========================================================================= */

/* ---------- tokens ---------- */
:root {
  --blue:        #0f92d8;
  --blue-600:    #0b76b3;
  --blue-700:    #085b8b;
  --navy:        #0a1b2a;
  --navy-800:    #0e2942;
  --amber:       #f79927;

  --bg:          #ffffff;
  --bg-alt:      #f4f7fa;
  --bg-sunken:   #eaf0f6;
  --surface:     #ffffff;
  --border:      #dbe4ed;
  --border-soft: #e8eef4;

  --text:        #0d2032;
  --text-muted:  #4d6479;
  --text-faint:  #6b8299;
  --on-dark:     #eef5fb;
  --on-dark-mut: #a8c0d4;

  --radius:      14px;
  --radius-lg:   22px;
  --shadow:      0 1px 2px rgba(10, 27, 42, .05), 0 8px 24px -12px rgba(10, 27, 42, .16);
  --shadow-lg:   0 2px 4px rgba(10, 27, 42, .05), 0 24px 56px -20px rgba(10, 27, 42, .26);

  --container:   1180px;
  --gutter:      clamp(1.15rem, 4vw, 2.5rem);
  --section:     clamp(3.75rem, 8vw, 7rem);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0a141d;
    --bg-alt:      #0e1b27;
    --bg-sunken:   #122132;
    --surface:     #101d29;
    --border:      #23384c;
    --border-soft: #1b2c3d;
    --text:        #e9f1f8;
    --text-muted:  #9fb6cb;
    --text-faint:  #8098b0;
    --shadow:      0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lg:   0 2px 4px rgba(0, 0, 0, .4), 0 24px 56px -20px rgba(0, 0, 0, .7);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  font-family: var(--font);
  font-size: clamp(1rem, .97rem + .16vw, 1.075rem);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* ---------- typography ---------- */
h1, h2, h3, h4, h5 {
  line-height: 1.13;
  letter-spacing: -.022em;
  font-weight: 660;
  text-wrap: balance;
}

h1 { font-size: clamp(2.15rem, 1.35rem + 3.6vw, 4.05rem); letter-spacing: -.032em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.3vw, 2.9rem);   letter-spacing: -.028em; }
h3 { font-size: clamp(1.2rem, 1.06rem + .6vw, 1.5rem); }
h4 { font-size: 1.115rem; }

p { text-wrap: pretty; }

.lede {
  font-size: clamp(1.09rem, 1.02rem + .38vw, 1.32rem);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 60ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-size: .765rem;
  font-weight: 660;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--blue-600);
}
.eyebrow::before {
  content: "";
  width: 1.7rem;
  height: 2px;
  background: var(--amber);
  border-radius: 2px;
}
.eyebrow--light { color: var(--on-dark-mut); }

/* ---------- layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: 780px; }
/* inside the narrow column the lede should fill it, not stop at 60ch */
.container--narrow > .lede { max-width: none; }

.section { padding-block: var(--section); }
.section--alt    { background: var(--bg-alt); }
.section--sunken { background: var(--bg-sunken); }

.section-head { max-width: 62ch; margin-bottom: clamp(2.25rem, 4vw, 3.5rem); }
.section-head > * + * { margin-top: .95rem; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head--center .lede { margin-inline: auto; }

.stack > * + * { margin-top: 1.1rem; }
.prose { max-width: 68ch; }
.prose > * + * { margin-top: 1.15rem; }
.prose h3 { margin-top: 2.3rem; }
.prose ul { padding-inline-start: 1.15rem; color: var(--text-muted); }
.prose li + li { margin-top: .5rem; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: .8rem 1.2rem;
  background: var(--navy);
  color: #fff;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--blue);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  padding: .82em 1.6em;
  font-size: .96rem;
  font-weight: 620;
  letter-spacing: -.005em;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: 100px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  transition: transform .18s var(--ease), background-color .18s var(--ease),
              border-color .18s var(--ease), box-shadow .18s var(--ease);
  box-shadow: 0 1px 2px rgba(10, 27, 42, .12);
}
.btn:hover  { background: var(--blue-600); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  border-color: var(--border);
  box-shadow: none;
}
.btn--ghost:hover { background: var(--bg-alt); border-color: var(--blue); color: var(--blue-600); }

.btn--on-dark {
  --btn-bg: rgba(255, 255, 255, .07);
  --btn-fg: #fff;
  border-color: rgba(255, 255, 255, .26);
  backdrop-filter: blur(8px);
  box-shadow: none;
}
.btn--on-dark:hover { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .5); }

.btn--lg { padding: .95em 1.9em; font-size: 1.02rem; }

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  font-weight: 600;
  font-size: .95rem;
  color: var(--blue-600);
}
.arrow-link::after {
  content: "→";
  transition: transform .2s var(--ease);
}
.arrow-link:hover::after { transform: translateX(4px); }

/* ---------- header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}
.header.is-stuck { border-bottom-color: var(--border-soft); }

.header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.brand { display: flex; align-items: center; gap: .7rem; flex-shrink: 0; }
.brand__mark { width: 38px; height: 38px; border-radius: 9px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.12; }
.brand__name {
  font-weight: 700;
  font-size: .99rem;
  letter-spacing: -.02em;
}
.brand__tag {
  font-size: .69rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.nav { margin-inline-start: auto; }
.nav__list {
  display: flex;
  align-items: center;
  gap: .3rem;
  list-style: none;
  padding: 0;
}
.nav__link {
  display: block;
  padding: .55rem .8rem;
  border-radius: 8px;
  font-size: .935rem;
  font-weight: 540;
  color: var(--text-muted);
  transition: color .16s var(--ease), background-color .16s var(--ease);
}
.nav__link:hover { color: var(--text); background: var(--bg-alt); }
.nav__link[aria-current="page"] { color: var(--blue-600); font-weight: 640; }

/* dropdown */
.nav__item--has-menu { position: relative; }
.nav__toggle {
  display: flex;
  align-items: center;
  gap: .3em;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav__toggle::after {
  content: "";
  width: .42em; height: .42em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: .6;
  transition: transform .2s var(--ease);
}
.nav__item--has-menu[data-open="true"] .nav__toggle::after { transform: rotate(225deg) translate(-2px, -2px); }

.submenu {
  position: absolute;
  top: calc(100% + .55rem);
  left: 50%;
  translate: -50% 0;
  width: max-content;
  max-width: 22rem;
  padding: .5rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.nav__item--has-menu[data-open="true"] .submenu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.submenu a {
  display: block;
  padding: .58rem .75rem;
  border-radius: 8px;
  font-size: .91rem;
  color: var(--text-muted);
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.submenu a:hover { background: var(--bg-alt); color: var(--blue-600); }

.header__cta { flex-shrink: 0; }

/* CTA shown inside the drawer only on small screens */
.nav__cta { display: none; }
@media (max-width: 1000px) {
  .nav__cta { display: block; margin-top: 1.1rem; }
  .nav__cta .btn { width: 100%; }
}

.lang {
  display: flex;
  align-items: center;
  gap: .1rem;
  padding-inline-start: .7rem;
  margin-inline-start: .35rem;
  border-inline-start: 1px solid var(--border);
}
.lang a {
  padding: .3rem .42rem;
  font-size: .78rem;
  font-weight: 640;
  letter-spacing: .04em;
  color: var(--text-faint);
  border-radius: 6px;
  text-transform: uppercase;
}
.lang a:hover { color: var(--text); background: var(--bg-alt); }
.lang a[aria-current="true"] { color: var(--blue-600); background: var(--bg-alt); }

/* burger */
.burger {
  display: none;
  width: 44px; height: 44px;
  margin-inline-start: auto;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.burger span {
  position: relative;
  width: 18px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: background-color .18s var(--ease);
}
.burger span::before, .burger span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .22s var(--ease);
}
.burger span::before { top: -6px; }
.burger span::after  { top: 6px; }
[data-menu-open="true"] .burger span { background: transparent; }
[data-menu-open="true"] .burger span::before { transform: translateY(6px) rotate(45deg); }
[data-menu-open="true"] .burger span::after  { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1000px) {
  .burger { display: flex; }
  .header__cta { display: none; }
  .nav {
    position: fixed;
    inset: 4.5rem 0 auto 0;
    max-height: calc(100dvh - 4.5rem);
    overflow-y: auto;
    margin: 0;
    padding: 1rem var(--gutter) 2rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
  }
  [data-menu-open="true"] .nav { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav__list { flex-direction: column; align-items: stretch; gap: .1rem; }
  .nav__link, .nav__toggle { width: 100%; padding: .8rem .6rem; font-size: 1.02rem; }
  .nav__toggle { justify-content: space-between; }
  .submenu {
    position: static;
    translate: none;
    width: auto;
    max-width: none;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    border-inline-start: 2px solid var(--border);
    border-radius: 0;
    margin: .1rem 0 .5rem .6rem;
    padding: 0 0 0 .5rem;
  }
  .nav__item--has-menu[data-open="true"] .submenu { display: block; }
  .lang { margin: 1rem 0 0; padding: 1rem 0 0; border-left: 0; border-top: 1px solid var(--border); }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: min(88svh, 780px);
  padding-block: clamp(6rem, 14vh, 9rem) clamp(3rem, 7vh, 5rem);
  background: var(--navy);
  color: var(--on-dark);
  isolation: isolate;
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(6, 18, 30, .78) 0%, rgba(6, 18, 30, .34) 34%, rgba(6, 18, 30, .88) 100%),
    linear-gradient(90deg, rgba(6, 18, 30, .82) 0%, rgba(6, 18, 30, .18) 62%);
}
.hero__inner { max-width: 46rem; }
.hero h1 { color: #fff; }
.hero h1 .accent {
  background: linear-gradient(96deg, #6fc6f5, var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lede {
  margin-top: 1.4rem;
  font-size: clamp(1.06rem, 1rem + .42vw, 1.3rem);
  line-height: 1.55;
  color: var(--on-dark-mut);
  max-width: 42rem;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: 2.1rem;
}
@media (max-width: 30rem) {
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1.6rem;
  margin-top: 2.6rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, .16);
  font-size: .875rem;
  color: var(--on-dark-mut);
}
.hero__meta span { display: inline-flex; align-items: center; gap: .5em; }
.hero__meta span::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

/* compact page hero for inner pages */
.pagehero {
  position: relative;
  padding-block: clamp(4.5rem, 11vh, 7rem) clamp(2.75rem, 7vh, 4.25rem);
  background: var(--navy);
  color: var(--on-dark);
  isolation: isolate;
  overflow: hidden;
}
.pagehero__media { position: absolute; inset: 0; z-index: -2; }
.pagehero__media img { width: 100%; height: 100%; object-fit: cover; }
.pagehero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(6, 18, 30, .9) 0%, rgba(6, 18, 30, .74) 60%, rgba(6, 18, 30, .95) 100%);
}
.pagehero--plain { background: linear-gradient(150deg, var(--navy) 0%, var(--navy-800) 62%, #123a5c 100%); }
.pagehero--plain::after { display: none; }
.pagehero h1 { color: #fff; max-width: 20ch; }
.pagehero__lede {
  margin-top: 1.15rem;
  max-width: 56ch;
  font-size: clamp(1.03rem, .99rem + .3vw, 1.2rem);
  color: var(--on-dark-mut);
}

/* breadcrumb */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin-bottom: 1.4rem;
  font-size: .83rem;
  color: var(--on-dark-mut);
  list-style: none;
  padding: 0;
}
.crumbs li { display: flex; align-items: center; gap: .45rem; }
.crumbs li + li::before { content: "/"; opacity: .45; }
.crumbs a { transition: color .16s var(--ease); }
.crumbs a:hover { color: #fff; }
.crumbs [aria-current] { color: #fff; }

/* ---------- cards ---------- */
.grid { display: grid; gap: clamp(1rem, 2vw, 1.6rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18.5rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }

/* Feature row: one full-width card opening an odd-numbered set, with the
   remaining cards in complete rows below. The gap between the two blocks
   matches the grid gutter, so the whole set reads as a single grid. */
.grid--feature { grid-template-columns: 1fr; }
.mt-grid { margin-top: clamp(1rem, 2vw, 1.6rem); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease),
              border-color .22s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--blue) 40%, var(--border)); }

.card__media {
  aspect-ratio: 3 / 2;
  background: var(--bg-sunken);
  overflow: hidden;
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.card:hover .card__media img { transform: scale(1.045); }

.card__body h2 { font-size: clamp(1.2rem, 1.06rem + .6vw, 1.5rem); letter-spacing: -.022em; }
.card__body { display: flex; flex-direction: column; gap: .6rem; padding: 1.5rem 1.5rem 1.65rem; flex: 1; }
.card__body p { color: var(--text-muted); font-size: .945rem; line-height: 1.6; }
.card__body .arrow-link { margin-top: auto; padding-top: .5rem; }

/* whole-card link */
.card__link::after { content: ""; position: absolute; inset: 0; }

/* icon card (no image) */
.card--icon .card__body { padding-top: 1.75rem; }
.icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  margin-bottom: .35rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  color: var(--blue-600);
}
.icon svg { width: 23px; height: 23px; }

/* numbered method steps */
.steps { counter-reset: step; }
.step {
  position: relative;
  padding: 1.6rem 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  display: block;
  margin-bottom: .85rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--amber);
}
.step h3 { font-size: 1.13rem; margin-bottom: .5rem; }
.step p { color: var(--text-muted); font-size: .94rem; }

/* ---------- split feature ---------- */
.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
}
.split__media img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.split--reverse .split__media { order: 2; }
@media (max-width: 62rem) { .split--reverse .split__media { order: 0; } }

.checklist { list-style: none; padding: 0; display: grid; gap: .85rem; }
.checklist li {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: .7rem;
  align-items: start;
  color: var(--text-muted);
  font-size: .97rem;
}
.checklist li::before {
  content: "";
  width: 1.35rem; height: 1.35rem;
  margin-top: .15rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--blue) 14%, transparent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b76b3' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / .8rem no-repeat;
}
.checklist strong { color: var(--text); font-weight: 620; }

/* ---------- stats ---------- */
.stats {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stat { padding: 1.6rem 1.4rem; background: var(--surface); }
.stat__num {
  font-size: clamp(1.9rem, 1.5rem + 1.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--blue-600);
}
.stat__label { margin-top: .5rem; font-size: .89rem; color: var(--text-muted); }

/* ---------- callout / CTA band ---------- */
.cta {
  position: relative;
  padding-block: clamp(3.5rem, 8vw, 6rem);
  background: var(--navy);
  color: var(--on-dark);
  isolation: isolate;
  overflow: hidden;
}
.cta__media { position: absolute; inset: 0; z-index: -2; }
.cta__media img { width: 100%; height: 100%; object-fit: cover; }
.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(100deg, rgba(6, 18, 30, .94) 0%, rgba(6, 18, 30, .72) 46%, rgba(6, 18, 30, .34) 100%),
    linear-gradient(180deg, rgba(6, 18, 30, .3) 0%, rgba(6, 18, 30, .55) 100%);
}
.cta h2 { color: #fff; max-width: 20ch; }
.cta p { margin-top: 1.1rem; max-width: 52ch; color: var(--on-dark-mut); }
.cta__actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2rem; }

/* ---------- contact ---------- */
.contact-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  align-items: start;
}

.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .45rem; }
.field label { font-size: .89rem; font-weight: 600; }
.field .req { color: var(--amber); }
.field input, .field textarea {
  width: 100%;
  padding: .8rem .95rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent);
}
.field textarea { min-height: 8.5rem; resize: vertical; }

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .7rem;
  align-items: start;
  font-size: .87rem;
  color: var(--text-muted);
}
.consent input { width: 1.1rem; height: 1.1rem; margin-top: .22rem; accent-color: var(--blue); }
.consent a { color: var(--blue-600); text-decoration: underline; text-underline-offset: 2px; }

.form-note { font-size: .84rem; color: var(--text-faint); }

.contact-list { list-style: none; padding: 0; display: grid; gap: 1.4rem; }
.contact-list dt {
  font-size: .78rem;
  font-weight: 660;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: .3rem;
}
.contact-list dd { margin: 0; }
.contact-list a { color: var(--blue-600); }
.contact-list a:hover { text-decoration: underline; }

/* ---------- insights list ---------- */
.post {
  display: grid;
  gap: .5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-soft);
  position: relative;
}
.post:first-child { border-top: 1px solid var(--border-soft); }
.post__date {
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.post h2, .post h3 {
  font-size: clamp(1.2rem, 1.06rem + .6vw, 1.5rem);
  letter-spacing: -.022em;
  transition: color .16s var(--ease);
}
.post:hover h2, .post:hover h3 { color: var(--blue-600); }
.post p { color: var(--text-muted); font-size: .95rem; max-width: 72ch; }

/* ---------- footer ---------- */
.footer {
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  background: var(--navy);
  color: var(--on-dark-mut);
  font-size: .93rem;
}
.footer__top {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.footer__brand { grid-column: span 2; max-width: 26rem; }
@media (max-width: 46rem) { .footer__brand { grid-column: span 1; } }
.footer__brand .brand__name { color: #fff; }
.footer__brand .brand__tag  { color: var(--on-dark-mut); }
.footer__blurb { margin-top: 1rem; color: var(--on-dark-mut); font-size: .92rem; }

.footer .footer__title {
  margin-bottom: .95rem;
  font-size: .78rem;
  font-weight: 660;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: #fff;
}
.footer ul { list-style: none; padding: 0; display: grid; gap: .55rem; }
.footer a { transition: color .16s var(--ease); }
.footer a:hover { color: #fff; }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.75rem;
  font-size: .85rem;
}
.footer__legal { display: flex; flex-wrap: wrap; gap: 1rem; }

.social { display: flex; gap: .45rem; }
.social a {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.social a:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .4); transform: translateY(-2px); }
.social svg { width: 16px; height: 16px; }

/* ---------- scroll reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .6s var(--ease), transform .6s var(--ease);
  }
  .reveal.is-in { opacity: 1; transform: none; }
}

/* ---------- utilities ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.mt-lg { margin-top: clamp(2.25rem, 4vw, 3.25rem); }
.text-center { text-align: center; }

/* ---------- tags & card meta ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: .28em .7em;
  border-radius: 100px;
  background: color-mix(in srgb, var(--blue) 13%, transparent);
  color: var(--blue-600);
  font-size: .73rem;
  font-weight: 660;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.pagehero__tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.pagehero__tags .tag {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.card__meta,
.article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .9rem;
  font-size: .8rem;
  color: var(--text-faint);
}
.card__meta time, .card__meta span:not(.tag) { letter-spacing: .02em; }

.card--article .card__body { gap: .75rem; }
.card--article h2,
.card--article h3 {
  font-size: clamp(1.14rem, 1.02rem + .5vw, 1.35rem);
  letter-spacing: -.022em;
}

/* ---------- article ---------- */
.pagehero--article { padding-block: clamp(5rem, 13vh, 8rem) clamp(3rem, 7vh, 4.5rem); }
.pagehero--article .article__meta { color: var(--on-dark-mut); margin-bottom: .3rem; }
.pagehero--article .tag { background: rgba(255, 255, 255, .14); color: #fff; }
.pagehero--article h1 {
  font-size: clamp(1.95rem, 1.3rem + 2.7vw, 3.35rem);
  max-width: 24ch;
}

.article__lede {
  font-size: clamp(1.14rem, 1.05rem + .45vw, 1.4rem);
  line-height: 1.5;
  font-weight: 500;
  color: var(--text);
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-soft);
}
.article__lede em { font-style: normal; }

/* table of contents */
.toc {
  margin: 2.25rem 0 .5rem;
  padding: 1.35rem 1.5rem 1.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.toc__title {
  font-size: .78rem;
  font-weight: 660;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: .9rem;
}
.toc ol {
  margin: 0;
  padding-inline-start: 1.1rem;
  display: grid;
  gap: .5rem;
  font-size: .95rem;
  color: var(--text-muted);
}
.toc a { color: var(--text-muted); }
.toc a:hover { color: var(--blue-600); text-decoration: underline; text-underline-offset: 3px; }

/* long-form prose */
.article__body { margin-top: 2.5rem; font-size: 1.06rem; line-height: 1.75; }
.article__body > * + * { margin-top: 1.3rem; }
.article__body h2 {
  margin-top: 3rem;
  font-size: clamp(1.45rem, 1.2rem + 1.1vw, 1.95rem);
  scroll-margin-top: 6rem;
}
.article__body h3 { margin-top: 2.25rem; font-size: 1.22rem; }
.article__body p { color: var(--text-muted); }
.article__body strong { color: var(--text); font-weight: 640; }
.article__body ul, .article__body ol { padding-inline-start: 1.3rem; color: var(--text-muted); }
.article__body li + li { margin-top: .55rem; }
.article__body a {
  color: var(--blue-600);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.article__body a:hover { text-decoration-thickness: 2px; }
.article__body blockquote {
  margin-inline: 0;
  padding-block: .35rem;
  padding-inline-start: 1.35rem;
  border-inline-start: 3px solid var(--amber);
  color: var(--text);
  font-size: 1.1rem;
}

/* data charts inside articles */
.chart { margin: 2.5rem 0; }
.chart img {
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: #fff;
}
.chart figcaption {
  margin-top: .75rem;
  font-size: .85rem;
  color: var(--text-faint);
  text-align: center;
}

.article__body table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
  display: block;
  overflow-x: auto;
}
.article__body th, .article__body td {
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: start;
}
.article__body th { font-weight: 660; color: var(--text); }

.article__foot {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: baseline;
  justify-content: space-between;
  font-size: .92rem;
  color: var(--text-muted);
}

/* ---------- compact navigation cards (altri servizi / altri settori) ---------- */
.card--nav .card__body { padding: 1.35rem 1.35rem 1.5rem; gap: .55rem; }
.card--nav h3 {
  font-size: 1.05rem;
  line-height: 1.28;
  letter-spacing: -.018em;
}
.card--nav p {
  font-size: .89rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card--nav .icon { width: 38px; height: 38px; border-radius: 10px; }
.card--nav .icon svg { width: 19px; height: 19px; }
.card--nav .card__media { aspect-ratio: 16 / 10; }
.card--nav .arrow-link { font-size: .875rem; }

/* ---------- form: honeypot & alert ---------- */
/* Kept out of the flow but not display:none, so bots that skip hidden
   fields still fill it in. */
.hp {
  position: absolute;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-alert {
  display: flex;
  gap: .7rem;
  padding: .95rem 1.15rem;
  margin-bottom: 1.5rem;
  border: 1px solid color-mix(in srgb, #c1121f 35%, var(--border));
  border-inline-start-width: 3px;
  border-inline-start-color: #c1121f;
  border-radius: var(--radius);
  background: color-mix(in srgb, #c1121f 7%, var(--surface));
  color: var(--text);
  font-size: .93rem;
  line-height: 1.5;
}
.form-alert[hidden] { display: none; }

/* =========================================================================
   Arabic / right-to-left
   The layout is built on logical properties, so only direction-dependent
   artwork, arrows and typography need overriding here.
   ========================================================================= */

[lang="ar"] {
  /* System Arabic faces first; the Latin stack still covers brand names. */
  --font: "SF Arabic", "Geeza Pro", "Segoe UI", "Noto Naskh Arabic", "Arabic Typesetting",
          Tahoma, -apple-system, BlinkMacSystemFont, sans-serif;
}

[lang="ar"] body { line-height: 1.85; }
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3,
[lang="ar"] h4, [lang="ar"] h5 {
  line-height: 1.4;
  letter-spacing: 0;          /* negative tracking damages Arabic joining */
  font-weight: 700;
}
[lang="ar"] .eyebrow { letter-spacing: .04em; }
[lang="ar"] .brand__tag { letter-spacing: .04em; }
[lang="ar"] .article__body { line-height: 1.95; }
[lang="ar"] .toc__title,
[lang="ar"] .footer__title,
[lang="ar"] .contact-list dt,
[lang="ar"] .tag { letter-spacing: .03em; }

/* Numerals and dates stay left-to-right inside RTL text */
[dir="rtl"] time,
[dir="rtl"] .stat__num,
[dir="rtl"] .step::before { direction: ltr; unicode-bidi: isolate; }

/* Arrow links point the way the language reads */
[dir="rtl"] .arrow-link::after { transform: scaleX(-1); }
[dir="rtl"] .arrow-link:hover::after { transform: scaleX(-1) translateX(4px); }

/* Directional hero and CTA gradients */
[dir="rtl"] .hero::after {
  background:
    linear-gradient(180deg, rgba(6, 18, 30, .78) 0%, rgba(6, 18, 30, .34) 34%, rgba(6, 18, 30, .88) 100%),
    linear-gradient(270deg, rgba(6, 18, 30, .82) 0%, rgba(6, 18, 30, .18) 62%);
}
[dir="rtl"] .cta::after {
  background:
    linear-gradient(260deg, rgba(6, 18, 30, .94) 0%, rgba(6, 18, 30, .72) 46%, rgba(6, 18, 30, .34) 100%),
    linear-gradient(180deg, rgba(6, 18, 30, .3) 0%, rgba(6, 18, 30, .55) 100%);
}

/* The dropdown caret and burger are symmetrical; the skip link is not */
[dir="rtl"] .skip-link { border-radius: 0 0 0 var(--radius); }

/* Breadcrumb separators read correctly when the list is isolated */
[dir="rtl"] .crumbs li + li::before { content: "/"; }

/* =========================================================================
   Mobile refinements
   The layout is responsive by design; this block tunes the things that only
   matter on a phone: tap-target size, notch safe areas and scroll behaviour.
   ========================================================================= */

@media (max-width: 62rem) {
  /* Comfortable tap targets: plain inline links are otherwise ~24px tall. */
  .footer ul a,
  .footer__legal a,
  .contact-list a,
  .crumbs a,
  .consent a,
  .toc a {
    display: inline-block;
    padding-block: .4rem;
  }
  /* Standalone arrow links need a real tap area; the ones inside cards
     already inherit the whole card via .card__link. */
  .arrow-link { padding-block: .4rem; }
  .footer ul { gap: .15rem; }
  .footer__legal { gap: 1.25rem; }

  .consent input { width: 1.35rem; height: 1.35rem; }
  .lang a { padding: .55rem .7rem; }

  /* Sections breathe a little less on a small screen */
  :root { --section: clamp(3rem, 9vw, 4.5rem); }

  .section-head { margin-bottom: 2rem; }
  .split { gap: 2.25rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 30rem) {
  .stats { grid-template-columns: 1fr; }
  .cta__actions .btn,
  .hero__actions .btn { width: 100%; }
  .article__foot { flex-direction: column; gap: .75rem; }
  .card__body { padding: 1.25rem 1.25rem 1.4rem; }
  .toc { padding: 1.15rem 1.2rem 1.25rem; }
}

/* Notch and home-indicator safe areas (viewport-fit=cover is set in <head>) */
@supports (padding: max(0px)) {
  .container {
    padding-inline: max(var(--gutter), env(safe-area-inset-left))
                    max(var(--gutter), env(safe-area-inset-right));
  }
  .footer { padding-bottom: max(2rem, env(safe-area-inset-bottom)); }
}

/* Touch niceties */
@media (hover: none) {
  a, button { -webkit-tap-highlight-color: rgba(15, 146, 216, .15); }
  /* Hover transforms are noise on touch: they stick after a tap. */
  .card:hover { transform: none; }
  .card:hover .card__media img { transform: none; }
  .btn:hover { transform: none; }
}

/* The open drawer owns the scroll; the page behind it must not move. */
html[data-menu-open="true"] { overflow: hidden; }
.nav { overscroll-behavior: contain; }

/* ---------- banner cookie ---------- */
.ck {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 90;
  padding: 0 var(--gutter) max(var(--gutter), env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.ck__box {
  pointer-events: auto;
  width: min(100%, 46rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.35rem 1.5rem 1.4rem;
}
.ck__titolo { font-size: 1.05rem; letter-spacing: -.01em; margin-bottom: .5rem; }
.ck__titolo:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.ck__testo { font-size: .92rem; line-height: 1.55; color: var(--text-muted); }
.ck__testo a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }

.ck__voci { margin-top: 1.1rem; display: grid; gap: .9rem; }
/* display:grid batte il comportamento predefinito di [hidden]: va riaffermato,
   altrimenti il pannello preferenze risulta aperto già alla prima visita. */
.ck__voci[hidden] { display: none; }
.ck__voce { border-top: 1px solid var(--border-soft); padding-top: .8rem; }
.ck__sw { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.ck__sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ck__pallina {
  flex: none; width: 40px; height: 23px; border-radius: 999px;
  background: var(--bg-sunken); border: 1px solid var(--border);
  position: relative; transition: background .18s var(--ease), border-color .18s var(--ease);
}
.ck__pallina::after {
  content: ""; position: absolute; top: 2px; inset-inline-start: 2px;
  width: 17px; height: 17px; border-radius: 50%; background: var(--text-faint);
  transition: transform .18s var(--ease), background .18s var(--ease);
}
.ck__sw input:checked + .ck__pallina { background: var(--blue); border-color: var(--blue); }
.ck__sw input:checked + .ck__pallina::after { background: #fff; transform: translateX(17px); }
[dir="rtl"] .ck__sw input:checked + .ck__pallina::after { transform: translateX(-17px); }
.ck__sw input:disabled + .ck__pallina { opacity: .55; }
.ck__sw input:disabled ~ .ck__nome { color: var(--text-muted); }
.ck__sw input:focus-visible + .ck__pallina { outline: 2px solid var(--blue); outline-offset: 3px; }
.ck__nome { font-weight: 600; font-size: .95rem; }
.ck__nota { margin-top: .35rem; font-size: .85rem; line-height: 1.5; color: var(--text-faint); }

.ck__azioni { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: .6rem; }
.ck__btn {
  flex: 1 1 8rem;
  min-height: 44px;
  padding: .7rem 1.1rem;
  font: inherit; font-weight: 600; font-size: .92rem;
  color: #fff; background: var(--blue);
  border: 1px solid var(--blue); border-radius: 999px;
  cursor: pointer;
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
.ck__btn:hover { background: var(--blue-600); border-color: var(--blue-600); }
.ck__btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
/* "Preferenze" è secondario; "Rifiuta" e "Accetta" restano identici fra loro:
   il rifiuto non deve costare più fatica dell'accettazione. */
.ck__btn--terzo,
.ck__btn--salva {
  color: var(--text); background: transparent; border-color: var(--border);
}
.ck__btn--terzo:hover,
.ck__btn--salva:hover { background: var(--bg-alt); border-color: var(--text-faint); }

.ck__gestisci { cursor: pointer; }

@media (max-width: 30rem) {
  .ck__azioni { flex-direction: column; }
  .ck__btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: no-preference) {
  .ck__box { opacity: 0; transform: translateY(14px); transition: opacity .28s var(--ease), transform .28s var(--ease); }
  .ck--in .ck__box { opacity: 1; transform: none; }
}
