/* Ginevra — heyginevra.com
   Idea guida: la voce e la macchina. Ciò che il commerciale dice è in serif
   corsivo (Newsreader); ciò che Ginevra ne ricava è in grotesk (Schibsted).
   Inchiostro: il blu della penna a sfera con cui si scrivono gli appunti
   di una telefonata. Il verde compare solo dove c'è una conferma. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #f4f5f1;
  --sheet: #ffffff;
  --ink: #1d2768;
  --ink-soft: #3a4594;
  --text: #22252d;
  --muted: #5b606d;
  --line: #d6d9d6;
  --line-strong: #b9bdc0;
  --confirm: #2a7653;
  --confirm-bg: #e6f1ea;
  --focus: #3a4594;

  --sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;

  /* Scala tipografica modulare, rapporto 1.25 su base 17px */
  --fs-small: 0.875rem;
  --fs-body: 1.0625rem;
  --fs-lead: 1.3rem;
  --fs-h3: 1.25rem;
  --fs-h2: clamp(1.75rem, 1.2rem + 1.8vw, 2.4rem);
  --fs-h1: clamp(2.6rem, 1.4rem + 4.6vw, 4.9rem);

  --measure: 66ch;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --wrap: 72rem;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #11152e;
  --sheet: #191e3d;
  --ink: #c3cbff;
  --ink-soft: #a3adf5;
  --text: #e6e8ef;
  --muted: #a5aabb;
  --line: #2c3258;
  --line-strong: #414876;
  --confirm: #6fd3a0;
  --confirm-bg: #183a2c;
  --focus: #c3cbff;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #11152e;
    --sheet: #191e3d;
    --ink: #c3cbff;
    --ink-soft: #a3adf5;
    --text: #e6e8ef;
    --muted: #a5aabb;
    --line: #2c3258;
    --line-strong: #414876;
    --confirm: #6fd3a0;
    --confirm-bg: #183a2c;
    --focus: #c3cbff;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-feature-settings: "ss01" on;
  overflow-x: hidden;
}

a { color: var(--ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -999px; top: 0.5rem;
  background: var(--sheet); color: var(--ink); padding: 0.5rem 0.8rem; z-index: 10;
}
.skip:focus { left: 0.5rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Intestazione ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 1.4rem; padding-bottom: 1.4rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none;
}
.brand svg { width: 1.6rem; height: 1.6rem; flex: none; }
.top nav { display: flex; gap: 1.4rem; font-size: 0.95rem; }
.top nav a { color: var(--text); text-decoration: none; }
.top nav a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 40rem) { .top nav .nav-optional { display: none; } }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding-top: clamp(2rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 8vw, 7rem);
}
@media (max-width: 56rem) { .hero { grid-template-columns: minmax(0, 1fr); } }

.hero h1 {
  font-size: var(--fs-h1);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 750;
  color: var(--ink);
  margin: 0 0 1.6rem;
}
.hero h1 .said {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 0.08em;
}
.hero .lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  max-width: 34ch;
  margin: 0 0 2rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.4rem; align-items: center; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0 1.4rem;
  background: var(--ink); color: var(--paper);
  font: 600 1rem/1 var(--sans);
  border: 0; border-radius: 999px; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--ink-soft); text-decoration: none; }
.quiet { font-weight: 500; }

/* ---------- Il foglio: nota dettata → azioni ---------- */
.sheet {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(1.2rem, 2.5vw, 1.9rem);
  box-shadow: 0 1px 0 var(--line), 0 24px 48px -32px rgba(29, 39, 104, 0.35);
}
.sheet-head {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--muted); font-size: var(--fs-small);
  margin-bottom: 0.9rem;
}
.wave { display: inline-flex; gap: 3px; align-items: center; height: 1rem; }
.wave i { display: block; width: 3px; border-radius: 2px; background: var(--ink); opacity: 0.75; }
.wave i:nth-child(1) { height: 35%; } .wave i:nth-child(2) { height: 80%; }
.wave i:nth-child(3) { height: 55%; } .wave i:nth-child(4) { height: 100%; }
.wave i:nth-child(5) { height: 45%; } .wave i:nth-child(6) { height: 70%; }
.wave i:nth-child(7) { height: 30%; }

.spoken {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.32rem;
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 1.4rem;
  min-height: 6em;
}
.spoken .w { opacity: 1; transition: opacity 180ms ease; }
.is-playing .spoken .w { opacity: 0; }
.is-playing .spoken .w.on { opacity: 1; }

.proposals-title {
  font-size: var(--fs-small); color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 1rem; margin: 0 0 0.4rem;
}
.proposals { list-style: none; margin: 0; padding: 0; }
.proposals li {
  display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: 0.6rem;
  padding: 0.7rem 0; border-bottom: 1px solid var(--line);
  transition: opacity 260ms ease, transform 260ms ease;
}
.is-playing .proposals li { opacity: 0; transform: translateY(6px); }
.is-playing .proposals li.on { opacity: 1; transform: none; }
.tick {
  width: 1.15rem; height: 1.15rem; margin-top: 0.2rem;
  border: 1.5px solid var(--confirm); border-radius: 4px;
  display: grid; place-items: center; color: var(--confirm);
}
.tick svg { width: 0.8rem; height: 0.8rem; }
.proposals strong { display: block; font-weight: 600; color: var(--text); }
.proposals span { color: var(--muted); font-size: 0.95rem; }

.confirm-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 1.1rem; flex-wrap: wrap;
}
.confirm-row small { color: var(--muted); font-size: var(--fs-small); }
.confirm {
  display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 1.1rem;
  border-radius: 999px; background: var(--confirm); color: var(--sheet);
  font-weight: 600; font-size: 0.95rem;
}
.example-note { color: var(--muted); font-size: var(--fs-small); margin: 0.8rem 0 0; }

/* ---------- Sezioni ---------- */
.section { padding-top: clamp(3rem, 7vw, 6rem); padding-bottom: clamp(3rem, 7vw, 6rem); border-top: 1px solid var(--line); }
.section h2 {
  font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -0.025em;
  color: var(--ink); margin: 0 0 1rem; max-width: 22ch; font-weight: 700;
}
.section .intro { max-width: 52ch; color: var(--muted); font-size: 1.12rem; margin: 0 0 2.5rem; }
.split .intro { margin-bottom: 1.2rem; }

.steps {
  list-style: none; margin: 0; padding: 0; counter-reset: step;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem;
}
@media (max-width: 60rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 36rem) { .steps { grid-template-columns: minmax(0, 1fr); } }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 1rem; }
.steps li::before {
  content: counter(step);
  font-family: var(--serif); font-style: italic; font-size: 2rem; line-height: 1;
  color: var(--ink); display: block; margin-bottom: 0.7rem;
}
.steps h3 { font-size: var(--fs-h3); line-height: 1.25; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
.steps p { margin: 0; color: var(--muted); }

.split {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 5rem); align-items: start;
}
@media (max-width: 52rem) { .split { grid-template-columns: minmax(0, 1fr); } }

.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.facts div:first-child { border-top: 1px solid var(--line); }
@media (max-width: 34rem) { .facts div { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; } }
.facts dt { font-weight: 600; color: var(--text); }
.facts dd { margin: 0; color: var(--muted); }

.pilot {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 2rem; align-items: end;
}
@media (max-width: 52rem) { .pilot { grid-template-columns: minmax(0, 1fr); } }
.pilot p { max-width: 50ch; margin: 0 0 1rem; }
.pilot .button { justify-self: start; }

/* ---------- Pagine legali ---------- */
.legal { padding-top: clamp(1.5rem, 4vw, 3rem); padding-bottom: 5rem; }
.legal-grid { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 56rem) { .legal-grid { grid-template-columns: minmax(0, 1fr); } }
.legal h1 { font-size: clamp(2.2rem, 1.5rem + 2.5vw, 3.2rem); line-height: 1.05; letter-spacing: -0.03em; color: var(--ink); margin: 0 0 0.6rem; }
.legal .updated { color: var(--muted); margin: 0 0 2rem; }
.legal .summary {
  font-family: var(--serif); font-size: 1.22rem; line-height: 1.55;
  max-width: 60ch; margin: 0 0 2.5rem; padding-left: 1rem; border-left: 3px solid var(--ink);
}
.toc { position: sticky; top: 1.5rem; font-size: 0.95rem; }
@media (max-width: 56rem) { .toc { position: static; order: 2; border-top: 1px solid var(--line); padding-top: 1.2rem; } .legal-grid > .prose { order: 1; } }
.toc p { font-weight: 600; margin: 0 0 0.6rem; }
.toc ol { margin: 0; padding-left: 1.2rem; color: var(--muted); }
.toc li { margin: 0.25rem 0; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: underline; }
.prose { max-width: var(--measure); }
.prose h2 { font-size: 1.45rem; line-height: 1.25; letter-spacing: -0.015em; color: var(--ink); margin: 2.6rem 0 0.8rem; scroll-margin-top: 1.5rem; }
.prose h3 { font-size: 1.1rem; margin: 1.6rem 0 0.5rem; }
.prose p, .prose li { color: var(--text); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: 0.35rem 0; }
.table-scroll { overflow-x: auto; margin: 1rem 0 1.5rem; border: 1px solid var(--line); border-radius: 10px; }
.prose table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; background: color-mix(in srgb, var(--paper) 70%, var(--sheet)); }
.prose tr:last-child td { border-bottom: 0; }

/* ---------- Piè di pagina ---------- */
.foot { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; color: var(--muted); font-size: 0.95rem; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
