/* ============================================================
   giuss.app — identità "universo schematizzato"
   Sfondo aurora + campo di particelle, schemi orbitali astratti
   come elementi grafici ricorrenti, tipografia sans decisa.
   Sito a tema scuro unico, non pensato per un tema chiaro.
   ============================================================ */

:root { color-scheme: dark; }
:root {
  --bg:        #0B0A10;
  --bg-panel:  #15131C;
  --bg-card:   #17151F;
  --hairline:  rgba(245,243,248,0.10);
  --hairline-strong: rgba(245,243,248,0.16);
  --text:      #F5F3F8;
  --text-dim:  #A79FBD;
  --text-mute: #6F6884;
  --accent:    #8B6CF2;
  --accent-soft: rgba(139,108,242,0.14);
  --rose:      #D68FA0;
  --ok:        #7ED9A6;
  --err:       #E38B8B;
  --font-display: -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font-sans: -apple-system, 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
.container { max-width: 980px; margin: 0 auto; padding: 0 32px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- sfondo ambientale: aurora, particelle, grana ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(90px); mix-blend-mode: screen; }
.aurora .a1 { width: 620px; height: 620px; background: radial-gradient(circle, rgba(139,108,242,0.5), transparent 70%); top: -220px; left: -120px; }
.aurora .a2 { width: 560px; height: 560px; background: radial-gradient(circle, rgba(214,143,160,0.32), transparent 70%); bottom: -240px; right: -140px; }
.aurora .a3 { width: 480px; height: 480px; background: radial-gradient(circle, rgba(90,70,180,0.35), transparent 70%); top: 30%; right: 10%; }

#particle-field { position: fixed; inset: 0; z-index: 0; display: block; }

.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 140px 140px;
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 20%, transparent 0%, rgba(11,10,16,0.4) 60%, var(--bg) 100%);
}
.glow-cursor {
  position: fixed; top: 0; left: 0; width: 500px; height: 500px; z-index: 1; pointer-events: none;
  background: radial-gradient(circle, rgba(139,108,242,0.10), transparent 70%);
  transform: translate(-50%, -50%); mix-blend-mode: screen; transition: opacity 300ms ease;
}

/* ---------- header ---------- */
header.site-header {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 28px 32px; max-width: 980px; margin: 0 auto;
}
.wordmark { font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
header.site-header nav { display: flex; align-items: center; gap: 26px; font-size: 14.5px; color: var(--text-dim); }
header.site-header nav a { position: relative; }
header.site-header nav a::after { content: ''; position: absolute; left: 0; right: 100%; bottom: -4px; height: 1px; background: var(--accent); transition: right 220ms ease; }
header.site-header nav a:hover { color: var(--text); }
header.site-header nav a:hover::after { right: 0; }
header.site-header nav .sep { color: var(--hairline-strong); }

main { position: relative; z-index: 2; }

/* ---------- intro di pagina (titolo/sottotitolo, riusati ovunque) ---------- */
.eyebrow {
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-mute); margin-bottom: 26px;
}
h1 {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -0.035em; line-height: 1.06;
  font-size: clamp(34px, 5.6vw, 58px); margin: 0 0 26px; text-wrap: balance; max-width: 760px;
}
h1 .accent { position: relative; color: var(--accent); display: inline-block; }
h1 .accent::after {
  content: ''; position: absolute; left: 0; bottom: 2px; height: 3px; width: 0;
  background: var(--accent); opacity: 0.55; border-radius: 2px;
  transition: width 900ms cubic-bezier(.2,.7,.2,1); transition-delay: 850ms;
}
h1.in .accent::after { width: 100%; }
p.sub { font-size: clamp(15.5px, 1.7vw, 17.5px); line-height: 1.8; color: var(--text-dim); max-width: 640px; margin: 0 0 30px; }

/* la comparsa in sequenza (fade-up) dell'hero è pura CSS (autoplay), non
   dipende dal JS: così il testo (elemento LCP) dipinge subito senza
   aspettare che lo script venga scaricato/eseguito. Il fade resta breve
   apposta — un'animazione lunga peggiora comunque il tempo di LCP anche
   se parte subito. */
@keyframes heroFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.hero .eyebrow, .hero h1, .hero p.sub, .hero .hero-actions {
  animation: heroFadeUp 420ms ease both;
}
.hero h1 { animation-delay: 40ms; }
.hero p.sub { animation-delay: 100ms; }
.hero .hero-actions { animation-delay: 160ms; }
@media (prefers-reduced-motion: reduce) {
  .hero .eyebrow, .hero h1, .hero p.sub, .hero .hero-actions { animation: none; }
}

/* ---------- hero (solo home) ---------- */
.hero { position: relative; min-height: calc(100vh - 96px); display: flex; flex-direction: column; justify-content: center; padding: 20px 0 60px; overflow: hidden; }
.hero-text { position: relative; z-index: 3; }
.hero-core {
  position: absolute; top: 50%; right: -70px; transform: translateY(-50%);
  width: 560px; height: 560px; z-index: 1; opacity: 0.85; pointer-events: none;
}
@media (max-width: 980px) {
  .hero-core { right: 50%; top: 62%; transform: translate(50%, -50%); width: 360px; height: 360px; opacity: 0.35; z-index: 0; }
}
.hero p.sub { text-align: justify; hyphens: auto; }

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.btn {
  display: inline-block; font-family: var(--font-sans); font-weight: 600; font-size: 15px; padding: 14px 30px; border-radius: 999px;
  cursor: pointer; transition: box-shadow 220ms ease, border-color 220ms ease, color 220ms ease;
}
.btn-primary { background: var(--text); color: var(--bg); border: none; position: relative; overflow: hidden; }
.btn-primary:hover { box-shadow: 0 14px 32px -10px rgba(245,243,248,0.35); }
.btn-primary::before {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(11,10,16,0.25), transparent);
  transform: skewX(-20deg); transition: left 550ms ease;
}
.btn-primary:hover::before { left: 130%; }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--hairline-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- rivelazione allo scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 900ms ease, transform 900ms ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.stagger-item { opacity: 0; transform: translateY(22px); transition: opacity 700ms ease, transform 700ms ease; }
.stagger-item.in-view { opacity: 1; transform: translateY(0); }

section { padding: 100px 0; }
.section-head { max-width: 560px; margin-bottom: 56px; }
.eyebrow-sm { font-size: 12.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 14px; }
h2 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.025em; font-size: clamp(26px, 3.2vw, 34px); margin: 0; text-wrap: balance; }

/* ---------- il metodo (3 passi) ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
@media (max-width: 780px) { .steps { grid-template-columns: 1fr; gap: 30px; } }
.step-num {
  width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-sans); font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.step h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.015em; font-size: 19px; margin: 0 0 10px; }
.step p { font-size: 14.5px; line-height: 1.65; color: var(--text-dim); margin: 0; }
.method-note {
  margin: 48px 0 0; padding-top: 28px; border-top: 1px solid var(--hairline);
  font-size: 14.5px; line-height: 1.7; color: var(--text-mute); max-width: 620px;
}

/* ---------- schema a cerchi (pausa visiva) ---------- */
.circle-scheme-section { padding: 40px 0 60px; }
.circle-scheme { width: 240px; height: 240px; margin: 0 auto; }
.circle-scheme canvas { width: 100%; height: 100%; display: block; }

/* ---------- costellazione (divisore tra sezioni) ---------- */
.stars-section { padding: 10px 0 30px; }
.stars-wrap { width: 100%; height: 130px; }
.stars-wrap canvas { width: 100%; height: 100%; display: block; }

/* ---------- progetti ---------- */
.projects { display: flex; flex-direction: column; gap: 1px; background: var(--hairline); border-radius: 18px; overflow: hidden; }
.project {
  display: grid; grid-template-columns: 140px 1fr auto; gap: 28px; align-items: center;
  background: var(--bg-card); padding: 34px 36px; transition: background 220ms ease;
}
@media (max-width: 720px) { .project { grid-template-columns: 1fr; text-align: left; } }
.project:hover { background: #1B1826; }
.project-icon {
  width: 84px; height: 84px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: transform 320ms ease;
}
.project:hover .project-icon { transform: scale(1.08) rotate(-4deg); }
.project-icon svg { width: 34px; height: 34px; }
.project-icon.i-green { background: linear-gradient(155deg, rgba(107,197,116,0.28), rgba(107,197,116,0.06)); color: #8FDB9B; }
.project-icon.i-blue  { background: linear-gradient(155deg, rgba(122,157,214,0.28), rgba(122,157,214,0.06)); color: #9DBBEB; }
.project-icon.i-rose  { background: linear-gradient(155deg, rgba(214,143,160,0.28), rgba(214,143,160,0.06)); color: #E3A9B8; }
.project-body h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; font-size: 22px; margin: 0 0 10px; }
.project-body p { font-size: 15px; line-height: 1.65; color: var(--text-dim); margin: 0; max-width: 480px; }
.pill {
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-mute); border: 1px solid var(--hairline-strong); border-radius: 999px; padding: 7px 16px; white-space: nowrap;
}
@media (max-width: 720px) { .pill { margin-top: 4px; } }
.pill-live { color: var(--ok); border-color: rgba(126,217,166,0.4); }
a.project:hover .pill-live { border-color: rgba(126,217,166,0.7); }

/* ---------- cta finale + sistema orbitale ---------- */
.cta-final { position: relative; overflow: hidden; text-align: center; padding: 130px 0 150px; }
.cta-orbit {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 700px; height: 700px; z-index: 0; opacity: 0.55; pointer-events: none;
}
.cta-final .container { position: relative; z-index: 1; }
.cta-final h2 { margin: 0 auto 14px; max-width: 640px; text-align: center; }
.cta-final p { color: var(--text-dim); font-size: 17px; margin: 0 auto 38px; max-width: 480px; }

/* ---------- footer ---------- */
footer.site-footer {
  position: relative; z-index: 2; padding: 30px 32px; border-top: 1px solid var(--hairline);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 13.5px; color: var(--text-mute); max-width: 980px; margin: 0 auto;
}

/* ---------- form contatti ---------- */
.form { display: flex; flex-direction: column; gap: 20px; max-width: 560px; margin-top: 8px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-family: var(--font-sans); font-size: 11.5px; color: var(--text-mute); letter-spacing: 0.05em; text-transform: uppercase; }
.field input, .field textarea {
  background: var(--bg-card); border: 1px solid var(--hairline-strong); border-radius: 8px;
  padding: 12px 14px; color: var(--text); font-family: var(--font-sans); font-size: 15px;
  transition: border-color 120ms ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 130px; }
.field-hint { font-family: var(--font-sans); font-size: 11.5px; color: var(--text-mute); margin-top: -2px; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin-top: 4px; }
.form-msg {
  display: none; font-family: var(--font-sans); font-size: 13px; line-height: 1.6;
  padding: 12px 14px; border-radius: 8px; max-width: 560px;
}
.form-msg.ok { display: block; color: var(--ok); border: 1px solid rgba(126,217,166,0.3); background: rgba(126,217,166,0.08); }
.form-msg.err { display: block; color: var(--err); border: 1px solid rgba(227,139,139,0.3); background: rgba(227,139,139,0.08); }

.pin-step { max-width: 560px; margin-top: 8px; }
.pin-input {
  font-family: var(--font-display); font-size: 26px; letter-spacing: 0.5em;
  text-align: center; padding: 14px 12px 14px 20px !important;
}
.link-btn {
  align-self: flex-start; background: none; border: none; padding: 0;
  font-family: var(--font-sans); font-size: 12.5px; color: var(--text-mute);
  text-decoration: underline; cursor: pointer;
}
.link-btn:hover { color: var(--text); }

.success-panel {
  max-width: 560px; margin-top: 8px;
  opacity: 0; transform: translateY(10px); transition: opacity 500ms ease, transform 500ms ease;
}
.success-panel.show { opacity: 1; transform: translateY(0); }
.success-panel h2 { margin-bottom: 12px; }
.success-panel p.sub { margin-bottom: 28px; }
