/* Campania Senza Glutine — pagina introduttiva (giallo #ffde59 + bordeaux) */
@font-face {
  font-family: "Lazydog";
  src: url("../fonts/Lazydog.otf") format("opentype"),
       url("../fonts/Lazydog.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --yellow: #ffde59;
  --yellow-deep: #f7cf3f;
  --yellow-light: #fff1ad;
  --bordeaux: #420000;
  --red: #c0341d;
  --terracotta: #d04a2a;
  --ink: #141414;
  --font-display: "Lazydog", "Cormorant Garamond", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem 6rem;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--yellow);
}

/* ---------- Splash screen iniziale ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--yellow);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash.is-hidden {
  opacity: 0;
  visibility: hidden;
}

body.splash-active {
  overflow: hidden;
}

.splash-inner {
  text-align: center;
}

.splash-logo {
  display: block;
  width: clamp(170px, 48vw, 240px);
  height: auto;
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 14px 34px rgba(66, 0, 0, 0.25));
  animation: splash-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes splash-rise {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: none; }
}

.splash-wheat {
  display: block;
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: splash-fade 0.7s ease 0.2s forwards;
}

.splash-mark {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  margin: 0 auto 1.25rem;
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 1.8rem;
  color: var(--yellow);
  background: var(--bordeaux);
  border-radius: 26px;
  box-shadow: 0 18px 40px rgba(66, 0, 0, 0.35);
  animation: splash-pop 0.9s cubic-bezier(0.2, 1, 0.3, 1) both,
    splash-glow 2.2s ease-in-out 0.9s infinite;
}

.splash-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--bordeaux);
  opacity: 0;
  animation: splash-fade 0.7s ease 0.5s forwards;
}

.splash-title em {
  font-style: italic;
  color: var(--red);
}

.splash-bar {
  width: 180px;
  height: 4px;
  margin: 1.5rem auto 0;
  background: rgba(66, 0, 0, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.splash-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--red), var(--bordeaux));
  animation: splash-load 1s ease 0.25s forwards;
}

@keyframes splash-pop {
  from { opacity: 0; transform: scale(0.5) rotate(-12deg); }
  to { opacity: 1; transform: none; }
}

@keyframes splash-glow {
  0%, 100% { box-shadow: 0 18px 40px rgba(66, 0, 0, 0.35); }
  50% { box-shadow: 0 18px 60px rgba(66, 0, 0, 0.55); }
}

@keyframes splash-fade {
  to { opacity: 1; }
}

@keyframes splash-load {
  to { width: 100%; }
}

/* ---------- Sfondo fotografico Campania (Costiera Amalfitana) ---------- */
.photo-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(180deg, rgba(255, 222, 89, 0.88) 0%, rgba(255, 222, 89, 0.8) 55%, rgba(255, 222, 89, 0.9) 100%),
    url("https://images.unsplash.com/photo-1720360572655-35bf522fcf17?fm=jpg&q=72&w=2400&auto=format&fit=crop");
  background-size: cover;
  background-position: center 60%;
  animation: slow-zoom 28s ease-in-out infinite alternate;
}

@keyframes slow-zoom {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* ---------- Scena decorativa ---------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Anelli concentrici bordeaux */
.ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(66, 0, 0, 0.12);
}

.ring-1 {
  width: 70vmax;
  height: 70vmax;
  top: -22vmax;
  right: -18vmax;
  border-width: 3px;
  animation: spin 60s linear infinite;
}

.ring-2 {
  width: 46vmax;
  height: 46vmax;
  bottom: -16vmax;
  left: -12vmax;
  border-style: dashed;
  animation: spin 80s linear infinite reverse;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Macchie morbide rosse/bordeaux */
.blob {
  position: absolute;
  width: 42vmax;
  height: 42vmax;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.16;
  animation: drift 24s ease-in-out infinite;
}

.blob-1 {
  background: radial-gradient(circle, var(--red) 0%, transparent 68%);
  top: -14%;
  left: -10%;
}

.blob-2 {
  background: radial-gradient(circle, var(--bordeaux) 0%, transparent 68%);
  bottom: -18%;
  right: -12%;
  animation-delay: -9s;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(5vw, 4vh) scale(1.1); }
  66% { transform: translate(-4vw, -3vh) scale(0.94); }
}

/* Glyph giganti in filigrana */
.big-glyph {
  position: absolute;
  font-size: 30vmin;
  line-height: 1;
  opacity: 0.06;
  filter: grayscale(1);
}

.bg-wheat {
  top: -4vmin;
  left: -2vmin;
  transform: rotate(-18deg);
}

.bg-pizza {
  bottom: -6vmin;
  right: -2vmin;
  transform: rotate(12deg);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Emoji fluttuanti ---------- */
.floaties {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.floaty {
  position: absolute;
  font-size: clamp(1.5rem, 3vw, 2.75rem);
  opacity: 0.85;
  animation: float 9s ease-in-out infinite;
  filter: drop-shadow(0 10px 16px rgba(66, 0, 0, 0.22));
}

.f1 { top: 16%; left: 11%; animation-delay: 0s; }
.f2 { top: 72%; left: 16%; animation-delay: -2s; }
.f3 { top: 22%; right: 13%; animation-delay: -4s; }
.f4 { top: 64%; right: 9%; animation-delay: -1s; }
.f5 { top: 46%; left: 5%; animation-delay: -3s; font-size: 1.6rem; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-22px) rotate(6deg); }
}

/* ---------- Contenuto ---------- */
.intro {
  position: relative;
  z-index: 2;
  max-width: 800px;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.85rem;
  padding: 0.55rem 1.2rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--yellow);
  background: var(--bordeaux);
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(66, 0, 0, 0.28);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6ee7a0;
  box-shadow: 0 0 0 0 rgba(110, 231, 160, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(110, 231, 160, 0.6); }
  70% { box-shadow: 0 0 0 9px rgba(110, 231, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(110, 231, 160, 0); }
}

.headline {
  margin: 0 0 1.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.headline .line {
  display: block;
}

.line-top {
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.line-bottom {
  position: relative;
  display: inline-block;
  margin-top: 0.1em;
}

.grad {
  display: inline-block;
  margin-top: 0.12em;
  padding: 0.02em 0.4em 0.12em;
  color: var(--yellow);
  background: var(--bordeaux);
  border-radius: 0.18em;
  transform: rotate(-2.5deg);
  box-shadow: 0 14px 32px rgba(66, 0, 0, 0.3);
}

.underline {
  display: none;
}

.reveal.is-in .underline {
  animation: draw 1s ease 0.5s forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.subtitle {
  max-width: 34rem;
  margin: 0 auto 2.6rem;
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  line-height: 1.6;
  color: #141414;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 2rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.btn-glow {
  position: relative;
  color: var(--yellow);
  background: var(--bordeaux);
  box-shadow: 0 12px 30px rgba(66, 0, 0, 0.35);
}

.btn-glow:hover {
  transform: translateY(-3px) scale(1.03);
  background: var(--red);
  box-shadow: 0 18px 44px rgba(66, 0, 0, 0.45);
}

.btn-glow svg {
  transition: transform 0.25s ease;
}

.btn-glow:hover svg {
  transform: translateX(4px);
}

.btn-outline {
  color: var(--bordeaux);
  border-color: var(--bordeaux);
  background: transparent;
}

.btn-outline:hover {
  transform: translateY(-3px);
  background: var(--bordeaux);
  color: var(--yellow);
}

/* ---------- Link Instagram ---------- */
.intro-ig {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 2.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bordeaux);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.intro-ig:hover {
  color: var(--red);
  transform: translateY(-1px);
}

/* ---------- Statistiche ---------- */
.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 1.4rem 0.5rem;
  list-style: none;
  background: var(--bordeaux);
  border-radius: 22px;
  box-shadow: 0 20px 44px rgba(66, 0, 0, 0.3);
}

.stats li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 2.2rem;
  position: relative;
}

.stats li + li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 1px;
  background: rgba(255, 222, 89, 0.25);
}

.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 2.9rem);
  font-weight: 700;
  line-height: 1;
  color: var(--yellow);
}

.stat-label {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 222, 89, 0.75);
}

/* ---------- Marquee (nastro bordeaux) ---------- */
.marquee {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 4;
  overflow: hidden;
  padding: 0.65rem 0;
  background: var(--bordeaux);
}

.marquee-track {
  display: inline-flex;
  gap: 1.4rem;
  white-space: nowrap;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  color: var(--yellow);
  animation: scroll-x 30s linear infinite;
}

.marquee-track span {
  flex-shrink: 0;
}

@keyframes scroll-x {
  to { transform: translateX(-50%); }
}

/* ---------- Skip ---------- */
.enter-skip {
  position: fixed;
  top: 1.5rem;
  right: 1.75rem;
  z-index: 5;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--bordeaux);
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.enter-skip:hover {
  color: var(--yellow);
  background: var(--bordeaux);
}

/* ---------- Logo centrale dell'intro ---------- */
.intro-crest {
  display: block;
  width: clamp(96px, 16vw, 132px);
  height: auto;
  margin: 0 auto 1.4rem;
  filter: drop-shadow(0 10px 24px rgba(66, 0, 0, 0.22));
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), filter 0.8s ease;
}

/* ---------- Velo di transizione ---------- */
.page-veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: radial-gradient(circle at 50% 40%, var(--bordeaux) 0%, #1a0400 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
}

.page-veil.is-active {
  opacity: 1;
  pointer-events: all;
}

/* ============================================================
   MOBILE — pagina unica FISSA (niente scroll): tutto in una schermata.
   Usa 100dvh per evitare i tagli della barra Safari su iPhone.
   ============================================================ */
@media (max-width: 900px) {
  html, body { height: 100%; }
  body {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    justify-content: center;
    overflow: hidden;
    /* spazio in basso riservato al nastro fisso */
    padding: clamp(3rem, 8vh, 4.5rem) 1.4rem clamp(3rem, 7vh, 4rem);
  }
  .intro { max-width: 560px; }
  .intro-crest {
    width: clamp(64px, 12vh, 104px);
    margin-bottom: clamp(0.5rem, 1.4vh, 1rem);
  }
  .headline {
    font-size: clamp(2.2rem, 8.5vh, 4.2rem);
    margin-bottom: clamp(0.6rem, 1.6vh, 1.4rem);
  }
  .subtitle {
    font-size: clamp(0.92rem, 1.9vh, 1.15rem);
    line-height: 1.45;
    margin-bottom: clamp(0.9rem, 2.2vh, 1.8rem);
  }
  .cta-row {
    gap: clamp(0.6rem, 1.4vh, 1rem);
    margin-bottom: clamp(0.7rem, 1.8vh, 1.6rem);
  }
  .btn {
    padding: clamp(0.7rem, 1.6vh, 1rem) 1.7rem;
    font-size: clamp(0.95rem, 1.9vh, 1.05rem);
  }
  .intro-ig {
    font-size: clamp(0.85rem, 1.7vh, 0.95rem);
    margin-bottom: clamp(0.8rem, 1.8vh, 1.6rem);
  }
  .stats { padding: clamp(0.7rem, 1.8vh, 1.3rem) 0.5rem; }
  .stat-num { font-size: clamp(1.4rem, 3.4vh, 2rem); }
  .stat-label { font-size: clamp(0.55rem, 1.3vh, 0.72rem); }
  .marquee { padding: clamp(0.4rem, 1vh, 0.6rem) 0; }
  .marquee-track { font-size: clamp(0.9rem, 2vh, 1.2rem); }
  .floaty { display: none; }
}

/* Telefoni stretti: titolo e statistiche su una riga compatta */
@media (max-width: 600px) {
  .intro { max-width: 100%; }
  .headline { font-size: clamp(2rem, 8vh, 3rem); }
  .grad { padding: 0.02em 0.32em 0.1em; }
  .cta-row { flex-direction: column; align-items: stretch; width: 100%; }
  .btn { width: 100%; justify-content: center; }
  .stats { width: 100%; flex-wrap: nowrap; }
  .stats li { flex: 1; padding: 0 0.4rem; }
  .big-glyph { font-size: 38vmin; }
}

/* Orientamento orizzontale su telefono: layout ancora più compatto */
@media (max-height: 520px) and (max-width: 900px) {
  .intro-crest { display: none; }
  .headline { font-size: clamp(1.8rem, 14vh, 2.6rem); margin-bottom: 0.4rem; }
  .subtitle { margin-bottom: 0.6rem; }
  .intro-ig { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .blob, .floaty, .marquee-track, .badge-dot, .ring, .big-glyph { animation: none; }
  .reveal { opacity: 1; transform: none; filter: none; }
  .underline { stroke-dashoffset: 0; }
  .splash { display: none; }
}
