/* Landing page di carovitanontitemo.it: nessuno script, nessun font esterno. Colori in variabili, tema scuro automatico. */
:root {
  --navy: #17324f;
  --navy-2: #24496f;
  --sun: #ffb627;
  --sun-soft: #fff1cf;
  --coral: #e8553e;
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5b6676;
  --line: #e3ded3;
  --hill: #b9d8a8;
  --ground: #d9cfbd;
  --city: #8fa3b8;
  --shadow: 0 1px 2px rgb(23 50 79 / 6%), 0 8px 24px rgb(23 50 79 / 8%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1a27;
    --surface: #162436;
    --text: #e9eef4;
    --muted: #a3b0c0;
    --line: #26384d;
    --sun-soft: #3a3020;
    --hill: #3d5e3a;
    --ground: #3a3326;
    --city: #4d6580;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 0.6em; }
h3 { font-size: 1.2rem; margin: 0 0 0.4em; }

.sprite { position: absolute; }

/* Intestazione */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1.05rem;
}
.brand b { color: var(--coral); }
.brand-mark { width: 32px; height: 32px; flex: none; }
.top-nav { display: flex; gap: 20px; }
.top-nav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; }
.top-nav a:hover { color: var(--text); }
@media (max-width: 640px) { .top-nav { display: none; } }

main > section { max-width: 1120px; margin: 0 auto; padding: 48px 16px; }

/* Apertura */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
  padding-top: 32px;
}
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: 24px; } }
.kicker {
  display: inline-block;
  margin: 0 0 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--sun-soft);
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0 0 20px; }
.hl {
  background: linear-gradient(transparent 60%, var(--sun) 60%, var(--sun) 92%, transparent 92%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
@media (prefers-color-scheme: dark) { .hl { background: none; color: var(--sun); } }
.lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.lead b { color: var(--text); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.note { margin: 16px 0 0; font-size: 0.9rem; color: var(--muted); }

.button {
  display: inline-block;
  padding: 13px 22px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.button.primary { background: var(--coral); color: #fff; }
.button.primary:hover { background: #d4432d; }
.button.ghost { border: 2px solid var(--line); }
.button.ghost:hover { border-color: var(--muted); }

/* Illustrazione */
.hero-art { margin: 0; }
.hero-art svg { width: 100%; height: auto; display: block; border-radius: 20px; background: linear-gradient(#dff0fb, #fdf6e6); box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) { .hero-art svg { background: linear-gradient(#1b3350, #2a3140); } }
.sun { fill: var(--sun); }
.city rect { fill: var(--city); }
.windows rect { fill: #fff4cc; opacity: 0.9; }
.price circle { fill: var(--coral); }
.price.cheap circle { fill: #2e9e5b; }
.price text { fill: #fff; font: 700 15px system-ui, sans-serif; }
.hill { fill: var(--hill); }
.houses path { fill: var(--surface); stroke: var(--navy); stroke-width: 2.5; stroke-linejoin: round; }
.ground { fill: var(--ground); }
.rail { stroke: var(--navy); stroke-width: 3; }
.sleepers { stroke: var(--navy); stroke-width: 5; stroke-dasharray: 3 12; opacity: 0.5; }
.train > rect:first-child { fill: var(--navy); }
.train-window { fill: var(--sun); }
.wheel { fill: #333; }
.clock circle { fill: var(--surface); stroke: var(--navy); stroke-width: 3; }
.clock path { fill: none; stroke: var(--coral); stroke-width: 3; stroke-linecap: round; }
@media (prefers-color-scheme: dark) { .train > rect:first-child { fill: #6f93bd; } .rail, .sleepers { stroke: #6f93bd; } }

@media (prefers-reduced-motion: no-preference) {
  .train { animation: ride 9s ease-in-out infinite alternate; }
  @keyframes ride { from { transform: translateX(-150px); } to { transform: translateX(110px); } }
}

/* Come funziona */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.steps li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.steps p { margin: 0; color: var(--muted); }
.step-n {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--sun);
  font-weight: 800;
}

/* Strumenti */
.section-lead { color: var(--muted); margin: -8px 0 24px; }
.cards { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.card.featured { border-top: 6px solid var(--sun); }
.card.soon { border-style: dashed; box-shadow: none; background: transparent; }
.card.soon p { color: var(--muted); margin: 0; }
.card-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.card-head h3 { font-size: 1.5rem; margin: 0; }
.card-head h3 a { text-decoration: none; }
.card-icon { width: 48px; height: 48px; flex: none; }
.tag { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.modes {
  list-style: none;
  padding: 0;
  margin: 20px 0 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 560px) { .modes { grid-template-columns: 1fr; } }
.modes a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.modes a:hover { border-color: var(--sun); background: var(--sun-soft); }
.modes span { color: var(--muted); font-size: 0.92rem; }

/* Domande */
.faq details {
  max-width: 820px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 20px;
  margin-bottom: 10px;
}
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  font-weight: 700;
  padding: 16px 0;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sun-soft);
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* Chiusura */
.closing { text-align: center; }
.closing h2 { max-width: 18em; margin: 0 auto 24px; }

.foot {
  border-top: 1px solid var(--line);
  padding: 24px 16px 40px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.foot p { margin: 4px auto; max-width: 60em; }
