:root {
  --black: #05060a;
  --panel: #12151d;
  --panel-2: #191d28;
  --blue-1: #4fb3ff;
  --blue-2: #1c6fd9;
  --blue-3: #8ad4ff;
  --blue-glow: rgba(79, 179, 255, 0.35);
  --white: #f5f7fa;
  --grey: #8b94a3;
  --line: rgba(255,255,255,0.09);
  --success: #2ecc71;

  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Inter', sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  overflow-x: hidden;
  position: relative;
}

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

/* ---------- Ambient background: moving light orbs ---------- */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -2;
  opacity: 0.55;
  pointer-events: none;
}
.orb-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, var(--blue-1), transparent 70%);
  top: -180px; left: -140px;
  animation: floatA 22s ease-in-out infinite;
}
.orb-2 {
  width: 460px; height: 460px;
  background: radial-gradient(circle, var(--blue-2), transparent 70%);
  bottom: -200px; right: -120px;
  animation: floatB 26s ease-in-out infinite;
}
.orb-3 {
  width: 340px; height: 340px;
  background: radial-gradient(circle, var(--blue-3), transparent 70%);
  top: 40%; left: 60%;
  opacity: 0.28;
  animation: floatC 30s ease-in-out infinite;
}
@keyframes floatA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 80px) scale(1.15); }
}
@keyframes floatB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-70px, -50px) scale(1.1); }
}
@keyframes floatC {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-90px, 40px); }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  animation: reveal 0.9s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; }

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--blue-1);
  font-weight: 700;
}
.center { text-align: center; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(5,6,10,0.65);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand-logo {
  width: 34px; height: 34px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.nav-actions { display: flex; gap: 0.7rem; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-body);
  font-weight: 700;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}
.btn-sm { padding: 0.55rem 1.2rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-1), var(--blue-2));
  color: #04070d;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.btn-primary:hover::before { left: 130%; }
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 34px var(--blue-glow);
}
.btn-ghost {
  background: rgba(255,255,255,0.03);
  color: var(--white);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  border-color: var(--blue-1);
  background: rgba(79,179,255,0.08);
  transform: translateY(-2px);
}
.btn:active { transform: translateY(0); }
.btn svg { transition: transform 0.25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100vh - 68px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem 4rem;
  max-width: 780px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(2.8rem, 8vw, 5rem);
  line-height: 1.05;
  margin: 1rem 0 1.2rem;
}
.gradient-text {
  background: linear-gradient(120deg, var(--blue-3), var(--blue-1) 40%, var(--blue-2));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer {
  to { background-position: 200% center; }
}

.tagline {
  font-size: 1.15rem;
  color: var(--grey);
  line-height: 1.65;
  max-width: 520px;
}

.cta-row {
  display: flex;
  gap: 1rem;
  margin-top: 2.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.stats-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-top: 3.6rem;
  padding: 1.6rem 2.2rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(6px);
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--blue-1);
}
.stat-label {
  font-size: 0.72rem;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stat-divider { width: 1px; height: 34px; background: var(--line); }

.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-top: 3.5rem;
  color: var(--grey);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.scroll-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--blue-1);
  position: absolute;
  left: -2px;
  animation: scrollDown 2s ease-in-out infinite;
}
@keyframes scrollDown {
  0% { top: -10%; opacity: 0; }
  30% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ---------- Departments ---------- */
.departments {
  max-width: 1120px;
  margin: 0 auto;
  padding: 6rem 1.5rem 5rem;
}
.section-title { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin: 0.6rem 0 0.8rem; }
.section-sub { color: var(--grey); font-size: 1rem; max-width: 480px; margin: 0 auto 3.5rem; }

.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.3rem;
  perspective: 1000px;
}

.dept-card {
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.8rem;
  position: relative;
  transition: transform 0.25s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  transform-style: preserve-3d;
  will-change: transform;
}
.dept-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(160deg, rgba(79,179,255,0.35), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.dept-card:hover::after { opacity: 1; }
.dept-card:hover {
  box-shadow: 0 20px 45px rgba(0,0,0,0.35), 0 0 0 1px rgba(79,179,255,0.15);
}
.dept-card.is-soon { opacity: 0.65; }

.dept-icon { font-size: 1.8rem; margin-bottom: 0.9rem; }
.dept-name { font-size: 1.4rem; margin: 0.7rem 0 0.5rem; }
.dept-desc { color: var(--grey); font-size: 0.9rem; line-height: 1.55; }

.badge {
  position: absolute;
  top: 1.6rem; right: 1.6rem;
  font-size: 0.65rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}
.badge-active { color: var(--success); border: 1px solid rgba(46,204,113,0.35); background: rgba(46,204,113,0.06); }
.badge-soon { color: var(--grey); border: 1px solid var(--line); }

/* ---------- CTA band ---------- */
.cta-band {
  max-width: 720px;
  margin: 2rem auto 6rem;
  text-align: center;
  padding: 3.2rem 2rem;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(79,179,255,0.08), rgba(18,21,29,0.4));
  border: 1px solid var(--line);
}
.cta-band h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 0.8rem; }
.cta-band p { color: var(--grey); margin-bottom: 1.8rem; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  color: var(--grey);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

/* ---------- Modal (used by later sections) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,6,10,0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.2rem;
  opacity: 0;
  animation: fadeIn 0.25s var(--ease) forwards;
}
@keyframes fadeIn { to { opacity: 1; } }

.modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  transform: translateY(14px) scale(0.98);
  opacity: 0;
  animation: modalIn 0.35s var(--ease) forwards;
}
@keyframes modalIn { to { transform: translateY(0) scale(1); opacity: 1; } }

.input {
  width: 100%;
  background: #0a0c11;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input:focus { border-color: var(--blue-1); box-shadow: 0 0 0 3px rgba(79,179,255,0.12); }

.error-text { color: #e5484d; font-size: 0.85rem; margin: -0.4rem 0 0.8rem; }

@media (max-width: 640px) {
  .stats-row { flex-wrap: wrap; gap: 1.2rem; padding: 1.2rem; }
  .stat-divider { display: none; }
  .brand-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Performance mobile: riduce sfarfallio su scroll ---------- */
@media (max-width: 820px) {
  .navbar {
    backdrop-filter: none;
    background: rgba(5,6,10,0.95);
  }
  .orb { display: none; } /* le sfere sfocate di sfondo pesano molto su mobile */
}