/* ============================================================
   Il Gelato di Rosita — dal 1960
   Palette ispirata al feed reale: rosa cipria, panna, caffè.
   ============================================================ */

:root {
  --pink: #f3d3d6;
  --pink-soft: #f9e6e8;
  --pink-deep: #e6b3b9;
  --berry: #a94257;
  --berry-dark: #7f2c3c;
  --cream: #fbf5ee;
  --cream-2: #f6ece1;
  --white: #fffdfb;
  --coffee: #3a2a22;
  --coffee-soft: #6b4d3d;
  --coffee-fade: rgba(58, 42, 34, 0.62);
  --line: rgba(58, 42, 34, 0.14);
  --shadow: 0 20px 50px rgba(122, 70, 60, 0.16);
  --radius: 22px;
  --serif: 'Playfair Display', 'Georgia', serif;
  --sans: 'Jost', 'Helvetica Neue', Arial, sans-serif;
}

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--coffee);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.eyebrow {
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--berry);
  font-weight: 500;
  margin: 0 0 14px;
}
.eyebrow-light { color: rgba(255, 255, 255, 0.78); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  margin: 0;
  color: var(--coffee);
}

.section {
  padding: 110px 6vw;
  max-width: 1240px;
  margin: 0 auto;
}

.lead { font-size: 18px; color: var(--coffee-soft); max-width: 560px; }
.lead-light { font-size: 18px; color: rgba(255,255,255,0.85); max-width: 560px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s ease, background 0.3s ease, color 0.3s ease;
}
.btn-berry { background: var(--berry); color: var(--white); box-shadow: 0 14px 30px rgba(169,66,87,0.35); }
.btn-berry:hover { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(169,66,87,0.45); background: var(--berry-dark); }
.btn-white { background: var(--white); color: var(--berry); }
.btn-white:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(0,0,0,0.18); }
.btn-outline { background: transparent; color: var(--coffee); border-color: var(--line); }
.btn-outline:hover { border-color: var(--coffee); transform: translateY(-3px); }
.btn-outline-light { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.5); }
.btn-outline-light:hover { border-color: var(--white); transform: translateY(-3px); }

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  padding: 18px 5vw;
  transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(251, 245, 238, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { padding: 12px 5vw; }
.nav.scrolled::before { opacity: 1; border-bottom-color: var(--line); }

.nav-inner, .brand span, .nav-links a { color: var(--white); }
.brand em { color: var(--pink); }
.nav-burger { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.12); }
.nav-burger span { background: var(--white); }
.nav.scrolled .brand span, .nav.scrolled .nav-links a { color: var(--coffee); }
.nav.scrolled .brand em { color: var(--berry); }
.nav.scrolled .nav-burger { border-color: var(--line); background: var(--white); }
.nav.scrolled .nav-burger span { background: var(--coffee); }
.nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 46px; height: 46px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(58,42,34,0.25);
}
.brand span {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.brand em { font-style: italic; color: var(--berry); font-weight: 500; }

.nav-links {
  display: flex;
  gap: 30px;
  font-size: 14.5px;
  font-weight: 500;
}
.nav-links a { position: relative; padding: 4px 0; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  height: 1.5px; width: 0;
  background: var(--berry);
  transition: width 0.35s ease;
}
.nav-links a:hover::after, .nav-links a[aria-current]::after { width: 100%; }
.nav-cta {
  background: var(--berry);
  color: var(--white);
  padding: 11px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(169,66,87,0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(169,66,87,0.4); }

.nav-burger {
  display: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--white);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}
.nav-burger span { width: 18px; height: 1.5px; background: var(--coffee); transition: transform 0.3s ease, opacity 0.3s ease; }
.nav-burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  top: 0; right: 0;
  height: 100dvh;
  width: min(84vw, 360px);
  background: var(--white);
  z-index: 600;
  padding: 100px 34px 40px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1);
  box-shadow: -20px 0 60px rgba(0,0,0,0.18);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu a { font-family: var(--serif); font-size: 24px; font-weight: 700; }
.mobile-overlay {
  position: fixed; inset: 0; background: rgba(58,42,34,0.35);
  z-index: 550; opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.mobile-overlay.open { opacity: 1; pointer-events: auto; }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--white);
}
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.08);
}
.hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(58,42,34,0.35) 0%, rgba(58,42,34,0.1) 38%, rgba(58,42,34,0.75) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 6vw 90px;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}
.hero-logo {
  width: 108px; height: 108px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 26px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.35);
  border: 3px solid rgba(255,255,255,0.85);
}
.hero h1 {
  font-size: clamp(40px, 7vw, 84px);
  color: var(--white);
  line-height: 1.02;
  max-width: 900px;
  font-style: italic;
}
.hero h1 span { color: var(--pink); font-style: normal; }
.hero-sub {
  font-size: 18px;
  max-width: 520px;
  margin: 22px 0 34px;
  color: rgba(255,255,255,0.88);
  font-weight: 300;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-scroll {
  position: absolute;
  bottom: 34px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.75);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.hero-scroll-line {
  width: 1px; height: 40px;
  background: rgba(255,255,255,0.5);
  overflow: hidden;
  position: relative;
}
.hero-scroll-line::after {
  content: "";
  position: absolute;
  top: -100%; left: 0; right: 0; height: 100%;
  background: var(--white);
  animation: scrollDrip 1.8s ease-in-out infinite;
}
@keyframes scrollDrip { 0% { top: -100%; } 60% { top: 100%; } 100% { top: 100%; } }

/* ---------- STORIA ---------- */
.storia {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6vw;
  align-items: center;
}
.storia-media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/5;
  box-shadow: var(--shadow);
}
.storia-media img { width: 100%; height: 100%; object-fit: cover; }
.storia-badge {
  position: absolute;
  bottom: -26px; left: -26px;
  background: var(--berry);
  color: var(--white);
  width: 128px; height: 128px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--serif);
  box-shadow: 0 16px 34px rgba(169,66,87,0.4);
}
.storia-badge strong { font-size: 34px; line-height: 1; }
.storia-badge span { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; margin-top: 4px; font-family: var(--sans); }
.storia-text h2 { font-size: clamp(30px, 4vw, 46px); font-style: italic; margin-bottom: 22px; line-height: 1.15; }
.storia-text p { color: var(--coffee-soft); font-size: 16.5px; margin-bottom: 16px; max-width: 500px; }
.storia-quote {
  margin-top: 28px;
  padding-left: 22px;
  border-left: 2px solid var(--pink-deep);
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--coffee);
}

/* ---------- SPECIALITA — masonry gallery ---------- */
.speciality-head { text-align: center; max-width: 640px; margin: 0 auto 60px; }
.speciality-head .eyebrow { justify-self: center; }
.speciality-head h2 { font-size: clamp(30px, 4vw, 48px); font-style: italic; }
.speciality-head p { color: var(--coffee-soft); margin-top: 16px; }

.gallery {
  columns: 3 260px;
  column-gap: 22px;
}
.gallery-item {
  break-inside: avoid;
  margin-bottom: 22px;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(58,42,34,0.12);
}
.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.7s cubic-bezier(.2,.8,.2,1);
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 20px 16px;
  background: linear-gradient(180deg, transparent, rgba(30,20,16,0.82));
  color: var(--white);
  transform: translateY(6px);
  opacity: 0.94;
}
.gallery-caption strong { font-family: var(--serif); font-style: italic; font-size: 17px; display: block; }
.gallery-caption span { font-size: 12px; letter-spacing: 1px; color: rgba(255,255,255,0.75); }

.speciality-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 54px;
}
.tag {
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 13.5px;
  letter-spacing: 0.3px;
  color: var(--coffee-soft);
}

/* ---------- DOVE SIAMO ---------- */
.dove { background: var(--coffee); color: var(--white); border-radius: 40px; margin: 0 4vw; max-width: none; padding: 100px 6vw; }
.dove-head { max-width: 620px; margin-bottom: 56px; }
.dove-head h2 { color: var(--white); font-size: clamp(30px, 4vw, 48px); font-style: italic; }
.dove-head p { color: rgba(255,255,255,0.75); margin-top: 16px; }

.locations {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.location-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  padding: 28px 24px;
  transition: transform 0.35s ease, background 0.35s ease;
}
.location-card:hover { transform: translateY(-6px); background: rgba(255,255,255,0.1); }
.location-card .loc-num { font-family: var(--serif); font-style: italic; color: var(--pink); font-size: 15px; }
.location-card h3 { color: var(--white); font-size: 22px; margin: 10px 0 8px; }
.location-card p { color: rgba(255,255,255,0.72); font-size: 14.5px; margin: 0 0 18px; min-height: 40px; }
.location-card a { font-size: 13px; letter-spacing: 0.5px; color: var(--pink); border-bottom: 1px solid rgba(243,211,214,0.4); padding-bottom: 2px; }
.location-card a:hover { border-bottom-color: var(--pink); }

/* ---------- CONTATTI ---------- */
.contatti { text-align: center; }
.contatti-card {
  background: linear-gradient(135deg, var(--berry), var(--berry-dark));
  border-radius: 32px;
  padding: 90px 6vw;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.contatti-card::before {
  content: "";
  position: absolute;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(255,255,255,0.14), transparent 70%);
  top: -180px; right: -140px;
}
.contatti-card h2 { color: var(--white); font-size: clamp(30px, 4.5vw, 50px); font-style: italic; max-width: 720px; margin: 0 auto; }
.contatti-card .lead-light { margin: 20px auto 34px; }
.contatti-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; position: relative; z-index: 1; }

/* ---------- FOOTER ---------- */
.footer {
  padding: 46px 6vw 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--coffee-soft);
  border-top: 1px solid var(--line);
  max-width: 1240px;
  margin: 0 auto;
}
.footer-badge {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 500;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.footer-badge:hover { border-color: var(--berry); transform: translateY(-2px); }
.footer-badge strong { color: var(--berry); }

/* ---------- reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.9s cubic-bezier(.2,.8,.2,1), transform 0.9s cubic-bezier(.2,.8,.2,1); }
.reveal.in-view { opacity: 1; transform: none; }

/* ---------- hero entrance (CSS-only, never depends on JS/IntersectionObserver) ---------- */
.hero-fade { opacity: 0; transform: translateY(24px); animation: heroFadeIn 1s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: var(--fd, 0.1s); }
@keyframes heroFadeIn { to { opacity: 1; transform: none; } }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-burger { display: flex; }
  .storia { grid-template-columns: 1fr; gap: 60px; }
  .storia-media { max-width: 420px; margin: 0 auto; }
  .locations { grid-template-columns: repeat(2, 1fr); }
  .dove { border-radius: 26px; margin: 0 4vw; }
}

@media (max-width: 640px) {
  .section { padding: 80px 6vw; }
  .hero-content { padding-bottom: 64px; }
  .hero h1 { font-size: clamp(34px, 10vw, 52px); }
  .gallery { columns: 2 160px; column-gap: 14px; }
  .gallery-item { margin-bottom: 14px; }
  .locations { grid-template-columns: 1fr; }
  .storia-badge { width: 100px; height: 100px; left: 0; bottom: -20px; }
  .storia-badge strong { font-size: 26px; }
  .footer { flex-direction: column; text-align: center; }
  .contatti-card { padding: 60px 6vw; border-radius: 24px; }
}
