@font-face { font-family: "Rajdhani"; src: url("/assets/fonts/Rajdhani-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("/assets/fonts/Rajdhani-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/assets/fonts/Barlow-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/assets/fonts/Barlow-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/assets/fonts/Barlow-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  /* I colori dell'app: lime = cronometro, ciano = countdown, arancio = ultimi secondi,
     rosso = tempo scaduto. --accent lo cambia app.js con lo stato dell'orologio. */
  --ink: #050b0e;
  --ink-2: #0a161b;
  --ink-3: #10222a;
  --text: #e6ecef;
  --muted: #92a4ac;
  --line: rgba(215, 222, 226, 0.13);
  --lime: #c6f51a;
  --cyan: #1ec8f0;
  --orange: #ff9f0a;
  --red: #ff453a;
  --accent: var(--lime);
  --display: "Rajdhani", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
  --gutter: clamp(1rem, 5vw, 3rem);
  --max: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 1.0625rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: -0.01em; text-wrap: pretty; }
p { margin: 0; }

.skip { position: absolute; left: -999px; top: 0; padding: .6rem 1rem; background: var(--text); color: var(--ink); z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* --- Testata ---------------------------------------------------------------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: var(--max); margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) var(--gutter) .5rem;
}
.wordmark {
  display: inline-flex; align-items: center; gap: .55rem;
  font: 700 1.35rem/1 var(--display); text-decoration: none; color: var(--text);
}
.wordmark img { width: 2.25rem; height: 2.25rem; border-radius: 22.4%; }
.lang {
  font: 500 .95rem/1 var(--body); color: var(--muted); text-decoration: none;
  padding: .7rem .2rem; /* area di tocco */
}
.lang:hover { color: var(--text); }

/* --- Hero ------------------------------------------------------------------- */
/* Telefono: titolo, quadrante, selettore e "Provalo con la voce" stanno nella prima schermata;
   la descrizione viene subito dopo. Desktop: testo a sinistra, quadrante grande a destra. */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: .5rem var(--gutter) 3rem;
  display: grid; gap: 1rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 9.6vw, 5.6rem);
  line-height: .9;
  max-width: 12ch;
}
.hero-copy { display: contents; }
.hero .actions { order: 2; margin-top: .25rem; }
.hero .note { order: 3; margin-top: 0; }
.hero .lede { order: 4; margin-top: 1rem; }
.stage { order: 1; }

.lede { max-width: 34rem; color: #c9d4d9; font-size: 1.125rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  min-height: 3.25rem; padding: 0 1.35rem; border-radius: 999px;
  font: 600 1.05rem/1 var(--body); text-decoration: none; border: 0; cursor: pointer;
}
.btn svg { width: 1.3rem; height: 1.3rem; flex: none; }
.btn-primary { background: var(--accent); color: var(--ink); transition: background .4s, transform .15s; }
.btn-primary:active { transform: scale(.97); }
.btn-primary[aria-pressed="true"] { background: var(--text); }
.btn-store { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); cursor: default; }
.note { margin-top: .9rem; color: var(--muted); font-size: .9375rem; max-width: 30rem; }

.stage {
  position: relative;
  display: grid; justify-items: center; gap: .7rem;
  touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
}
/* Il quadrante: il centro sta al 60% dell'altezza (lo stesso valore in app.js), sopra
   restano i fumetti. Il canvas sborda oltre il riquadro: alone, raggi e onde non si tagliano. */
.dial {
  position: relative;
  width: min(100%, 40rem, 64svh);
  aspect-ratio: 1 / 1.1;
  container-type: inline-size;
  cursor: pointer;
}
.dial canvas {
  position: absolute; inset: -4% calc(var(--gutter) * -1) -2%;
  width: calc(100% + var(--gutter) * 2); height: 106%;
  pointer-events: none;
  /* L'alone sfuma ai bordi del canvas invece di finire con un taglio netto. */
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 58%, #000 74%, transparent);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 58%, #000 74%, transparent);
}
.readout {
  position: absolute; left: 0; right: 0; top: 60%;
  transform: translateY(-50%);
  display: grid; justify-items: center; gap: .2rem;
  pointer-events: none;
}
.readout-label, .readout-state { color: var(--muted); font: 500 clamp(.85rem, 3.6cqi, 1.1rem)/1 var(--body); }
.readout-state { color: #b9c6cc; }
.digits {
  /* L'anello è largo il 60% del quadrante: le cifre stanno dentro a ogni misura. */
  font: 700 12cqi/1 var(--display);
  color: var(--text);
  display: inline-flex;
  transition: color .3s;
}
.digits.alarm { color: var(--red); }
/* Rajdhani non ha cifre tabulari: celle fisse, così le cifre non ballano. */
.digits .d { display: inline-block; width: .56em; text-align: center; }
.digits .s { display: inline-block; width: .26em; text-align: center; }

.bubbles {
  position: absolute; left: 0; right: 0; top: 0;
  display: grid; align-content: start; gap: .4rem; padding: 0 .25rem;
  pointer-events: none;
  z-index: 1;
}
.bubble {
  justify-self: start; max-width: 92%;
  padding: .45rem .9rem .55rem; border-radius: 1.1rem;
  background: color-mix(in srgb, var(--c, var(--accent)) 14%, var(--ink));
  box-shadow: inset 0 0 0 2px var(--c, var(--accent));
  font: 700 clamp(1.25rem, 5.6cqi, 1.8rem)/1.05 var(--display);
  animation: pop .34s cubic-bezier(.3, 1.6, .5, 1) both;
}
.bubble.you { justify-self: end; background: #f4f7f8; color: var(--ink); box-shadow: none; }
.bubble .who { display: block; font: 600 .7rem/1.4 var(--body); letter-spacing: .02em; color: var(--c, var(--accent)); }
.bubble.you .who { color: #606a70; }
.bubble.out { animation: fade-out .25s ease forwards; }
@keyframes pop { from { opacity: 0; transform: scale(.6) translateX(var(--from, -2rem)); } to { opacity: 1; transform: none; } }
@keyframes fade-out { to { opacity: 0; transform: translateY(-.4rem); } }

.stage-bar { display: grid; justify-items: center; gap: .5rem; position: relative; }
.modes { display: inline-flex; padding: .25rem; border-radius: 999px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.mode {
  border: 0; background: transparent; cursor: pointer;
  min-height: 2.6rem; padding: 0 1.1rem; border-radius: 999px;
  font: 600 1rem/1 var(--body); color: var(--muted);
}
.mode[aria-pressed="true"] { background: var(--accent); color: var(--ink); }
.hint { text-align: center; color: #b9c6cc; font-size: .975rem; min-height: 1.5em; padding: 0 1rem; text-wrap: balance; }
.mic-off { border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: .3rem; }

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); grid-template-rows: auto 1fr; column-gap: 3rem;
    min-height: min(56rem, calc(100svh - 4.5rem)); padding-top: 1rem; padding-bottom: 4rem; align-content: center;
  }
  .hero h1 { grid-column: 1; grid-row: 1; align-self: end; font-size: min(5.2vw, 5.2rem); max-width: none; }
  .hero-copy { display: block; grid-column: 1; grid-row: 2; align-self: start; }
  .hero .actions { margin-top: 1.75rem; }
  .hero .note { margin-top: .9rem; }
  .hero .lede { margin-top: 1.5rem; }
  .stage { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .dial canvas {
    inset: -10% -24% -6% -8%; width: 132%; height: 116%;
    -webkit-mask-image: radial-gradient(ellipse 50% 50% at 44% 60%, #000 70%, transparent);
    mask-image: radial-gradient(ellipse 50% 50% at 44% 60%, #000 70%, transparent);
  }
}

/* --- Conversazione ---------------------------------------------------------- */
.talk, .private, .last {
  max-width: var(--max); margin: 0 auto; padding: 4rem var(--gutter);
}
.talk h2, .scene h2, .private h2, .last h2 { font-size: clamp(2.2rem, 9vw, 3.6rem); line-height: .95; }
.section-lede { margin-top: 1rem; max-width: 36rem; color: #c9d4d9; }
.chat {
  list-style: none; margin: 2.25rem 0 0; padding: 0;
  display: grid; gap: .6rem; max-width: 34rem;
}
.say {
  justify-self: start; max-width: 90%;
  padding: .5rem 1rem .65rem; border-radius: 1.15rem;
  font: 700 clamp(1.35rem, 6vw, 1.8rem)/1.05 var(--display);
  background: color-mix(in srgb, var(--c) 13%, var(--ink));
  box-shadow: inset 0 0 0 2px var(--c);
}
.say.you { justify-self: end; background: #f4f7f8; color: var(--ink); box-shadow: none; }
.say .who { display: block; font: 600 .72rem/1.45 var(--body); color: var(--c); }
.say.you .who { color: #606a70; }
.commands { margin-top: 1.75rem; color: var(--muted); max-width: 36rem; }
.commands span { color: var(--text); font-weight: 500; }
@media (min-width: 900px) {
  .talk { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto 1fr; column-gap: 4rem; align-items: start; }
  .talk .chat { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; }
}

/* --- Scene fotografiche ------------------------------------------------------ */
.scene { max-width: var(--max); margin: 0 auto; padding: 2rem var(--gutter) 3rem; display: grid; gap: 1.75rem; }
.photo { margin: 0 calc(var(--gutter) * -1); position: relative; }
.photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.photo::after { content: ""; position: absolute; inset: auto 0 0; height: 30%; background: linear-gradient(transparent, var(--ink)); }
/* L'app che parla sopra la scena. */
.photo-say { position: absolute; z-index: 1; left: var(--gutter); bottom: 12%; margin: 0;
  background: color-mix(in srgb, var(--c) 18%, rgba(5, 11, 14, .82));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.scene-flip .photo-say { left: auto; right: var(--gutter); }
.facts { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1.1rem; max-width: 32rem; }
.facts li { padding-left: 1.1rem; border-left: 3px solid var(--line); color: #c9d4d9; }
.facts strong { color: var(--text); font-weight: 600; }
.scene:first-of-type .facts li { border-color: color-mix(in srgb, var(--lime) 55%, transparent); }
.scene-flip .facts li { border-color: color-mix(in srgb, var(--cyan) 55%, transparent); }
@media (min-width: 900px) {
  .scene { grid-template-columns: 1fr 1fr; align-items: center; gap: 4rem; padding: 4rem var(--gutter); }
  .photo { margin: 0; }
  .photo img { border-radius: 1.5rem; }
  .photo-say { left: -1.5rem; bottom: 2rem; }
  .scene-flip .photo-say { left: auto; right: -1.5rem; }
  .photo::after { display: none; }
  .scene-flip .photo { order: 2; }
}

/* --- Privacy e chiusura ----------------------------------------------------- */
.private p, .last p { margin-top: 1rem; max-width: 36rem; color: #c9d4d9; }
.last { padding-bottom: 5rem; display: grid; justify-items: center; text-align: center; }
.last p { margin-inline: auto; }
.app-icon { width: 8.5rem; height: 8.5rem; border-radius: 22.4%; margin-bottom: 2rem;
  box-shadow: 0 0 0 1px var(--line), 0 1.5rem 5rem -.5rem color-mix(in srgb, var(--cyan) 40%, transparent); }
.btn-store-big { margin-top: 1.75rem; }
@media (min-width: 900px) {
  .private { display: grid; grid-template-columns: 1fr 1fr; column-gap: 4rem; align-items: end; }
  .private p { margin-top: 0; font-size: 1.1875rem; }
  .last { padding-top: 6rem; padding-bottom: 7rem; }
  .last h2 { font-size: clamp(3rem, 5vw, 4.5rem); }
}

/* --- Pagine di testo (supporto, privacy, 404) --------------------------------- */
.doc { max-width: 44rem; margin: 0 auto; padding: 2rem var(--gutter) 5rem; }
.doc h1 { font-size: clamp(2.6rem, 10vw, 4rem); line-height: .95; margin-bottom: 1.5rem; }
.doc h2 { font-size: 1.75rem; line-height: 1.1; margin: 2.5rem 0 .75rem; }
.doc p, .doc li { color: #c9d4d9; }
.doc p + p { margin-top: .9rem; }
.doc strong { color: var(--text); font-weight: 600; }
.doc ul { margin: .9rem 0; padding-left: 1.2rem; display: grid; gap: .45rem; }
.doc li::marker { color: var(--lime); }
.doc a { color: var(--text); text-underline-offset: 3px; text-decoration-color: var(--lime); }
.doc .meta { color: var(--muted); font-size: .9375rem; }
.doc .actions { margin-top: 2rem; }

.foot {
  max-width: var(--max); margin: 0 auto;
  padding: 2rem var(--gutter) max(2rem, env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  color: var(--muted); font-size: .9375rem;
  border-top: 1px solid var(--line);
}
.foot nav { display: flex; gap: 1.25rem; }
.foot a { color: var(--text); text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bubble, .bubble.out { animation: none; }
}
