/* Stalloni dello Zodiaco: token dal design system (stalloni-design-system.md) */
:root {
  color-scheme: dark;

  --color-bg: #080910;
  --color-surface: #151124;
  --color-surface-2: #1d1733;
  --color-line: #2e2550;
  --color-purple: #8026CE;
  --color-cyan: #00D5E8;
  --color-pink: #FF239D;
  --color-lime: #C1F600;
  --color-yellow: #FFD323;
  --color-orange: #FF7518;
  --color-text: #F5F3FF;
  --color-text-muted: #B9B3CE;
  --color-on-accent: #080910;
  --color-error: #FF6FBE;

  --font-display: "Bangers", Impact, "Arial Black", sans-serif;
  --font-heading: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --gradient-brand: linear-gradient(135deg, #8026CE 0%, #FF239D 50%, #00D5E8 100%);
  --shadow-cyan: 0 0 20px rgba(0, 213, 232, 0.35);
  --shadow-pink: 0 0 20px rgba(255, 35, 157, 0.35);
  --shadow-lime: 0 0 20px rgba(193, 246, 0, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --container-max: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --section-space: clamp(3.5rem, 8vw, 7rem);
}

/* BASE */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-cyan); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h2, h3 { font-family: var(--font-heading); font-weight: 700; }
p { margin: 0; }

:focus-visible { outline: 3px solid var(--color-cyan); outline-offset: 3px; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.container.narrow { max-width: 560px; }

.section { padding-block: var(--section-space); }
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: .025em;
  color: var(--color-yellow);
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* BOTTONI */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: .8rem 1.4rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  font: 700 1rem/1.2 var(--font-heading);
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button[disabled] { opacity: .6; cursor: wait; transform: none; }
.button svg { width: 22px; height: 22px; flex: none; }

.button-primary { background: var(--color-lime); border-color: var(--color-lime); color: var(--color-on-accent); }
.button-primary:hover { box-shadow: var(--shadow-lime); }

.button-secondary { background: var(--color-surface); border-color: var(--color-cyan); color: var(--color-text); }
.button-secondary:hover { box-shadow: var(--shadow-cyan); }

.button-small { min-height: 44px; padding: .5rem 1rem; font-size: .95rem; }
.button-large { min-height: 56px; padding: 1rem 1.8rem; font-size: 1.1rem; }
.button-block { width: 100%; }

/* Bottone senza link ancora configurato */
.button.soon { opacity: .5; cursor: default; pointer-events: none; }

.linkbtn {
  background: none;
  border: 0;
  min-height: 44px;
  padding: 8px;
  font: 500 .95rem var(--font-body);
  color: var(--color-text-muted);
  text-decoration: underline;
  cursor: pointer;
}

/* HEADER */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: rgba(8, 9, 16, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-line);
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 21;
  background: var(--color-bg);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--color-text); text-decoration: none; font: 700 1rem var(--font-heading); min-width: 0; }
.brand img { width: 40px; height: 40px; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-nav { display: flex; align-items: center; gap: 6px; flex: none; }
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--color-text);
  font: 600 .95rem var(--font-heading);
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.nav-link:hover { color: var(--color-cyan); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: inherit; }
.hero-copy .hero-actions { justify-content: center; }

/* HERO */
.hero {
  position: relative;
  padding-block: 28px 56px;
  background:
    linear-gradient(180deg, rgba(8, 9, 16, .55) 0%, rgba(8, 9, 16, .35) 40%, var(--color-bg) 100%),
    url("assets/backgrounds/hero-cosmic-mobile.webp") center top / cover no-repeat,
    var(--color-bg);
}
.hero-inner { display: grid; gap: 20px; justify-items: center; text-align: center; }
.hero-logo {
  width: min(70vw, 300px);
  border-radius: var(--radius-xl);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55), var(--shadow-pink);
  animation: pop .7s cubic-bezier(.2, 1.6, .4, 1) both;
}
@keyframes pop { from { transform: scale(.6) rotate(-6deg); opacity: 0; } }
.hero-copy { display: grid; gap: 18px; justify-items: center; max-width: 34rem; }

.headline {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: .95;
  letter-spacing: .025em;
  text-transform: uppercase;
}
.headline .line { display: block; font-size: clamp(2rem, 8vw, 3rem); color: var(--color-text); }
.headline .big { font-size: clamp(2.9rem, 13vw, 5.5rem); white-space: nowrap; }
.headline .big .ch {
  display: inline-block;
  color: var(--c);
  -webkit-text-stroke: 2px var(--color-bg);
  paint-order: stroke fill;
  text-shadow: 3px 4px 0 var(--color-bg);
  animation: bounce .6s cubic-bezier(.3, 1.8, .5, 1) both;
  animation-delay: calc(var(--i) * 50ms + 150ms);
}
@keyframes bounce { from { transform: translateY(-50px) scale(.4); opacity: 0; } }

.hero-sub { font-size: 1.05rem; color: var(--color-text); max-width: 32rem; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.hero-sub strong { color: var(--color-lime); }

/* PANNELLO ISCRIZIONE */
.join-section { padding-top: 8px; }
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45), 0 0 0 1px rgba(128, 38, 206, .25);
}
.panel h2 { font-size: 1.6rem; }
.lead { color: var(--color-text-muted); }
.join, form, .success { display: grid; gap: 14px; }
.panel-mascot { width: 104px; height: 104px; justify-self: center; border-radius: 50%; box-shadow: var(--shadow-pink); }
#profile h2, .success h2, .success .lead { text-align: center; }

.trust {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  font-size: .875rem;
  color: var(--color-text-muted);
}
.trust li::before { content: "✓ "; color: var(--color-lime); font-weight: 700; }

.or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--color-text-muted);
  font: 600 .8rem var(--font-heading);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--color-line); }
#signup h3 { font-size: 1.15rem; }

/* CAMPI FORM */
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.label { font: 600 .95rem var(--font-heading); color: var(--color-text); padding: 0; }
.label em { font-weight: 500; font-style: normal; color: var(--color-text-muted); }
input[type=text], input[type=tel], input[type=email] {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font: 400 1rem var(--font-body); /* 16px evita lo zoom automatico su iOS */
  color: var(--color-text);
  background: var(--color-bg);
  border: 2px solid var(--color-line);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
input::placeholder { color: #7f78a0; }
input:focus { border-color: var(--color-cyan); box-shadow: var(--shadow-cyan); }
input.invalid { border-color: var(--color-error); }

.check { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: .9rem; color: var(--color-text-muted); }
.check input { width: 24px; height: 24px; margin: 0; accent-color: var(--color-lime); }
.check.invalid span { color: var(--color-error); }

.error {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-error);
  background: rgba(255, 35, 157, .1);
  color: var(--color-text);
  font-size: .9rem;
}
.error::before { content: "⚠ "; color: var(--color-error); }

/* CLASSI D&D */
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 10px;
  border: 2px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font: 600 .85rem/1.2 var(--font-heading);
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip .ico { font-size: 22px; flex: none; }
.chip:has(input:checked) { border-color: var(--c, var(--color-lime)); box-shadow: 0 0 14px color-mix(in srgb, var(--c, var(--color-lime)) 45%, transparent); }
.chip:has(input:focus-visible) { outline: 3px solid var(--color-cyan); outline-offset: 2px; }
.verdict { min-height: 1.5em; font-size: .95rem; color: var(--color-lime); }

/* COSA FACCIAMO */
.activities {
  background:
    linear-gradient(180deg, var(--color-bg) 0%, rgba(8, 9, 16, .86) 18%, rgba(8, 9, 16, .86) 82%, var(--color-bg) 100%),
    url("assets/backgrounds/zodiac-pattern.webp") center / 900px auto repeat,
    var(--color-bg);
}
.cards { display: grid; gap: 20px; margin-top: 28px; }
.card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
  padding: 16px 18px 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 30%, transparent); }
.card-art {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin-bottom: 6px;
}
.card-art img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}
.card h3 { font-size: 1.3rem; color: var(--accent); }
.card p { min-width: 0; color: var(--color-text-muted); overflow-wrap: anywhere; }
.card-pink { --accent: var(--color-pink); }
.card-cyan { --accent: var(--color-cyan); }
.card-yellow { --accent: var(--color-yellow); }

/* CHI SIAMO */
.about-inner { display: grid; gap: 24px; align-items: center; }
.about-mascot { width: min(64vw, 280px); justify-self: center; border-radius: 50%; box-shadow: var(--shadow-pink); }
.about-copy { display: grid; gap: 16px; justify-items: start; }
.about-copy p { color: var(--color-text-muted); max-width: 62ch; }
.values { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.values li { padding-left: 28px; position: relative; color: var(--color-text-muted); }
.values li::before { content: "★"; position: absolute; left: 0; top: 0; color: var(--color-yellow); }
.values strong { color: var(--color-text); }

/* FOOTER */
.site-footer {
  border-top: 1px solid var(--color-line);
  padding-block: 28px max(28px, env(safe-area-inset-bottom, 0px));
  color: var(--color-text-muted);
  font-size: .875rem;
}
.footer-inner { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; text-align: center; }

/* INTRO: logo che entra girando, timbro che sbatte, schermo che trema */
.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 45%, #241245 0%, var(--color-bg) 70%);
  cursor: pointer;
  animation: intro-out .45s ease-in 2.3s forwards;
}
.intro.skip { animation: intro-out .25s ease-in forwards; }
.intro-logo { grid-area: 1 / 1; width: min(70vw, 320px); border-radius: var(--radius-xl); animation: intro-logo .9s cubic-bezier(.2, 1.4, .4, 1) both; }
.stamp {
  grid-area: 1 / 1;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 6.5vw, 3.8rem);
  letter-spacing: .03em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--color-lime);
  padding: 4px 18px;
  border: 5px solid var(--color-lime);
  border-radius: var(--radius-md);
  background: rgba(8, 9, 16, .7);
  box-shadow: var(--shadow-lime);
  transform: rotate(-10deg);
  animation: stamp .35s cubic-bezier(.5, 0, .7, 1.4) .95s both;
}
@keyframes intro-logo { from { transform: scale(0) rotate(-540deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes stamp { from { transform: rotate(-10deg) scale(4); opacity: 0; } to { transform: rotate(-10deg) scale(1); opacity: 1; } }
@keyframes intro-out { to { opacity: 0; visibility: hidden; } }
.intro.shake { animation: shake .45s cubic-bezier(.36, .07, .19, .97), intro-out .45s ease-in 2.3s forwards; }
@keyframes shake {
  10%, 90% { transform: translate(-2px, 1px); }
  20%, 80% { transform: translate(5px, -3px); }
  30%, 50%, 70% { transform: translate(-8px, 4px) rotate(-1deg); }
  40%, 60% { transform: translate(8px, -4px) rotate(1deg); }
}
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }

/* DESKTOP */
@media (min-width: 768px) {
  .section-title { font-size: 3rem; }
  .panel { padding: 32px; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .about-inner { grid-template-columns: 2fr 3fr; gap: 48px; }
  .about-mascot { width: 100%; max-width: 360px; }
}
@media (min-width: 900px) {
  .hero {
    padding-block: 56px 88px;
    background:
      linear-gradient(180deg, rgba(8, 9, 16, .45) 0%, rgba(8, 9, 16, .3) 50%, var(--color-bg) 100%),
      url("assets/backgrounds/hero-cosmic.webp") center / cover no-repeat,
      var(--color-bg);
  }
  .hero-inner {
    grid-template-columns: minmax(260px, 360px) minmax(0, 34rem);
    justify-content: center;
    justify-items: stretch;
    gap: clamp(24px, 4vw, 48px);
    text-align: left;
    align-items: center;
  }
  .hero-logo { width: min(100%, 360px); justify-self: center; }
  .hero-copy .hero-actions { justify-content: flex-start; }
  .hero-copy { width: 100%; justify-items: start; padding: 28px 32px; border-radius: var(--radius-xl); background: rgba(8, 9, 16, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
  }
}

/* Schermi molto stretti: solo il simbolo nell'header, così "Chi siamo" ed "Entra" restano interi */
@media (max-width: 400px) {
  .brand span { display: none; }
}
