:root {
    --bg-0: #020c17;
    --cyan-glow: rgba(90, 210, 255, .55);
    --text: #a9ecff;
  }
  * { box-sizing: border-box; margin: 0; }
  html, body { height: 100%; background: var(--bg-0); overflow: hidden; }
  body {
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--text);
  }
  #bg { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

  main {
    position: relative; z-index: 1;
    height: 100%; min-height: 100dvh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: clamp(28px, 6.5vh, 68px);            /* spazio tra titolo e pulsante di accesso */
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    text-align: center;
  }
  /* cervello + titolo: il cervello ha la stessa larghezza del testo */
  .stack {
    display: flex; flex-direction: column; align-items: center;
    width: fit-content; max-width: 100%;
    gap: clamp(14px, 3.4vh, 38px);            /* spazio tra cervello e titolo */
  }
  h1 {
    font-weight: 300;
    font-size: clamp(36px, min(13vw, 12vh), 92px);
    letter-spacing: .01em;
    line-height: 1;
    color: var(--text);
    text-shadow: 0 0 18px var(--cyan-glow), 0 0 48px rgba(60, 170, 255, .35);
  }
  /* segnaposto: il cervello è disegnato sul canvas in questa posizione */
  #brain-slot {
    width: 100%;
    aspect-ratio: 100 / 74;
    max-height: 46vh;
  }
  .google-btn {
    display: inline-flex; align-items: center; gap: 14px;
    padding: 14px 30px;
    background: #fff; color: #1f1f1f;
    border-radius: 6px;
    font: 400 clamp(15px, 1.5vw, 19px) 'Montserrat', system-ui, sans-serif;
    text-decoration: none;
    box-shadow: 0 0 0 1px rgba(255,255,255,.25), 0 0 26px rgba(80, 200, 255, .55), 0 6px 24px rgba(0,0,0,.45);
    transition: transform .2s ease, box-shadow .2s ease;
  }
  .google-btn:hover, .google-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px rgba(255,255,255,.4), 0 0 40px rgba(110, 220, 255, .85), 0 10px 30px rgba(0,0,0,.5);
    outline: none;
  }
  .google-btn svg { width: 22px; height: 22px; flex: none; }

  /* ---- UI della gate app ---- */
  #actions {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    max-width: min(560px, 100%); max-height: 24vh; overflow-y: auto; padding: 6px 4px;
  }
  .msg { font-size: clamp(13px, 1.4vw, 16px); color: #8fc9dd; max-width: 34ch; line-height: 1.4; }
  .who { font-size: clamp(13px, 1.4vw, 16px); color: #a9ecff; }
  .services { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
  .service {
    display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 10px 20px; min-width: 120px;
    background: rgba(255,255,255,.96); color: #14212b; border-radius: 6px; text-decoration: none;
    font-size: clamp(14px, 1.4vw, 17px);
    box-shadow: 0 0 0 1px rgba(255,255,255,.25), 0 0 20px rgba(80,200,255,.45), 0 4px 16px rgba(0,0,0,.4);
    transition: transform .2s ease, box-shadow .2s ease;
  }
  .service small { font-size: .72em; color: #5b6b76; }
  .service:hover, .service:focus-visible {
    transform: translateY(-2px); outline: none;
    box-shadow: 0 0 0 1px rgba(255,255,255,.4), 0 0 34px rgba(110,220,255,.8), 0 8px 24px rgba(0,0,0,.5);
  }
  .link-btn {
    background: none; border: 0; color: #7fb3c8; font: inherit; font-size: 13px; cursor: pointer;
    text-decoration: underline; padding: 4px;
  }
  .link-btn:hover { color: #a9ecff; }
  button.google-btn { border: 0; cursor: pointer; }
  button.google-btn[disabled] { opacity: .6; cursor: default; }
  .lang { position: fixed; top: 12px; right: 14px; z-index: 2; display: flex; gap: 4px; }
  .lang button {
    background: rgba(255,255,255,.06); color: #7fb3c8; border: 1px solid rgba(143,227,255,.25);
    border-radius: 4px; padding: 3px 8px; font: 400 12px 'Montserrat', system-ui, sans-serif; cursor: pointer;
  }
  .lang button[aria-pressed="true"] { color: #a9ecff; border-color: rgba(143,227,255,.7); }
