/* Palette e tipografia dalla bozza "Home essenziale" */
:root {
  --bg: #160E1E;
  --bg-deep: #0F0916;
  --bg-raised: #22172D;
  --line: #2E2438;
  --line-strong: #4A3D5A;
  --text: #FFFFFF;
  --text-soft: #D9D1E8;
  --text-muted: #C9BFE0;
  --footer-text: #B5ABC6;
  --accent: #EC1268;
  --link: #FF3D86;
  --link-hover: #FF7AAE;
  --cta: #D10F5C;
  --cta-hover: #B00D4D;
  --surface: #ECE6F5;
  --surface-ink: #160E1E;
  --surface-accent: #B00D4D;
  --card: #FFFFFF;
  --ink-muted: #554C66;
  --ink-body: #3D3448;
  --error: #FF7AAE;
  --font: Sora, system-ui, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
  --wrap: 1200px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
img { max-width: 100%; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 24px; }
.accent { color: var(--accent); }

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

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  padding: 12px 20px; border-radius: 999px; background: var(--cta); color: var(--text);
}
.skip-link:focus { top: 16px; color: var(--text); }

/* Bottoni */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px; border: 0; border-radius: 999px;
  background: var(--cta); color: var(--text);
  font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--cta-hover); color: var(--text); }
.btn--sm { min-height: 44px; padding: 0 20px; font-size: 15px; }
.btn--lg { min-height: 56px; padding: 0 32px; font-size: 17px; }
.btn--ghost { background: transparent; border: 1px solid var(--line-strong); font-weight: 400; }
.btn--ghost:hover { background: transparent; border-color: var(--text-soft); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  padding-block: 20px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.wordmark { font-size: 26px; line-height: 1; letter-spacing: -0.04em; }
.wordmark b { font-weight: 600; }
.wordmark .dot { color: var(--accent); }
.wordmark .web { font-weight: 300; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; font-size: 15px; }
.nav a:not(.btn) { color: var(--text-soft); text-decoration: none; }
.nav a:not(.btn):hover, .nav a[aria-current="page"]:not(.btn) { color: var(--text); }

/* Pulsante menu (solo mobile, solo con JS attivo) */
.nav-toggle {
  display: none; position: relative; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; cursor: pointer;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  position: absolute; left: 50%; width: 18px; height: 2px; margin-left: -9px;
  border-radius: 2px; background: var(--text); transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle__bars { top: 50%; margin-top: -1px; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; left: 0; margin-left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 719px) {
  .wrap { padding-inline: 20px; }
  .site-header .wrap { padding-block: 14px; gap: 0; }
  .brand { gap: 10px; }
  .brand img { width: 34px; height: 34px; }
  .site-header .wordmark { font-size: 22px; }

  /* Senza JS la navigazione resta visibile, solo più compatta */
  .nav { gap: 8px 20px; }

  .js .nav-toggle { display: inline-block; }
  .js .nav {
    display: none; flex-basis: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding-top: 12px; font-size: 17px;
  }
  .js .nav-toggle[aria-expanded="true"] + .nav { display: flex; }
  .js .nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .js .nav a[aria-current="page"]:not(.btn) { color: var(--accent); }
  .js .nav .btn { margin-top: 20px; min-height: 50px; font-size: 16px; }
}

/* Testi comuni */
.eyebrow {
  margin: 0; font-size: 14px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--text-muted);
}
.lead { margin: 0; max-width: 560px; font-size: 19px; line-height: 1.6; font-weight: 300; color: var(--text-soft); }
.lead code { font-family: var(--mono); font-size: 0.9em; color: var(--link); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* Hero */
.hero { padding-block: 112px 96px; display: flex; flex-wrap: wrap; align-items: center; gap: 56px; }
.hero__text { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.hero h1 {
  margin: 0; min-height: 2.1em;
  font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.05; font-weight: 600; letter-spacing: -0.035em;
}
.spin { display: inline-block; width: 0.9em; font-weight: 400; color: var(--accent); }
.hero__mark { flex: 1 1 280px; display: flex; justify-content: center; }
.hero__mark img { width: 320px; height: auto; }

/* Intestazione pagine interne */
.page-head { padding-block: 96px 56px; display: flex; flex-direction: column; gap: 24px; }
.page-head h1, .error-page h1 {
  margin: 0; font-size: clamp(2.4rem, 5vw, 3.8rem); line-height: 1.08; font-weight: 600; letter-spacing: -0.035em;
}

/* Sezione chiara (progetti) */
.section-light { background: var(--surface); color: var(--surface-ink); }
.section-light > .wrap { padding-block: 96px; display: flex; flex-direction: column; gap: 48px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-head > div { display: flex; flex-direction: column; gap: 12px; }
.section-head h2 {
  margin: 0; font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.1; font-weight: 600; letter-spacing: -0.03em;
}
.section-head .more { font-size: 15px; font-weight: 600; color: var(--surface-accent); }
.kicker {
  margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--surface-accent);
}
.project-list { display: flex; flex-direction: column; gap: 32px; }

/* Card progetto */
.project {
  display: flex; flex-wrap: wrap; align-items: center; gap: 24px 40px;
  padding: 16px; border-radius: 24px; background: var(--card);
}
.project__media {
  flex: 1 1 460px; min-width: 0; aspect-ratio: 4 / 3;
  border-radius: 14px; overflow: hidden; background: var(--bg);
}
.project__media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.project__body {
  flex: 1 1 320px; min-width: 0; padding: 16px 24px 24px 8px;
  display: flex; flex-direction: column; gap: 16px;
}
.project__kind { margin: 0; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-muted); }
.project h3 {
  margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; font-weight: 600; letter-spacing: -0.02em;
}
.project__summary { margin: 0; font-size: 16px; line-height: 1.65; color: var(--ink-body); }
.project .btn { align-self: flex-start; min-height: 48px; margin-top: 8px; padding: 0 24px; font-size: 15px; }

/* Invito al contatto */
.cta > .wrap {
  padding-block: 112px;
  display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center;
}
.cta h2 {
  margin: 0; max-width: 760px;
  font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.08; font-weight: 600; letter-spacing: -0.035em;
}
.cta p { margin: 0; max-width: 520px; font-size: 18px; line-height: 1.6; font-weight: 300; color: var(--text-soft); }

/* Contatti */
.contact { padding-bottom: 112px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 48px 64px; }
.form { flex: 2 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 600; color: var(--text-soft); }
.field input, .field textarea {
  min-height: 52px; padding: 14px 16px;
  border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--bg-deep); color: var(--text); font: inherit; font-size: 16px;
}
.field textarea { min-height: 180px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--link); outline-offset: 2px; }
.field .input-validation-error { border-color: var(--error); }
.field-error { font-size: 14px; color: var(--error); }
.form-errors ul { margin: 0; padding: 16px 20px; list-style: none; border-radius: 14px; background: var(--bg-raised); color: var(--error); }
.validation-summary-valid { display: none; }
.form .btn { align-self: flex-start; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice {
  flex: 2 1 420px; padding: 32px; border: 1px solid var(--line-strong); border-radius: 24px; background: var(--bg-raised);
}
.notice h2 { margin: 0 0 12px; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.notice p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--text-soft); }
.contact-aside { flex: 1 1 260px; display: flex; flex-direction: column; gap: 12px; font-size: 16px; line-height: 1.6; color: var(--text-soft); }
.contact-aside h2 { margin: 0; font-size: 20px; font-weight: 600; color: var(--text); }
.contact-aside p { margin: 0; }

/* Footer */
.site-footer { background: var(--bg-deep); }
.site-footer .wrap {
  padding-block: 32px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  font-size: 14px; color: var(--footer-text);
}
.site-footer .wordmark { font-size: 18px; color: var(--text); }

/* Newsletter: iscrizione (testata scura con modulo affiancato, ultima edizione su lavanda) */
.nl-hero { padding-block: 96px 80px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 48px 64px; }
.nl-hero__text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.nl-hero h1 { margin: 0; font-size: clamp(2.4rem, 5vw, 3.8rem); line-height: 1.08; font-weight: 600; letter-spacing: -0.035em; }
.nl-sources { margin: 0; font-size: 15px; line-height: 1.6; color: var(--footer-text); }
.nl-card {
  flex: 1 1 400px; min-width: 0; padding: 28px; border-radius: 24px;
  background: var(--card); color: var(--surface-ink);
}
.nl-card h2 { margin: 0 0 12px; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.nl-card p { margin: 0 0 8px; font-size: 16px; line-height: 1.6; color: var(--ink-body); }
.nl-muted { color: var(--ink-muted) !important; font-size: 14px !important; }
.nl-form { display: flex; flex-direction: column; gap: 20px; }
.nl-field { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.nl-field > label, .nl-field legend { padding: 0; font-size: 14px; font-weight: 600; color: var(--surface-ink); }
.nl-field input[type="email"] {
  min-height: 50px; padding: 12px 16px; border: 1px solid #D9D1E8; border-radius: 14px;
  background: #fff; color: var(--surface-ink); font: inherit; font-size: 16px;
}
.nl-field input:focus-visible { outline: 2px solid var(--cta); outline-offset: 2px; }
.nl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nl-chip { position: relative; cursor: pointer; }
.nl-chip input { position: absolute; opacity: 0; }
.nl-chip span {
  display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid #D9D1E8;
  font-size: 14px; color: var(--ink-muted); background: #fff;
}
.nl-chip input:checked + span { background: var(--surface); border-color: var(--surface); color: var(--surface-ink); font-weight: 600; }
.nl-chip input:checked + span::before { content: "✓ "; color: var(--surface-accent); }
.nl-chip input:focus-visible + span { outline: 2px solid var(--cta); outline-offset: 2px; }
.nl-radios { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 15px; color: var(--ink-body); }
.nl-radios input, .nl-consent input { accent-color: var(--cta); }
.nl-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--ink-body); }
.nl-consent input { margin-top: 3px; flex: none; width: 18px; height: 18px; }
.nl-card a { color: var(--surface-accent); }
.nl-errors ul { margin: 0; padding: 12px 16px; list-style: none; border-radius: 12px; background: #FDE7EF; color: var(--cta-hover); font-size: 14px; }
.nl-form .btn { align-self: flex-start; }
.nl-latest { padding-block: 72px; display: flex; flex-direction: column; gap: 28px; }
.nl-latest h2 { margin: 0; font-size: clamp(1.8rem, 3.5vw, 2.4rem); line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; }
.nl-titles { display: flex; flex-direction: column; gap: 10px; }
.nl-title {
  display: block; padding: 16px 20px; border-radius: 14px; background: var(--card);
  color: var(--surface-ink); font-weight: 600; text-decoration: none; line-height: 1.4;
}
.nl-title:hover { color: var(--surface-accent); }
.nl-narrow { max-width: 760px; }
.nl-prefs { max-width: 760px; padding-bottom: 112px; }
.nl-prefs .nl-card { max-width: 640px; }
.nl-ok { padding: 10px 14px; border-radius: 12px; background: var(--surface); color: var(--surface-ink) !important; font-weight: 600; }
.nl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 16px; }
.nl-danger { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #ECE6F5; }
.nl-danger form { margin: 0; }
.nl-link {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--ink-muted); text-decoration: underline;
}
.nl-link:hover { color: var(--surface-accent); }

/* Newsletter: archivio, edizione, informativa */
.nl-empty { margin: 0; font-size: 17px; color: var(--ink-body); }
.nl-archive { display: flex; flex-direction: column; gap: 12px; }
.nl-archive__item {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 22px; border-radius: 16px;
  background: var(--card); color: var(--surface-ink); text-decoration: none;
}
.nl-archive__item:hover { color: var(--surface-ink); box-shadow: 0 0 0 2px var(--surface-accent); }
.nl-archive__kind { font-size: 12px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--surface-accent); }
.nl-archive__date { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.nl-archive__titles { font-size: 15px; line-height: 1.5; color: var(--ink-body); }
.nl-pager { display: flex; justify-content: space-between; gap: 16px; }
.nl-pager .more { font-size: 15px; font-weight: 600; color: var(--surface-accent); }
.nl-edition { padding-block: 64px 96px; max-width: 840px; display: flex; flex-direction: column; gap: 40px; }
.nl-edition__section { display: flex; flex-direction: column; gap: 12px; }
.nl-story { padding: 20px 24px; border-radius: 16px; background: var(--card); }
.nl-story h2 { margin: 0; font-size: 19px; line-height: 1.35; font-weight: 600; color: var(--surface-ink); }
.nl-story p { margin: 8px 0 0; font-size: 16px; line-height: 1.6; color: var(--ink-body); }
.nl-story__sources a { color: var(--surface-accent); font-weight: 600; font-size: 14px; text-decoration: none; }
.nl-legal { padding-bottom: 112px; color: var(--text-soft); font-size: 16px; line-height: 1.7; }
.nl-legal h2 { margin: 32px 0 8px; font-size: 20px; font-weight: 600; color: var(--text); }
.nl-legal p, .nl-legal ul { margin: 0 0 12px; }
.nl-narrow form { margin: 0; }

/* Pagina errore */
.error-page { padding-block: 112px; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }

/* Mobile: meno spazio sopra i titoli, più contenuto sopra la piega */
@media (max-width: 719px) {
  .hero { padding-block: 56px 72px; gap: 48px; }
  .hero__mark img { width: 200px; }
  .page-head, .nl-hero { padding-block: 56px 48px; }
}
