/* Roberto Dagostin. The page speaks the film's language: paper, thick ink outlines, flat fills,
   hard shadows, no gradients. Blue and orange are extras; labels and shapes carry the meaning.
   Motion lives in motion.css. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;
  --bg: #fff1e3;
  --surface: #fffaf4;
  --sky: #e8eef6;
  --ink: #1d1d1f;
  --muted: #4d4d55;
  --outline: #1d1d1f;
  --shadow: #1d1d1f;
  --hairline: rgba(29, 29, 31, 0.22);
  --accent: #1a5cc8;
  --accent-hover: #0a3a8f;
  --on-accent: #ffffff;
  --night: #0a3a8f;
  --orange: #e8791f;
  --signal: #8a3e00;
  --signal-bg: #fffaf4;
  --font: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1626;
    --surface: #18233a;
    --sky: #14233f;
    --ink: #fff1e3;
    --muted: #c8cbd6;
    --outline: #fff1e3;
    --shadow: #000000;
    --hairline: rgba(255, 241, 227, 0.24);
    --accent: #8fbcff;
    --accent-hover: #bcd7ff;
    --on-accent: #0a1a33;
    --signal: #ffb877;
    --signal-bg: #2c2116;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
  accent-color: var(--accent);
  caret-color: var(--accent);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--on-accent); }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; font-weight: 800; }
h1 { font-size: clamp(3rem, 13.5vw, 5rem); font-weight: 900; line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: clamp(2.25rem, 1.5rem + 3.4vw, 3.75rem); font-weight: 900; line-height: 1.06; letter-spacing: -0.03em; }
h3 { font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.02em; }
p { max-width: 62ch; }
a { color: var(--accent); text-underline-offset: 0.2em; }
.icon { width: 1.5rem; height: 1.5rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 1.125rem; height: 1.125rem; stroke-width: 2.25; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right)); }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; display: inline-flex; align-items: center; background: var(--surface); color: var(--ink); padding: 0.75rem 1rem; min-height: 2.75rem; border-radius: 12px; }
.skip:focus-visible { top: 1rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Buttons: ink outline, hard shadow, pressed down on tap ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0.625rem 1.25rem;
  font: 700 1rem/1.2 var(--font); letter-spacing: -0.005em; text-decoration: none; cursor: pointer;
  border: 2.5px solid var(--outline); border-radius: 12px;
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 4px 0 var(--shadow);
  touch-action: manipulation;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow); }
.btn--quiet, .btn--plain { background: var(--surface); color: var(--ink); }
.btn--big { min-height: 3.75rem; padding: 0.875rem 1.75rem; font-size: 1.25rem; }
@media (hover: hover) {
  .btn:hover { background: var(--accent-hover); }
  .btn--quiet:hover, .btn--plain:hover { background: var(--sky); }
}

/* ---------- Header ---------- */
.head { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 3px solid var(--outline); }
.head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.75rem; }
.brand { display: flex; flex-direction: column; justify-content: center; min-height: 2.75rem; text-decoration: none; color: var(--ink); line-height: 1.15; }
.brand strong { font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.015em; }
.brand span { font-size: 0.875rem; color: var(--muted); }
.nav { display: none; gap: 1.5rem; }
.nav a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--ink); text-decoration: none; font-size: 0.9375rem; font-weight: 600; white-space: nowrap; }
.nav a:hover { color: var(--accent); text-decoration: underline; }
.head .btn, .brand span { white-space: nowrap; }
@media (min-width: 1080px) { .nav { display: flex; } }
@media (max-width: 519px) { .head .wrap > .btn { display: none; } } /* the bottom contact bar carries the buttons on phones */

/* ---------- Hero: the valley, and three cards dealt in front of it ---------- */
.hero { position: relative; isolation: isolate; overflow: clip; padding-block: clamp(3rem, 8vw, 6rem) clamp(8rem, 17vw, 14rem); background: var(--sky); }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: clamp(6rem, 14vw, 12rem); z-index: 0; background: url("assets/ridge.svg") center bottom / cover no-repeat; pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; display: grid; gap: 3rem; align-items: center; }
.hero__text { display: grid; gap: 1.75rem; justify-items: start; }
.hero__lead { font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.4; letter-spacing: -0.01em; color: var(--muted); max-width: 30em; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.fan { position: relative; width: 100%; max-width: 30rem; margin-inline: auto; aspect-ratio: 5 / 4; }
.fan img { position: absolute; width: 76%; height: auto; border: 3px solid var(--outline); border-radius: 20px; box-shadow: 5px 5px 0 var(--shadow); }
.fan img:nth-child(1) { left: 0; top: 2%; transform: rotate(-5deg); }
.fan img:nth-child(2) { right: 0; top: 28%; transform: rotate(4deg); }
.fan img:nth-child(3) { left: 8%; bottom: 0; transform: rotate(-2deg); }
@media (min-width: 960px) {
  h1 { font-size: clamp(4.5rem, 7.4vw, 5.75rem); }
  .hero .wrap { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 4rem; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(4rem, 9vw, 7rem); }
.section--surface { background: var(--surface); }
.section__head { display: grid; gap: 0.875rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section__head .muted { font-size: clamp(1.1875rem, 2vw, 1.375rem); line-height: 1.4; letter-spacing: -0.01em; }

.steps { list-style: none; margin: 0 0 clamp(3rem, 6vw, 5rem); padding: 0; display: grid; gap: 1.25rem; counter-reset: step; }
@media (min-width: 880px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }
.steps li { counter-increment: step; display: grid; gap: 0.5rem; align-content: start; justify-items: start; padding: 1.25rem; background: var(--surface); border: 3px solid var(--outline); border-radius: 20px; box-shadow: 5px 5px 0 var(--shadow); }
.steps li::before { content: "Passo " counter(step); padding: 0.125rem 0.625rem; font-weight: 800; font-size: 0.9375rem; color: #1d1d1f; background: var(--orange); border: 2px solid #1d1d1f; border-radius: 8px; }
.steps h3 { font-size: 1.5rem; }
.steps p { color: var(--muted); }

/* Booking form, and the phone beside it */
.checkup { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 880px) { .checkup { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2rem; } }
.form { display: grid; gap: 1.375rem; padding: clamp(1.25rem, 4vw, 2.25rem); background: var(--surface); border: 3px solid var(--outline); border-radius: 24px; box-shadow: 6px 6px 0 var(--shadow); }
.form__note { font-size: 0.9375rem; color: var(--muted); }
.field { display: grid; gap: 0.375rem; }
.field label, .field legend { font-weight: 700; font-size: 0.9375rem; padding: 0; }
.field input[type="text"], .field select {
  min-height: 2.75rem; padding: 0.5rem 0.875rem; font: inherit; color: var(--ink);
  background: var(--surface); border: 2.5px solid var(--outline); border-radius: 12px; width: 100%;
}
.field input::placeholder { color: var(--muted); opacity: 1; }
.field input[aria-invalid="true"] { border-color: var(--signal); box-shadow: inset 0 0 0 2px var(--signal); }
fieldset.field { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.375rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.5rem 1rem; border: 2.5px solid var(--outline); border-radius: 12px; background: var(--surface); font-weight: 600; }
.choice input:checked + span { background: var(--sky); box-shadow: inset 0 0 0 2px var(--outline); font-weight: 800; }
.choice input:checked + span::before { content: ""; width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--ink); }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 3px; }
.status { min-height: 1.5rem; font-weight: 700; }
.phone-alt { display: grid; gap: 0.75rem; justify-items: start; padding: clamp(1.25rem, 4vw, 2rem); background: var(--sky); border: 3px solid var(--outline); border-radius: 24px; box-shadow: 6px 6px 0 var(--shadow); }
.phone-alt .contact__num { color: var(--ink); font-size: clamp(1.625rem, 1.3rem + 1.4vw, 2.125rem); }

/* Capire le assicurazioni: eight native <details>, each with its card */
.lead-note { font-size: clamp(1.1875rem, 2vw, 1.375rem); line-height: 1.4; letter-spacing: -0.01em; font-weight: 500; }
.areas { display: grid; gap: 0.875rem; }
.area { background: var(--bg); border: 3px solid var(--outline); border-radius: 20px; }
.area summary {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.75rem; align-items: center;
  min-height: 2.75rem; padding: 0.75rem; border-radius: 16px; cursor: pointer; list-style: none; touch-action: manipulation;
}
.area summary::-webkit-details-marker { display: none; }
/* The open state is a shape: the chevron turns */
.area summary::after { content: ""; width: 0.75rem; height: 0.75rem; margin: 0 0.375rem 0.25rem; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(45deg); }
.area[open] summary::after { transform: translateY(0.25rem) rotate(225deg); }
.area__chip { display: block; width: 5rem; overflow: hidden; border: 2.5px solid var(--outline); border-radius: 10px; }
.area__chip img { width: 100%; height: auto; }
.area__head { display: grid; gap: 0.125rem; min-width: 0; }
.area__title { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.area__worry { color: var(--muted); line-height: 1.35; }
@media (hover: hover) { .area summary:hover .area__title { color: var(--accent); } }
.area__body { display: grid; gap: 1.5rem; padding: 0.5rem 0.875rem 1.25rem; }
.area__know, .area__side, .area__ask, .area__warn { display: grid; gap: 0.5rem; align-content: start; min-width: 0; }
.area__card { width: 100%; height: auto; margin-bottom: 1rem; border: 3px solid var(--outline); border-radius: 20px; }
.area__know h3 + * { margin-bottom: 0.875rem; }
.area__side { gap: 1.5rem; }
.area h3 { font-size: 1.125rem; font-weight: 800; letter-spacing: -0.01em; }
.area ul { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.375rem; }
/* "Attenzione a" carries itself by label, icon, box and weight; the orange is only an extra */
.area__warn { padding: 1rem 1rem 1.125rem; background: var(--signal-bg); border: 2.5px solid var(--outline); border-left-width: 8px; border-radius: 12px; font-weight: 500; }
.area__warn h3 { display: flex; align-items: center; gap: 0.5rem; font-weight: 900; color: var(--signal); }
.area__ask .actions { margin-top: 0.75rem; }
@media (min-width: 880px) {
  .area summary { padding: 0.875rem 1.25rem; gap: 1.125rem; }
  .area__chip { width: 7rem; }
  .area__body { grid-template-columns: 1fr 1fr; gap: 3rem; padding: 0.5rem 1.5rem 1.75rem; }
}

/* Parole da sapere */
.words { display: grid; gap: 1rem; margin-top: clamp(3rem, 6vw, 4.5rem); }
.words h3 { font-size: 1.625rem; letter-spacing: -0.025em; }
.words dl { margin: 0; display: grid; }
.words dl > div { padding-block: 0.75rem; border-top: 1px solid var(--hairline); }
.words dt { display: inline; font-weight: 700; }
.words dd { display: inline; margin: 0; }
@media (min-width: 880px) { .words dl { grid-template-columns: 1fr 1fr; column-gap: 3rem; } }

/* Cosa fare se... */
.guides { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 1000px) { .guides { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.guide { display: grid; gap: 0.875rem; min-width: 0; padding: clamp(1.25rem, 3vw, 1.75rem); background: var(--surface); border: 3px solid var(--outline); border-radius: 20px; box-shadow: 5px 5px 0 var(--shadow); }
.guide__lead { font-weight: 700; }
.guides__more { margin-top: 1.5rem; }
.guide ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; counter-reset: passo; }
.guide li { counter-increment: passo; position: relative; padding-left: 2.5rem; min-height: 1.875rem; }
.guide li::before { content: counter(passo); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 1.875rem; height: 1.875rem; font-weight: 800; font-size: 0.9375rem; color: var(--bg); background: var(--ink); border-radius: 50%; }
.guide__note { padding-top: 0.75rem; font-size: 0.9375rem; color: var(--muted); border-top: 1px solid var(--hairline); }

/* Come raggiungermi: the clearest thing on the page. Fixed colours: the panel looks the same in dark mode. */
.contact {
  position: relative; overflow: hidden; display: grid; gap: 1.25rem; justify-items: center; text-align: center;
  padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 5vw, 4rem) clamp(7rem, 15vw, 12rem);
  color: #fff1e3; background: #0a3a8f; border: 3px solid var(--outline); border-radius: 28px; box-shadow: 8px 8px 0 var(--shadow);
}
.contact::after { content: ""; position: absolute; inset: auto 0 0; height: clamp(5rem, 12vw, 10rem); background: url("assets/ridge.svg") center bottom / cover no-repeat; pointer-events: none; }
.contact > * { position: relative; z-index: 1; }
.contact__num { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: clamp(2rem, 8.4vw, 5.5rem); font-weight: 900; letter-spacing: -0.02em; line-height: 1.05; color: #ffffff; text-decoration: none; }
.contact__num:hover { text-decoration: underline; }
.contact h2 { font-size: clamp(1.75rem, 1.25rem + 2.2vw, 2.75rem); }
.contact .actions { justify-content: center; }
.contact .btn { --outline: #1d1d1f; box-shadow: 0 4px 0 #1d1d1f; background: #e8791f; color: #1d1d1f; }
.contact .btn--plain { background: #fff1e3; }
.face { width: 7rem; height: 7rem; border-radius: 50%; object-fit: cover; border: 3px solid #fff1e3; }
@media (max-width: 519px) { .contact .actions, .contact .btn { width: 100%; } }

/* Roberto */
.about { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 880px) { .about { grid-template-columns: 1fr 1fr; gap: 4.5rem; } }
.video {
  --ink: #fff1e3; --muted: #d5e2f2; --accent: #9accff; --accent-hover: #bcdeff; --on-accent: #06264d; --outline: #1d1d1f;
  margin: 0; overflow: hidden; color: var(--ink); background: var(--night); border: 3px solid #1d1d1f; border-radius: 24px; box-shadow: 6px 6px 0 var(--shadow);
}
/* The portrait is the resting layer; site.js adds .is-ready once the film's poster loads */
.film__stage { position: relative; aspect-ratio: 4 / 3; }
.film__still { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 0.875rem; padding: 1rem; text-align: center; color: var(--muted); }
.film__still strong { color: var(--ink); font-size: 1.25rem; letter-spacing: -0.015em; }
.film__still .face { width: 8rem; height: 8rem; }
.film video { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--night); cursor: pointer; }
.film__hint { display: none; position: absolute; inset-block-end: 1rem; inset-inline-end: 1rem; pointer-events: none; } /* a corner: centred, it covers the poster's name */
.film__bar { display: none; flex-wrap: wrap; align-items: center; gap: 0.625rem; padding: 0.875rem 1rem 1rem; }
.film__alt { flex: 1 1 100%; font-weight: 700; }
.film__bar .btn { flex: 1 1 8rem; }
.film.is-ready video { display: block; }
.film.is-ready .film__bar { display: flex; }
.film.is-ready.is-paused .film__hint { display: block; background: rgba(6, 38, 77, 0.75); }
.video .btn--quiet { background: transparent; color: #fff1e3; border-color: #fff1e3; box-shadow: none; }
.video .icon:not(.icon--sm) { box-sizing: content-box; width: 2rem; height: 2rem; padding: 1rem; border-radius: 50%; box-shadow: inset 0 0 0 2px #fff1e3; }
.film__more { padding: 0 1rem 1rem; }
.film__more .btn { width: 100%; }
.film__text { padding: 0 1rem 1rem; }
.film__text summary { display: flex; align-items: center; min-height: 2.75rem; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }
.film__text p { margin-top: 0.625rem; }
.about__text { display: grid; gap: 1.5rem; justify-items: start; }
.quote { font-size: clamp(1.625rem, 3vw, 2.25rem); line-height: 1.2; letter-spacing: -0.025em; font-weight: 700; }

/* Footer */
.foot { padding-block: 2.5rem 6rem; font-size: 0.875rem; color: var(--muted); display: grid; gap: 0.625rem; }
.foot p { max-width: 70ch; }

/* Informativa privacy */
.legal { display: grid; gap: 1rem; max-width: 46rem; padding-block: clamp(2.5rem, 7vw, 4.5rem); }
.legal h1 { font-size: clamp(2.25rem, 1.5rem + 3.4vw, 3.5rem); }
.legal h2 { margin-top: 1rem; font-size: 1.375rem; letter-spacing: -0.02em; }
.legal ul { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.375rem; }
.legal a { overflow-wrap: anywhere; }

/* Floating contact bar (phone) */
.contact-bar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 0.625rem max(1rem, env(safe-area-inset-right)) calc(0.75rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); display: flex; gap: 0.5rem; background: var(--bg); border-top: 3px solid var(--outline); }
.contact-bar .btn { flex: 1; }
@media (min-width: 880px) { .contact-bar { display: none; } .foot { padding-bottom: 3rem; } }

/* ---------- Visitor preferences win ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
