@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --text: #1b1b1b;
  --muted: #4a4a4a;
  --bg: #ffffff;
  --rule: #c8c8c8;
  --link: #1a4f8b;
  --link-visited: #5a3a7a;
  --focus: #ffbf47;
  --focus-text: #0b0c0c;
  --box: #f3f2f1;
  --todo: #8a1c1c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #ececec;
    --muted: #c4c4c4;
    --bg: #161616;
    --rule: #4a4a4a;
    --link: #9cc3f5;
    --link-visited: #c9a8ec;
    --box: #232323;
    --todo: #ff9c9c;
  }
}

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

html {
  font-size: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.1875rem;
  line-height: 1.5;
  text-align: left;
}

.skip-link {
  position: absolute;
  left: -999rem;
}

.skip-link:focus {
  position: static;
  display: block;
  padding: 0.5rem 1rem;
}

.wrap {
  max-width: 66ch;
  margin: 0 auto;
  padding: 0 1rem;
}

header.site {
  border-bottom: 1px solid var(--rule);
  padding: 1rem 0;
}

header.site a {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
}

main {
  padding: 1.5rem 0 2.5rem;
}

h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0.5rem 0 1.25rem;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
}

h3 {
  font-size: 1.1875rem;
  margin: 1.5rem 0 0.5rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

li {
  margin-bottom: 0.4rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:visited {
  color: var(--link-visited);
}

a:hover {
  text-decoration-thickness: 3px;
}

a:focus-visible {
  outline: 3px solid transparent;
  background: var(--focus);
  color: var(--focus-text);
  box-shadow: 0 -2px var(--focus), 0 4px var(--focus-text);
  text-decoration: none;
}

.lede {
  font-size: 1.3125rem;
}

.boundary {
  background: var(--box);
  border-left: 5px solid var(--rule);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.boundary p:last-child {
  margin-bottom: 0;
}

.todo {
  color: var(--todo);
  font-weight: 700;
}

address {
  font-style: normal;
  margin-bottom: 1rem;
}

footer.site {
  border-top: 1px solid var(--rule);
  padding: 1.25rem 0 2rem;
  font-size: 1rem;
  color: var(--muted);
}

footer.site ul {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

footer.site p {
  margin: 0 0 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Home: banda d'apertura e schede */
:root {
  --accent: #0f3d5c;
  --accent-text: #ffffff;
  --accent-soft: #e8f0f5;
  --wide: 62rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #0c2e45;
    --accent-soft: #1d2a33;
  }
}

.wrap {
  max-width: var(--wide);
}

.wrap > p,
.wrap > ul,
.wrap > ol,
.wrap > address,
.wrap > .boundary,
.hero .wrap > * {
  max-width: 66ch;
}

header.site {
  background: var(--accent);
  border-bottom: 0;
}

header.site a,
header.site a:visited {
  color: var(--accent-text);
  text-decoration: none;
  letter-spacing: 0.01em;
}

header.site a:focus-visible {
  color: var(--focus-text);
}

.hero {
  background: var(--accent-soft);
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--rule);
}

.hero h1 {
  font-size: clamp(2rem, 1.4rem + 2.5vw, 2.75rem);
  margin-top: 0.25rem;
}

.eyebrow {
  font-size: 1rem;
  font-weight: 700;
  text-transform: none;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

main {
  padding-top: 0;
}

main > .wrap {
  padding-top: 0.5rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem;
}

.card {
  border: 1px solid var(--rule);
  border-top: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  background: var(--bg);
}

.card h3 {
  margin-top: 0;
}

.card p {
  margin-bottom: 0;
}

.note {
  font-size: 1rem;
  color: var(--muted);
  border-left: 4px solid var(--accent);
  padding-left: 0.75rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 1rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rule);
}

thead th {
  border-bottom: 2px solid var(--accent);
}

/* Hero: riga d'offerta e invito a scrivere (2026-10-04) */
.hero-offer {
  font-size: 1.1875rem;
  margin-bottom: 0.75rem;
  text-wrap: pretty;
}

.hero h1 {
  text-wrap: balance;
}

.cta-row {
  margin: 1rem 0 0.5rem;
}

.cta,
.cta:visited {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.5rem 1.25rem;
  background: var(--accent);
  color: var(--accent-text);
  border: 2px solid var(--accent);
  border-radius: 0.25rem;
  font-weight: 700;
  text-decoration: none;
}

.cta:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.cta:focus-visible {
  background: var(--focus);
  color: var(--focus-text);
  border-color: var(--focus-text);
}

.cta-note {
  font-size: 1rem;
  color: var(--muted);
  margin: 0;
}

@media (prefers-color-scheme: dark) {
  .cta,
  .cta:visited {
    background: var(--link);
    border-color: var(--link);
    color: #0b0c0c;
  }
}

@media (max-width: 40rem) {
  header.site {
    padding: 0.75rem 0;
  }

  .hero {
    padding: 1rem 0 1.5rem;
  }

  .hero .eyebrow {
    margin-bottom: 0;
  }

  .hero h1 {
    font-size: 1.625rem;
    margin: 0.25rem 0 0.5rem;
  }

  .hero .lede {
    margin-bottom: 0.75rem;
  }
}

/* ripetuta per ultima: deve vincere su .cta:visited anche nel tema scuro */
.cta:focus-visible,
.cta:visited:focus-visible {
  background: var(--focus);
  color: var(--focus-text);
  border-color: var(--focus-text);
}

/* Barra fissa sul telefono con l'invito a scrivere (2026-10-04).
   Solo CSS: il sito non ha script (CSP script-src 'none').
   Stato di base VISIBILE: dove il browser non supporta le animazioni legate allo scorrimento,
   o chi chiede meno movimento (la regola reduced-motion toglie ogni animazione), la vede sempre.
   Dove sono supportate, compare solo dopo che il pulsante della prima schermata e' uscito dalla vista. */
.sticky-cta {
  display: none;
}

@media (max-width: 40rem) {
  .sticky-cta {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    margin: 0;
    padding: 0.25rem 1rem calc(0.25rem + env(safe-area-inset-bottom));
    background: var(--accent-soft);
    border-top: 1px solid var(--rule);
    text-align: center;
  }

  .sticky-cta a,
  .sticky-cta a:visited {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    color: var(--link);
    font-weight: 700;
  }

  .sticky-cta a:focus-visible {
    color: var(--focus-text);
  }

  /* spazio in fondo, perche' la barra non copra il footer ne' un elemento a fuoco */
  body {
    padding-bottom: calc(3.5rem + env(safe-area-inset-bottom));
  }

  html {
    scroll-padding-bottom: 4rem;
  }

  @supports (animation-timeline: scroll()) {
    .sticky-cta {
      animation: sticky-cta-in linear both;
      animation-timeline: scroll(root);
      animation-range: 520px 580px;
    }
  }
}

@keyframes sticky-cta-in {
  from {
    opacity: 0;
    visibility: hidden;
  }
  to {
    opacity: 1;
    visibility: visible;
  }
}

/* Blocco «What happens when you write» (2026-10-04) */
.next {
  max-width: 66ch;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.next h3 {
  margin-top: 0;
}

.next ul {
  padding-left: 1.25rem;
}

.next li {
  margin-bottom: 0.4rem;
  font-size: 1.0625rem;
}

@media (prefers-color-scheme: dark) {
  .next {
    border-left-color: var(--link);
  }
}

/* Consiglio C8 (2026-10-04, notte): griglia 2x2, titoli bilanciati, bordi visibili nel tema scuro,
   «How it is made» a voci, ponte fra schede e offerta. */
:root {
  --accent-line: var(--accent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent-line: #4f86ad;
  }

  .boundary {
    border-left-color: var(--accent-line);
  }
}

h2,
h3 {
  text-wrap: balance;
}

.cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 42rem) {
  .cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

.card {
  border-top-color: var(--accent-line);
}

.note {
  border-left-color: var(--accent-line);
}

.boundary h2 {
  margin-top: 0;
}

.bridge {
  font-size: 1.3125rem;
  font-weight: 700;
  text-wrap: balance;
}

.made {
  list-style: none;
  padding: 0;
}

.made li {
  margin-bottom: 1rem;
}

.made strong {
  display: block;
}

thead th {
  border-bottom-color: var(--accent-line);
}
