/* Nexus Demo: palcoscenico scuro, schermata vera al centro, didascalia sotto.
   Il font e' Inter, lo stesso del portale, servito dalla cartella della demo
   (nessuna risorsa da internet: la demo deve girare anche senza rete). */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('fonts/inter-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('fonts/inter-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('fonts/inter-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('fonts/inter-600-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --navy: #0b1626;
  --navy-2: #15243a;
  --navy-3: #1e3150;
  --teal: #1fc7b6;
  --teal-dark: #0e8f84;
  --ink-soft: #c9d4e2;
  --muted: #8a9ab0;
  --line: rgba(255, 255, 255, 0.10);
  --caption-h: 148px;
  --bar-h: 52px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--navy);
  color: #fff;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* barra in alto */
.bar {
  height: var(--bar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--navy);
}
.brand { background: none; border: 0; font-weight: 600; font-size: 20px; padding: 4px 0; }
.brand span { color: var(--teal); }
.brand em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 14px; margin-left: 4px; }
.bar__scene { flex: 1; min-width: 0; color: var(--ink-soft); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__tools { display: flex; gap: 8px; }
.tool {
  background: var(--navy-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; font-size: 13px; color: var(--ink-soft);
}
.tool[aria-pressed="true"] { background: var(--teal); color: var(--navy); border-color: var(--teal); font-weight: 600; }
.tool:hover { border-color: var(--teal); }

/* indice delle scene */
.home { height: calc(100% - var(--bar-h)); overflow-y: auto; padding: 40px 16px 32px; }
.home__intro, .home__grid, .home__foot { max-width: 1200px; margin: 0 auto; }
.home__intro h1 { font-size: clamp(28px, 4vw, 44px); margin: 0 0 12px; font-weight: 600; letter-spacing: -0.01em; }
.home__intro p { color: var(--ink-soft); font-size: 17px; line-height: 1.55; max-width: 760px; margin: 0 0 20px; }
.home__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.btn {
  background: var(--navy-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 18px; font-size: 15px; font-weight: 600;
}
.btn:hover { border-color: var(--teal); }
.btn--primary { background: var(--teal); color: var(--navy); border-color: var(--teal); }
.home__keys { font-size: 13px !important; color: var(--muted) !important; }
kbd { background: var(--navy-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-family: inherit; font-size: 12px; }
.home__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 28px; }
.card {
  text-align: left; background: var(--navy-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 0; overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--teal); }
.card__thumb { aspect-ratio: 16 / 9.5; background: #fff center top / cover no-repeat; }
.card__body { padding: 14px 16px 18px; }
.card__num { color: var(--teal); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.card__title { font-size: 18px; font-weight: 600; margin: 4px 0 6px; }
.card__sub { color: var(--ink-soft); font-size: 14px; line-height: 1.45; margin: 0; }
.home__foot { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 32px; }

/* palcoscenico */
.player { height: calc(100% - var(--bar-h)); display: flex; flex-direction: column; }
.viewport { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; padding: 16px; }
.stage-wrap { position: relative; }
.stage {
  position: absolute; top: 0; left: 0; transform-origin: 0 0;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  background: #fff;
}
.stage--phone { border-radius: 36px; box-shadow: 0 0 0 10px #05090f, 0 0 0 11px #2a3a52, 0 18px 50px rgba(0, 0, 0, 0.5); }
.stage__bg { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.stage__layer { position: absolute; inset: 0; }
.stage__layer.fade { animation: fadein .35s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* punto da cliccare */
.hot {
  position: absolute; border-radius: 10px; cursor: pointer;
  outline: 3px solid var(--teal); outline-offset: 2px;
  background: rgba(31, 199, 182, 0.10);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(31, 199, 182, 0.55); }
  70% { box-shadow: 0 0 0 18px rgba(31, 199, 182, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 199, 182, 0); }
}
.hot.nudge { animation: nudge .4s ease; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.hot.press::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; background: rgba(31, 199, 182, 0.6); animation: ripple .55s ease-out forwards;
}
@keyframes ripple { to { transform: scale(9); opacity: 0; } }

/* scrittura animata dentro un campo */
.typing { position: absolute; overflow: hidden; white-space: pre-wrap; word-wrap: break-word; }
.caret { display: inline-block; width: 1.5px; height: 1.1em; margin-left: 1px; vertical-align: text-bottom; background: currentColor; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* risposta che si compone: una copertura che scopre il testo dall'alto */
/* la sfumatura sta DENTRO la copertura: sporgere sopra il riquadro copriva l'intestazione della chat */
.cover { position: absolute; }
.dots { position: absolute; left: 18px; top: 16px; display: flex; gap: 6px; align-items: center; color: #5b6778; font-size: 13px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-dark); opacity: .3; animation: dot 1.1s infinite; }
.dots i:nth-child(2) { animation-delay: .18s; }
.dots i:nth-child(3) { animation-delay: .36s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* riquadri evidenziati */
.mark { position: absolute; border-radius: 8px; outline: 3px solid #f5a524; outline-offset: 2px; background: rgba(245, 165, 36, 0.10); animation: fadein .4s ease; }

/* didascalia */
.caption {
  height: var(--caption-h); flex: none; position: relative;
  display: grid; grid-template-columns: 220px 1fr auto; gap: 24px; align-items: center;
  padding: 16px 24px 20px; background: var(--navy-2); border-top: 1px solid var(--line);
}
.caption__scene { color: var(--teal); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; line-height: 1.4; }
.caption__count { color: var(--muted); font-size: 13px; margin-top: 6px; }
.caption__text { margin: 0; font-size: clamp(16px, 1.5vw, 21px); line-height: 1.45; color: #fff; max-width: 980px; }
.caption__note { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); font-style: italic; }
.caption__nav { display: flex; align-items: center; gap: 12px; }
.caption__hint { min-width: 150px; text-align: center; color: var(--ink-soft); font-size: 13px; }
.caption__hint button { background: var(--teal); color: var(--navy); border: 0; border-radius: 9px; padding: 9px 14px; font-weight: 600; font-size: 14px; }
.nav { width: 44px; height: 44px; border-radius: 50%; background: var(--navy-3); border: 1px solid var(--line); font-size: 24px; line-height: 1; }
.nav:hover { border-color: var(--teal); }
.nav:disabled { opacity: .35; cursor: default; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.06); }
.progress__bar { height: 100%; width: 0; background: var(--teal); transition: width .3s ease; }

@media (max-width: 860px) {
  :root { --caption-h: 190px; }
  .caption { grid-template-columns: 1fr; gap: 10px; padding: 12px 16px 16px; }
  .caption__meta { display: flex; gap: 12px; align-items: baseline; }
  .caption__count { margin: 0; }
  .caption__nav { justify-content: space-between; }
  .bar__scene { display: none; }
}

/* pannello di spiegazione: al posto della schermata, a parole semplici */
.explain { position: absolute; inset: 0; background: #f4f7fa; color: #172234; padding: 90px 110px; display: flex; flex-direction: column; }
.explain__kicker { color: #0e8f84; font-size: 20px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.explain__title { font-size: 52px; line-height: 1.15; margin: 18px 0 18px; font-weight: 600; max-width: 1300px; }
.explain__lead { font-size: 26px; line-height: 1.45; color: #5b6778; margin: 0 0 54px; max-width: 1250px; }
.explain__items { display: flex; gap: 28px; align-items: stretch; }
.explain__item { flex: 1; background: #fff; border-radius: 18px; padding: 30px 28px 32px; box-shadow: 0 6px 24px rgba(11, 22, 38, .08); position: relative; }
.explain__num { width: 48px; height: 48px; border-radius: 50%; background: #0b1626; color: #1fc7b6; font-weight: 600; font-size: 22px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.explain__head { font-size: 27px; font-weight: 600; margin-bottom: 12px; }
.explain__text { font-size: 21px; line-height: 1.45; color: #3b4758; margin: 0; }
.explain__tag { display: inline-block; margin-top: 18px; font-size: 17px; font-weight: 600; padding: 5px 14px; border-radius: 999px; background: #e3f7f4; color: #0e8f84; }
.explain__tag--reuse { background: #eef2f7; color: #5b6778; }
.explain--flow .explain__items { gap: 0; align-items: stretch; }
.explain__arrow { flex: none; width: 56px; display: flex; align-items: center; justify-content: center; font-size: 40px; color: #0e8f84; }
