/* === RESET === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === DESIGN TOKENS === */
:root {
  --bg:          #0a0a0a;
  --text:        #ffffff;
  --muted:       #888888;
  --accent:      #7C3AED;
  --accent-hi:   #9D5CF0;
  --card-bg:     #111111;
  --border:      #1e1e1e;
  --green:       #22c55e;
  --locked:      #444444;
  --r-card:      18px;
  --r-btn:       10px;
  --r-badge:     100px;
  --f-display:   'Barlow Condensed', sans-serif;
  --f-body:      'DM Sans', sans-serif;
  --max-w:       1200px;
  --nav-h:       60px;
  --px:          1.25rem;
}

@media (min-width: 600px) { :root { --px: 2rem; } }
@media (min-width: 900px) { :root { --px: 3rem; } }

/* === BASE === */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* === SCROLLBAR === */
::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }

/* === NAVBAR === */
#navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease;
}

#navbar.scrolled {
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo reale come immagine */
.nav-logo {
  height: 32px;
  width: auto;
  display: block;
  flex-shrink: 0;
  filter: brightness(1.6);
  opacity: 0.9;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}
.nav-link:hover       { color: var(--text); }
.nav-link:focus-visible {
  color: var(--text);
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

/* =========================================
   HERO — mobile: ~1/3 schermata
   ========================================= */
.hero {
  position: relative;
  min-height: 30svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 0.75rem) var(--px) 1.25rem;
  overflow: hidden;
}

/* Glow ambientale viola */
.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 45% at 50% 52%, rgba(124,58,237,0.16) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Watermark logo — come nelle slide Instagram */
.hero-watermark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 52vh;
  width: auto;
  opacity: 0.045;
  filter: brightness(3);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

/* Piccola label sopra il titolo — stile watermark Instagram */
.hero-eyebrow {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  opacity: 0.7;
}

.hero-headline {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(3rem, 11vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

/* Mobile: font più contenuto così le righe hanno spazio */
@media (max-width: 899px) {
  .hero-headline { font-size: 2.2rem; }
}

.muted { color: var(--muted); }

.mobile-only { display: none; }
@media (max-width: 899px) { .mobile-only { display: inline; } }

.hero-sub {
  font-weight: 300;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--muted);
  max-width: 400px;
  margin: 0 auto;
}

/* =========================================
   PRODUCTS — mobile: scroll naturale
   ========================================= */
.products {
  padding: 1.5rem var(--px) 5rem;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.products-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0.6;
}

/* === CARD GRID === */
.card-grid {
  display: grid;
  gap: 0.875rem;
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid .card:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 50%;
    width: 100%;
    margin: 0 auto;
  }
}

/* === CARD === */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  /* animazione entrata */
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  will-change: transform, opacity;
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card:nth-child(1) { transition-delay: 0s; }
.card:nth-child(2) { transition-delay: 0.08s; }
.card:nth-child(3) { transition-delay: 0.16s; }

.card:not(.card-locked):hover {
  border-color: var(--accent);
  box-shadow: 0 0 32px rgba(124, 58, 237, 0.13);
}

/* === CARD HEADER (badge + numero editoriale) === */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-num {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: #444444;
}

/* === CARD LOCKED === */
.card-locked {
  opacity: 0.38 !important;
  pointer-events: none;
  cursor: default;
}
.card-locked.visible { opacity: 0.38 !important; }

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 0.28rem 0.7rem;
  border-radius: var(--r-badge);
}

.badge-active {
  color: var(--green);
  background: rgba(34, 197, 94, 0.09);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-soon {
  color: var(--locked);
  background: rgba(68, 68, 68, 0.1);
  border: 1px solid rgba(68, 68, 68, 0.22);
}

/* === CARD CONTENT === */
.card-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(1.9rem, 3.5vw, 2.4rem);
  line-height: 1.0;
  color: var(--text);
}

.card-desc {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
  flex-grow: 1;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--f-body);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--r-btn);
  padding: 0.65rem 1.35rem;
  min-height: 44px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  width: fit-content;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

.btn-disabled {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--locked);
  padding: 0.65rem 0;
}

/* === FOOTER === */
footer {
  border-top: 1px solid #161616;
  padding: 3rem var(--px);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.footer-logo {
  height: 48px;
  width: auto;
  display: block;
  filter: brightness(1.4);
  opacity: 0.35;
  margin-bottom: 0.5rem;
}

.footer-handle {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}

.footer-link {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-link:hover,
.footer-link:focus-visible { color: var(--text); }
.footer-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

/* =========================================
   SCROLL HINT — solo mobile
   ========================================= */
.scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  z-index: 50;
  background: var(--accent);
  border: 1px solid var(--accent-hi);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  color: #fff;
  cursor: pointer;
  animation: hint-bounce 2s ease-in-out infinite;
  transition: opacity 0.4s ease;
}

.scroll-hint:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.scroll-hint.hidden {
  opacity: 0;
  pointer-events: none;
}

@keyframes hint-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(7px); }
}

@media (min-width: 900px) {
  .scroll-hint { display: none; }
}

/* =========================================
   DESKTOP ≥ 900px:
   Hero + 3 card tutte nella prima schermata
   ========================================= */
@media (min-width: 900px) {

  /* main occupa l'intera altezza viewport meno la navbar */
  main {
    height: calc(100svh - var(--nav-h));
    margin-top: var(--nav-h);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Hero: compatto in cima */
  .hero {
    flex-shrink: 0;
    min-height: auto;
    padding: 2.5rem var(--px) 1.75rem;
  }

  .hero-headline {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    margin-bottom: 0.875rem;
  }

  .hero-eyebrow { margin-bottom: 0.875rem; }

  /* Products: riempie lo spazio restante */
  .products {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 var(--px) 1.75rem;
    max-width: var(--max-w);
    margin: 0 auto;
    width: 100%;
  }

  .products-label {
    flex-shrink: 0;
    margin-bottom: 0.875rem;
  }

  /* Card grid: 3 colonne, altezza = spazio restante */
  .card-grid {
    flex: 1;
    min-height: 0;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr;
  }

  /* Annulla override tablet della terza card */
  .card-grid .card:nth-child(3) {
    grid-column: auto;
    max-width: none;
    margin: 0;
  }

  /* Card si stira per riempire la riga della griglia */
  .card { align-self: stretch; }

  /* nav-link: touch target adeguato */
  .nav-link { padding: 0.75rem 0; }
}
