/* TapCall landing — Warm Terminal.
   Coerente con web/shop.css. Token brin condivisi via :root. */

:root {
  --color-bg:               #fdfcfc;
  --color-surface:          #f8f7f7;
  --color-surface-2:        #f1f0f0;
  --color-text:             #3a3838;
  --color-text-secondary:   #6a6868;
  --color-text-muted:       #a3a1a1;
  --color-text-strong:      #201e1e;
  --color-border-subtle:    hsla(0, 100%, 3%, 0.12);
  --color-border:           hsla(0, 100%, 3%, 0.18);
  --color-success:          #22c55e;
  --color-warning:          #f59e0b;
  --color-danger:           #ef4444;
  --color-primary:          #201e1e;
  --color-primary-hover:    #2e2c2c;
  --color-primary-text:     #fdfcfc;
  --color-accent:           hsl(62, 100%, 50%);
  --color-accent-subtle:    hsla(62, 100%, 50%, 0.08);

  --r-sm: 3px;
  --r-md: 5px;
  --r-lg: 8px;

  --maxw:        1080px;
  --maxw-narrow: 720px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background: var(--color-bg);
  color-scheme: light;
}
html, body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}


body { min-height: 100vh; display: flex; flex-direction: column; }

a { color: var(--color-text-strong); text-decoration: none; border-bottom: 1px solid var(--color-border-subtle); }
a:hover { border-bottom-color: var(--color-text-strong); }

h1, h2, h3, h4 { color: var(--color-text-strong); font-weight: 600; line-height: 1.25; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.125rem; }

p { color: var(--color-text); }

/* ============== LAYOUT ============== */

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

section { padding: var(--space-16) 0; }

/* Regola sfondi:
   - bianco (default): nessun bordo
   - surface / dark: border-top + border-bottom (delimitazione del blocco colorato) */
.features,
.try,
.demo,
.security,
.cta-final {
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
}
.security {
  border-top-color: rgba(255, 255, 255, 0.08);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* ============== HEADER ============== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 252, 252, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border-subtle);
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-strong);
  border-bottom: none;
}

.nav-cluster {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-primary {
  display: flex;
  gap: var(--space-6);
}
.nav-primary a {
  font-size: 13px;
  color: var(--color-text-secondary);
  border-bottom: none;
}
.nav-primary a:hover { color: var(--color-text-strong); }

.cta-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-primary);
  color: var(--color-primary-text);
  padding: var(--space-2) var(--space-4);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: none;
  border-bottom: 2px solid var(--color-accent);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.15s;
}
.cta-primary:hover { background: var(--color-primary-hover); border-bottom-color: var(--color-accent); }

.cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: transparent;
  color: var(--color-text-strong);
  padding: var(--space-2) var(--space-4);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--color-text-strong);
  border-radius: var(--r-md);
  cursor: pointer;
}
.cta-secondary:hover { background: var(--color-surface); }

.burger {
  display: none;
  background: transparent;
  border: none;
  font: inherit;
  font-size: 18px;
  color: var(--color-text-strong);
  cursor: pointer;
  padding: var(--space-2);
}

@media (max-width: 768px) {
  .nav-primary { display: none; }
  .burger { display: inline-flex; }
  .nav-primary.open {
    display: flex;
    position: absolute;
    top: 56px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border-subtle);
    padding: var(--space-3) var(--space-5);
  }
  .nav-primary.open a { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border-subtle); }
  .nav-primary.open a:last-child { border-bottom: none; }
}

/* ============== HERO ============== */

.hero {
  padding: var(--space-16) 0 var(--space-24);
  background-image: url("/img/sfondo2-web.jpg");
  background-size: cover;
  background-position: center;
  position: relative;
  isolation: isolate;
}

/* Overlay bianco traslucido: lascia trapelare la trama del muro
   senza compromettere la leggibilità del claim. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(253, 252, 252, 0);
  z-index: -1;
  pointer-events: none;
}

.hero .shell {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  gap: var(--space-12);
  align-items: center;
}

/* Targa testuale — oggetto bianco applicato al muro. La targa nera
   del tag a destra è il pendant: "racconta" vs "mostra". Stessa
   altezza per simmetria visiva, larghezza modesta per non sbilanciare. */
.hero-card {
  width: 440px;
  max-width: 100%;
  height: 440px;
  background: var(--color-bg);
  padding: var(--space-8);
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 4px 8px -2px rgba(0, 0, 0, 0.10),
    0 18px 40px -10px rgba(0, 0, 0, 0.20),
    0 48px 96px -28px rgba(0, 0, 0, 0.25);
}

.hero-card h1 {
  font-size: clamp(1.5rem, 2.4vw, 1.875rem);
  margin-bottom: var(--space-8);
  line-height: 1.2;
}

.hero-card .lead {
  font-size: 0.9375rem;
  margin-bottom: var(--space-8);
}

@media (max-width: 768px) {
  .hero-card {
    width: 100%;
    min-height: 0;
    margin: 0 auto;
  }
}

.hero h1 { margin-bottom: var(--space-5); }
.hero .lead {
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
  max-width: 38ch;
}

.hero-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Tag mockup — targa quadrata 40×40mm: oggetto digitale sopra
   il muro reale dell'hero. Solo wordmark "TapCall" centrato.
   Sostituibile con <img> quando arriva il render del tag fisico vero. */
.tag-mockup {
  position: relative;
  width: 240px;
  aspect-ratio: 1 / 1;
  background: var(--color-text-strong);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.08) inset,
    0 4px 8px -2px rgba(0, 0, 0, 0.30),
    0 18px 40px -10px rgba(0, 0, 0, 0.55),
    0 48px 96px -28px rgba(0, 0, 0, 0.45);
}

.tag-mockup-label {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fafafa;
}

@media (prefers-reduced-motion: reduce) {
  .tag-waves span { animation: none; opacity: 0.4; }
  html { scroll-behavior: auto; }
}

@media (max-width: 768px) {
  .hero { padding: var(--space-12) 0 var(--space-16); }
  .hero .shell {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    text-align: center;
  }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .tag-mockup { width: 220px; }
}

/* ============== TRE PILASTRI (centrati, h3 uppercase) ============== */

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-12);
}

.pillar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pillar h3 {
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-strong);
  text-wrap: balance;
}

.pillar p {
  font-size: 1.0625rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .pillars-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .pillar { padding-bottom: var(--space-6); border-bottom: 1px dashed var(--color-border-subtle); }
  .pillar:last-child { border-bottom: none; padding-bottom: 0; }
}

/* ============== SECTION HEADER ============== */

.section-head {
  margin-bottom: var(--space-12);
  text-align: center;
}

.section-head h2 {
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-wrap: balance;
}

/* Lead/sottotitolo dentro section-head: limitato per leggibilità,
   l'h2 invece può occupare tutta la shell. */
.section-head > p {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ============== FEATURES (lista lunga) ============== */

.features {
  background: var(--color-surface);
}

.features-grid {
  list-style: none;
  display: grid;
  grid-template-columns: auto auto 1fr;
  column-gap: var(--space-5);
  row-gap: 0;
}

.feature {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: baseline;
  padding: var(--space-3) 0;
  border-bottom: 1px dashed var(--color-border-subtle);
  column-gap: 0;
}
.feature:last-child { border-bottom: none; }

.feature-mark {
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  font-weight: 700;
  color: var(--color-accent);
  padding-right: var(--space-3);
}

.feature h3 {
  font-size: 0.9375rem;
  line-height: 1.5;
  font-weight: 600;
  color: var(--color-text-strong);
  padding-right: var(--space-5);
}

.feature p {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: auto 1fr;
    column-gap: var(--space-3);
  }
  .feature {
    grid-template-columns: subgrid;
    align-items: start;
    row-gap: var(--space-1);
  }
  .feature h3 {
    grid-column: 2;
    padding-right: 0;
  }
  .feature p {
    grid-column: 2;
  }
  .section-head { margin-bottom: var(--space-8); }
}

/* ============== COME FUNZIONA ============== */

.flow { background: var(--color-bg); }

.flow-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
  align-items: stretch;
}

.flow-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.flow-role {
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: var(--space-5);
}

.flow-role-title {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-text-strong);
  margin-bottom: var(--space-3);
}

.flow-role-sub {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
}

.flow-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  flex: 1;
}

.flow-steps li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.flow-steps h3 {
  font-size: 1.125rem;
  line-height: 1.3;
  font-weight: 600;
  color: var(--color-text-strong);
}

.flow-steps p {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
}

.flow-note {
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--color-text-secondary);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--color-border-subtle);
}

/* --- Attivazione (sub-block: one-time, 5 step orizzontali) --- */

.flow-setup {
  margin-top: var(--space-12);
  padding-top: var(--space-12);
  border-top: 1px solid var(--color-border-subtle);
}

.flow-setup-head {
  margin-bottom: var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

.flow-setup-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-6);
}

.flow-setup-steps li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.flow-setup-steps h3 {
  font-size: 0.9375rem;
  line-height: 1.35;
  font-weight: 600;
  color: var(--color-text-strong);
}

.flow-setup-steps p {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
}

@media (max-width: 900px) {
  .flow-grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
  .flow-setup-steps {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6) var(--space-5);
  }
}

@media (max-width: 560px) {
  .flow-setup-steps {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
}

/* ============== SICUREZZA + PRIVACY (warm dark inversion) ============== */

.security {
  background: #635d5d;
  color: #ebe9e9;
}

.security h2 { color: #fafafa; }

.security-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
}

.security-item {
  display: flex;
  flex-direction: column;
}

.security-item h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #fafafa;
  margin-bottom: var(--space-3);
  line-height: 1.3;
  text-wrap: balance;
}

.security-item p {
  font-size: 0.9375rem;
  color: #ebe9e9;
  line-height: 1.65;
  max-width: 48ch;
}

@media (max-width: 768px) {
  .security-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

/* ============== FAQ ============== */

.faq { background: var(--color-bg); }

/* FAQ leggibili in colonna stretta. */
.faq > .shell { max-width: var(--maxw-narrow); }

.faq-list {
  display: flex;
  flex-direction: column;
}

.faq-item {
  border-bottom: 1px dashed var(--color-border-subtle);
}
.faq-item:first-child {
  border-top: 1px dashed var(--color-border-subtle);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-4) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-strong);
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  color: var(--color-accent);
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after {
  content: '−';
}
.faq-item summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.faq-answer {
  padding-bottom: var(--space-5);
}
.faq-answer p {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-text-secondary);
  max-width: 60ch;
}

/* Wrapper accordion "Vedi tutte le altre domande" */
.faq-more {
  border-bottom: 1px dashed var(--color-border-subtle);
}
.faq-more > summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-4) 0;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  user-select: none;
}
.faq-more > summary::-webkit-details-marker { display: none; }
.faq-more > summary::after {
  content: '↓';
  color: var(--color-accent);
  font-weight: 700;
  transition: transform 0.2s ease;
}
.faq-more[open] > summary::after { transform: rotate(180deg); }
.faq-more > summary:hover { color: var(--color-text-strong); }

.faq-more-list {
  display: flex;
  flex-direction: column;
}
.faq-more-list .faq-item {
  border-bottom: 1px dashed var(--color-border-subtle);
}
.faq-more-list .faq-item:last-child {
  border-bottom: none;
}

/* ============== CTA FINALE ============== */

.cta-final {
  background: var(--color-surface);
  padding: var(--space-16) 0;
  text-align: center;
}

.cta-final .section-head { margin-bottom: var(--space-8); }

.cta-final-lead {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-text);
  max-width: 50ch;
  margin: var(--space-5) auto 0;
}

.cta-final-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}

.cta-primary-large {
  font-size: 14px;
  padding: var(--space-3) var(--space-6);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cta-final-secondary {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}
.cta-final-secondary a {
  color: var(--color-text-strong);
  border-bottom: 1px solid var(--color-border-subtle);
}
.cta-final-secondary a:hover {
  border-bottom-color: var(--color-text-strong);
}

@media (max-width: 768px) {
  .cta-final { padding: var(--space-12) 0; }
}

/* ============== PROVALO IN 4 TOCCHI ============== */

.try {
  background: var(--color-surface);
}

.try-lead {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  max-width: 50ch;
  margin: var(--space-4) auto 0;
}

.try-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

.try-steps li {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.try-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--color-text-muted);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-accent);
  align-self: flex-start;
  margin-bottom: var(--space-2);
}

.try-steps h3 {
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 600;
  color: var(--color-text-strong);
}

.try-steps p {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
}

.try-cta {
  display: flex;
  justify-content: center;
}

/* CTA disabled: bottone visibile ma inerte (è un placeholder, non spinge l'azione). */
.cta-primary[disabled],
.cta-primary:disabled {
  background: var(--color-text-muted);
  color: var(--color-bg);
  border-bottom-color: transparent;
  cursor: not-allowed;
  opacity: 0.85;
  font-style: italic;
}
.cta-primary[disabled]:hover {
  background: var(--color-text-muted);
}

@media (max-width: 900px) {
  .try-steps {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6) var(--space-5);
  }
}

@media (max-width: 560px) {
  .try-steps {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
}

/* ============== PROVALO SUBITO (widget demo state machine) ==============
   Sezione interattiva: l'utente preme un bottone, riceve un codice invito
   reale, lo digita nell'app, e dal browser fa squillare il proprio telefono.
   Stati gestiti via [data-state] sul wrapper .demo-widget. */

.demo {
  background: var(--color-surface);
}

.demo-lead {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin: var(--space-4) auto 0;
}
.demo-lead em { font-style: italic; color: var(--color-text-strong); }

/* Override della regola globale .section-head > p { max-width: 600px }
   che spezzava il lead della sezione provalo. */
.section-head > .demo-lead { max-width: none; }

/* Container logico, niente cornice: gli stati vivono direttamente sulla
   shell come .cta-final / .pillars / .features. La sezione è già
   delimitata dal cambio di sfondo (surface) e dai border-top/bottom. */
.demo-widget {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

/* State switching via data-attribute: ogni .demo-state controlla la
   propria visibilità tramite [hidden]. Il JS gestisce l'attributo. */
.demo-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
}

.demo-state[hidden] { display: none; }

.demo-state-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
}

.demo-step-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--color-text-muted);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-accent);
  margin-bottom: var(--space-2);
}

.demo-state-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text-strong);
  letter-spacing: -0.005em;
}

.demo-state-sub {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
}

.demo-pitch {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  max-width: 48ch;
}

.demo-microcopy {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.demo-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.demo-actions--row {
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 560px) {
  .demo-actions--row {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-4);
  }
}

/* Layout 2-col stato waiting-claim: sequenza visiva sx→dx, prima
   "scarica l'app" (badge store), poi "usa il codice". I numeri "1." e
   "2." rinforzano la sequenza senza occupare spazio. */
.demo-twocol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  width: 100%;
  align-items: stretch;
}

.demo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: var(--space-5);
  padding: var(--space-6) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--r-md);
  height: 100%;
}

.demo-col-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

/* Istruzione prominente fuori dalle card: stessa scala del state-title
   (1.25rem) per essere il "messaggio guida" della sezione. Due righe
   distinte = due step (claim welcome / submit form). */
.demo-instruction {
  margin-top: var(--space-6);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.demo-instruction p {
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--color-text);
  font-weight: 500;
}
.demo-instruction em {
  font-style: normal;
  font-weight: 700;
  color: var(--color-text-strong);
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 1px;
}

@media (max-width: 640px) {
  .demo-twocol {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
}

/* Codice invito: protagonista visivo. Mono spaziato grande,
   sfondo chiaro warm, bordo dashed che richiama il pattern editoriale
   delle features. Il codice è renderizzato lettera per lettera dal JS
   con spazi separatori per migliorare la leggibilità. */
.demo-code-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  position: relative;
  padding: var(--space-3) 0;
}

.demo-code-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.demo-code {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(1.625rem, 4vw, 2.125rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--color-text-strong);
  line-height: 1.1;
  user-select: all;
  -webkit-user-select: all;
  word-spacing: 0.05em;
  /* Le lettere "spaziate" tipo S P H Z E Z sono ottenute via JS che
     inserisce thin-space tra caratteri; il letter-spacing aggiunge
     respiro ulteriore. */
}

.demo-copy {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  margin-top: var(--space-2);
}
.demo-copy:hover {
  background: var(--color-text-strong);
  color: var(--color-bg);
  border-color: var(--color-text-strong);
}
.demo-copy[data-copied="true"] {
  background: var(--color-success);
  color: var(--color-bg);
  border-color: var(--color-success);
}

/* Badge store: visivamente operativi (no opacity/grayscale). Asset
   ufficiali Apple SVG + Google PNG, normalizzati alla stessa altezza
   per pareggio visivo. Quando avremo gli URL definitivi popoliamo
   APP_STORE_URL/PLAY_STORE_URL nel JS e diventano cliccabili davvero;
   nel frattempo il JS intercetta il click su href="#" e fa preventDefault. */
.demo-stores {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

/* Pareggio per altezza (pattern standard store guidelines): entrambi
   i badge a 48px alti, width naturale. Asset Google PNG croppato per
   togliere il padding alpha interno, ora aspect 3.36 (vicino ad Apple
   SVG aspect 2.99). Le larghezze risultanti sono molto simili. */
.demo-store {
  display: inline-flex;
  align-items: center;
  border-bottom: none;
  cursor: pointer;
}

.demo-store img {
  display: block;
  height: 48px;
  width: auto;
}

/* Istruzioni numerate: lista compatta, allineata a sinistra dentro
   la box centrata. Più leggibile di una lista centrata. */
.demo-instructions {
  list-style: none;
  counter-reset: demo-step;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: left;
  width: 100%;
  max-width: 380px;
  padding: var(--space-4) 0;
  border-top: 1px dashed var(--color-border-subtle);
  border-bottom: 1px dashed var(--color-border-subtle);
}

.demo-instructions li {
  counter-increment: demo-step;
  position: relative;
  padding-left: 2.25rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text);
}
.demo-instructions li::before {
  content: counter(demo-step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  background: var(--color-text-strong);
  padding: 3px 6px;
  border-radius: var(--r-sm);
  line-height: 1;
}
.demo-instructions li em {
  font-style: normal;
  font-weight: 600;
  color: var(--color-text-strong);
}

/* Stato di progresso: spinner per attesa, check per "fatto". */
.demo-progress {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--r-md);
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.demo-progress--ok {
  background: hsla(142, 70%, 45%, 0.08);
  color: var(--color-text-strong);
}

.demo-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-text-strong);
  border-radius: 50%;
  animation: demo-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes demo-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .demo-spinner { animation: none; }
}

.demo-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--color-success);
  color: var(--color-bg);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

.demo-victory {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--color-text-strong);
  font-weight: 600;
  max-width: 44ch;
}

/* Status text in stato ready-to-call: stessa scala dell'instruction
   (1.25rem) ma plain, no underline, color secondary — è solo un
   "feedback narrativo" non un'azione da seguire. */
.demo-status {
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--color-text-secondary);
  font-weight: 500;
  text-align: center;
}

/* CTA "magico" verde per il bottone Prova! Match con il verde
   iOS dell'accettazione chiamata (.demo-status sopra è il preludio
   verbale, il bottone è l'azione). */
.cta-success {
  background: var(--color-success);
  color: #fff;
  border-bottom-color: rgba(0, 0, 0, 0.18);
}
.cta-success:hover {
  background: #16a34a;
  border-bottom-color: rgba(0, 0, 0, 0.28);
}

.demo-recall {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: var(--space-2) var(--space-4);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.demo-recall:hover {
  color: var(--color-text-strong);
  border-color: var(--color-text-strong);
}

/* Restart link: piccolo, sotto, non urla. */
.demo-restart {
  display: block;
  margin: var(--space-6) auto 0;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: var(--space-2);
}
.demo-restart:hover { color: var(--color-text-strong); }

.demo-footnote {
  margin-top: var(--space-24);
  text-align: center;
  font-size: 11px;
  font-style: italic;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  line-height: 1.5;
  max-width: none;
}

/* ============== MODALE VIDEOCHIAMATA (iframe visitor.html) ==============
   Si apre quando l'utente clicca CHIAMA! e la /api/demo/.../call torna 200.
   Mostra visitor.html in modalità demo: l'iframe gestisce il side visitor
   (getUserMedia, signalling WS, PeerConnection). Il telefono dell'utente
   risponde dall'altra parte → videochiamata bidirezionale vera, non simulata. */

.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}
.demo-modal[hidden] { display: none; }

.demo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 18, 0.72);
  backdrop-filter: blur(4px);
}

.demo-modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  height: 82vh;
  max-height: 82vh;
  background: var(--color-bg);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 24px 64px -16px rgba(0, 0, 0, 0.55),
    0 8px 24px -8px rgba(0, 0, 0, 0.30);
}

.demo-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-surface);
}

/* Info-bar "chi è chi": browser=visitatore, telefono=residente.
   Riga sottile sotto l'header, font piccolo, mai protagonista. */
.demo-modal-roles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-5);
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.demo-modal-roles strong {
  color: var(--color-text-strong);
  font-weight: 700;
}
.demo-modal-role-sep {
  color: var(--color-text-muted);
  font-weight: 400;
}

.demo-modal-title {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}
.demo-modal-title span {
  color: var(--color-text-strong);
  text-transform: none;
  letter-spacing: 0;
}

.demo-modal-close {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.demo-modal-close:hover {
  background: var(--color-surface-2);
  color: var(--color-text-strong);
}

.demo-modal-iframe {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
  background: var(--color-bg);
}

@media (max-width: 640px) {
  .demo-modal { padding: 0; }
  .demo-modal-card { max-width: none; max-height: 100vh; height: 100vh; border-radius: 0; }
}

@media (max-width: 560px) {
  .demo-state-title { font-size: 1.25rem; }
  .demo-code { font-size: 2rem; letter-spacing: 0.14em; }
  .demo-store img { height: 40px; }
}

/* ============== STRISCIA CITOFONI (marquee auto-animato b&n) ============== */

.strip {
  background: var(--color-bg);
  padding: var(--space-12) 0;
  overflow: hidden;
}

.strip-inner {
  overflow: hidden;
  margin-bottom: var(--space-6);
}

.strip-track {
  display: flex;
  gap: var(--space-3);
  width: max-content;
  animation: strip-marquee 80s linear infinite;
}

.strip-track:hover {
  animation-play-state: paused;
}

@keyframes strip-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .strip-track { animation: none; }
}

.strip-card {
  flex: 0 0 auto;
  width: 280px;
  height: 280px;
  background: var(--color-surface);
  border-radius: var(--r-sm);
  overflow: hidden;
  user-select: none;
}
.strip-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  display: block;
}

.strip-caption {
  text-align: center;
  font-style: italic;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

@media (max-width: 768px) {
  .strip-card { width: 220px; height: 220px; }
  .strip-track { animation-duration: 60s; }
}

/* ============== DEVICE FRAME (mockup app — placeholder rimpiazzabile con <img>) ============== */

.device-frame {
  width: 220px;
  aspect-ratio: 9 / 19;
  margin: 0 auto;
  padding: 8px;
  background: #1a1818;
  border-radius: 28px;
  box-shadow:
    0 24px 48px -20px rgba(0, 0, 0, 0.22),
    0 6px 14px -6px rgba(0, 0, 0, 0.08);
  position: relative;
}

/* Notch in cima — generica, non iPhone-branded. */
.device-frame::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 78px;
  height: 18px;
  background: #1a1818;
  border-radius: 0 0 12px 12px;
  z-index: 2;
}

.device-screen {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #f5f3f3 0%, #e8e6e6 100%);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 18px 18px;
}

.device-placeholder {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #999898;
  text-align: center;
  line-height: 1.5;
  user-select: none;
}

/* Variante centrata per Attivazione (sopra il titolo della sub-section). */
.device-frame-centered {
  margin-bottom: var(--space-6);
}

@media (max-width: 768px) {
  .device-frame { width: 180px; }
}

/* ============== TECH & NERD (sezione finale sobria, accordion chiuso) ============== */

.tech-nerd {
  background: var(--color-bg);
  padding: var(--space-12) 0;
}

.tech-nerd > .shell { max-width: var(--maxw-narrow); }

.tech-nerd .section-head { margin-bottom: var(--space-6); }

.tech-nerd-toggle {
  border-top: 1px dashed var(--color-border-subtle);
  border-bottom: 1px dashed var(--color-border-subtle);
}

.tech-nerd-toggle > summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-4) 0;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  user-select: none;
}
.tech-nerd-toggle > summary::-webkit-details-marker { display: none; }
.tech-nerd-toggle > summary::after {
  content: '↓';
  color: var(--color-accent);
  font-weight: 700;
  transition: transform 0.2s ease;
}
.tech-nerd-toggle[open] > summary::after { transform: rotate(180deg); }
.tech-nerd-toggle > summary:hover { color: var(--color-text-strong); }

.tech-nerd-body {
  padding: var(--space-3) 0 var(--space-6);
  text-align: center;
  max-width: 60ch;
  margin: 0 auto;
}
.tech-nerd-body p {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}
.tech-nerd-body p:last-child { margin-bottom: 0; }

/* ============== PAGINE LEGAL / STORE (placeholder) ============== */

.legal {
  padding: var(--space-16) 0;
}

.legal > .shell { max-width: var(--maxw-narrow); }

.legal .section-head { margin-bottom: var(--space-8); }

.legal-body { font-size: 0.9375rem; line-height: 1.7; color: var(--color-text); }
.legal-body h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-strong);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}
.legal-body p { margin-bottom: var(--space-3); max-width: 60ch; }
.legal-body p:last-child { margin-bottom: 0; }

.legal-notice {
  padding: var(--space-3) var(--space-4);
  background: var(--color-accent-subtle);
  border-left: 2px solid var(--color-accent);
  border-radius: var(--r-sm);
  margin-bottom: var(--space-6);
}

.legal-meta {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--color-border-subtle);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.store-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.store-note {
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* ============== FOOTER (placeholder) ============== */

.site-footer {
  margin-top: auto;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-subtle);
  font-size: 13px;
}

.site-footer > .shell {
  padding-top: var(--space-12);
  padding-bottom: var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: var(--space-8);
}

.footer-claim p { color: var(--color-text-secondary); margin-top: var(--space-3); max-width: 28ch; }

.footer-col h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  font-weight: 500;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: var(--space-2); }
.footer-col a { color: var(--color-text); border-bottom: none; }
.footer-col a:hover { color: var(--color-text-strong); }

.footer-bottom {
  border-top: 1px solid var(--color-border-subtle);
  font-size: 11px;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}
.footer-bottom > .shell {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
  .footer-claim { grid-column: 1 / -1; }
}
