/* ============================================================================
   base.css — RESET + TOKEN STRUTTURALI + TIPOGRAFIA + LAYOUT + BOTTONI
   ----------------------------------------------------------------------------
   File STRUTTURALE del prodotto: non cambia per cliente. I colori/font arrivano
   da theme.css via var(). Mobile-first: le media query salgono verso il desktop.
   ============================================================================ */

:root {
  /* Spacing — sistema 8pt */
  --space-2xs: 4px;
  --space-xs:  8px;
  --space-sm:  16px;
  --space-md:  24px;
  --space-lg:  48px;
  --space-xl:  80px;
  --space-2xl: 120px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* Layout */
  --container-max: 1200px;
  --container-pad: clamp(1.25rem, 5vw, 3rem);
  --section-pad:   clamp(3.5rem, 8vw, 7.5rem);   /* padding verticale sezioni */

  /* Ombre */
  --shadow-sm: 0 1px 3px var(--color-shadow);
  --shadow-md: 0 8px 24px var(--color-shadow);
  --shadow-lg: 0 20px 50px var(--color-shadow);

  /* Z-index scale */
  --z-base: 1;
  --z-sticky: 20;
  --z-header: 40;
  --z-overlay: 60;
  --z-cookie: 80;

  /* Motion (durate base; GSAP usa le sue) */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 180ms;
  --dur-mid: 280ms;
}

/* ---- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: var(--fs-400);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
img { background: var(--color-bg-alt); }

a { color: var(--color-link); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--color-link-hover); }

ul, ol { list-style: none; padding: 0; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }

/* Accessibilità focus */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 50%; top: -60px; transform: translateX(-50%);
  background: var(--color-secondary); color: #fff;
  padding: var(--space-xs) var(--space-md); border-radius: var(--radius-pill);
  z-index: var(--z-cookie); transition: top var(--dur-mid) var(--ease-out);
}
.skip-link:focus { top: var(--space-sm); color: #fff; }

/* ---- Tipografia ---------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  /* Anton ha un solo peso reale (400): con 700 il browser sintetizza un bold
     "finto" che sbava (effetto glow). Peso 400 + font-synthesis:none = nitido. */
  font-weight: 400;
  font-synthesis: none;
  line-height: var(--lh-tight);
  color: var(--color-heading);
  letter-spacing: 0.005em;     /* niente tracking stretto: Anton respira come nell'hero */
  text-transform: uppercase;   /* regola brand: Anton sempre in UPPERCASE */
}
h2 { font-size: var(--fs-700); }
h3 { font-size: var(--fs-600); line-height: var(--lh-snug); }
p { max-width: 65ch; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-300);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-link-hover);   /* ember scuro → AA su sfondo chiaro */
  margin-bottom: var(--space-sm);
}
.section--dark .eyebrow { color: var(--color-accent); }  /* gold su scuro */
.eyebrow::before {
  content: ""; display: inline-block;
  width: 28px; height: 2px; margin-right: 0.7em; vertical-align: middle;
  background: var(--color-accent);
}

/* ---- Layout helpers ------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section { padding-block: var(--section-pad); }
/* compensa l'header fisso quando si salta a un'ancora interna */
:where(section[id], [id].hero) { scroll-margin-top: 84px; }
.section--alt { background: var(--color-bg-alt); }
.section--dark {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
}
.section--dark h2, .section--dark h3 { color: var(--color-heading-on-dark); }

.section__head { max-width: 60ch; margin-bottom: var(--space-lg); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__intro { color: var(--color-text-muted); margin-top: var(--space-sm); font-size: var(--fs-500); }
.section--dark .section__intro { color: var(--color-text-on-dark); opacity: 0.85; }

/* ---- Bottoni ------------------------------------------------------------- */
.btn {
  --_bg: var(--color-primary);
  --_fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 48px;
  padding: 0.85em 1.6em;
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-400);
  line-height: 1;
  color: var(--_fg);
  background: var(--_bg);
  border: 2px solid var(--_bg);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.btn:hover { color: var(--_fg); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn--ghost {
  --_bg: transparent;
  --_fg: var(--color-heading);
  border-color: var(--color-border);
}
.btn--ghost:hover { --_fg: var(--color-primary); border-color: var(--color-primary); }

.btn--on-dark { --_bg: transparent; --_fg: #fff; border-color: rgba(255,255,255,0.4); }
.btn--on-dark:hover { --_bg: #fff; --_fg: var(--color-secondary); border-color: #fff; }

.btn--accent { --_bg: var(--color-accent); --_fg: var(--color-secondary); }

/* CTA ad alta enfasi: ember pieno, ombra calda, icona che fa un nudge e
   un alone che "batte" per attirare lo sguardo. Il magnetismo lo fa motion.js. */
.btn--cta {
  --_bg: var(--color-primary);
  --_fg: #fff;
  position: relative;
  box-shadow: 0 8px 22px rgba(226, 85, 43, 0.32);
}
.btn--cta:hover {
  --_bg: var(--color-link-hover);
  box-shadow: 0 14px 34px rgba(226, 85, 43, 0.45);
}
.btn--cta .icon { transition: transform var(--dur-mid) var(--ease-spring); }
.btn--cta:hover .icon { transform: translateX(4px); }

/* Alone pulsante (battito d'attenzione) */
.btn--cta::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(226, 85, 43, 0.55);
  animation: cta-pulse 2.6s var(--ease-out) infinite;
  pointer-events: none;
}
.btn--cta:hover::after { animation: none; }
@keyframes cta-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(226, 85, 43, 0.5); }
  70%  { box-shadow: 0 0 0 16px rgba(226, 85, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(226, 85, 43, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .btn--cta::after { animation: none; }
  .btn--cta .icon { transition: none; }
}

.btn .icon { width: 20px; height: 20px; }

/* Icone Lucide */
.icon { width: 24px; height: 24px; stroke-width: 1.75; flex: none; }
