/* ==========================================================================
   Miraform — base: token, reset, tipografia, shell condivisa
   Nessuna risorsa remota. Font locali con licenza OFL in assets/fonts.
   ========================================================================== */

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-roman.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-roman.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  /* Superfici */
  --paper: #f6f3ec;
  --paper-2: #efeade;
  --paper-3: #e7e1d2;
  --ink: #14140f;
  --ink-2: #1d1d16;

  /* Testo */
  --text: #14140f;
  --text-soft: #55524a;
  --text-muted: #6b675d;
  --on-dark: #f2efe7;
  --on-dark-soft: #b9b5a9;

  /* Accenti */
  --cobalt: #1b3a8c;
  --cobalt-light: #7d9ae8;
  --terracotta: #a94d22;
  --terracotta-light: #e3925c;

  --line: rgba(20, 20, 15, 0.14);
  --line-strong: rgba(20, 20, 15, 0.28);
  --line-dark: rgba(242, 239, 231, 0.18);

  --display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --shell: 1360px;
  --gutter: clamp(20px, 5vw, 72px);
  --section-y: clamp(72px, 11vw, 152px);

  --radius: 4px;
  --shadow-screen: 0 40px 90px -50px rgba(20, 20, 15, 0.55), 0 2px 8px rgba(20, 20, 15, 0.08);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4, p, figure, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

::selection { background: var(--cobalt); color: #fff; }

:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
  border-radius: 2px;
}
/* Su fondo inchiostro il cobalto sparisce: serve un contorno chiaro. */
.section--dark :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--terracotta-light);
}

/* --- Tipografia ---------------------------------------------------------- */

.display {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.98;
  text-wrap: balance;
}
.display em { font-style: italic; color: var(--terracotta); }

.d-xl { font-size: clamp(40px, 7.4vw, 104px); }
.d-lg { font-size: clamp(34px, 5.4vw, 72px); }
.d-md { font-size: clamp(27px, 3.4vw, 46px); }
.d-sm { font-size: clamp(22px, 2.4vw, 31px); line-height: 1.08; }

.eyebrow {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 20px;
}
.eyebrow--accent { color: var(--terracotta); }

.lede { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55; color: var(--text-soft); max-width: 40ch; }
.body-soft { color: var(--text-soft); }
.measure { max-width: 62ch; }

/* --- Layout -------------------------------------------------------------- */

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(52px, 7vw, 96px); }

.section--dark {
  background: var(--ink);
  color: var(--on-dark);
}
.section--dark .eyebrow { color: var(--on-dark-soft); }
.section--dark .display em { color: var(--terracotta-light); }
.section--dark .lede,
.section--dark .body-soft { color: var(--on-dark-soft); }

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

/* --- Bottoni e link ------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 26px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}
.btn:hover { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: transparent; border-color: var(--ink); color: var(--ink); }

.section--dark .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.section--dark .btn:hover { background: var(--terracotta-light); border-color: var(--terracotta-light); color: var(--ink); }
.section--dark .btn--ghost { background: transparent; color: var(--on-dark); border-color: var(--line-dark); }
.section--dark .btn--ghost:hover { background: transparent; border-color: var(--on-dark); color: var(--on-dark); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
  color: var(--cobalt);
  text-decoration: none;
  border-bottom: 1px solid rgba(27, 58, 140, 0.3);
  padding-bottom: 2px;
  transition: border-color 160ms ease;
}
.link-arrow:hover { border-bottom-color: var(--cobalt); }
.section--dark .link-arrow { color: var(--terracotta-light); border-bottom-color: rgba(227, 146, 92, 0.4); }
.section--dark .link-arrow:hover { border-bottom-color: var(--terracotta-light); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; }

/* --- Skip link ----------------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 650;
}
.skip:focus { left: 12px; top: 12px; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 243, 236, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.015em;
  text-decoration: none;
}
.brand__mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--terracotta);
  flex: none;
  transform: translateY(-1px);
}

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a {
  font-size: 14px;
  font-weight: 550;
  color: var(--text-soft);
  text-decoration: none;
  transition: color 160ms ease;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--ink); }

.site-header .btn { min-height: 40px; padding: 9px 20px; font-size: 13px; }

/* Selettore di lingua: link diretto alla pagina gemella nell'altra lingua,
   niente JavaScript, niente redirect. */
.lang-switch {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  transition: color 160ms ease, border-color 160ms ease;
}
.lang-switch:hover { color: var(--ink); border-color: var(--ink); }
.nav-mobile__panel .lang-switch { display: inline-block; margin-top: 4px; border-radius: 999px; padding: 8px 16px; }

/* Navigazione mobile: <details>, funziona senza JavaScript. */
.nav-mobile { display: none; }
.nav-mobile > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 4px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.nav-mobile > summary::-webkit-details-marker { display: none; }
.nav-mobile__bars { display: grid; gap: 4px; width: 20px; }
.nav-mobile__bars span { height: 1.5px; background: var(--ink); border-radius: 2px; }
.nav-mobile[open] .nav-mobile__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--paper);
  border-block: 1px solid var(--line);
  padding: 8px var(--gutter) 24px;
}
.nav-mobile__panel a {
  display: block;
  padding: 13px 0;
  font-size: 17px;
  font-weight: 550;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.nav-mobile__panel .btn { margin-top: 18px; width: 100%; justify-content: center; }

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

.site-footer {
  background: var(--ink);
  color: var(--on-dark-soft);
  padding-block: clamp(48px, 6vw, 76px);
  font-size: 14px;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.site-footer .brand { color: var(--on-dark); }
.site-footer__tag { margin-top: 14px; max-width: 30ch; line-height: 1.55; }
.site-footer h3 {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--on-dark);
  margin-bottom: 14px;
}
.site-footer li { margin-bottom: 10px; }
.site-footer a { text-decoration: none; transition: color 160ms ease; }
.site-footer a:hover { color: var(--on-dark); }
.site-footer__base {
  margin-top: clamp(36px, 5vw, 56px);
  padding-top: 22px;
  border-top: 1px solid var(--line-dark);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  justify-content: space-between;
  font-size: 13.5px;
}
.site-footer__base a { padding: 2px 1px; }

/* --- Etichetta "concept dimostrativo" ------------------------------------ */

.demo-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--text-soft);
}
.demo-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--terracotta);
  flex: none;
}
.section--dark .demo-tag { background: transparent; border-color: var(--line-dark); color: var(--on-dark-soft); }

/* --- Cornice browser (disegnata in CSS, zero byte di immagine) ------------ */

.screen {
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper-2);
  box-shadow: var(--shadow-screen);
  border: 1px solid var(--line);
}
.screen__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.screen__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); flex: none; }
.screen__url {
  margin-left: 10px;
  flex: 1;
  min-width: 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--paper);
  font-size: 11px;
  font-weight: 550;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.screen img { width: 100%; }

.phone {
  border-radius: 26px;
  padding: 8px;
  background: var(--ink);
  box-shadow: var(--shadow-screen);
}
.phone img { border-radius: 19px; }

/* --- Animazioni leggere -------------------------------------------------- */

.reveal { opacity: 0; transform: translateY(10px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity 620ms ease, transform 620ms ease; }
/* Senza JavaScript il contenuto resta visibile. */
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.is-in { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* --- Breakpoint ---------------------------------------------------------- */

@media (max-width: 899px) {
  .site-nav { display: none; }
  .site-header .btn { display: none; }
  .nav-mobile { display: block; }
  .site-header { position: relative; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 599px) {
  body { font-size: 16px; }
  .site-footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .actions .btn { width: 100%; justify-content: center; }
}
