:root {
  --bg: #07070f;
  --bg-2: #0d0d1c;
  --ink: #eef0ff;
  --muted: #9aa0c0;
  --accent: #7c6cff;
  --accent-2: #29d0ff;
  --hot: #ff5a7e;
  --yt: #ff3b3b;
  --card: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.09);
  --radius: 18px;
  --maxw: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 800px at 70% -10%, #1a1336 0%, var(--bg) 55%) fixed;
  color: var(--ink);
  overflow-x: hidden;
  line-height: 1.6;
}

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

body > *:not(#starfield) { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }

/* ---------- Nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(18px, 5vw, 48px);
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(7,7,15,0.7), transparent);
  z-index: 30;
}
.brand {
  font-weight: 800;
  letter-spacing: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}
.brand-logo {
  height: 38px; width: auto; display: block;
  filter: drop-shadow(0 0 12px rgba(124,108,255,0.45));
  transition: filter .25s, transform .2s;
}
.brand:hover .brand-logo { filter: drop-shadow(0 0 18px rgba(41,208,255,0.7)); transform: translateY(-1px); }
.brand-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--accent));
  box-shadow: 0 0 16px var(--accent);
}
.nav-links { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); font-size: 15px; }
.nav-links a { color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px; font-weight: 600;
  cursor: pointer; transition: transform .15s ease, box-shadow .25s ease, background .25s;
  border: 1px solid transparent; font-size: 16px;
}
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #08080f;
  box-shadow: 0 8px 30px rgba(124,108,255,0.45);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(41,208,255,0.5); }
.btn-secondary {
  background: var(--card); border-color: var(--border); color: var(--ink);
}
.btn-secondary:hover { transform: translateY(-2px); background: rgba(255,255,255,0.08); }
.btn-ghost { padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px; }
.btn-ghost:hover { background: rgba(255,255,255,0.06); }

/* Language switch (sliding flag toggle) */
.lang-switch {
  position: relative; display: inline-flex; align-items: center;
  width: 80px; height: 34px; padding: 3px; box-sizing: border-box;
  border-radius: 999px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.06); cursor: pointer;
  transition: background .2s, border-color .2s;
}
.lang-switch:hover { background: rgba(255,255,255,0.12); border-color: var(--accent); }
.lang-switch .ls-flag {
  flex: 1; display: flex; align-items: center; justify-content: center;
  line-height: 1; z-index: 2; position: relative;
  filter: grayscale(0.6); opacity: .5; transition: filter .2s, opacity .2s, transform .2s;
}
.lang-switch .ls-flag .flag {
  width: 23px; height: 15px; display: block; border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25);
}
.lang-switch[data-lang="it"] .ls-flag[data-l="it"],
.lang-switch[data-lang="en"] .ls-flag[data-l="en"] { filter: none; opacity: 1; }
.lang-switch .ls-knob {
  position: absolute; top: 3px; left: 3px;
  width: calc(50% - 3px); height: calc(100% - 6px);
  border-radius: 999px; z-index: 1;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 2px 12px rgba(124,108,255,0.55);
  transition: transform .28s cubic-bezier(.4,1.3,.5,1);
}
.lang-switch[data-lang="en"] .ls-knob { transform: translateX(100%); }

/* ---------- Hero ---------- */
.hero {
  min-height: 92vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 90px 20px 110px;
}
.hero-inner { max-width: 820px; }
.hero-logo {
  width: min(420px, 72vw); height: auto; margin: 0 auto 26px; display: block;
  filter: drop-shadow(0 0 40px rgba(124,108,255,0.55));
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.eyebrow {
  text-transform: uppercase; letter-spacing: 4px; font-size: 13px;
  color: var(--accent-2); margin: 0 0 14px;
}
.hero-title {
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1.02; margin: 0 0 18px; font-weight: 800; letter-spacing: -1px;
}
.grad {
  background: linear-gradient(110deg, var(--accent-2), var(--accent) 50%, var(--hot));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: clamp(16px, 2.2vw, 20px); color: var(--muted); margin: 0 auto 32px; max-width: 620px; }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cta-row.center { margin-top: 20px; }
.hero-note { margin-top: 22px; font-size: 13px; color: var(--muted); }
.scroll-hint {
  position: absolute; bottom: 24px; font-size: 12px; letter-spacing: 2px;
  color: var(--muted); animation: bob 2s ease-in-out infinite;
}
/* Hide the hint when the viewport is too short to fit it without overlap */
@media (max-height: 760px) {
  .scroll-hint { display: none; }
}
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(8px)} }

/* ---------- Sections ---------- */
.section { padding: clamp(70px, 12vw, 140px) clamp(18px, 5vw, 48px); max-width: var(--maxw); margin: 0 auto; }
.section.alt { max-width: none; background: linear-gradient(180deg, transparent, var(--bg-2) 20%, var(--bg-2) 80%, transparent); }
.section.alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section h2 { font-size: clamp(28px, 4.5vw, 48px); margin: 6px 0 16px; letter-spacing: -.5px; }
.muted { color: var(--muted); }
.center { text-align: center; }

.section-grid {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(30px, 6vw, 80px);
  align-items: center;
}
.feature-list { list-style: none; padding: 0; margin: 22px 0; color: var(--muted); }
.feature-list li { padding: 6px 0; }

/* Cosmo visual */
.cosmo-visual { position: relative; aspect-ratio: 1; max-width: 420px; margin: 0 auto; width: 100%; }
.cosmo-visual .core {
  position: absolute; inset: 0; margin: auto; width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--accent) 60%, transparent);
  box-shadow: 0 0 60px 10px rgba(124,108,255,0.6);
}
.orbit {
  position: absolute; inset: 0; margin: auto; border: 1px solid var(--border); border-radius: 50%;
  animation: spin linear infinite;
}
.orbit .planet {
  position: absolute; top: -7px; left: 50%; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--accent-2));
  box-shadow: 0 0 14px var(--accent-2);
}
.o1 { width: 45%; height: 45%; animation-duration: 9s; }
.o2 { width: 70%; height: 70%; animation-duration: 16s; }
.o2 .planet { background: radial-gradient(circle at 30% 30%, #fff, var(--hot)); box-shadow: 0 0 14px var(--hot); }
.o3 { width: 100%; height: 100%; animation-duration: 26s; }
@keyframes spin { to { transform: rotate(360deg); } }

.section-head { text-align: center; max-width: 680px; margin: 0 auto 50px; }

/* Course grid */
.course-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px; margin-bottom: 40px;
}
.course-card {
  display: block; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; transition: transform .2s, border-color .2s, box-shadow .2s;
  position: relative; overflow: hidden;
}
.course-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 14px 40px rgba(124,108,255,0.25); }
.course-card .cc-icon { font-size: 30px; }
.course-card h3 { margin: 12px 0 4px; font-size: 19px; }
.course-card p { margin: 0; color: var(--muted); font-size: 14px; }
.course-card .cc-meta { margin-top: 14px; font-size: 12px; letter-spacing: 1px; color: var(--accent-2); text-transform: uppercase; }

/* Rich catalog cards */
.corsi-count {
  display: inline-block; margin-top: 14px; font-size: 13px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 16px;
}
.course-card.rich { display: flex; flex-direction: column; }
.course-card.rich:hover { border-color: var(--cc); box-shadow: 0 16px 44px -12px var(--cc); }
.course-card .cc-top { display: flex; gap: 8px; margin-bottom: 14px; }
.cc-badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid; }
.cc-level { color: var(--cc); border-color: color-mix(in srgb, var(--cc) 45%, transparent); background: color-mix(in srgb, var(--cc) 14%, transparent); }
.cc-new { color: #fff; border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.12); }
.course-card .cc-icon {
  width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center;
  justify-content: center; font-size: 26px; margin-bottom: 4px; transition: transform .2s;
}
.course-card.rich:hover .cc-icon { transform: scale(1.08); }
.course-card .cc-foot { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; }
.course-card .cc-foot .cc-meta { margin-top: 0; }
.course-card .cc-go { font-size: 13px; font-weight: 600; color: var(--cc); opacity: 0; transform: translateX(-4px); transition: all .2s; }
.course-card.rich:hover .cc-go { opacity: 1; transform: none; }

/* Bio */
.bio { max-width: 760px; margin: 0 auto; text-align: center; }
.bio-lead {
  font-size: clamp(18px, 2.6vw, 26px); line-height: 1.5; color: var(--ink);
  font-weight: 400; margin: 8px auto 6px; max-width: 680px;
}
.bio-lead strong { font-weight: 700; color: #fff; }

/* Social icons */
.social-title {
  text-transform: uppercase; letter-spacing: 3px; font-size: 12px;
  color: var(--muted); margin: 38px 0 18px;
}
.social-row { display: flex; gap: clamp(24px, 6vw, 52px); justify-content: center; align-items: center; flex-wrap: wrap; margin-bottom: 40px; }
/* Big, full brand-colour listening logos */
.social-row .social-btn {
  width: auto; height: auto; border: none; background: none; border-radius: 0;
  color: var(--bc);
}
.social-row .social-btn svg {
  width: clamp(84px, 12vw, 104px); height: clamp(84px, 12vw, 104px);
  fill: var(--bc);
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.45));
  transition: transform .2s, filter .25s;
}
.social-row .social-btn:hover { transform: translateY(-6px); background: none; box-shadow: none; }
.social-row .social-btn:hover svg { transform: scale(1.08); filter: drop-shadow(0 12px 28px var(--bc)); }
.social-btn {
  width: 54px; height: 54px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: #fff; transition: transform .18s, background .25s, border-color .25s, box-shadow .25s;
  --bc: var(--accent);
}
.social-btn svg { width: 24px; height: 24px; fill: currentColor; transition: fill .2s; }
.social-btn:hover {
  transform: translateY(-4px);
  border-color: var(--bc);
  background: rgba(255,255,255,0.09);
  box-shadow: 0 10px 28px -6px var(--bc);
}
.social-btn:hover svg { fill: var(--bc); }
.s-spotify   { --bc: #1DB954; }
.s-apple     { --bc: #FB5C74; }
.s-amazon    { --bc: #25D1DA; }
.s-ytmusic   { --bc: #FF0000; }
.s-youtube   { --bc: #FF0000; }
.s-instagram { --bc: #E1306C; }

.footer-social { display: flex; gap: 12px; justify-content: center; margin-bottom: 22px; }
.footer-social .social-btn { width: 46px; height: 46px; }
.footer-social .social-btn svg { width: 20px; height: 20px; }

/* Footer */
.footer { text-align: center; padding: 50px 20px; border-top: 1px solid var(--border); color: var(--muted); }
.footer a { color: var(--accent); }
.footer a.yt { color: var(--yt); }
.footer .tiny { font-size: 12px; margin-top: 8px; opacity: .7; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Email gate overlay ---------- */
.gate-overlay {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(4,4,10,0.78); backdrop-filter: blur(8px);
}
.gate-overlay.show { display: flex; }
.gate-card {
  width: 100%; max-width: 420px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 22px; padding: 34px 30px; text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6); animation: gate-in .3s ease;
}
@keyframes gate-in { from { opacity:0; transform: translateY(20px) scale(.97);} to {opacity:1; transform:none;} }
.gate-card h3 { margin: 0 0 8px; font-size: 24px; }
.gate-card p { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
.gate-card input {
  width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.04); color: var(--ink); font-size: 16px; margin-bottom: 14px;
}
.gate-card input:focus { outline: none; border-color: var(--accent); }
.gate-card .btn-primary { width: 100%; justify-content: center; }
.gate-msg { font-size: 13px; margin-top: 12px; min-height: 18px; }
.gate-msg.err { color: var(--hot); }
.gate-msg.ok { color: var(--accent-2); }
.gate-fine { font-size: 11px; color: var(--muted); margin-top: 16px; opacity: .7; }
.gate-close { position: absolute; }

@media (max-width: 760px) {
  .section-grid { grid-template-columns: 1fr; }
  .nav-links a:not(.btn-ghost) { display: none; }
}
