/*
  Alesca Informatica · proposta «Racconto».
  Il triangolo del logo guida lo scroll. Fondo chiaro e freddo, due scene in blu notte.
  Senza JS, sotto i 900px o con movimento ridotto le scene sono sezioni normali in sequenza;
  con html.guided (impostata da script.js) diventano palcoscenici fissati da ScrollTrigger.
*/
:root {
  --blu-scuro: #0054A1;
  --blu: #308CC9;
  --grigio: #A1A1A1;
  --carta: #F4F7FB;
  --bianco: #FFFFFF;
  --inchiostro: #0D2340;
  --testo-2: #3A4F69;
  --linea: #D3DEEA;
  --tenue: #E4EDF6;
  --notte: #0A1D38;
  --notte-2: #12305A;
  --su-notte: #EEF4FB;
  --su-notte-2: #BFD2E8;
  --luce: #8FC8EE;
  --badge-h: 36px;
  --head-h: 76px;
  --top: calc(var(--badge-h) + var(--head-h));
  --gutter: clamp(16px, 5vw, 72px);
  --titoli: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --testo: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 12px); }
html.guided { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--carta);
  color: var(--inchiostro);
  font-family: var(--testo);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
@media (min-width: 900px) { body { font-size: 19px; } }
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--titoli); font-weight: 500; line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--blu-scuro); text-underline-offset: 3px; }
button, input, textarea { font: inherit; color: inherit; }
:where(a, button, input, textarea):focus-visible { outline: 3px solid var(--blu-scuro); outline-offset: 3px; border-radius: 4px; }
.night :where(a, button):focus-visible { outline-color: var(--luce); }
.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; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: fixed; top: 8px; left: 16px; z-index: 100;
  padding: 12px 20px; border-radius: 8px;
  background: var(--bianco); color: var(--inchiostro); font-weight: 700;
  transform: translateY(-200%); transition: transform .2s ease;
}
.skip-link:focus { transform: none; }

/* ---------- Badge della proposta e testata ---------- */
.badge {
  position: fixed; inset: 0 0 auto; z-index: 60; height: var(--badge-h);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: var(--tenue); color: var(--testo-2); font-size: 16px; line-height: 1;
  border-bottom: 1px solid var(--linea);
}
.badge a { color: var(--blu-scuro); font-weight: 600; }

.site-header {
  position: fixed; top: var(--badge-h); left: 0; right: 0; z-index: 50; height: var(--head-h);
  display: flex; align-items: center; gap: 24px; padding: 0 var(--gutter);
  background: rgba(244, 247, 251, .94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linea);
}
.brand { display: block; flex: none; }
.brand img { height: 58px; width: auto; }
.menu-toggle {
  margin-left: auto; min-height: 48px; padding: 0 20px;
  border: 2px solid var(--blu-scuro); border-radius: 999px; background: var(--bianco);
  color: var(--blu-scuro); font-weight: 700; cursor: pointer;
}
.main-nav {
  position: fixed; top: var(--top); left: 0; right: 0;
  max-height: calc(100svh - var(--top)); overflow-y: auto;
  padding: 12px var(--gutter) 28px; background: var(--carta);
  border-bottom: 1px solid var(--linea); box-shadow: 0 24px 40px -24px rgba(13, 35, 64, .3);
  display: none;
}
.main-nav.is-open { display: block; }
.main-nav ul { display: grid; }
.main-nav li a {
  display: block; padding: 12px 0; font-size: 20px; color: var(--inchiostro);
  text-decoration: none; border-bottom: 1px solid var(--linea);
}
.nav-show {
  display: inline-flex; align-items: center; min-height: 52px; margin-top: 18px; padding: 0 22px;
  border-radius: 999px; background: var(--blu-scuro); color: var(--bianco);
  font-weight: 700; text-decoration: none;
}
@media (min-width: 1180px) {
  .menu-toggle { display: none; }
  .main-nav {
    position: static; display: flex !important; align-items: center; gap: 28px; margin-left: auto;
    max-height: none; overflow: visible; padding: 0; background: none; border: 0; box-shadow: none;
  }
  .main-nav ul { display: flex; gap: 22px; }
  .main-nav li a { padding: 8px 0; font-size: 18px; border: 0; }
  .main-nav li a:hover { color: var(--blu-scuro); text-decoration: underline; }
  .nav-show { margin-top: 0; min-height: 48px; }
}

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 30px; border-radius: 999px;
  font-size: 19px; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: background .2s ease, color .2s ease;
}
.btn-primary { background: var(--blu-scuro); color: var(--bianco); }
.btn-primary:hover { background: #00427f; }
.btn-ghost { border-color: var(--blu-scuro); color: var(--blu-scuro); background: transparent; }
.btn-ghost:hover { background: var(--tenue); }
.btn-light { background: var(--bianco); color: var(--notte); }
.btn-light:hover { background: var(--luce); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh; padding: calc(var(--top) + 32px) var(--gutter) 48px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.hero-tri { width: min(46vw, 230px); height: auto; overflow: visible; margin-bottom: 20px; }
.hero-kicker { font-weight: 600; color: var(--blu-scuro); font-size: 19px; }
.hero-title {
  margin-top: 10px; max-width: 15em;
  font-size: clamp(40px, 7.2vw, 104px); line-height: .98; letter-spacing: -0.03em;
}
.hero-text { margin-top: 26px; max-width: 38em; color: var(--testo-2); font-size: clamp(18px, 1.5vw, 21px); }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.numbers {
  margin-top: 48px; width: 100%; max-width: 1100px;
  display: grid; grid-template-columns: 1fr; gap: 6px 40px;
  border-top: 1px solid var(--linea); padding-top: 24px; color: var(--testo-2);
}
.numbers strong { display: block; font-family: var(--titoli); font-weight: 500; font-size: 44px; line-height: 1.1; color: var(--inchiostro); }
.numbers-place { align-self: end; font-weight: 600; color: var(--blu-scuro); }
@media (min-width: 700px) { .numbers { grid-template-columns: repeat(4, 1fr); } }
.scroll-cue { margin-top: 28px; color: var(--testo-2); font-size: 17px; }

/* ---------- Titoli di sezione ---------- */
.section-title { font-size: clamp(40px, 6vw, 88px); letter-spacing: -0.03em; }
.stage-title { font-size: clamp(34px, 4.4vw, 60px); letter-spacing: -0.025em; }

/* =====================================================================
   SCENE: modalità statica (predefinita)
   ===================================================================== */
.scene { padding: 72px var(--gutter); }
.scene .stage-art { display: none; }
.scene .steps { display: grid; gap: 28px; margin-top: 32px; }
.step h3 { font-size: clamp(30px, 3.4vw, 46px); }
.step p { max-width: 34em; }
.step > p:not(.step-num):not(.pj-client) { margin-top: 10px; }

/* Servizi */
.sv-step { padding: 28px; background: var(--bianco); border-radius: 20px; border: 1px solid var(--linea); }
.mini { width: 64px; height: 58px; margin-bottom: 14px; }
@media (min-width: 700px) { .scene-servizi .steps { grid-template-columns: 1fr 1fr; } }

/* Metodo */
.night { background: var(--notte); color: var(--su-notte); }
.night a:not(.btn) { color: var(--luce); }
.scene-metodo .rail { display: none; }
.mt-step { padding-left: 22px; border-left: 4px solid var(--blu); }
.mt-step p:not(.step-num) { color: var(--su-notte-2); }
.step-num { font-family: var(--titoli); font-size: 64px; line-height: 1; color: var(--luce); margin-bottom: 6px; }
@media (min-width: 700px) { .scene-metodo .steps { grid-template-columns: 1fr 1fr; gap: 40px; } }

/* Progetti */
.laptop-wrap, .pj-index { display: none; }
.pj-step .shot { width: 100%; aspect-ratio: 800 / 420; object-fit: cover; border-radius: 12px; border: 1px solid var(--linea); margin-bottom: 16px; }
.pj-client { font-weight: 600; color: var(--blu-scuro); }
.pj-link {
  display: inline-flex; align-items: center; min-height: 48px; margin-top: 8px;
  font-weight: 700; font-size: 19px;
}
@media (min-width: 700px) { .scene-progetti .steps { grid-template-columns: 1fr 1fr; gap: 44px 32px; } }

/* =====================================================================
   SCENE: modalità guidata (≥900px, movimento consentito). Lo stage viene fissato.
   ===================================================================== */
.guided .scene { padding: 0; }
.guided .stage {
  position: relative; height: 100vh; height: 100svh; overflow: hidden;
  padding: calc(var(--top) + 28px) var(--gutter) 40px;
}
.guided .scene .stage-art { display: block; position: absolute; }
.guided .scene .steps { display: block; margin: 0; }
.guided .step {
  position: absolute; opacity: 0; visibility: hidden;
  transform: translateY(18px);
  transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s;
}
.guided .step.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity .45s ease .1s, transform .45s ease .1s, visibility 0s; }

/* Servizi guidati: il triangolo occupa lo stage, le schede si alternano di lato */
.guided .sv-art { left: 0; right: 0; top: calc(var(--top) + 90px); bottom: 24px; width: 100%; height: calc(100% - var(--top) - 114px); }
.guided .sv-step { width: min(34%, 500px); top: 54%; padding: 34px; box-shadow: 0 30px 60px -36px rgba(13, 35, 64, .35); }
.guided .sv-step.pos-right { right: var(--gutter); transform: translateY(-50%) translateX(24px); }
.guided .sv-step.pos-left { left: var(--gutter); transform: translateY(-50%) translateX(-24px); }
.guided .sv-step.pos-bottom { left: 50%; top: auto; bottom: 40px; width: min(62%, 820px); transform: translateX(-50%) translateY(24px); }
.guided .sv-step.pos-right.is-active, .guided .sv-step.pos-left.is-active { transform: translateY(-50%); }
.guided .sv-step.pos-bottom.is-active { transform: translateX(-50%); }
.guided .sv-step.pos-bottom { display: grid; grid-template-columns: auto 1fr; gap: 4px 24px; align-items: center; }
.guided .sv-step.pos-bottom .mini { grid-row: span 2; margin: 0; }

/* Metodo guidato: figura a sinistra, testo grande a destra, passi in alto */
.guided .metodo-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; }
.guided .scene-metodo .rail { display: flex; flex-wrap: wrap; gap: 10px; }
.rail button {
  min-height: 48px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--notte-2); background: var(--notte-2); color: var(--su-notte-2);
  font-size: 17px; font-weight: 600;
}
.rail button[aria-current="step"] { background: var(--su-notte); border-color: var(--su-notte); color: var(--notte); }
.guided .mt-art { left: var(--gutter); top: calc(var(--top) + 110px); bottom: 32px; width: 50%; height: calc(100% - var(--top) - 142px); }
.guided .mt-step { right: var(--gutter); top: 56%; width: min(40%, 560px); border: 0; padding: 0; transform: translateY(-46%); }
.guided .mt-step.is-active { transform: translateY(-50%); }
.guided .mt-step .step-num { font-size: clamp(96px, 11vw, 168px); letter-spacing: -0.04em; color: transparent; -webkit-text-stroke: 2px var(--luce); margin-bottom: 4px; }
.guided .mt-step h3 { font-size: clamp(36px, 3.6vw, 56px); }
.guided .mt-step p:not(.step-num) { font-size: 22px; }

.mt-flow rect { fill: var(--notte-2); stroke: #2f5585; stroke-width: 2; }
.mt-flow rect.mt-hit { fill: rgba(48, 140, 201, .28); stroke: var(--luce); stroke-width: 3; }
.mt-flow path { stroke: #4b6f9b; stroke-width: 3; fill: none; }
.mt-art text { fill: var(--su-notte); font-family: var(--testo); font-size: 24px; font-weight: 600; text-anchor: middle; }
.mt-wire { fill: none; stroke: var(--luce); stroke-width: 3; stroke-dasharray: .02 .015; }
.mt-track { fill: var(--notte-2); }
.mt-bar { fill: var(--blu); transform-box: fill-box; transform-origin: 0 50%; }
.mt-link { fill: none; stroke: var(--luce); stroke-width: 3; stroke-dasharray: 1; stroke-dashoffset: 1; }
.mt-nodes rect { fill: var(--notte-2); stroke: var(--luce); stroke-width: 2; }
.mt-orbit circle:first-child { fill: none; stroke: #2f5585; stroke-width: 3; stroke-dasharray: 10 12; }
.mt-arrow { fill: none; stroke: var(--luce); stroke-width: 4; stroke-linecap: round; }
.mt-dot { fill: var(--luce); }
.mt-spark { fill: none; stroke: var(--luce); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.mt-art .mt-live { font-size: 22px; fill: var(--su-notte-2); }

/* Progetti guidati: portatile a sinistra, elenco e testo a destra */
.guided .scene-progetti .stage { background: linear-gradient(var(--carta), var(--tenue)); }
.guided .laptop-wrap {
  display: block; position: absolute; left: var(--gutter); top: calc(var(--top) + 110px);
  width: min(58%, calc((100svh - var(--top) - 160px) * 1100 / 590));
  aspect-ratio: 1100 / 590;
}
.guided .pj-index {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px;
  position: absolute; right: var(--gutter); top: calc(var(--top) + 100px); width: min(32%, 460px);
}
.pj-index button {
  width: 100%; min-height: 44px; padding: 4px 0; text-align: left; cursor: pointer;
  background: none; border: 0; border-bottom: 2px solid var(--linea);
  color: var(--testo-2); font-size: 17px; font-weight: 600;
}
.pj-index button[aria-current="step"] { color: var(--blu-scuro); border-bottom-color: var(--blu-scuro); }
.guided .pj-step { right: var(--gutter); bottom: 64px; width: min(32%, 460px); }
.guided .pj-step .shot { display: none; }
.guided .pj-step h3 { font-size: clamp(40px, 4vw, 62px); }

/* Portatile: misura fissa 1100×590, scalato da --s */
.laptop {
  position: absolute; left: 0; top: 0; width: 1100px; height: 590px;
  transform: scale(var(--s, .5)); transform-origin: 0 0;
}
.lid {
  position: absolute; left: 60px; top: 0; width: 980px; height: 548px;
  border-radius: 26px 26px 8px 8px; background: #1a2433;
  box-shadow: inset 0 0 0 2px #2c3a4e, 0 40px 80px -40px rgba(13, 35, 64, .55);
}
.cam { position: absolute; left: 50%; top: 9px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #3c4a5e; }
.screen { position: absolute; left: 20px; top: 24px; width: 940px; height: 500px; overflow: hidden; border-radius: 4px; background: #0b1a2e; }
.bar { position: absolute; inset: 0 0 auto; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: #e9eef4; z-index: 2; }
.bar span { width: 12px; height: 12px; border-radius: 50%; background: #c3ccd6; }
.bar .url {
  margin: 0 auto; padding: 2px 18px; border-radius: 8px; background: var(--bianco);
  font: 600 16px/24px var(--testo); color: var(--testo-2); min-width: 360px; text-align: center;
}
.shots { position: absolute; left: 0; right: 0; top: 38px; bottom: 0; }
.shots img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center;
  clip-path: inset(0 0 0 100%); transition: clip-path .7s cubic-bezier(.7, 0, .2, 1);
}
.shots img.is-past, .shots img.is-active { clip-path: inset(0 0 0 0); }
.base {
  position: absolute; left: 0; top: 548px; width: 1100px; height: 30px;
  border-radius: 4px 4px 26px 26px / 4px 4px 22px 22px;
  background: linear-gradient(#d9e0e8, #aab5c2);
}
.base span { position: absolute; left: 50%; top: 0; width: 160px; height: 12px; margin-left: -80px; border-radius: 0 0 12px 12px; background: #9aa6b4; }

/* ---------- Show ---------- */
.show-band { position: relative; overflow: hidden; padding: 96px var(--gutter); }
.show-wire {
  position: absolute; right: -6%; top: 50%; width: min(70vw, 720px); height: auto;
  transform: translateY(-50%); opacity: .5; pointer-events: none;
}
.show-wire polygon { fill: none; stroke: var(--blu); stroke-width: 1.5; }
.show-inner { position: relative; max-width: 900px; }
.show-band h2 { font-size: clamp(44px, 7.4vw, 112px); line-height: .98; letter-spacing: -0.035em; }
.show-band p { margin-top: 24px; max-width: 34em; font-size: clamp(19px, 1.6vw, 22px); color: var(--su-notte-2); }
.show-band .btn { margin-top: 32px; min-height: 64px; padding: 0 40px; font-size: 21px; }

/* ---------- Chi siamo: citazione larga e missione sfalsata a destra ---------- */
.about, .history, .people, .clients, .news, .contact { padding: 88px var(--gutter); }
.about-quote { margin-top: 28px; max-width: 1180px; }
.about-quote p { font-family: var(--titoli); font-size: clamp(28px, 3.6vw, 52px); line-height: 1.15; letter-spacing: -0.015em; }
.about-grid { margin-top: 48px; display: grid; gap: 28px; }
.about-photo img { width: 100%; border-radius: 16px; aspect-ratio: 16 / 10; object-fit: cover; }
.about-mission { padding: 30px; border-radius: 16px; background: var(--blu-scuro); color: var(--bianco); align-self: end; }
.about-mission h3 { font-size: 32px; }
.about-mission p { margin-top: 12px; font-size: clamp(19px, 1.6vw, 23px); }
@media (min-width: 900px) {
  .about-grid { grid-template-columns: 7fr 4fr; align-items: end; }
  .about-mission { margin-bottom: -40px; margin-left: -80px; position: relative; }
}

/* ---------- Storia: anni alternati ---------- */
.history { background: var(--bianco); }
.timeline { margin-top: 40px; display: grid; gap: 44px; }
.timeline li { display: grid; gap: 16px; }
.timeline img { width: 100%; border-radius: 12px; aspect-ratio: 3 / 2; object-fit: cover; }
.year { font-family: var(--titoli); font-size: clamp(52px, 7vw, 104px); line-height: 1; color: var(--blu-scuro); letter-spacing: -0.03em; }
.timeline li p:not(.year) { margin-top: 8px; max-width: 32em; }
@media (min-width: 900px) {
  .timeline li { grid-template-columns: 5fr 6fr; align-items: center; gap: 56px; }
  .timeline li:nth-child(even) img { order: 2; }
}

/* ---------- Persone ---------- */
.people { display: grid; gap: 40px; }
.people-intro p { margin-top: 16px; max-width: 30em; font-size: clamp(19px, 1.6vw, 22px); color: var(--testo-2); }
.founders { display: grid; gap: 28px; grid-template-columns: 1fr; }
.founders img { width: 100%; aspect-ratio: 8 / 9; object-fit: cover; border-radius: 14px; }
.founders h3 { margin-top: 14px; font-size: 28px; }
.founders p { color: var(--testo-2); }
.office img { width: 100%; border-radius: 14px; aspect-ratio: 3 / 4; object-fit: cover; max-height: 80svh; }
@media (min-width: 640px) { .founders { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) {
  .people { grid-template-columns: 1fr 1fr 1fr 1.2fr; grid-template-rows: auto 1fr; column-gap: 32px; }
  .people-intro { grid-column: 1 / 4; }
  .founders { grid-column: 1 / 4; }
  .office { grid-column: 4; grid-row: 1 / 3; }
  .office img { height: 100%; max-height: none; }
}

/* ---------- Clienti ---------- */
.clients { background: var(--tenue); }
.client-list { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px 36px; }
.client-list li { font-family: var(--titoli); font-size: clamp(24px, 2.6vw, 38px); line-height: 1.3; color: var(--inchiostro); }

/* ---------- News ---------- */
.news-note { margin-top: 12px; color: var(--testo-2); }
.news-list { margin-top: 32px; display: grid; gap: 24px; }
.news-list article { height: 100%; padding: 28px; border-radius: 16px; background: var(--bianco); border: 2px dashed var(--linea); }
.tag { display: inline-block; padding: 2px 12px; border-radius: 999px; background: var(--tenue); color: var(--blu-scuro); font-weight: 700; font-size: 16px; }
.news-list h3 { margin-top: 14px; font-size: 30px; }
.news-list p:not(.tag) { margin-top: 10px; color: var(--testo-2); }
@media (min-width: 800px) { .news-list { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Contatti ---------- */
.contact { display: grid; gap: 40px; align-items: center; background: var(--bianco); }
.contact address { margin-top: 24px; font-style: normal; font-size: clamp(20px, 1.7vw, 24px); display: grid; gap: 8px; }
.contact-form { margin-top: 32px; display: grid; gap: 8px; max-width: 560px; }
.contact-form label { font-weight: 600; margin-top: 8px; }
.contact-form input, .contact-form textarea {
  width: 100%; min-height: 54px; padding: 12px 16px; border-radius: 12px;
  border: 2px solid #8a9bb0; background: var(--bianco); font-size: 19px;
}
.contact-form .btn { margin-top: 16px; justify-self: start; }
.form-status { min-height: 1.6em; font-weight: 700; color: var(--blu-scuro); }
.contact-tri { width: min(70vw, 360px); height: auto; justify-self: center; overflow: visible; }
@media (min-width: 900px) {
  .contact { grid-template-columns: 1.1fr 1fr; }
  .contact-tri { width: min(100%, 520px); }
}

/* ---------- Footer ---------- */
.site-footer { padding: 56px var(--gutter) 64px; background: var(--tenue); display: grid; gap: 24px; }
.footer-logo { width: 96px; height: auto; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.site-footer ul a { display: inline-block; padding: 8px 0; font-weight: 600; }
.legal { color: var(--testo-2); max-width: 60em; }

/* Movimento ridotto: niente transizioni, tutto visibile */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
/* Le facce in arrivo non devono allargare la pagina */
.hero, .contact { overflow-x: clip; }
