/* ====== NEXTSAPIENS — SHARED STYLES ====== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900&family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Palette */
  --bg-deep:     #050914;
  --bg:          #0a0f1f;
  --bg-2:        #0f1629;
  --bg-3:        #151d36;
  --ink:         #e9edf7;
  --ink-dim:     #9aa3be;
  --ink-soft:    #6b7494;
  --line:        rgba(255,255,255,0.08);
  --line-2:      rgba(255,255,255,0.14);

  --blue:        #4d7dff;
  --blue-bright: #7ba6ff;
  --cyan:        #5eead4;
  --gold:        #e3b341;
  --magenta:     #e879f9;

  --grad-hero: radial-gradient(1200px 600px at 10% 0%, rgba(77,125,255,0.25), transparent 60%),
               radial-gradient(900px 500px at 90% 20%, rgba(94,234,212,0.18), transparent 55%),
               radial-gradient(700px 700px at 50% 100%, rgba(232,121,249,0.10), transparent 60%);

  --radius:      18px;
  --radius-sm:   10px;
  --radius-lg:   28px;

  --f-display: 'Fraunces', serif;
  --f-sans:    'Space Grotesk', sans-serif;
  --f-mono:    'JetBrains Mono', monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; }
body {
  font-family: var(--f-sans);
  background: var(--bg-deep);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

/* Grain overlay */
body::before {
  content:"";
  position: fixed; inset:0;
  pointer-events:none;
  z-index: 1;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.8'/></svg>");
}

a { color: inherit; text-decoration: none; }
img { max-width:100%; display:block; }

/* ---------- NAV ---------- */
.nav {
  position: fixed; top:0; left:0; right:0;
  z-index: 100;
  padding: 20px 40px;
  display:flex; align-items:center; justify-content:space-between;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  background: rgba(5, 9, 20, 0.6);
  border-bottom: 1px solid var(--line);
  transition: all 0.4s var(--ease);
}
.nav.is-scrolled {
  padding: 12px 40px;
  background: rgba(5, 9, 20, 0.85);
}
.nav__brand {
  display:flex; align-items:center; gap:10px;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.nav__brand-logo {
  height: 40px;
  width: auto;
  transition: transform 0.3s var(--ease);
}
.nav.is-scrolled .nav__brand-logo { height: 34px; }
.nav__brand-logo:hover { transform: scale(1.04); }
.nav__brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: conic-gradient(from 180deg, var(--cyan), var(--blue), var(--magenta), var(--cyan));
  box-shadow: 0 0 16px var(--blue);
  animation: spin 8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.nav__brand-tag {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-left: 8px;
  padding: 3px 8px;
  border: 1px solid var(--line-2);
  border-radius: 99px;
}
.nav__links {
  display:flex; gap:4px;
  list-style: none;
}
.nav__links a {
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 14px;
  color: var(--ink-dim);
  transition: all 0.25s var(--ease);
  position: relative;
}
.nav__links a:hover { color: var(--ink); background: var(--line); }
.nav__links a.active {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(77,125,255,0.18), rgba(94,234,212,0.12));
  border: 1px solid rgba(123,166,255,0.3);
}
.nav__cta {
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: var(--bg-deep);
  border: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.nav__cta:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(77,125,255,0.4); }

.nav__burger { display:none; background:none; border:none; color:var(--ink); cursor:pointer; font-size: 24px; }

/* ---------- LAYOUT ---------- */
.wrap  { max-width: 1280px; margin: 0 auto; padding: 0 40px; position: relative; z-index: 2; }
.wrap--narrow { max-width: 980px; }

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

/* ---------- HERO SHARED (per pagine interne) ---------- */
.page-hero {
  padding: 180px 0 80px;
  background: var(--grad-hero), var(--bg-deep);
  position: relative;
}
.page-hero__eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 20px;
  display: inline-flex; align-items: center; gap: 10px;
}
.page-hero__eyebrow::before {
  content: ""; width: 24px; height: 1px; background: var(--cyan);
}
.page-hero__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
  max-width: 14ch;
}
.page-hero__title em {
  font-style: italic;
  font-weight: 300;
  background: linear-gradient(135deg, var(--blue-bright), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-hero__lead {
  font-size: clamp(18px, 1.8vw, 22px);
  color: var(--ink-dim);
  max-width: 60ch;
  line-height: 1.5;
}

/* ---------- COMMON COMPONENTS ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: 99px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-2);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.pill--cyan { color: var(--cyan); border-color: rgba(94,234,212,0.3); background: rgba(94,234,212,0.08); }
.pill--gold { color: var(--gold); border-color: rgba(227,179,65,0.3); background: rgba(227,179,65,0.08); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  border-radius: 99px;
  font-family: var(--f-sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.25s var(--ease);
  text-decoration: none;
}
.btn--primary {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: var(--bg-deep);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(77,125,255,0.4); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn--ghost:hover { background: var(--line); border-color: var(--line-2); }

.section-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.section-title em {
  font-style: italic; font-weight: 300;
  background: linear-gradient(135deg, var(--blue-bright), var(--cyan));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-lead {
  font-size: 18px; color: var(--ink-dim);
  max-width: 65ch; line-height: 1.6;
}
.section-head {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 64px;
  max-width: 900px;
}

/* ---------- FOOTER ---------- */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 80px 0 40px;
  margin-top: 120px;
  position: relative;
  z-index: 2;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 60px;
  padding-bottom: 60px;
  border-bottom: 1px solid var(--line);
}
.footer__brand-name {
  font-family: var(--f-display);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.footer__brand-logo {
  height: 54px;
  width: auto;
  margin-bottom: 20px;
  display: block;
}
.footer__brand-desc {
  color: var(--ink-dim);
  font-size: 14px;
  max-width: 32ch;
  margin-bottom: 20px;
}
.footer__col h4 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
  font-weight: 500;
}
.footer__col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer__col a {
  color: var(--ink-dim);
  font-size: 14px;
  transition: color 0.2s;
}
.footer__col a:hover { color: var(--ink); }
.footer__bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 30px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  flex-wrap: wrap;
  gap: 16px;
}
.footer__legal { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- REVEAL ANIMATIONS ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.40s; }
.reveal[data-delay="6"] { transition-delay: 0.48s; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .nav { padding: 14px 20px; }
  .nav.is-scrolled { padding: 10px 20px; }
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: block; }
  .nav__brand-tag { display: none; }

  .wrap { padding: 0 20px; }
  .page-hero { padding: 140px 0 60px; }

  .footer__grid { grid-template-columns: 1fr; gap: 40px; }
  .footer__bottom { flex-direction: column; text-align: center; }
}

/* ---------- MOBILE MENU ---------- */
.mobile-menu {
  position: fixed; inset: 0;
  background: var(--bg-deep);
  z-index: 99;
  padding: 100px 30px 40px;
  transform: translateY(-100%);
  transition: transform 0.5s var(--ease);
  display: flex; flex-direction: column; gap: 30px;
}
.mobile-menu.is-open { transform: translateY(0); }
.mobile-menu a {
  font-family: var(--f-display);
  font-size: 32px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}
