﻿/* ============================================================================
   ExcellIA — home.css
   Stili della homepage estratti VERBATIM dall'<helmet> del prototipo di Daisy.
   Contiene gli anchor di sezione (scroll-padding/scroll-margin curati da Daisy
   per le schermate perfette: NON modificare i valori), keyframes, hover, responsive.
   I token var(--*) arrivano da colors_and_type.css. Tema: excellia (blu notte).
   ============================================================================ */
  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  html { scroll-behavior: smooth; scroll-padding-top: 84px; background: #06111E; }
  /* puntamento ancore: compensa navbar sticky + sporgenza blocco-logo (desktop ~150px) */
  #servizi { scroll-margin-top: -85px; }
  #ework { scroll-margin-top: -150px; }
  #chi-sono { scroll-margin-top: -96px; }
  #scrivici { scroll-margin-top: -64px; }
  #contatti { scroll-margin-top: 4px; }
  @media (max-width: 760px) {
    html { scroll-padding-top: 68px; }
    #servizi, #ework, #chi-sono, #scrivici, #contatti { scroll-margin-top: 0; }
  }
  body { background: #06111E; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
  h1, h2, h3, p { margin: 0; }
  .ex-root button { font: inherit; }
  .ex-root, .ex-root * { font-family: 'Inter', system-ui, sans-serif; }
  .ework-home { transition: background .15s var(--ease-out-quart); }
  .ework-home:hover { background: var(--surface-container-lowest) !important; }
  .ework-home:hover .ework-wm { color: var(--sky-blue); }
  .ework-wm { transition: color .15s var(--ease-out-quart); }
  [data-reveal][data-revealed] { opacity: 1 !important; transform: none !important; }
  /* Safety net: se il JS non gira/fallisce, le sezioni compaiono comunque dopo 3s (niente pagina vuota) */
  @keyframes ew-safety-reveal { to { opacity: 1; transform: none; } }
  [data-reveal] { animation: ew-safety-reveal .01s linear 3s forwards; }
  @keyframes blk { 0%,100% { opacity: .52; transform: scale(1); } 50% { opacity: 1; transform: scale(1.14); } }
  .mark-live rect, .mark-live polygon, .mark-live circle { animation: blk 3.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; opacity: .52; }
  .mark-live circle { animation-duration: 2.2s; filter: drop-shadow(0 0 2.4px rgba(56,182,255,0.9)); }
  .mark-live rect:nth-of-type(5n){animation-delay:.8s} .mark-live rect:nth-of-type(5n+1){animation-delay:2.6s} .mark-live rect:nth-of-type(5n+2){animation-delay:1.5s} .mark-live rect:nth-of-type(5n+3){animation-delay:3.8s} .mark-live rect:nth-of-type(5n+4){animation-delay:.3s}
  .mark-live circle:nth-of-type(4n){animation-delay:1.2s} .mark-live circle:nth-of-type(4n+1){animation-delay:3.1s} .mark-live circle:nth-of-type(4n+2){animation-delay:4.4s}
  @media (prefers-reduced-motion: reduce) { .mark-live rect, .mark-live polygon, .mark-live circle { animation: none; opacity: 1; } }
  @media (min-width: 900px) { .hero-glow { left: 66% !important; } }
  .link-cta { color: #38B6FF !important; text-decoration: none; transition: color .15s var(--ease-out-quart); }
  .link-cta:hover { color: #00A3FF !important; text-decoration: underline; }
  .svc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  @media (max-width: 860px) { .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 560px) { .svc-grid { grid-template-columns: 1fr; } }
  .svc-card { cursor: pointer; }
  .spark-band canvas { -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 38%, #000 62%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 0%, #000 38%, #000 62%, transparent 100%); }
  header.glass { background: var(--nav-bg, color-mix(in oklab, var(--surface-container) 72%, transparent)) !important; background-size: 100vw 100% !important; background-repeat: no-repeat !important; background-position: left center !important; }
  .logo-block { background: transparent; box-shadow: none !important; }
  .logo-block::before { content: ''; position: absolute; inset: 0; background: var(--nav-solid, var(--surface)); background-size: 100vw 100%; background-repeat: no-repeat; background-position: left center; border-bottom-right-radius: 20px; -webkit-mask-image: linear-gradient(to top, transparent 1%, #000 56%); mask-image: linear-gradient(to top, transparent 1%, #000 56%); z-index: 0; pointer-events: none; }
  .logo-block img { position: relative; z-index: 1; }
  .nav-blooms { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; mix-blend-mode: screen; }
  .nav-blooms b, .logo-blooms b { position: absolute; top: 50%; left: 0; width: 230px; height: 230px; border-radius: 50%; filter: blur(36px); opacity: 0; will-change: transform, opacity; }
  .logo-blooms { position: absolute; top: 0; left: 0; width: 100%; height: 64px; overflow: hidden; pointer-events: none; mix-blend-mode: screen; z-index: 0; }
  @media (prefers-reduced-motion: reduce) { .nav-blooms { display: none; } }
  @media (max-width: 720px) {
    .logo-block { width: clamp(104px,30vw,138px) !important; height: 92px !important; padding: 9px 12px 13px !important; }
    .hero-inner { padding-top: 112px !important; }
  }
  .ex-link { color: var(--on-surface-variant); text-decoration: none; transition: color .15s var(--ease-out-quart); }
  .ex-link:hover { color: var(--on-surface); }
  .cert-link:hover { text-decoration: underline; text-underline-offset: 3px; }
  .nav-desktop a, header .btn-primary-ex { white-space: nowrap; }
  .nav-desktop { display: none; }
  .nav-burger { display: inline-flex; }
  @media (min-width: 880px) {
    .nav-desktop { display: flex; }
    .nav-burger { display: none !important; }
    .mobile-sheet { display: none !important; }
    .sticky-cta { display: none !important; }
  }
  @keyframes ex-breathe {
    0%, 100% { transform: translate(-50%, -50%) scale(0.94); opacity: .08; }
    50% { transform: translate(-50%, -50%) scale(1.18); opacity: .58; }
  }
  .hero-glow { animation: ex-breathe 5.5s var(--ease-in-out-quart) infinite; }
  .eb-desc { max-height: 60px; opacity: 1; transition: max-height .32s var(--ease-out-quart), opacity .32s var(--ease-out-quart); }
  @media (hover: hover) and (min-width: 880px) {
    .eb-desc { max-height: 0; opacity: 0; }
    .eb:hover .eb-desc { max-height: 60px; opacity: 1; }
  }
  .eb { transition: transform .15s var(--ease-out-quart), box-shadow .2s var(--ease-out-quart), background .2s var(--ease-out-quart); }
  .eb-open:hover { transform: translateY(-3px); }
  .svc-card { transition: transform .18s var(--ease-out-quart), box-shadow .25s var(--ease-out-quart), background .2s var(--ease-out-quart); }
  .svc-card:hover { transform: translateY(-4px); background: var(--surface-container-high); box-shadow: 0 18px 50px -22px rgba(0,163,255,0.55); }
  .svc-card-tools:hover > div[aria-hidden] { opacity: 0.72 !important; }
  .slot-row:hover { border-color: var(--electric-blue) !important; transform: translateY(-1px); box-shadow: 0 0 0 1px var(--electric-blue), 0 8px 24px rgba(0,163,255,.15); }
  @media (max-width: 760px) { .slot-grid { grid-template-columns: repeat(2, 1fr) !important; } }
  @media (max-width: 480px) { .slot-grid { grid-template-columns: 1fr !important; } }
  .metodo-grid > div:nth-child(2) { margin-top: 34px; }
  .metodo-grid > div:nth-child(3) { margin-top: 68px; }
  @media (max-width: 720px) { .metodo-grid { grid-template-columns: 1fr !important; } .metodo-grid > div { margin-top: 0 !important; } }
  .slot-arrow:hover:not([disabled]) { border-color: var(--electric-blue) !important; background: var(--surface-container-high) !important; }
  @keyframes cardGlowPulse { 0%, 100% { opacity: 0.5; transform: scale(1); } 50% { opacity: 0.9; transform: scale(1.09); } }
  .card-glow { transform-origin: center; animation: cardGlowPulse 7s var(--ease-in-out-quart, ease-in-out) infinite; }
  .card-glow-4 { animation-duration: 8.5s; animation-delay: -3s; }
  @keyframes cgSphere { 0%, 100% { opacity: 0.4; transform: scale(1); } 50% { opacity: 0.95; transform: scale(1.28); } }
  .cg-sphere { position: absolute; border-radius: 50%; filter: blur(0.5px); animation: cgSphere 6s var(--ease-in-out-quart, ease-in-out) infinite; }
  .svc-card-glow:hover .card-glow { opacity: 1 !important; }
  @media (prefers-reduced-motion: reduce) { .card-glow, .cg-sphere { animation: none; opacity: 0.6; } }
  .svc-card:hover .svc-arrow { color: var(--sky-blue); transform: translateX(3px); }
  .svc-arrow { transition: transform .18s var(--ease-out-quart), color .18s var(--ease-out-quart); }
  .btn-primary-ex { transition: box-shadow .15s var(--ease-out-quart), transform .15s var(--ease-out-quart), background .15s; }
  @media (min-width: 760px) { .cta-grid { grid-template-columns: 1fr 1.05fr !important; align-items: start !important; } }
  @media (min-width: 820px) { .scrivici-grid { grid-template-columns: 1.5fr 1fr !important; align-items: stretch !important; } }
  #contatti input:focus, #contatti textarea:focus { border-color: var(--electric-blue) !important; }
  #contatti input::placeholder, #contatti textarea::placeholder { color: var(--on-surface-muted); }
  .btn-primary-ex:hover { box-shadow: 0 12px 34px -8px rgba(0,163,255,0.65); transform: translateY(-1px); background: var(--sky-blue); }
  .btn-primary-ex:active { transform: scale(0.98); }
  .ework-detail { display: grid; grid-template-columns: 1fr; gap: 20px; }
  @media (min-width: 760px) { .ework-detail { grid-template-columns: 1.25fr 1fr; gap: 28px; } }
  .ework-blocks { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
  @media (min-width: 620px) { .ework-blocks { grid-template-columns: repeat(4, 1fr); } }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero-glow { animation: none !important; }
    [data-reveal] { opacity: 1 !important; transform: none !important; }
  }

  /* --- Chip "servizi" e bottoni "preferenza" del form (introdotti nella conversione 11ty) --- */
  .svc-chip { padding: 9px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--on-surface-variant); font-size: 13px; font-weight: 500; cursor: pointer; text-align: left; transition: 160ms var(--ease-out-quart); }
  .svc-chip:hover { border-color: rgba(0,163,255,.5); color: var(--on-surface); }
  .svc-chip.active { background: rgba(0,163,255,.14); border-color: var(--electric-blue); color: var(--on-surface); }
  .pref-btn { flex: 1; padding: 9px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--on-surface-variant); font-size: 14px; font-weight: 600; cursor: pointer; transition: 160ms var(--ease-out-quart); }
  .pref-btn:hover { color: var(--on-surface); }
  .pref-btn.active { background: var(--electric-blue); border-color: var(--electric-blue); color: var(--on-primary); }

  /* --- Menu mobile: voci allineate a destra, così non finiscono sotto il blocco-logo (che sporge a sinistra) --- */
  #mobileSheet { align-items: flex-end; text-align: right; }
  #mobileSheet a.ex-link { padding-right: 4px; }
  #mobileSheet .btn-primary-ex { width: 100%; justify-content: center; }

  /* --- Aggiustamenti mobile (collaudo 26/6) --- */
  @media (max-width: 879px) {
    /* la CTA fissa in basso copre i contenuti: spazio sotto al footer */
    footer { padding-bottom: 96px; }
    /* niente doppio bottone blu: la CTA sotto la demo E.Work sparisce dove c'è la CTA fissa */
    .ework-cta-blue { display: none !important; }
  }
  @media (max-width: 760px) {
    /* il reveal su mobile sembra un caricamento lento: tutto visibile subito */
    [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
    /* menù del footer su 2 colonne (non più colonnina stretta) */
    .footer-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; align-content: start; }
    .footer-nav > span { grid-column: 1 / -1; }
  }

  /* --- Form contatti: alone gradiente soffice dietro per contrasto (campi leggibili) --- */
  #scrivici { position: relative; }
  #scrivici::before { content: ""; position: absolute; left: 50%; top: 6%; transform: translateX(-50%); width: min(880px, 94%); height: 72%; border-radius: 50%; background: var(--gradient-brand); filter: blur(120px); opacity: 0.15; pointer-events: none; z-index: 0; }
  #scrivici > div { position: relative; z-index: 1; }
