/* Metis — vetrina. Identità dell'agente: nebbia, inchiostro petrolio, la luce gialla del percorso critico. */
:root {
  --nebbia: #E6ECEA; --carta: #FBFCFB; --petrolio: #0F2E33; --ardesia: #5B7076; --linea: #D2DCD9;
  --faro: #1F7F7A; --faro-chiaro: #DCEFEC; --lampada: #F3C24E;
  --verde: #2F8F5B; --giallo: #C98A12; --rosso: #C2432C;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--nebbia); color: var(--petrolio); font-family: var(--sans); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
ul, ol { list-style: none; }
:focus-visible { outline: 3px solid var(--faro); outline-offset: 3px; border-radius: 8px; }

/* Barra */
.bar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 12px clamp(16px, 4vw, 48px); background: color-mix(in srgb, var(--nebbia) 85%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--linea); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.01em; text-decoration: none; }
.back-tondo { justify-self: start; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--carta); border: 1px solid var(--linea); color: var(--petrolio); transition: border-color .2s; }
.back-tondo:hover { border-color: var(--faro); }
.back-tondo svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.back-tondo:hover svg, .back-pill:hover svg { transform: translateX(-2px); }
.back-pill { display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; padding: 4px 18px 4px 4px; border-radius: 999px; background: var(--carta); border: 1px solid var(--linea); font-weight: 700; font-size: 14px; text-decoration: none; transition: border-color .2s, color .2s; }
.back-pill .back-tondo { width: 34px; height: 34px; background: var(--nebbia); }
.back-pill:hover { border-color: var(--faro); color: var(--faro); }

/* Pulsanti e video */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px 14px 18px; border-radius: 12px; border: 0; background: var(--lampada); color: var(--petrolio); font: inherit; font-weight: 800; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -10px rgba(15, 46, 51, .45); }
.btn[hidden] { display: none; }
.play-ic { width: 26px; height: 26px; border-radius: 50%; background: var(--petrolio); display: grid; place-items: center; }
.play-ic svg { width: 12px; height: 12px; fill: var(--lampada); margin-left: 2px; }
.demo-modal { border: 0; padding: 0; background: transparent; overflow: visible; max-width: none; max-height: none; width: auto; margin: auto; }
.demo-modal[open] { display: grid; justify-items: center; animation: demo-in .35s cubic-bezier(.2, .8, .2, 1); }
.demo-modal::backdrop { background: rgba(10, 30, 34, .82); backdrop-filter: blur(6px); }
@keyframes demo-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.demo-frame { width: min(92vw, calc(80vh * 16 / 9), 1280px); aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: var(--petrolio); box-shadow: 0 40px 100px rgba(0, 0, 0, .5); }
.demo-frame video { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--petrolio); }
@media (max-aspect-ratio: 1 / 1) { .demo-frame { width: min(92vw, calc(76vh * 4 / 5)); aspect-ratio: 4 / 5; } }
.demo-close { position: fixed; top: 20px; right: 20px; width: 46px; height: 46px; border-radius: 50%; cursor: pointer; background: var(--carta); border: 0; color: var(--petrolio); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.demo-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

main { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }
section { padding: 100px 0; }
h1, h2 { font-weight: 800; letter-spacing: -.035em; line-height: 1.05; }
h1 { font-size: clamp(38px, 4.3vw, 58px); }
h2 { font-size: clamp(32px, 4vw, 50px); }
h1 span, h2 span { font-weight: 300; color: var(--faro); }
.lead { color: var(--ardesia); font-size: clamp(17px, 1.5vw, 19px); max-width: 48ch; margin-top: 24px; }
.cta { margin-top: 32px; }
.sec-head { max-width: 640px; margin-bottom: 44px; }
.sec-head p { color: var(--ardesia); margin-top: 16px; }

/* Hero con il simulatore */
.hero { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; min-height: calc(100vh - 63px); padding: 50px 0 80px; }
.sim { background: var(--carta); border: 1px solid var(--linea); border-radius: 24px; padding: 26px 28px 24px; box-shadow: 0 40px 80px -40px rgba(15, 46, 51, .35); }
.sim figcaption { display: grid; gap: 2px; margin-bottom: 22px; }
.sim figcaption b { font-size: 17px; }
.sim figcaption span { color: var(--ardesia); font-size: 15px; }
.track { --nm: 128px; position: relative; padding: 4px 0 30px; }
.freeze { position: absolute; top: 0; bottom: 30px; border-radius: 8px; background: repeating-linear-gradient(-45deg, rgba(194, 67, 44, .12) 0 7px, rgba(194, 67, 44, .03) 7px 14px); border: 1px dashed rgba(194, 67, 44, .45); }
.freeze small { position: absolute; bottom: 6px; left: 8px; right: 4px; font-size: 11.5px; font-weight: 700; color: var(--rosso); line-height: 1.2; }
.deadline { position: absolute; top: -6px; bottom: 30px; width: 0; border-left: 2px solid var(--petrolio); }
.deadline small { position: absolute; top: -2px; right: 6px; font-family: var(--mono); font-size: 11.5px; font-weight: 500; background: var(--petrolio); color: #fff; padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
#rows { position: relative; display: grid; gap: 7px; padding-top: 22px; }
.row { display: grid; grid-template-columns: var(--nm) 1fr; align-items: center; height: 24px; }
.row .nm { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 10px; }
.lane { position: relative; height: 100%; }
.gb { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; transition: left .7s cubic-bezier(.6, 0, .2, 1), width .7s cubic-bezier(.6, 0, .2, 1), background .4s; }
.gb.arredi { background: #B7793A; }
.gb.team { background: var(--faro); }
.gb.traslochi { background: #7E8F94; }
.gb.ms { top: 4px; width: 16px !important; height: 16px; margin-left: -8px; border-radius: 4px; transform: rotate(45deg); background: var(--verde); }
.track.late .gb.ms { background: var(--rosso); }
.axis { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; border-top: 1px solid var(--linea); }
.tick { position: absolute; top: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--ardesia); transform: translateX(-50%); white-space: nowrap; }
.controls { display: grid; gap: 14px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--linea); }
.slider span { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; }
.slider output { font-family: var(--mono); font-weight: 500; color: var(--faro); }
.slider input { width: 100%; margin-top: 8px; accent-color: var(--faro); }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--faro); }
.verdict { margin-top: 16px; padding: 12px 16px; border-radius: 12px; font-weight: 700; font-size: 15px; }
.verdict.si { background: rgba(47, 143, 91, .12); color: var(--verde); }
.verdict.stretto { background: rgba(201, 138, 18, .13); color: #8F6208; }
.verdict.no { background: rgba(194, 67, 44, .11); color: var(--rosso); }

/* Come lavora: una sequenza vera, numerata */
.steps h2 { margin-bottom: 40px; }
.steps ol { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: passo; }
.steps li { counter-increment: passo; padding-top: 22px; border-top: 2px solid var(--petrolio); }
.steps li::before { content: counter(passo); display: block; font-family: var(--mono); font-size: 13px; color: var(--faro); margin-bottom: 10px; }
.steps b { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.steps p { color: var(--ardesia); font-size: 15.5px; margin-top: 8px; }

/* Strumenti */
.tools { border-top: 1px solid var(--linea); }
.tool-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 40px; }
.tool-list li { display: grid; grid-template-columns: minmax(0, 210px) 1fr auto; gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--linea); }
.tool-list code { font-family: var(--mono); font-size: 14.5px; font-weight: 500; color: var(--faro); }
.tool-list span { color: var(--ardesia); font-size: 15px; }
.tool-list em { font-style: normal; font-size: 12.5px; font-weight: 700; color: #7A5A12; background: #FBEFCB; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.tool-list li.key code { color: var(--petrolio); }

/* Regole */
.rules { border-top: 1px solid var(--linea); }
.rule-list { display: grid; gap: 0; max-width: 760px; }
.rule-list li { font-size: clamp(19px, 2vw, 24px); font-weight: 600; letter-spacing: -.015em; padding: 16px 0 16px 34px; border-bottom: 1px solid var(--linea); position: relative; }
.rule-list li::before { content: ''; position: absolute; left: 0; top: 27px; width: 12px; height: 12px; border-radius: 50%; background: var(--lampada); box-shadow: 0 0 0 5px rgba(243, 194, 78, .22); }

/* Come è costruito */
.stack { padding: 0; }
.stack-in { background: var(--petrolio); color: #E8F0EE; border-radius: 28px; padding: clamp(36px, 5vw, 64px); }
.stack-in h2 { color: #fff; margin-bottom: 20px; }
.stack-in p { max-width: 62ch; color: #B9CDCA; }
.stack-in p + p { margin-top: 14px; }

.final { text-align: center; display: grid; justify-items: center; gap: 26px; padding: 120px 0 90px; }
.final img { border-radius: 22px; }
.foot { text-align: center; padding: 30px clamp(16px, 4vw, 48px) 60px; color: var(--ardesia); font-size: 14px; display: grid; justify-items: center; gap: 8px; }
.foot p a { color: var(--petrolio); font-weight: 700; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 40px; padding-top: 40px; }
  .steps ol { grid-template-columns: repeat(2, 1fr); }
  .tool-list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  section { padding: 70px 0; }
  .steps ol { grid-template-columns: 1fr; }
  .tool-list li { grid-template-columns: 1fr auto; }
  .tool-list span { grid-column: 1 / -1; grid-row: 2; }
  .sim { padding: 20px 16px; }
  .track { --nm: 96px; }
  .row .nm { font-size: 12px; }
  .freeze small { font-size: 0; }
  .freeze small::after { content: 'Chiusura'; font-size: 10.5px; }
  .tick:nth-child(even) { display: none; }
}
/* Categoria, vantaggi, destinatari */
h1 { font-size: clamp(36px, 3.7vw, 52px); }
.kicker { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--faro); margin-bottom: 22px; }
.kicker::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--faro); }
.benefits { border-top: 1px solid var(--linea); }
.benefit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.benefit { background: var(--carta); border: 1px solid var(--linea); border-radius: 18px; padding: 26px 26px 28px; }
.benefit .ix { font-family: var(--mono); font-size: 13px; color: var(--faro); }
.benefit h3 { font-size: 21px; font-weight: 800; letter-spacing: -.015em; line-height: 1.25; margin: 14px 0 8px; }
.benefit p { color: var(--ardesia); font-size: 15.5px; }
.fit { border-top: 1px solid var(--linea); }
.fit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.fit h3 { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ardesia); margin-bottom: 8px; }
.fit li { padding: 14px 0; border-bottom: 1px solid var(--linea); font-size: clamp(17px, 1.6vw, 19px); font-weight: 600; letter-spacing: -.01em; }
.contact-soft { color: var(--ardesia); font-size: 16px; }
.contact-soft a { color: var(--faro); font-weight: 700; }
@media (max-width: 960px) { .benefit-grid { grid-template-columns: 1fr; } .fit-grid { grid-template-columns: 1fr; gap: 32px; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } html { scroll-behavior: auto; } }
