/* "V per Vedetta" · la pagina d'attesa (modalità coming soon).
   Desktop: panorama notturno, testo a sinistra, il faro a destra che spazza la scena e accende il titolo.
   Telefono: composizione verticale, il faro in basso al centro con il fascio che gira tutto intorno,
   il modulo in un foglio che sale dal basso. Niente stili in linea: la CSP è 'self'. */

@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("../fonts/atkinson-hyperlegible-next/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("../fonts/atkinson-hyperlegible-next/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 500; src: url("../fonts/ibm-plex-mono/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
    --ink: #060d1a;
    --night: #0f2238;
    --lantern: #f2a900;
    --lantern-hi: #ffd56a;
    --text: #f4f1e8;
    --muted: #b9c6d6;
    --glass: rgba(8, 18, 34, .62);
    --line: rgba(255, 255, 255, .14);
    --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
    --lit: 0;   /* quanto il fascio sta illuminando il titolo (0-1), dal JavaScript */
    --flash: 0; /* il lampo della lanterna (0-1) */
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.cs {
    min-height: 100vh; min-height: 100svh;
    font: 400 1.05rem/1.55 var(--font); color: var(--text);
    background: radial-gradient(ellipse 60% 55% at 78% 70%, rgba(242, 169, 0, .10), transparent 70%),
                radial-gradient(ellipse 80% 60% at 20% 0%, rgba(40, 90, 160, .25), transparent 70%),
                linear-gradient(180deg, #050b17 0%, #0a1830 55%, #112a4c 100%);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    display: flex; flex-direction: column;
}
.cs-main { flex: 1 0 auto; }
a { color: var(--lantern-hi); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--lantern); outline-offset: 3px; }

.cs-sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.cs-flash { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: var(--flash); background: radial-gradient(ellipse 70% 60% at var(--fx, 78%) var(--fy, 62%), rgba(255, 226, 150, .55), rgba(255, 210, 110, .12) 45%, transparent 75%); mix-blend-mode: screen; }

/* In alto: il marchio e lo stato. */
.cs-top { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px clamp(20px, 5vw, 64px); }
.cs-brand { display: inline-flex; align-items: center; gap: 12px; }
.cs-brand img { width: 44px; height: 44px; filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .5)); }
.cs-brand b { display: block; font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.cs-brand em { font-style: normal; color: var(--lantern); }
.cs-brand small { display: block; font: 500 .68rem/1.3 var(--mono); letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.cs-status { display: inline-flex; align-items: center; gap: 10px; font: 500 .78rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--lantern-hi); padding: 9px 14px; border: 1px solid rgba(242, 169, 0, .35); border-radius: 999px; background: rgba(242, 169, 0, .08); }
.cs-lamp { width: 9px; height: 9px; border-radius: 50%; background: var(--lantern); box-shadow: 0 0 0 0 rgba(242, 169, 0, .7); animation: cs-lamp 2.4s ease-in-out infinite; }
@keyframes cs-lamp { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 169, 0, .55); } 50% { box-shadow: 0 0 0 7px rgba(242, 169, 0, 0); } }

/* Il contenuto. */
.cs-main { position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0, 680px); gap: 22px; padding: clamp(12px, 4vh, 48px) clamp(20px, 5vw, 64px) 32px; }
.cs-nowrap { white-space: nowrap; }
.cs-kicker { margin: 0 0 14px; font: 500 .82rem/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--lantern); }
.cs-title {
    margin: 0; font-size: clamp(3rem, 7vw, 6.4rem); line-height: .95; font-weight: 800; letter-spacing: -.035em;
    color: color-mix(in srgb, #fff calc(78% + var(--lit) * 22%), #9fb0c6);
    text-shadow: 0 0 calc(var(--lit) * 42px) rgba(255, 214, 120, calc(var(--lit) * .55)), 0 2px 0 rgba(0, 0, 0, .25);
    transition: color .2s linear;
}
.cs-v { display: inline-block; color: var(--lantern); text-shadow: 0 0 calc(18px + var(--lit) * 50px) rgba(255, 200, 80, calc(.35 + var(--lit) * .55)); transform-origin: 50% 90%; }
.cs-v.is-blink { animation: cs-v .5s ease-out; }
@keyframes cs-v { 0% { filter: brightness(2.2); transform: scale(1.08); } 100% { filter: none; transform: none; } }
.cs-sub { margin: 14px 0 0; font-size: clamp(1.4rem, 2.6vw, 2.1rem); line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
.cs-lead { margin: 12px 0 0; max-width: 36rem; font-size: 1.08rem; color: var(--muted); }
.cs-lead strong { color: var(--text); }

/* La V in Morse: punto punto punto linea, acceso in sincrono con la lanterna. */
.cs-morse { display: flex; align-items: center; gap: 14px; margin-top: 18px; font-size: .92rem; color: var(--muted); }
.cs-morse__code { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.cs-morse__code i { display: block; width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 214, 120, .25); transition: background .08s, box-shadow .08s; }
.cs-morse__code i.dash { width: 26px; border-radius: 5px; }
.cs-morse__code i.is-on { background: var(--lantern-hi); box-shadow: 0 0 14px rgba(255, 214, 120, .9); }
.cs-morse__text b { color: var(--lantern); }

/* Conto alla rovescia, modulo, promesse. */
.cs-panel { display: grid; gap: 14px; }
.cs-count { display: flex; align-items: center; gap: 18px; padding: 14px 16px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); }
.cs-count__label { flex: 1; margin: 0; font: 500 .78rem/1.45 var(--mono); letter-spacing: .03em; color: var(--muted); }
.cs-count__grid { flex: 0 0 auto; display: grid; grid-template-columns: repeat(4, 74px); gap: 8px; }
.cs-count__grid div { display: grid; justify-items: center; padding: 10px 4px 8px; border-radius: 12px; background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); border: 1px solid rgba(255, 255, 255, .08); }
.cs-count__grid b { font-size: 1.9rem; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; }
.cs-count__grid b.is-tick { animation: cs-tick .4s ease-out; }
@keyframes cs-tick { from { color: var(--lantern-hi); transform: translateY(-3px); } to { color: #fff; transform: none; } }
.cs-count__grid span { margin-top: 6px; font: 500 .68rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.cs-sheet { border-radius: 18px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(12px); padding: 18px 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.cs-form__title { margin: 0; font-size: 1.2rem; line-height: 1.2; font-weight: 800; }
.cs-form__text { margin: 4px 0 12px; font-size: .9rem; color: var(--muted); }
.cs-field { display: flex; gap: 10px; }
.cs-field input { flex: 1; min-width: 0; padding: 15px 16px; border-radius: 12px; border: 1.5px solid rgba(255, 255, 255, .22); background: rgba(3, 9, 20, .55); color: #fff; font: inherit; font-size: 1.05rem; }
.cs-field input::placeholder { color: #8395ad; }
.cs-field button { padding: 15px 22px; border: 0; border-radius: 12px; font: inherit; font-weight: 800; font-size: 1.05rem; cursor: pointer; color: #14202e; background: linear-gradient(180deg, #ffcc4d, var(--lantern)); box-shadow: 0 0 0 2px rgba(255, 255, 255, .55), 0 10px 30px rgba(242, 169, 0, .3); transition: transform .15s, box-shadow .15s; }
.cs-field button:hover { transform: translateY(-1px); box-shadow: 0 0 0 2px #fff, 0 14px 36px rgba(242, 169, 0, .45); }
.cs-check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: .88rem; color: var(--muted); }
.cs-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--lantern); }
.cs-error { margin: 10px 0 0; color: #ffb4a8; font-weight: 700; }
.cs-sent { display: grid; gap: 6px; font-size: 1rem; color: var(--muted); }
.cs-sent b { display: block; font-size: 1.6rem; line-height: 1.15; color: #fff; text-shadow: 0 0 24px rgba(255, 214, 120, .6); }
.cs-sent__kicker { font: 500 .78rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--lantern); }
.cs-sent__mail { font-size: .9rem; }
/* La festa: il riquadro entra quando la stella è arrivata in cielo. */
.cs-sheet:has(.cs-sent) { border-color: rgba(242, 169, 0, .55); box-shadow: 0 0 0 1px rgba(242, 169, 0, .25), 0 0 60px rgba(242, 169, 0, .25), 0 30px 80px rgba(0, 0, 0, .35); animation: cs-sent-in 1s cubic-bezier(.2, .8, .2, 1) 2.6s both; }
@keyframes cs-sent-in { 0% { opacity: 0; transform: translateY(16px) scale(.97); } 60% { box-shadow: 0 0 0 2px rgba(255, 214, 120, .9), 0 0 120px rgba(242, 169, 0, .55), 0 30px 80px rgba(0, 0, 0, .35); } 100% { opacity: 1; transform: none; } }
/* Mentre il faro si accende per te. */
.cs-form.is-igniting button { color: #14202e; background: linear-gradient(90deg, #ffe7a3, #fff8e0, #ffcc4d); background-size: 200% 100%; animation: cs-ignite .6s linear infinite; box-shadow: 0 0 0 2px #fff, 0 0 50px rgba(255, 214, 120, .9); }
@keyframes cs-ignite { from { background-position: 0 0; } to { background-position: 200% 0; } }
.cs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cs-promises { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; list-style: none; font-weight: 700; font-size: .92rem; }
.cs-promises li { display: inline-flex; align-items: center; gap: 8px; }
.cs-promises li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--lantern) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%2314202e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }

.cs-morse__text kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .3); border-bottom-width: 3px; font: 500 .8rem var(--mono); color: var(--lantern-hi); text-align: center; }
.cs-hint { display: none; position: fixed; z-index: 3; right: 0; left: 0; text-align: center; margin: 0; font: 500 .74rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: rgba(185, 198, 214, .75); }
.cs-hint kbd { display: inline-block; min-width: 22px; padding: 3px 6px; margin: 0 2px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .3); border-bottom-width: 3px; font: inherit; color: var(--lantern-hi); text-align: center; }
.cs-cta { display: none; }

.cs-cta[hidden] { display: none !important; }
.cs-foot { position: relative; z-index: 3; display: flex; justify-content: space-between; gap: 16px; padding: 14px clamp(20px, 5vw, 64px); font-size: .8rem; color: rgba(185, 198, 214, .8); background: linear-gradient(0deg, rgba(4, 10, 22, .85), transparent); }

/* L'ingresso in scena. */
.cs-top, .cs-kicker, .cs-title, .cs-sub, .cs-lead, .cs-morse, .cs-panel { animation: cs-in .9s cubic-bezier(.2, .7, .2, 1) both; }
.cs-kicker { animation-delay: .25s; } .cs-title { animation-delay: .4s; } .cs-sub { animation-delay: .65s; }
.cs-lead { animation-delay: .8s; } .cs-morse { animation-delay: .95s; } .cs-panel { animation-delay: 1.1s; }
@keyframes cs-in { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes cs-fade { from { opacity: 0; } to { opacity: 1; } }

/* ── Desktop largo: il contenuto in due tempi, il faro a destra. ── */
@media (min-width: 1100px) {
    .cs-main { grid-template-columns: minmax(0, 660px) minmax(0, 380px); grid-template-areas: "hero ." "panel ."; column-gap: 40px; align-content: start; }
    .cs-hero { grid-area: hero; } .cs-panel { grid-area: panel; max-width: 600px; }
}

/* ── Telefono: una schermata sola. In alto le parole, in basso il faro che gira (lo spazio libero lo misura il JavaScript),
      il modulo in un foglio che sale dal basso. ── */
@media (max-width: 760px) {
    body.cs { display: flex; flex-direction: column; height: 100vh; height: 100svh; overflow: hidden; background: radial-gradient(ellipse 90% 40% at 50% 100%, rgba(242, 169, 0, .14), transparent 70%), linear-gradient(180deg, #050b17 0%, #0a1830 60%, #112a4c 100%); }
    .cs-top { padding: 14px 18px 0; padding-top: max(14px, env(safe-area-inset-top)); }
    .cs-brand img { width: 36px; height: 36px; }
    .cs-brand small, .cs-status { display: none; }
    /* Il foglio è fisso sullo schermo: chi lo contiene non deve avere transform o filtri (nemmeno animati). */
    .cs-panel { animation-name: cs-fade; }
    .cs-main { flex: 0 0 auto; align-content: start; padding: 10px 18px 0; gap: 14px; text-align: center; }
    .cs-kicker { margin-bottom: 8px; font-size: .72rem; }
    .cs-title { font-size: clamp(2.6rem, 12.6vw, 4rem); }
    .cs-sub { font-size: 1.15rem; margin-top: 8px; }
    .cs-lead { margin: 8px auto 0; font-size: .95rem; line-height: 1.45; }
    .cs-morse { justify-content: center; gap: 10px; margin-top: 12px; font-size: .78rem; }
    .cs-morse__text { text-align: left; max-width: 15rem; line-height: 1.35; }
    .cs-morse__code { padding: 8px 11px; }
    .cs-hint--desk { display: none; }
    .cs-count { flex-direction: column; gap: 8px; padding: 10px; }
    .cs-count__label { text-align: center; font-size: .7rem; }
    .cs-count__grid { grid-template-columns: repeat(4, 1fr); width: 100%; gap: 6px; }
    .cs-count__grid div { padding: 7px 2px 6px; }
    .cs-count__grid b { font-size: 1.5rem; }
    .cs-count__grid span { font-size: .58rem; margin-top: 4px; }
    .cs-promises { display: none; }
    .cs-sheet { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; border-radius: 22px 22px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); text-align: left; transform: translateY(105%); transition: transform .45s cubic-bezier(.2, .8, .2, 1); background: #0a1628; box-shadow: 0 -20px 60px rgba(0, 0, 0, .6); }
    .cs-sheet.is-open, .cs-sheet:has(.cs-sent), .cs-sheet:has(.cs-error), .cs-sheet:has(form:target) { transform: none; }
    /* Al ritorno dall'iscrizione il foglio sale solo dopo che la stella è salita in cielo. */
    .cs-sheet:has(.cs-sent) { animation: cs-sheet-up .8s cubic-bezier(.2, .8, .2, 1) 2.7s both; }
    @keyframes cs-sheet-up { from { transform: translateY(105%); } to { transform: none; } }
    .cs-sheet::before { content: ""; display: block; width: 44px; height: 5px; margin: -10px auto 16px; border-radius: 3px; background: rgba(255, 255, 255, .25); }
    .cs-field { flex-direction: column; }
    .cs-field input, .cs-field button { font-size: 1.1rem; padding: 16px; }
    .cs-cta { position: fixed; z-index: 5; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); display: block; padding: 16px; border-radius: 16px; text-align: center; text-decoration: none; font-weight: 800; font-size: 1.08rem; color: #14202e; background: linear-gradient(180deg, #ffcc4d, var(--lantern)); box-shadow: 0 0 0 2px rgba(255, 255, 255, .6), 0 18px 40px rgba(0, 0, 0, .45), 0 0 40px rgba(242, 169, 0, .35); }
    .cs-hint { display: block; bottom: calc(84px + env(safe-area-inset-bottom)); font: 500 .7rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: rgba(185, 198, 214, .7); }
    .cs-foot { display: none; }
    body.is-sheet .cs-hint, body.is-sheet .cs-cta { display: none; }
}
@media (max-width: 760px) and (max-height: 700px) {
    .cs-lead { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
