@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}

:root {
  --bg: #ffffff;
  --ink: #16171a;
  --dim: #676a72;
  --line: #e6e7ea;
  --soft: #f5f6f8;
  --accent: #2446d8;
  --accent-ink: #1b35a8;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 6vw, 96px);
  --radius: 10px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

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

.site-footer {
  padding: 28px var(--gutter);
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--dim);
  display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap;
}
.site-footer a { color: var(--dim); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* ───────── Bottoni ───────── */

.btn {
  display: inline-flex; align-items: center; gap: 0.55em;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(16px, 1.5vw, 18px);
  letter-spacing: 0.005em;
  word-spacing: 0.06em;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  padding: 0.95em 1.45em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(22, 23, 26, .08), 0 8px 24px -8px rgba(36, 70, 216, .45);
  transition: background .2s ease, transform .2s ease;
}
.btn .arrow { transition: transform .2s ease; }
.btn:hover { background: var(--accent-ink); }
.btn:hover .arrow { transform: translateX(4px); }
.btn[href^="#"]:hover .arrow { transform: translateY(3px); }
.btn:active { transform: translateY(1px); }

/* ───────── Hero ───────── */

.hero {
  min-height: 100svh;
  padding: clamp(40px, 8vh, 80px) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: ". phone" "text phone" "cta phone" ". phone";
  grid-template-rows: 1fr auto auto 1fr;
  column-gap: clamp(32px, 6vw, 96px);
}
.hero-text { grid-area: text; }
.hero-cta { grid-area: cta; align-self: start; justify-self: start; }
.phone { grid-area: phone; align-self: center; }

/* Link testuale al posto del bottone */
.text-cta {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.28em;
  transition: color .2s ease;
}
.text-cta .arrow { display: inline-block; transition: transform .2s ease; }
.text-cta:hover { color: var(--accent); }
.text-cta:hover .arrow { transform: translateY(3px); }
.hero-l1 {
  font-style: italic;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  color: var(--dim);
  margin: 0 0 clamp(14px, 2.5vh, 24px);
}
.hero-l2 {
  font-weight: 400;
  font-size: clamp(2.5rem, 5vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 13ch;
}
.typer {
  display: inline-block;
  min-width: 6.2em;
  font-style: italic;
  color: var(--accent);
  white-space: nowrap;
}
.caret {
  display: inline-block;
  width: 2px; height: 0.82em;
  margin-left: 0.06em;
  vertical-align: -0.04em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
.caret.busy { animation: none; }
@keyframes blink { 50% { opacity: 0; } }

.hero-sub {
  font-family: var(--sans);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.5;
  color: var(--dim);
  margin: clamp(18px, 3vh, 28px) 0 clamp(20px, 3vh, 28px);
  max-width: 34ch;
  text-wrap: pretty;
}

.phone {
  position: relative;
  margin: 0;
  width: clamp(240px, 24vw, 340px);
  aspect-ratio: 9 / 16;
  border-radius: 28px;
  overflow: hidden;
  background: #e8e3da;
  box-shadow: 0 0 0 1px rgba(22, 23, 26, .06), 0 30px 60px -24px rgba(22, 23, 26, .35);
}
.phone video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sound {
  position: absolute; left: 50%; bottom: 14px;
  transform: translateX(-50%);
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, .92);
  border: 0; border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(22, 23, 26, .18);
  white-space: nowrap;
}
.sound:hover { background: #fff; }

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-areas: "text" "phone" "cta";
    grid-template-rows: auto;
    row-gap: 28px;
    padding-top: 72px;
  }
  .hero-sub { margin-bottom: 0; }
  .phone { justify-self: center; width: min(78vw, 320px); }
  .hero-cta { justify-self: center; }
}

/* Entrata in sequenza al caricamento */
.enter { opacity: 0; animation: enter 0.9s cubic-bezier(.2,.7,.2,1) forwards; }
.enter-1 { animation-delay: 0.15s; }
.enter-2 { animation-delay: 1.2s; }
.enter-3 { animation-delay: 1.7s; }
.enter-4 { animation-delay: 2.6s; }
@keyframes enter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ───────── Frasi a scorrimento ───────── */

.beat {
  min-height: 80svh;
  padding: 0 var(--gutter);
  display: flex; align-items: center;
}
.beat p {
  margin: 0;
  text-wrap: balance;
  font-size: clamp(2.2rem, 6vw, 5.6rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 18ch;
}
.beat-1 p { color: var(--dim); }
.beat-2 { justify-content: flex-end; text-align: right; min-height: 60svh; }
.beat-2 p { font-style: italic; }
.beat-3 { min-height: 60svh; }
.beat-3 em { color: var(--accent); }

.reveal { opacity: 0; transform: translateY(32px);
  transition: opacity 1s ease, transform 1s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ───────── Iscrizione ───────── */

.signup {
  padding: clamp(64px, 14vh, 140px) var(--gutter) clamp(64px, 12vh, 120px);
  max-width: 1100px;
  scroll-margin-top: 24px;
}
.signup-head h2 {
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 16ch;
  text-wrap: balance;
}
.signup-head p {
  font-family: var(--sans);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.5;
  color: var(--dim);
  margin: 18px 0 0;
  max-width: 40ch;
}

.lessons {
  list-style: none; margin: clamp(32px, 6vh, 56px) 0; padding: 0;
  max-width: 760px;
  border-top: 1px solid var(--line);
}
.lessons li {
  display: grid; grid-template-columns: 3.2rem 1fr; align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.lessons .num {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.lessons .title { font-size: clamp(1.35rem, 2.4vw, 1.9rem); line-height: 1.2; }
.lessons .last .title { font-style: italic; color: var(--dim); }

@media (min-width: 1000px) {
  .signup {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 460px);
    column-gap: clamp(48px, 6vw, 96px);
    align-items: start;
    max-width: 1320px;
  }
  .signup-head { grid-column: 1 / -1; margin-bottom: clamp(32px, 6vh, 56px); }
  .lessons { margin: 0; }
  .form { position: sticky; top: 32px; }
}

.form {
  max-width: 600px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(22, 23, 26, .04), 0 12px 32px -16px rgba(22, 23, 26, .12);
}
.form-lede {
  display: block;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  line-height: 1.2;
  margin: 0 0 16px;
}
.form-row { display: flex; gap: 8px; }
.form-row input[type="email"] {
  flex: 1; min-width: 0;
  font-family: var(--sans); font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfd2d8;
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-row input[type="email"]::placeholder { color: #9a9da5; }
.form-row input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(36, 70, 216, .14);
}
.form-row .btn { font-size: 16px; padding: 14px 22px; box-shadow: none; }
.form-row .btn[disabled] { opacity: .6; cursor: wait; }

.consent {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 16px;
  font-family: var(--sans); font-size: 14px; line-height: 1.5;
  color: var(--dim);
  cursor: pointer;
}
.consent input {
  flex: none;
  width: 18px; height: 18px; margin: 1px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.consent a { color: var(--ink); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.msg {
  min-height: 1.5em;
  margin: 16px 0 0;
  font-family: var(--sans); font-size: 14.5px; font-weight: 500;
}
.msg:empty { display: none; }
.msg.ok { color: #157347; }
.msg.err { color: #b42318; }

.trust {
  margin: 14px 0 0;
  font-family: var(--sans); font-size: 13px; color: var(--dim);
}

@media (max-width: 640px) {
  .form-row { flex-direction: column; }
  .form-row .btn { justify-content: center; }
}

/* ───────── Pagine di testo (privacy, 404) ───────── */

.doc {
  max-width: 700px;
  margin: 0 auto;
  padding: clamp(48px, 10vh, 96px) 16px 48px;
  font-family: var(--sans);
  font-size: 16px; line-height: 1.7;
  color: #33363c;
}
.doc h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1; letter-spacing: -0.02em;
  color: var(--ink); margin: 0 0 12px;
}
.doc h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: 1.8rem; color: var(--ink);
  margin: 2em 0 0.3em;
}
.doc strong { color: var(--ink); font-weight: 600; }
.doc .meta { color: var(--dim); font-size: 14px; margin: 0 0 2em; }
.doc a:not(.btn) { color: var(--accent); }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: 0.4em; }
.doc .back { display: inline-block; margin-bottom: 40px; color: var(--dim); text-decoration: none; font-size: 14px; }
.doc .back:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .enter, .reveal { animation: none; opacity: 1; transform: none; transition: none; }
  .caret { animation: none; }
}
