/* FORNO NERO */

/* ══ FONTS ══ */

:root {
  --void:     #0a0a0a;
  --carbon:   #111111;
  --graphite: #181818;
  --slate:    #242424;

  --signal:   #e8b86d;
  --signal2:  #c9963a;

  --white:    #f5f2ee;
  --mist:     rgba(245,242,238,0.62);
  --ghost:    rgba(245,242,238,0.22);

  /* compat */
  --ink:      var(--void);
  --bark:     var(--graphite);
  --ember:    #1a0f06;
  --sienna:   #8b4a1e;
  --amber:    var(--signal2);
  --gold:     var(--signal);
  --cream:    var(--white);
  --parchment:#ede0c4;
  --ash:      rgba(245,242,238,0.1);

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");

  --font-display: 'Bebas Neue', sans-serif;
  --font-serif:   'Playfair Display', serif;
  --font-body:    'DM Sans', sans-serif;
  --font-accent:  'Italiana', serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--void);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 300;
  overflow-x: hidden;
  cursor: auto;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  width: 100%;
  max-width: 100vw;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: var(--grain);
  background-size: 300px 300px;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.3;
  mix-blend-mode: overlay;
}

/* NAV */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  padding: 32px 64px;
  display: flex; align-items: center; justify-content: space-between;
  transition: padding .5s, background .5s;
}
nav.scrolled {
  padding: 16px 64px;
  background: rgba(10,10,10,.97);
  backdrop-filter: blur(30px);
  border-bottom: 1px solid rgba(232,184,109,.06);
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: .2em;
  color: var(--white);
  text-decoration: none;
  display: flex; align-items: center; gap: 14px;
}
.nav-brand-dot {
  width: 5px; height: 5px;
  background: var(--signal);
  border-radius: 50%;
  animation: pulse 3s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse { 0%,100%{opacity:.5;transform:scale(1)} 50%{opacity:1;transform:scale(1.4)} }
.nav-links { display: flex; gap: 52px; }
.nav-links a {
  font-family: var(--font-body);
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ghost);
  text-decoration: none;
  position: relative;
  transition: color .3s;
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: -4px; left: 0; right: 0;
  height: 1px; background: var(--signal);
  transform: scaleX(0); transform-origin: left;
  transition: transform .4s cubic-bezier(.16,1,.3,1);
}
.nav-links a:hover,
.nav-links a.active { color: var(--white); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.hamburger {
  display: none; flex-direction: column; gap: 6px;
  cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 24px; height: 1px;
  background: var(--white);
  transition: all .4s cubic-bezier(.16,1,.3,1);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity:0; transform:scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mob-menu {
  position: fixed; inset: 0; z-index: 450;
  background: rgba(10,10,10,.99);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  opacity: 0; visibility: hidden;
  transition: opacity .5s, visibility .5s;
}
.mob-menu.open { opacity:1; visibility:visible; }
.mob-menu a {
  font-family: var(--font-display);
  font-size: clamp(3rem, 12vw, 5.5rem);
  letter-spacing: .1em;
  color: var(--white); text-decoration: none;
  opacity: 0; transform: translateY(30px);
  transition: color .3s;
}
.mob-menu.open a { opacity:1; transform:none; }
.mob-menu.open a:nth-child(2) { transition: opacity .5s .1s, transform .5s .1s, color .3s; }
.mob-menu.open a:nth-child(3) { transition: opacity .5s .2s, transform .5s .2s, color .3s; }
.mob-menu.open a:nth-child(4) { transition: opacity .5s .3s, transform .5s .3s, color .3s; }
.mob-menu.open a:nth-child(5) { transition: opacity .5s .4s, transform .5s .4s, color .3s; }
.mob-menu a:hover { color: var(--signal); }
.mob-line { width: 40px; height: 1px; background: rgba(232,184,109,.2); }

/* MARQUEE */
.marquee-strip {
  overflow: hidden;
  padding: 0;
  background: var(--signal);
  display: flex;
  align-items: center;
  height: 48px;
}
.marquee-strip {
  overflow: hidden;
  padding: 0;
  background: var(--signal);
  display: flex;
  align-items: center;
  /* ✅ FIX: min-height invece di height fisso, così il testo non viene mai tagliato */
  min-height: 48px;
  height: auto;
  /* ✅ FIX: padding verticale di sicurezza */
  padding-top: 10px;
  padding-bottom: 10px;
}
 
.marquee-track {
  display: flex;
  align-items: center;
  /* ✅ FIX: width max-content è corretto, ma aggiungiamo flex-shrink:0
     per evitare che il browser comprima il track quando calcola il layout */
  width: max-content;
  flex-shrink: 0;
  animation: marqueeScroll 30s linear infinite;
  will-change: transform;
}
 
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
 
.marquee-item {
  font-family: var(--font-display);
  font-size: .9rem;
  letter-spacing: .22em;
  color: var(--void);
  padding: 0 56px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  /* ✅ FIX: line-height esplicita per evitare variazioni tra browser */
  line-height: 1.2;
}
 
.marquee-item::after {
  content: '/';
  font-size: .75rem;
  opacity: .35;
  margin-left: 56px;
}
 
/* Pause on hover */
.marquee-strip:hover .marquee-track {
  animation-play-state: paused;
}
 
/* Mobile */
@media (max-width: 768px) {
  .marquee-item {
    font-size: .8rem;
    padding: 0 32px;
  }
  .marquee-item::after {
    margin-left: 32px;
  }
}
/* PARALLAX SECTIONS */
.parallax-section {
  position: relative; min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
  overflow: hidden;
}
.parallax-section.parallax-reverse { direction: rtl; }
.parallax-section.parallax-reverse .parallax-text-col { direction: ltr; }
.parallax-img-col { position: relative; overflow: hidden; }
.parallax-img {
  position: absolute; inset: -15% 0;
  background-size: cover; background-position: center;
  will-change: transform;
}
.parallax-text-col {
  display: flex; align-items: center;
  padding: 120px 80px;
  background: var(--graphite); position: relative;
}
.parallax-text-col::before {
  display: none;
}
.parallax-text { max-width: 480px; }

/* TEXT ELEMENTS */
.section-label {
  font-family: var(--font-body);
  font-size: .62rem; letter-spacing: .42em; text-transform: uppercase;
  color: var(--signal); margin-bottom: 22px;
  display: flex; align-items: center; gap: 14px;
  font-weight: 500;
}
.section-label::before {
  content: ''; width: 22px; height: 1px;
  background: var(--signal); opacity: .55;
}
.section-h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 3.8rem);
  font-weight: 700; line-height: 1.1;
  color: var(--white); margin-bottom: 28px;
}
.section-h2 em {
  font-style: italic;
  font-family: var(--font-accent);
  color: var(--signal);
  font-weight: 400;
}
.section-body {
  font-size: .95rem; line-height: 1.95;
  color: var(--mist); font-weight: 300;
}

/* DIVIDER */
.ornament-divider {
  display: flex; align-items: center;
  padding: 0 10vw; gap: 24px; height: 80px;
  background: var(--void);
}
.ornament-divider::before, .ornament-divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, rgba(232,184,109,.12), transparent);
}
.ornament-glyph { font-size: 1rem; color: var(--signal); opacity: .3; }

/* BUTTONS */
.btn-primary {
  font-family: var(--font-display);
  font-size: 1rem; letter-spacing: .18em;
  color: var(--void); background: var(--signal);
  text-decoration: none; padding: 15px 36px;
  display: inline-block; cursor: none;
  transition: background .25s, letter-spacing .25s;
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
}
.btn-primary:hover {
  background: var(--white);
  letter-spacing: .24em;
}

.btn-secondary {
  font-family: var(--font-display);
  font-size: .95rem; letter-spacing: .18em;
  color: var(--white); background: transparent;
  border: 1px solid rgba(245,242,238,.2);
  text-decoration: none; padding: 15px 36px;
  display: inline-block; cursor: none;
  transition: border-color .3s, color .3s;
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
}
.btn-secondary:hover { border-color: var(--signal); color: var(--signal); }

/* REVEAL */
.reveal {
  opacity: 0; transform: translateY(36px);
  transition: opacity .85s cubic-bezier(.16,1,.3,1), transform .85s cubic-bezier(.16,1,.3,1);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .18s; }
.reveal.d3 { transition-delay: .3s; }
.reveal.d4 { transition-delay: .44s; }
@keyframes fadeUp { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:none; } }

/* ── ADVANCED ANIMATIONS ── */

/* Magnetic hover effect for buttons */
.btn-primary, .btn-secondary {
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width .6s cubic-bezier(.16,1,.3,1), height .6s cubic-bezier(.16,1,.3,1);
}
.btn-primary:hover::before { width: 300px; height: 300px; }

/* Shimmer animation for stat numbers */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Stagger entrance for nav links */
@keyframes navLinkIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.nav-links a {
  animation: navLinkIn .5s cubic-bezier(.16,1,.3,1) both;
}
.nav-links a:nth-child(1) { animation-delay: .05s; }
.nav-links a:nth-child(2) { animation-delay: .1s; }
.nav-links a:nth-child(3) { animation-delay: .15s; }
.nav-links a:nth-child(4) { animation-delay: .2s; }

/* Glow pulse for brand dot */
.nav-brand-dot {
  box-shadow: 0 0 0 0 rgba(232,184,109,.4);
  animation: brandPulse 3s ease-in-out infinite;
}
@keyframes brandPulse {
  0%, 100% { opacity:.5; transform:scale(1); box-shadow: 0 0 0 0 rgba(232,184,109,.4); }
  50% { opacity:1; transform:scale(1.4); box-shadow: 0 0 0 6px rgba(232,184,109,0); }
}

/* Floating animation for ornament glyph */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.ornament-glyph {
  animation: float 3s ease-in-out infinite;
  display: inline-block;
}

/* Marquee hover pause */
.marquee-strip:hover .marquee-track {
  animation-play-state: paused;
}

/* Underline swipe animation */
.nav-links a {
  overflow: hidden;
}

/* Card hover glow */
.preview-card::after,
.spec-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 100%, rgba(232,184,109,.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .5s cubic-bezier(.16,1,.3,1);
  pointer-events: none;
}
.preview-card:hover::after,
.spec-card:hover::after { opacity: 1; }

/* Cursor glow (desktop) */
#cur {
  display: none;
}
#cur.visible { opacity: 1; }
#cur.hovered { width: 40px; height: 40px; opacity: .5; }

/* Line border reveal */
@keyframes lineDraw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Texture shimmer on hover for sections */
.parallax-text-col {
  transition: background .6s;
}

/* Number counter animation */
@keyframes countUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}
.stat-item.visible .stat-number {
  animation: countUp .7s cubic-bezier(.16,1,.3,1) both;
}
.stat-item.visible.d1 .stat-number { animation-delay: .05s; }
.stat-item.visible.d2 .stat-number { animation-delay: .15s; }
.stat-item.visible.d3 .stat-number { animation-delay: .25s; }
.stat-item.visible.d4 .stat-number { animation-delay: .35s; }

/* FOOTER */
footer {
  background: var(--carbon);
  border-top: 1px solid rgba(232,184,109,.05);
  padding: 100px 10vw 50px;
  overflow: hidden;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 80px; margin-bottom: 80px;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: .22em; color: var(--white); margin-bottom: 20px;
  white-space: nowrap;
}
.footer-brand span { color: var(--signal); }
.footer-sub { font-size: .88rem; color: var(--mist); line-height: 1.9; max-width: 290px; }
.footer-col h4 {
  font-family: var(--font-body); font-size: .62rem;
  letter-spacing: .38em; text-transform: uppercase;
  color: var(--signal); margin-bottom: 24px; font-weight: 500;
}
.footer-col a {
  display: block; font-size: .88rem;
  color: var(--mist); text-decoration: none;
  margin-bottom: 12px; transition: color .3s;
}
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(232,184,109,.06); padding-top: 32px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: .62rem; letter-spacing: .12em; color: var(--ghost);
  font-family: var(--font-body);
  flex-wrap: wrap; gap: 8px;
}
.footer-ornament { color: var(--signal); opacity: .2; font-size: 1rem; }

/* TABLET */
@media (max-width: 1024px) {
  nav, nav.scrolled { padding: 20px 32px; }
  .nav-links { gap: 28px; }
  .parallax-section { grid-template-columns: 1fr; min-height: auto; }
  .parallax-section.parallax-reverse { direction: ltr; }
  .parallax-img-col { height: 55vw; min-height: 280px; }
  .parallax-img { position: absolute; inset: 0; height: 100%; transform: none !important; }
  .parallax-text-col { padding: 72px 8vw; }
  .parallax-text { max-width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 48px; }
  footer { padding: 80px 8vw 44px; }
}
@media (max-width: 768px) {
  body { cursor: auto; }
  #cur { display: none; }
  nav, nav.scrolled { padding: 18px 20px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .parallax-img-col { height: 60vw; min-height: 220px; }
  .parallax-text-col { padding: 56px 6vw; }
  .section-h2 { font-size: clamp(1.8rem, 7vw, 2.8rem); }
  .footer-grid { grid-template-columns: 1fr; gap: 36px; }
  .footer-brand { font-size: 1.8rem; }
  .footer-bottom { flex-direction: column; gap: 10px; align-items: flex-start; }
  .footer-ornament { display: none; }
  footer { padding: 60px 6vw 32px; }
  .marquee-item { font-size: .8rem; padding: 0 32px; }
  .btn-primary, .btn-secondary { padding: 14px 28px; font-size: .9rem; }
}
