/*
Theme Name: AIˢ — Elevate AI to the Power of Skills
Theme URI: https://aipowers.it
Author: AIˢ / PixelCrew
Author URI: https://aipowers.it
Description: Tema WordPress custom per la landing di AIˢ (aipowers.it). Single-page front-page basata su Advanced Custom Fields per i contenuti e Fluent Forms per il form contatti. Design fedele al Brand Book AIˢ: Space Grotesk, palette Notte/Crema/Corallo/Magenta/Scintilla/Viola.
Version: 1.3.0
Requires at least: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ais
*/

/* ============================================================
   FONT — Space Grotesk self-hosted (variabile 300–700, subset latin)
   Scaricato da Google Fonts, SIL Open Font License.
   ============================================================ */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('assets/fonts/space-grotesk-latin-var.woff2') format('woff2');
}

/* ============================================================
   DESIGN TOKENS (dal Brand Book AIˢ)
   ============================================================ */
:root {
  --ais-notte:     #15111C;  /* sfondo scuro primario + testo */
  --ais-notte-2:   #0F0B14;  /* footer, fondi ancora più profondi */
  --ais-crema:     #F6F4F0;  /* sfondo chiaro */
  --ais-corallo:   #FF6B35;  /* accento caldo */
  --ais-magenta:   #FF2E7E;  /* fine gradiente S */
  --ais-scintilla: #FFC93C;  /* energia / accento */
  --ais-viola:     #8B5CFF;  /* accento umano */

  /* Gradienti caldi — SOLO su S e scintilla, mai sul testo "AI" */
  --ais-grad-s:         linear-gradient(135deg, #FFB23D, #FF2E7E);
  --ais-grad-scintilla: linear-gradient(135deg, #FFD23F, #FF6B35);

  --ais-maxw: 1180px;
  --ais-pad-x: clamp(20px, 4vw, 48px);
  --ais-radius: 22px;
  --ais-font: 'Space Grotesk', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ais-font);
  font-weight: 400;
  background: var(--ais-notte);
  color: var(--ais-crema);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--ais-corallo); color: var(--ais-notte); }

.ais-container { max-width: var(--ais-maxw); margin: 0 auto; padding-left: var(--ais-pad-x); padding-right: var(--ais-pad-x); }
.ais-section { padding-top: clamp(72px, 9vw, 120px); padding-bottom: clamp(72px, 9vw, 120px); }
.ais-eyebrow { font-size: 14px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 16px; }
.ais-eyebrow--corallo { color: var(--ais-corallo); }
.ais-eyebrow--scintilla { color: var(--ais-scintilla); }

/* Sezioni su fondo chiaro (Crema) */
.ais-light { background: var(--ais-crema); color: var(--ais-notte); }
/* Sezioni su fondo scuro (Notte) */
.ais-dark .ais-muted { color: rgba(246,244,240,0.74); }
/* Dichiarata dopo: il <body> ha sempre la classe ais-dark (vedi header.php),
   quindi nelle sezioni chiare .ais-muted è discendente di entrambe le classi
   e, a parità di specificità, deve vincere questa regola (altrimenti il testo
   risulta chiaro su sfondo chiaro). */
.ais-light .ais-muted { color: rgba(21,17,28,0.72); }

/* ============================================================
   LOGO / LETTERMARK  AIˢ  — asset ufficiale (assets/img/logo/), variante "negativo"
   La S non va MAI portata in linea con "AI" (già garantito nel file sorgente).
   ============================================================ */
.ais-logo { display: inline-block; line-height: 0; }
.ais-logo img { display: block; width: auto; }
.ais-logo--sm img { height: 40px; }
.ais-logo--lg img { height: clamp(120px, 20vw, 210px); }
.ais-logo--footer img { height: 52px; }

/* Scintilla riutilizzabile come motivo grafico */
.ais-spark {
  display: inline-block; width: 1em; height: 1em;
  background: var(--ais-grad-scintilla);
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
}
.ais-spark--glow { filter: drop-shadow(0 0 12px rgba(255,201,60,0.55)); }

/* ============================================================
   BOTTONI / CTA
   ============================================================ */
.ais-btn {
  display: inline-block; text-decoration: none; cursor: pointer; border: none;
  background: var(--ais-corallo); color: var(--ais-notte);
  font-family: inherit; font-weight: 600; letter-spacing: -0.01em;
  padding: 15px 30px; border-radius: 999px; font-size: 17px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.ais-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255,107,53,0.40); }
.ais-btn--sm { padding: 10px 20px; font-size: 15px; }
.ais-link-under { text-decoration: none; font-weight: 500; letter-spacing: -0.01em; border-bottom: 1px solid rgba(246,244,240,0.3); padding-bottom: 2px; transition: color .18s ease, border-color .18s ease; }
.ais-link-under:hover { color: var(--ais-scintilla); border-color: var(--ais-scintilla); }

/* ============================================================
   HEADER
   ============================================================ */
.ais-header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); background: rgba(21,17,28,0.82); border-bottom: 1px solid rgba(246,244,240,0.08); }
.ais-header__inner { max-width: var(--ais-maxw); margin: 0 auto; padding: 16px var(--ais-pad-x); display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ais-nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); flex-wrap: wrap; }
.ais-nav a { text-decoration: none; color: rgba(246,244,240,0.72); font-size: 15px; font-weight: 500; letter-spacing: -0.01em; transition: color .18s ease; }
.ais-nav a:hover { color: var(--ais-crema); }
.ais-nav a.ais-btn { color: var(--ais-notte); }
.ais-nav a.ais-btn:hover { color: var(--ais-notte); }

.ais-nav__menu { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); list-style: none; margin: 0; padding: 0; }

.ais-nav__toggle { display: none; }

@media (max-width: 768px) {
  .ais-nav__toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
  }

  .ais-nav__toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--ais-crema);
    transition: transform .2s ease, opacity .2s ease;
  }

  .ais-nav__toggle[aria-expanded="true"] .ais-nav__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .ais-nav__toggle[aria-expanded="true"] .ais-nav__toggle-bar:nth-child(2) { opacity: 0; }
  .ais-nav__toggle[aria-expanded="true"] .ais-nav__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .ais-nav__menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--ais-pad-x) 20px;
    background: rgba(21,17,28,0.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(246,244,240,0.08);
  }

  .ais-nav__menu.is-open { display: flex; }

  .ais-nav__menu li { width: 100%; }

  .ais-nav__menu a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid rgba(246,244,240,0.08);
  }

  .ais-nav__menu li:last-child a { border-bottom: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.ais-hero { position: relative; padding: clamp(64px,9vw,120px) var(--ais-pad-x) clamp(72px,10vw,130px); overflow: hidden; }
.ais-hero__glow { position: absolute; pointer-events: none; filter: blur(10px); }
.ais-hero__glow--viola { top: -8%; right: -6%; width: min(620px,70vw); height: min(620px,70vw); background: radial-gradient(circle, rgba(139,92,255,0.32), rgba(139,92,255,0) 62%); animation: ais-glow 9s ease-in-out infinite; }
.ais-hero__glow--corallo { bottom: -14%; left: -8%; width: min(540px,64vw); height: min(540px,64vw); background: radial-gradient(circle, rgba(255,107,53,0.22), rgba(255,107,53,0) 64%); animation: ais-glow 11s ease-in-out infinite; }
.ais-hero__grid { position: relative; max-width: var(--ais-maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: clamp(40px,6vw,80px); align-items: center; }
.ais-hero__eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--ais-scintilla); font-size: clamp(13px,1.4vw,15px); font-weight: 500; letter-spacing: 0.02em; margin-bottom: 22px; text-transform: uppercase; }
.ais-h1 { font-size: clamp(38px,6.2vw,72px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; margin: 0 0 22px; text-wrap: balance; }
.ais-hero__sub { font-size: clamp(17px,1.9vw,21px); line-height: 1.55; color: rgba(246,244,240,0.74); max-width: 36ch; margin: 0 0 34px; }
.ais-hero__cta { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ais-hero__cta .ais-link-under { color: var(--ais-crema); font-size: 17px; }

/* Card formula */
.ais-formula-card { position: relative; border: 1px solid rgba(246,244,240,0.12); border-radius: 28px; padding: clamp(32px,4.5vw,56px) clamp(26px,4vw,48px); background: linear-gradient(160deg, rgba(139,92,255,0.10), rgba(255,107,53,0.05)); box-shadow: 0 30px 80px rgba(0,0,0,0.40); }
.ais-formula-card__logo { display: flex; justify-content: center; align-items: flex-start; margin-bottom: clamp(30px,4vw,44px); }
.ais-divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(246,244,240,0.18), transparent); margin-bottom: clamp(28px,3.5vw,40px); }
.ais-formula { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(10px,1.6vw,16px); font-size: clamp(18px,2.6vw,30px); font-weight: 600; letter-spacing: -0.02em; }
.ais-formula__op { color: rgba(246,244,240,0.4); font-weight: 400; }
.ais-formula__ai { color: var(--ais-crema); }
.ais-formula__skills { color: var(--ais-viola); }
.ais-formula__roi { color: var(--ais-corallo); }

/* ============================================================
   CONCETTO — card
   ============================================================ */
.ais-lead { max-width: 760px; margin-bottom: clamp(44px,6vw,64px); }
.ais-h2 { font-size: clamp(30px,4.4vw,52px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.06; margin: 0 0 22px; text-wrap: balance; }
.ais-lead__p { font-size: clamp(16px,1.7vw,19px); line-height: 1.6; margin: 0; max-width: 62ch; }
.ais-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: clamp(18px,2.4vw,28px); }
.ais-card { background: var(--ais-notte); color: var(--ais-crema); border-radius: var(--ais-radius); padding: clamp(28px,3.4vw,38px); }
.ais-card__icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 24px; }
.ais-card__title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 10px; }
.ais-card__text { font-size: 16px; line-height: 1.55; color: rgba(246,244,240,0.66); margin: 0; }

/* ============================================================
   PROBLEMA — centrato
   ============================================================ */
.ais-problem { position: relative; overflow: hidden; }
.ais-problem__glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: min(500px,60vw); height: min(500px,60vw); background: radial-gradient(circle, rgba(255,46,126,0.14), rgba(255,46,126,0) 66%); pointer-events: none; }
.ais-center { position: relative; max-width: 840px; margin: 0 auto; text-align: center; }
.ais-center__p { font-size: clamp(17px,1.9vw,21px); line-height: 1.6; margin: 0 auto; max-width: 60ch; }

/* ============================================================
   METODO — step + claim
   ============================================================ */
.ais-grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px,1fr)); gap: clamp(18px,2.4vw,26px); margin-bottom: clamp(40px,5vw,56px); }
.ais-step { border: 1px solid rgba(21,17,28,0.12); border-radius: 20px; padding: clamp(26px,3vw,34px); background: rgba(255,255,255,0.5); }
.ais-step__num { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; margin-bottom: 18px; }
.ais-step__title { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 10px; }
.ais-step__text { font-size: 15.5px; line-height: 1.55; color: rgba(21,17,28,0.68); margin: 0; }
.ais-claim { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--ais-notte); color: var(--ais-crema); border-radius: 18px; padding: clamp(22px,3vw,30px) clamp(26px,3.4vw,38px); }
.ais-claim__spark { flex: none; width: 26px; height: 26px; }
.ais-claim p { font-size: clamp(17px,2vw,22px); font-weight: 500; letter-spacing: -0.02em; margin: 0; }
.ais-claim p span { color: rgba(246,244,240,0.6); }

/* ============================================================
   PER CHI — due gruppi + chip
   ============================================================ */
.ais-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: clamp(18px,2.4vw,26px); }
.ais-audience { border: 1px solid rgba(246,244,240,0.14); border-radius: var(--ais-radius); padding: clamp(30px,3.6vw,42px); }
.ais-audience--pmi { background: linear-gradient(160deg, rgba(255,107,53,0.08), transparent); }
.ais-audience--studi { background: linear-gradient(160deg, rgba(139,92,255,0.10), transparent); }
.ais-audience__title { font-size: clamp(22px,2.6vw,28px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 16px; }
.ais-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ais-chip { font-size: 15px; font-weight: 500; color: var(--ais-crema); border: 1px solid rgba(246,244,240,0.2); border-radius: 999px; padding: 8px 16px; }

/* ============================================================
   TEAM
   ============================================================ */
.ais-team-member__photo { aspect-ratio: 1; border-radius: 20px; overflow: hidden; margin-bottom: 18px; position: relative; background: repeating-linear-gradient(135deg,#e9e6e0,#e9e6e0 10px,#efece6 10px,#efece6 20px); display: flex; align-items: flex-end; justify-content: center; padding: 14px; }
.ais-team-member__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ais-team-member__spark { position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; z-index: 2; }
.ais-team-member__ph { font-family: ui-monospace, monospace; font-size: 12px; color: rgba(21,17,28,0.4); }
.ais-team-member__name { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 4px; }
.ais-team-member__role { font-size: 15px; font-weight: 500; margin: 0; }

/* ============================================================
   CONTATTI + FORM
   ============================================================ */
.ais-contact__grid { position: relative; max-width: var(--ais-maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); gap: clamp(40px,6vw,72px); align-items: start; }
.ais-contact__glow { position: absolute; top: -10%; right: -6%; width: min(560px,64vw); height: min(560px,64vw); background: radial-gradient(circle, rgba(139,92,255,0.24), rgba(139,92,255,0) 64%); pointer-events: none; }
.ais-contact__links { display: flex; flex-direction: column; gap: 16px; margin-top: 34px; }
.ais-contact__links a { text-decoration: none; color: var(--ais-crema); font-size: 17px; font-weight: 500; display: inline-flex; align-items: center; gap: 12px; transition: color .18s ease; }
.ais-contact__links a:hover { color: var(--ais-scintilla); }
.ais-contact__label { color: rgba(246,244,240,0.5); font-size: 14px; width: 76px; display: inline-block; }
.ais-form-wrap { border: 1px solid rgba(246,244,240,0.14); border-radius: 24px; padding: clamp(28px,3.6vw,44px); background: rgba(246,244,240,0.03); }

/* Stile Fluent Forms dentro il wrapper AIˢ (override sobrio del markup FF) */
.ais-form-wrap .fluentform .ff-el-input--label label,
.ais-form-wrap label { display: block; font-size: 14px; font-weight: 500; color: rgba(246,244,240,0.7); margin-bottom: 8px; }
.ais-form-wrap .ff-el-group { margin-bottom: 18px; }
.ais-form-wrap input[type=text],
.ais-form-wrap input[type=email],
.ais-form-wrap textarea {
  width: 100%; background: rgba(21,17,28,0.4); border: 1px solid rgba(246,244,240,0.16);
  border-radius: 12px; padding: 13px 16px; color: var(--ais-crema); font-size: 16px;
  font-family: inherit; outline: none; transition: border-color .18s ease;
}
.ais-form-wrap textarea { resize: vertical; min-height: 110px; }
.ais-form-wrap input::placeholder, .ais-form-wrap textarea::placeholder { color: rgba(246,244,240,0.4); }
.ais-form-wrap input:focus, .ais-form-wrap textarea:focus { border-color: var(--ais-corallo); }
.ais-form-wrap .ff-btn-submit,
.ais-form-wrap button[type=submit] {
  margin-top: 4px; color: var(--ais-notte); background: var(--ais-corallo); border: none;
  padding: 15px 30px; border-radius: 999px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; font-family: inherit;
}
.ais-form-wrap .ff-btn-submit:hover, .ais-form-wrap button[type=submit]:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255,107,53,0.40); }
.ais-form-wrap .ff-message-success { color: var(--ais-scintilla); }

/* ============================================================
   FOOTER
   ============================================================ */
.ais-footer { background: var(--ais-notte-2); color: var(--ais-crema); padding: clamp(56px,7vw,84px) var(--ais-pad-x) clamp(32px,4vw,44px); border-top: 1px solid rgba(246,244,240,0.08); }
.ais-footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: clamp(28px,4vw,48px); align-items: start; margin-bottom: clamp(40px,5vw,56px); }
.ais-footer__payoff { font-size: clamp(19px,2.4vw,26px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; margin: 18px 0 0; max-width: 22ch; }
.ais-footer__col { display: flex; flex-direction: column; gap: 12px; }
.ais-footer__col-title { font-size: 15px; color: rgba(246,244,240,0.5); font-weight: 500; }
.ais-footer__col a { text-decoration: none; color: rgba(246,244,240,0.82); font-size: 16px; transition: color .18s ease; }
.ais-footer__col a:hover { color: var(--ais-scintilla); }
.ais-footer__rule { height: 1px; background: rgba(246,244,240,0.1); margin-bottom: 26px; }
.ais-footer__legal { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.ais-footer__legal p { font-size: 14px; margin: 0; letter-spacing: -0.01em; }
.ais-footer__legal p:first-child { color: rgba(246,244,240,0.56); }
.ais-footer__legal p:last-child { color: rgba(246,244,240,0.58); }

/* ============================================================
   MICRO-INTERAZIONI — reveal allo scroll + bagliori
   ============================================================ */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.16,.7,.3,1), transform .7s cubic-bezier(.16,.7,.3,1); }
[data-reveal].is-visible { opacity: 1; transform: none; }

@keyframes ais-glow { 0%,100% { opacity: .55; transform: scale(1); } 50% { opacity: .9; transform: scale(1.06); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .ais-nav__toggle-bar { transition: none; }
}

/* Accessibilità: focus visibile */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--ais-scintilla); outline-offset: 2px; }
.ais-skip-link { position: absolute; left: -9999px; top: 0; background: var(--ais-scintilla); color: var(--ais-notte); padding: 10px 16px; z-index: 100; border-radius: 0 0 8px 0; font-weight: 600; }
.ais-skip-link:focus { left: 0; }

/* Stati errore/successo Fluent Forms (markup reale del plugin) */
.ais-form-wrap .ff-el-is-error input,
.ais-form-wrap .ff-el-is-error textarea { border-color: var(--ais-magenta); }
.ais-form-wrap .text-danger,
.ais-form-wrap .error { color: #FF9D9D; font-size: 13px; }
.ais-form-wrap .ff-message-success {
  color: var(--ais-scintilla);
  border: 1px solid rgba(255,201,60,0.35);
  border-radius: 12px;
  padding: 14px 16px;
}

/* Stampa: nessun contenuto nascosto dal reveal, niente bagliori decorativi */
@media print {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .ais-hero__glow, .ais-problem__glow, .ais-contact__glow { display: none !important; }
  .ais-header { position: static; }
}

/* Override del CSS di default di Fluent Forms dentro il wrapper AIˢ:
   la regola :focus di fluentform-public-default.css (.ff-default .ff-el-form-control:focus)
   ha specificità maggiore delle regole sopra e ripristina sfondo bianco, bordo blu e testo
   grigio sugli input in focus. Rialliniamo con le classi reali del markup. */
.ais-form-wrap .fluentform .ff-el-form-control:focus {
  background: rgba(21,17,28,0.4);
  border-color: var(--ais-corallo);
  color: var(--ais-crema);
  box-shadow: none;
  outline: none;
}
