/* ============ SitePloy — tema "Dark OLED + Bento" ============
   Design system generato con la skill ui-ux-pro-max:
   - stile: Dark Mode (OLED) + Bento Box Grid
   - palette: "operation orange on dark" (arancione del brand su nero caldo)
   - font: JetBrains Mono (titoli) + IBM Plex Sans (testo)
   - motion: comparsa a cascata 300-450ms, disattivata con prefers-reduced-motion */
:root {
  /* colori */
  --bg: #0c0a09;
  --bg-soft: #110f0e;
  --surface: #1c1917;
  --surface-2: #262321;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #fafaf9;
  --muted: #a8a29e;
  --accent: #f97316;
  --accent-strong: #ea580c;
  --accent-soft: rgba(249, 115, 22, .12);
  --on-accent: #0c0a09;
  --accent-2: #ef4444;
  --success: #22c55e;
  --danger: #f87171;
  --grad: linear-gradient(135deg, #fb923c, var(--accent-strong));

  /* forme e misure */
  --radius: 20px;
  --radius-sm: 12px;
  --maxw: 1160px;
  --gap: 16px;
  --space-section: 112px;

  /* tipografia */
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;

  /* movimento */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur: 200ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--on-accent); }

h1, h2, h3 { font-family: var(--mono); line-height: 1.12; letter-spacing: -0.04em; margin: 0 0 .6em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.grad-text { color: var(--accent); }

/* focus visibile per la tastiera su ogni elemento interattivo */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: var(--space-section) 0; }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .78rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.kicker::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--accent); }
.section-head { max-width: 680px; margin-bottom: 48px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 620px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12, 10, 9, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.03em; }
.logo img { width: 32px; height: 32px; }
.logo span b { color: var(--accent); font-weight: 700; }
.nav-links {
  display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
}
.nav-links a {
  display: flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  color: var(--muted); font-size: .94rem; font-weight: 500;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang-toggle {
  font-family: var(--mono); font-size: .8rem; font-weight: 600;
  background: transparent; color: var(--text); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); min-width: 44px; min-height: 44px; padding: 0 12px; cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }
.menu-btn {
  display: none; background: none; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  color: var(--text); width: 44px; height: 44px; cursor: pointer;
}
.menu-btn svg { width: 20px; height: 20px; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: var(--radius-sm);
  font-family: inherit; font-weight: 600; font-size: .98rem;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn svg { transition: transform var(--dur) var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: #fb923c; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: .92rem; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 104px 0 120px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
}
.hero::after {
  content: ""; position: absolute; width: 640px; height: 640px; right: -180px; top: -220px;
  background: radial-gradient(circle, rgba(249, 115, 22, .16), transparent 65%); pointer-events: none;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 64px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .78rem;
  color: var(--muted); border: 1px solid var(--border-strong); background: rgba(28, 25, 23, .7);
  padding: 7px 14px; border-radius: 999px; margin-bottom: 26px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); flex-shrink: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* Finto workflow n8n */
.workflow {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .9); overflow: hidden; font-family: var(--mono); font-size: .84rem;
}
.wf-bar { display: flex; align-items: center; gap: 7px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.wf-bar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; background: #44403c; }
.wf-bar span { margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-body { padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.wf-node {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft);
  opacity: 0; animation: nodeIn .4s var(--ease) forwards;
}
.wf-node:nth-of-type(1) { animation-delay: .2s; } .wf-node:nth-of-type(2) { animation-delay: .55s; }
.wf-node:nth-of-type(3) { animation-delay: .9s; } .wf-node:nth-of-type(4) { animation-delay: 1.25s; }
.wf-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.wf-icon svg { width: 18px; height: 18px; }
.wf-node .ok { margin-left: auto; color: var(--success); display: grid; place-items: center; }
.wf-node .ok svg { width: 16px; height: 16px; }
.wf-line { width: 2px; height: 14px; background: linear-gradient(var(--accent), transparent); opacity: .5; margin-left: 30px; }
.wf-foot { border-top: 1px solid var(--border); padding: 14px 20px; color: var(--success); display: flex; align-items: center; gap: 10px; }
@keyframes nodeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Griglie bento e card ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
/* 4 elementi in una griglia bento 3 colonne: larghe la prima e l'ultima */
.grid-4 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-4 > :nth-child(4n + 1), .grid-4 > :nth-child(4n) { grid-column: span 2; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; transition: border-color var(--dur) var(--ease);
}
.card:hover { border-color: rgba(249, 115, 22, .35); }
.card-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(249, 115, 22, .25); margin-bottom: 24px; }
.card-icon svg { width: 24px; height: 24px; }
.card p { color: var(--muted); }
.card > p:last-child { margin-bottom: 0; }
.link-arrow { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 600; font-size: .95rem; }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 4px; }

.step { position: relative; padding: 28px 30px; }
.step-num {
  font-family: var(--mono); font-size: 2.6rem; font-weight: 700; line-height: 1; letter-spacing: -0.05em;
  color: transparent; -webkit-text-stroke: 1px rgba(249, 115, 22, .7); margin-bottom: 22px; display: block;
}

.check-list { list-style: none; padding: 0; margin: 22px 0 0; }
.check-list li { position: relative; padding-left: 32px; margin-bottom: 12px; color: var(--text); }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 20px; height: 20px; border-radius: 6px;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f97316' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* ---------- Banda CTA ---------- */
.cta-band {
  position: relative; border-radius: 28px; padding: 72px 56px; overflow: hidden; text-align: center;
  background: var(--surface); border: 1px solid var(--border-strong);
}
.cta-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(249, 115, 22, .28), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 40px 40px;
}
.cta-band > * { position: relative; }
.cta-band h2 { max-width: 720px; margin-left: auto; margin-right: auto; }
.cta-band p { color: var(--muted); max-width: 560px; margin: 0 auto 30px; }

/* ---------- Intestazione pagine interne ---------- */
.page-hero { padding: 88px 0 48px; position: relative; }
.page-hero .lead { margin-top: 8px; }

/* ---------- Chi sono ---------- */
.about-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 64px; align-items: start; }
.photo {
  aspect-ratio: 4/5; border-radius: var(--radius); border: 1px solid var(--border-strong); overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(249, 115, 22, .22), transparent 60%),
    linear-gradient(160deg, var(--surface-2), var(--bg-soft));
  display: grid; place-items: center; position: relative;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .initial { font-family: var(--mono); font-size: 7rem; font-weight: 700; }
.photo-meta {
  margin-top: var(--gap); display: flex; flex-direction: column; gap: 12px; font-size: .95rem;
  padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.meta-row { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.meta-row svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: var(--mono); font-size: .88rem; padding: 10px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-strong);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.cert { display: flex; gap: 16px; align-items: flex-start; padding: 24px; }
.cert-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); border: 1px solid rgba(249, 115, 22, .25); display: grid; place-items: center; font-family: var(--mono); font-weight: 700; flex-shrink: 0; }
.cert-logo svg { width: 20px; height: 20px; }
.cert h3 { font-size: 1rem; margin-bottom: 4px; }
.cert p { margin: 0; font-size: .88rem; }

/* ---------- Servizi ---------- */
.service-block { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding: 56px; }
.service-block + .service-block { margin-top: var(--gap); }
.code-card {
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 24px; font-family: var(--mono); font-size: .85rem; color: var(--muted); overflow-x: auto; line-height: 1.85;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.code-card .k { color: #fb7185; } .code-card .s { color: #4ade80; } .code-card .c { color: #78716c; } .code-card .f { color: var(--accent); }
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 10px; transition: border-color var(--dur) var(--ease);
}
.faq details[open] { border-color: var(--border-strong); }
.faq summary {
  cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 64px; padding: 16px 24px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--mono); color: var(--accent); font-size: 1.2rem; line-height: 1;
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); flex-shrink: 0;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0; padding: 0 24px 22px; color: var(--muted); }

/* ---------- Contatti ---------- */
.contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: var(--gap); align-items: start; }
.info-card { padding: 30px; }
.info-item { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.info-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.info-item .wf-icon { width: 44px; height: 44px; border-radius: 12px; }
.info-item .wf-icon svg { width: 20px; height: 20px; }
.info-item small { display: block; color: var(--muted); font-family: var(--mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 2px; }
.info-item a { color: var(--accent); font-weight: 600; word-break: break-all; }
.info-item a:hover { text-decoration: underline; text-underline-offset: 4px; }
.form { padding: 36px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.field label { font-size: .9rem; font-weight: 600; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1rem; color: var(--text); background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); min-height: 48px; padding: 12px 14px; width: 100%;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: #78716c; }
.field textarea { min-height: 160px; resize: vertical; }
.field select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(255, 255, 255, .26); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(249, 115, 22, .18); }
.field.invalid label { color: var(--danger); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(248, 113, 113, .12); }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; color: var(--muted); margin-bottom: 24px; cursor: pointer; }
.consent input { margin-top: 3px; accent-color: var(--accent); width: 20px; height: 20px; flex-shrink: 0; cursor: pointer; }
.consent.invalid { color: var(--danger); }
/* Nascosto di default (interaction-only): lo spazio compare solo se il widget viene mostrato */
.cf-turnstile iframe { margin-bottom: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .btn-primary { width: 100%; }
.form-status { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm); font-size: .95rem; display: none; }
.form-status.show { display: block; }
.form-status.ok { background: rgba(34, 197, 94, .1); border: 1px solid rgba(34, 197, 94, .4); color: #4ade80; }
.form-status.err { background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .4); color: var(--danger); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 56px 0 32px; margin-top: 40px; }
.footer-grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-grid p { color: var(--muted); max-width: 340px; margin-top: 14px; font-size: .95rem; }
.footer-links { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-links h4 { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 0 12px; font-weight: 500; }
.footer-links ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.footer-links li { min-height: 36px; display: flex; align-items: center; }
.footer-links a { transition: color var(--dur) var(--ease); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

/* ---------- Comparsa a cascata ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
:is(.grid-2, .grid-3, .grid-4) > .reveal:nth-child(2) { transition-delay: 60ms; }
:is(.grid-2, .grid-3, .grid-4) > .reveal:nth-child(3) { transition-delay: 120ms; }
:is(.grid-2, .grid-3, .grid-4) > .reveal:nth-child(4) { transition-delay: 180ms; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  :root { --space-section: 88px; }
  .hero-grid, .about-grid, .contact-grid, .service-block { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 > :nth-child(4n + 1), .grid-4 > :nth-child(4n) { grid-column: auto; }
  .service-block { padding: 36px; gap: 36px; }
  .about-grid { gap: 40px; }
  .about-grid .photo { max-width: 360px; }
}
@media (max-width: 760px) {
  :root { --space-section: 72px; }
  body { font-size: 16px; }
  .hero { padding: 56px 0 80px; }
  .menu-btn { display: grid; place-items: center; }
  .nav-links {
    position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--bg); border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
    padding: 12px 20px 20px; gap: 4px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { min-height: 48px; border-radius: var(--radius-sm); }
  .nav-actions .btn { display: none; }
  .grid-2, .grid-3, .grid-4, .form-row { grid-template-columns: 1fr; }
  .form-row { gap: 0; }
  .cta-band { padding: 48px 24px; border-radius: var(--radius); }
  .card { padding: 26px; }
  .form, .service-block { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .wf-node { opacity: 1; transform: none; }
}

/* ---------- Utility ---------- */
.section-tight { padding-top: 16px; }
.container-narrow { max-width: 820px; }
.text-center { text-align: center; }
.dot-inline { margin: 0 5px; }

/* ---------- Glow cards (effetto spotlight che segue il mouse) ----------
   Versione HTML/CSS del componente GlowCard. Il JS (main.js) aggiorna
   --x / --y / --xp sulla pagina e aggiunge data-glow a ogni .card.
   Colore: --glow-base è la tinta di partenza (0 = rosso, 30 = arancione),
   --glow-spread quanto cambia muovendo il mouse da sinistra a destra.
   Il design system chiede un glow minimo: intensità ridotta rispetto alla versione precedente. */
:root { --glow-base: 18; --glow-spread: 16; }

.card[data-glow] {
  --border-size: 1px;
  --spotlight-size: 280px;
  --hue: calc(var(--glow-base) + (var(--xp, 0) * var(--glow-spread)));
  position: relative;
  background-color: var(--surface);
  background-image: radial-gradient(
    var(--spotlight-size) var(--spotlight-size) at calc(var(--x, -999) * 1px) calc(var(--y, -999) * 1px),
    hsl(var(--hue) 100% 60% / 0.06), transparent
  );
  background-attachment: fixed;
  border-width: var(--border-size);
}

/* bordo luminoso */
.card[data-glow]::before,
.card[data-glow]::after {
  content: ""; pointer-events: none; position: absolute;
  inset: calc(var(--border-size) * -1);
  border: var(--border-size) solid transparent;
  border-radius: inherit;
  background-attachment: fixed;
  background-repeat: no-repeat;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
          mask-composite: exclude;
}
.card[data-glow]::before {
  background-image: radial-gradient(
    calc(var(--spotlight-size) * .75) calc(var(--spotlight-size) * .75) at calc(var(--x, -999) * 1px) calc(var(--y, -999) * 1px),
    hsl(var(--hue) 100% 55% / 1), transparent 100%
  );
  filter: brightness(1.4);
}
.card[data-glow]::after {
  background-image: radial-gradient(
    calc(var(--spotlight-size) * .4) calc(var(--spotlight-size) * .4) at calc(var(--x, -999) * 1px) calc(var(--y, -999) * 1px),
    hsl(30 100% 92% / .6), transparent 100%
  );
}

/* alone sfumato all'esterno della card */
.card[data-glow] > .glow-halo {
  position: absolute; inset: 0; pointer-events: none;
  border-radius: inherit; filter: blur(14px); opacity: .35;
}
.card[data-glow] > .glow-halo::before {
  content: ""; position: absolute; inset: -10px;
  border: 10px solid transparent; border-radius: inherit;
  background-image: radial-gradient(
    calc(var(--spotlight-size) * .6) calc(var(--spotlight-size) * .6) at calc(var(--x, -999) * 1px) calc(var(--y, -999) * 1px),
    hsl(var(--hue) 100% 55% / 1), transparent 100%
  );
  background-attachment: fixed;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
          mask-composite: exclude;
}
.card[data-glow] > *:not(.glow-halo) { position: relative; }

/* su touch (telefono/tablet) l'effetto non serve: niente mouse */
@media (hover: none), (pointer: coarse) {
  .card[data-glow]::before, .card[data-glow]::after, .card[data-glow] > .glow-halo { display: none; }
}

/* ---------- Hero animato (sfondo WebGL, solo Home) ---------- */
.hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
  opacity: 0; transition: opacity 1.2s ease;
}
.hero-canvas.ready { opacity: .7; }
.hero-animated::before { z-index: 1; opacity: .6; }           /* griglia sopra al gradiente */
.hero-animated::after {                                        /* leggibilità del testo + fusione col resto della pagina */
  z-index: 1; width: auto; height: auto; inset: 0; right: 0; top: 0;
  background:
    linear-gradient(90deg, rgba(12, 10, 9, .85) 0%, rgba(12, 10, 9, .45) 45%, transparent 75%),
    linear-gradient(180deg, transparent 60%, var(--bg) 100%);
}
.hero-animated .hero-grid { z-index: 2; }
.hero-animated .workflow { background: rgba(28, 25, 23, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
@media (max-width: 760px) {
  .hero-animated::after {
    background:
      linear-gradient(180deg, rgba(12, 10, 9, .6) 0%, rgba(12, 10, 9, .5) 60%, var(--bg) 100%);
  }
}
