/* Schermo del welcome center: rete di fatti. Colori del profilo H-FARM: fondo rosso #E30613, tutto il resto bianco. Font Maison Neue. */
:root {
  --bg: #e30613; --fg: #ffffff; --soft: rgba(255,255,255,.72); --line: rgba(255,255,255,.35); --card: #ffffff; --ink: #202020;
  --sans: "Maison Neue", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font-family: var(--sans); overflow: hidden; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.meta, .hint, .perimeter, .answer .q, .answer .src { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }

.bar { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: baseline; padding: 28px 40px; pointer-events: none; }
.brand { display: flex; align-items: baseline; gap: 14px; }
.mark { font-weight: 700; font-size: 28px; }
.sub { font-size: 15px; }

.hero { position: fixed; left: 40px; bottom: 130px; max-width: 520px; pointer-events: none; transition: opacity .6s; }
.hero h1 { font-weight: 500; font-size: clamp(26px, 2.6vw, 42px); line-height: 1.08; letter-spacing: -.01em; margin: 0 0 14px; text-wrap: balance; }
.hint { margin: 0; }
body.unlocked .hero { opacity: 0; }

.answer { position: fixed; right: 40px; top: 110px; width: min(440px, 38vw); background: var(--card); color: var(--ink); border-radius: 14px; overflow: hidden; z-index: 6;
  line-height: 1.55; font-size: 17px; box-shadow: 0 22px 60px rgba(80,0,0,.32); transition: opacity .3s ease, transform .3s ease, box-shadow .2s; }
.answer.off { opacity: 0; visibility: hidden; transform: translateY(14px) scale(.97); transition: opacity .3s ease, transform .3s ease, visibility 0s .3s; }
.answer.drag { box-shadow: 0 30px 80px rgba(0,0,0,.35); transition: none; }
.ahead { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 22px; background: #202020; color: #fff; cursor: grab; user-select: none; touch-action: none;
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.answer.drag .ahead { cursor: grabbing; }
.ahead .x { background: transparent; border: 0; color: #fff; font-size: 20px; line-height: 1; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }
.ahead .x:hover { background: rgba(255,255,255,.18); }
.abody { padding: 20px 24px 22px; max-height: 60vh; overflow: auto; }
.answer.table { right: auto; left: 40px; width: min(470px, 38vw); font-size: 15px; }
.w { opacity: 0; animation: win .35s ease forwards; }
@keyframes win { to { opacity: 1; } }
.tab { width: 100%; border-collapse: collapse; }
.tab td { padding: 10px 0; border-top: 1px solid #ececec; vertical-align: top; }
.tab tr:first-child td { border-top: 0; }
.tab tr:hover b { color: #e30613; }
.tab .d { white-space: nowrap; padding-right: 16px; color: #e30613; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding-top: 13px; }
.tab b { display: block; font-weight: 600; line-height: 1.3; }
.tab span { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #8a8a8a; }
.bars { display: flex; gap: 12px; align-items: flex-end; margin: 2px 0 16px; padding-bottom: 12px; border-bottom: 1px solid #ececec; }
.yr { flex: 1; display: grid; justify-items: center; gap: 4px; font-size: 11px; color: #8a8a8a; }
.yr b { font-size: 13px; color: #202020; }
.yr i { display: block; width: 100%; max-width: 54px; background: #e30613; border-radius: 3px 3px 0 0; transform-origin: bottom; animation: grow .5s ease both; }
@keyframes grow { from { transform: scaleY(0); } }
@media (prefers-reduced-motion: reduce) { .w, .yr i { animation: none; opacity: 1; } }
.ftitle { font-size: 20px; font-weight: 600; line-height: 1.25; margin-bottom: 10px; }
.answer .q, .answer .src { color: #8a8a8a; }
.answer .q { margin-bottom: 10px; }
.answer .src { margin-top: 14px; font-size: 11px; }
.md .ap { margin: 0 0 8px; } .md .ap:last-child { margin-bottom: 0; }
.md .al { margin: 4px 0 10px; padding-left: 20px; } .md .al:last-child { margin-bottom: 0; }
.md .al li { margin: 0 0 6px; padding-left: 2px; } .md .al li::marker { color: var(--soft); }
.chip { font-size: 11px; font-weight: 700; color: #fff; background: var(--bg); padding: 1px 6px; border-radius: 2px; margin: 0 1px; cursor: default; }
.thinking { display: flex; gap: 10px; align-items: center; color: #8a8a8a; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bg); animation: pulse 1s infinite ease-in-out; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.6); } }

.dock { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 24px 40px 30px; }
.perimeter { min-width: 230px; }
body.unlocked .perimeter { color: var(--fg); font-weight: 700; }
.btn { background: var(--fg); color: var(--bg); border: 0; padding: 12px 18px; font: 600 15px var(--sans); border-radius: 3px; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.beta { position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: var(--fg); opacity: .45; pointer-events: none; }
.keys { display: flex; gap: 8px; align-items: center; }
.snd { background: none; border: 0; padding: 8px; color: var(--fg); cursor: pointer; display: grid; place-items: center; opacity: .85; }
.snd:hover { opacity: 1; }
/* microfono: fuori dal campo della domanda. Mentre ascolta l'anello si consuma in 30 secondi. */
.talk { position: relative; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--fg); cursor: pointer; display: grid; place-items: center; opacity: .85; }
.talk:hover { opacity: 1; }
.talk .ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.talk circle { fill: none; stroke: currentColor; stroke-width: 1.5; }
.talk .track { opacity: .28; }
.talk .time { stroke-width: 3; stroke-linecap: round; stroke-dasharray: 126; stroke-dashoffset: 126; }
.talk.rec { opacity: 1; background: var(--fg); color: var(--bg); }
.talk.rec .ring { color: var(--fg); inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); }
.talk.rec .track { opacity: 0; }
.talk.rec .time { animation: ringdown 30s linear forwards; }
.talk.busy { opacity: .45; cursor: progress; }
@keyframes ringdown { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 126; } }
.snd .off, .snd[aria-pressed="false"] .on { display: none; }
.snd[aria-pressed="false"] .off { display: inline; }
.snd[aria-pressed="false"] { opacity: .55; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
a.btn { text-decoration: none; display: inline-block; }

/* domanda: campo in sovraimpressione, compare con un click sullo schermo e sparisce quando non serve. Si chiede con Invio. */
.ask { position: fixed; left: 50%; bottom: 168px; width: min(720px, 62vw); display: grid; gap: 14px; justify-items: center; z-index: 5;
  opacity: 0; visibility: hidden; transform: translate(-50%, 16px); transition: opacity .3s ease, transform .3s ease, visibility 0s .3s; }
.ask.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .3s ease, transform .3s ease; }
#askf { width: 100%; position: relative; }
#q { width: 100%; background: #fff; color: var(--ink); border: 0; border-radius: 999px; padding: 19px 30px; font: 20px var(--sans); box-shadow: 0 18px 50px rgba(80,0,0,.35); }
#q::placeholder { color: #8a8a8a; }
#q:focus { outline: none; }
.presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.presets button { background: transparent; color: var(--fg); border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; font: 14px var(--sans); cursor: pointer; }
.presets button:hover { background: var(--fg); color: var(--bg); }

/* dentro: bianco e nero. Fondo bianco, nodi, linee e testi scuri; il rosso H-FARM resta solo per i fatti citati. */
body { transition: background-color .7s, color .7s; }
body.inside { --bg: #fff; --fg: #202020; --soft: rgba(32,32,32,.62); --line: rgba(32,32,32,.22); }
body.inside .hero, body.asking .hero { opacity: 0; }
body.inside .btn { background: #202020; color: #fff; }
body.inside .btn.ghost { background: transparent; color: #202020; }
body.inside #q { box-shadow: 0 0 0 1px rgba(32,32,32,.14), 0 18px 50px rgba(0,0,0,.16); }
body.inside .presets button { background: #fff; }
body.inside .answer { border: 1px solid rgba(32,32,32,.12); box-shadow: 0 14px 40px rgba(0,0,0,.12); }
body.inside .chip, body.inside .dot { background: #e30613; }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

/* agente di accoglienza al lavoro: registrazione dell'ospite e i tre momenti della visita */
.answer.visit { width: min(540px, 44vw); font-size: 15.5px; }
.answer.visit .abody { max-height: calc(100vh - 290px); }
.vguest { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid #cfcfcf; border-radius: 6px; padding: 13px 15px; margin-top: 10px; font: 16px var(--sans); color: #202020; cursor: pointer; }
.vguest:hover, .vguest:focus { border-color: #202020; outline: none; } .vguest b { display: block; } .vguest small { color: #5a5a5a; font-size: 13px; }
.vform { display: grid; gap: 10px; }
.vform input { width: 100%; box-sizing: border-box; border: 1px solid #cfcfcf; border-radius: 6px; padding: 12px 14px; font: 16px var(--sans); color: #202020; background: #fff; }
.vform input:focus { outline: 2px solid #202020; outline-offset: 1px; }
.vh { margin: 18px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #202020; border-top: 1px solid #ececec; padding-top: 14px; }
.vi { margin: 0 0 10px; } .vi b { display: block; font-weight: 600; line-height: 1.3; } .vi small { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #6a6a6a; }
.vmsg { background: #f4f4f4; border-radius: 8px; padding: 12px 14px; font-size: 14.5px; } .vmsg b { display: block; margin-bottom: 4px; }
.vbtn { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.vbtn button { background: #202020; color: #fff; border: 0; padding: 11px 16px; font: 600 14px var(--sans); border-radius: 3px; cursor: pointer; }
.vbtn button.ghost { background: transparent; color: #202020; border: 1px solid #b9b9b9; } .vbtn button:disabled { opacity: .5; cursor: default; }
.vok { color: #0b7a4b; font-weight: 600; } .vwait { color: #8a5200; font-weight: 600; }

/* suggeritore di domande sotto la barra */
.suggest { display: grid; gap: 6px; justify-items: center; background: none; border: 0; color: var(--fg); cursor: pointer; padding: 4px 18px; min-height: 58px; transition: opacity .25s ease; }
.suggest .lab { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--soft); }
.suggest .txt { font: 600 19px var(--sans); min-height: 26px; }
.suggest:hover .txt { text-decoration: underline; text-underline-offset: 5px; }
.suggest .caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 3px; vertical-align: -3px; background: currentColor; animation: caret 1s steps(1) infinite; }
.suggest.quiet { opacity: 0; pointer-events: none; }
@keyframes caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .suggest .caret { animation: none; } }

/* barra aperta: sotto la barra il fondo è pieno, la rete non passa dietro ai testi */
.scrim { position: fixed; left: 0; right: 0; bottom: 0; height: 470px; max-height: 62vh; pointer-events: none; opacity: 0; transition: opacity .35s ease;
  background: linear-gradient(to top, var(--bg) 0, var(--bg) 300px, transparent); }
body.asking .scrim { opacity: 1; }

/* Log-In con H-OS Pass: il QR al centro, il telefono lo inquadra; la barra si consuma finché il codice vale */
.scan { position: fixed; left: 50%; top: 50%; width: min(460px, 92vw); transform: translate(-50%, -50%); z-index: 20; background: #fff; color: var(--ink);
  border-radius: 14px; overflow: hidden; box-shadow: 0 30px 90px rgba(60,0,0,.45); transition: opacity .3s ease, transform .3s ease; }
.scan.off { opacity: 0; visibility: hidden; transform: translate(-50%, -46%) scale(.97); transition: opacity .3s ease, transform .3s ease, visibility 0s .3s; }
.scan .ahead { cursor: default; }
.sbody { padding: 22px 24px 22px; text-align: center; }
.passqr { position: relative; width: min(340px, 70vw, 48vh); aspect-ratio: 1; margin: 0 auto; }
.passqr img { width: 100%; height: 100%; display: block; image-rendering: pixelated; transition: opacity .3s, filter .3s; }
.passqr img:not([src]) { visibility: hidden; }
.passqr img.used { opacity: .08; filter: blur(2px); }
.passqr .tick { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transform: scale(.85); transition: opacity .3s, transform .3s; pointer-events: none; }
.scan.ok .tick { opacity: 1; transform: none; }
.tick svg { width: 44%; fill: none; stroke: #0b7a4b; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.scan .timer { height: 4px; background: #ececec; border-radius: 2px; margin: 12px auto 0; width: min(340px, 70vw, 48vh); overflow: hidden; }
.scan .timer i { display: block; height: 100%; width: 100%; background: #e30613; transform-origin: left; }
.scan.ok .timer i { background: #0b7a4b; }
.smsg { margin: 16px 0 6px; font-size: 20px; font-weight: 600; }
.scan.bad .smsg { color: #8a5200; }
.scan.ok .smsg { color: #0b7a4b; }
.shint { margin: 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #8a8a8a; line-height: 1.6; }
.hello { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(.96); z-index: 19; pointer-events: none; text-align: center; opacity: 0;
  font-weight: 600; font-size: clamp(40px, 6vw, 92px); letter-spacing: -.02em; line-height: 1.02; color: var(--fg); transition: opacity .6s ease, transform .6s ease; }
.hello small { display: block; margin-top: 14px; font-size: 13px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; opacity: .8; }
.hello.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
@media (prefers-reduced-motion: reduce) { .cam .frame { animation: none; } }
/* durante il saluto la rete si fa da parte: il nome si legge pulito */
#cv { transition: opacity .6s ease; }
body.greeting #cv { opacity: .18; }
.vnew { margin-top: 18px; display: grid; gap: 8px; }
.vnew .vh { margin: 0 0 2px; }
.vnew input { font: 16px var(--sans); padding: 11px 13px; border: 1px solid #cfcfcf; border-radius: 6px; color: #202020; background: #fff; }
.vnew input:focus { border-color: #202020; outline: none; }
.vnew button { font: 600 15px var(--sans); padding: 12px; border: 0; border-radius: 6px; background: #202020; color: #fff; cursor: pointer; }
.vnew .vtime { color: #5a5a5a; font-size: 12px; }

/* sottotitoli della voce: centrati nello spazio libero tra i due riquadri, sopra la barra in basso */
.cc { position: fixed; bottom: 92px; left: 50%; width: min(760px, 90vw); z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
  opacity: 0; transform: translate(-50%, 14px); transition: opacity .35s ease, transform .35s ease; }
.cc.on { opacity: 1; transform: translate(-50%, 0); }
.cctag { display: flex; align-items: center; gap: 8px; padding: 5px 11px 5px 9px; border-radius: 999px; background: #202020; color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; box-shadow: 0 8px 22px rgba(80,0,0,.18); }
.eq { display: flex; gap: 2px; align-items: center; height: 12px; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: #e30613; transform: scaleY(.18); transition: transform .07s linear; }
.ccline { max-width: 100%; padding: 12px 20px 13px; border-radius: 14px; background: rgba(255,255,255,.88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(80,0,0,.16); color: #202020; text-align: center; text-wrap: balance;
  font-size: clamp(19px, 1.6vw, 26px); font-weight: 600; line-height: 1.4; letter-spacing: -.005em; }
.ccline:empty { display: none; }
.ccl { animation: ccin .34s cubic-bezier(.2,.7,.2,1) both; }
@keyframes ccin { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }
.cw { color: rgba(32,32,32,.26); border-radius: 2px; transition: color .12s, background-color .12s, box-shadow .12s; }
.cw.said { color: #202020; }
/* il rosso esce dalla parola con l'ombra piena, senza spostare il testo né mangiare gli spazi */
.cw.now { color: #fff; background: #e30613; box-shadow: 0 0 0 .12em #e30613, 0 6px 16px rgba(227,6,19,.35); }
@media (prefers-reduced-motion: reduce) { .ccl { animation: none; } .cc { transition: none; } }
