@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&display=swap');

/* =====================
   ANIMAZIONI DI ENTRATA — tutti gli elementi
   ===================== */
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes reveal-scale {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes reveal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Stato iniziale degli elementi osservati */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.75s ease, transform 0.75s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: opacity, transform;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: opacity, transform;
}
.reveal-scale.in-view { opacity: 1; transform: scale(1); }

/* Stagger automatico dentro le griglie */
.cat-grid.in-view .cat-widget,
.masonry-gallery.in-view .masonry-item,
.gallery.in-view .card,
.gallery.in-view .card-link {
  animation: reveal-up 0.7s cubic-bezier(0.23, 1, 0.32, 1) both;
}
.cat-grid.in-view .cat-widget:nth-child(1) { animation-delay: 0.05s; }
.cat-grid.in-view .cat-widget:nth-child(2) { animation-delay: 0.14s; }
.cat-grid.in-view .cat-widget:nth-child(3) { animation-delay: 0.23s; }
.cat-grid.in-view .cat-widget:nth-child(4) { animation-delay: 0.32s; }

/* Elementi fissi (logo, hamburger) — entrata all'apertura pagina */
@keyframes fixed-in-left {
  from { opacity: 0; transform: translateX(-30px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes fixed-in-right {
  from { opacity: 0; transform: translateX(30px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

.logo-card { animation: fixed-in-left 0.7s 0.1s cubic-bezier(0.23, 1, 0.32, 1) both; }
.hamburger { animation: fixed-in-right 0.7s 0.1s cubic-bezier(0.23, 1, 0.32, 1) both; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-scale { opacity: 1; transform: none; }
  .logo-card, .hamburger { animation: none; }
  .cat-grid.in-view .cat-widget, .gallery.in-view .card { animation: none; }
}

/* =====================
   VARIABILI — TEMA CHIARO (default)
   Palette blu ispirata a toneadapt.com
   ===================== */
:root {
  --bg:            #f3f6fd;
  --bg-surface:    #ffffff;
  --bg-card:       #e6edfb;
  --text:          #0b1430;
  --text-muted:    #1e2a52;
  --text-dim:      #5a6890;
  --text-dark:     #0b1430;
  --brand:         #2563eb;
  --brand-deep:    #1d4ed8;
  --brand-dark:    #1e3a8a;
  --brand-bright:  #3b82f6;
  --brand-soft:    #93c5fd;
  --gold:          var(--brand-deep);
  --gold-dim:      var(--brand-dark);
  --gold-bright:   var(--brand-bright);
  --star:          #facc15;
  --star-deep:     #eab308;
  --star-dim:      rgba(250, 204, 21, 0.22);
  --white:         #ffffff;
  --border:        rgba(37, 99, 235, 0.22);
  --border-strong: rgba(37, 99, 235, 0.45);
  --border-subtle: rgba(37, 99, 235, 0.10);
  --overlay-text:  #ffffff;
  --overlay-text-hover: #cfe0ff;
  --brand-on:      #ffffff;
  --radius:        6px;
  --radius-lg:     14px;
  --transition:    0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out-quart: cubic-bezier(0.23, 1, 0.32, 1);
  --shadow:        0 10px 40px rgba(37, 99, 235, 0.18);
  --overlay-bg:    rgba(11, 20, 48, 0.60);
}

/* =====================
   TEMA SCURO — nero + blu
   ===================== */
[data-tema="scuro"] {
  --bg:            #07070a;
  --bg-surface:    #101018;
  --bg-card:       #161621;
  --text:          #f0f3fa;
  --text-muted:    #b8c0dc;
  --text-dim:      #7a83a8;
  --text-dark:     #07070a;
  --brand:         #3b82f6;
  --brand-deep:    #2563eb;
  --brand-dark:    #1e40af;
  --brand-bright:  #60a5fa;
  --brand-soft:    #93c5fd;
  --gold:          var(--brand-bright);
  --gold-dim:      var(--brand);
  --gold-bright:   var(--brand-soft);
  --white:         #f0f3fa;
  --border:        rgba(96, 165, 250, 0.22);
  --border-strong: rgba(96, 165, 250, 0.45);
  --border-subtle: rgba(96, 165, 250, 0.10);
  --overlay-text:  #f0f3fa;
  --overlay-text-hover: #93c5fd;
  --brand-on:      #ffffff;
  --shadow:        0 10px 40px rgba(0, 0, 0, 0.6);
  --overlay-bg:    rgba(0, 0, 0, 0.80);
}

/* =====================
   RESET & BASE
   ===================== */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
}

/* =====================
   SCROLLBAR — stilizzata blu brand
   ===================== */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--brand-deep) var(--bg);
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--brand-deep);
  border-radius: 999px;
  border: 3px solid var(--bg);
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-bright);
}

::-webkit-scrollbar-corner {
  background: var(--bg);
}

/* =====================
   LOGO CARD — fixed top-left, sfondo blu brand
   ===================== */
.logo-card {
  position: fixed;
  top: 20px;
  left: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 18px 22px;
  transition: background 0.4s ease, border-color 0.4s ease,
              transform 0.45s var(--ease-out-quart), box-shadow 0.45s ease;
  box-shadow: var(--shadow);
  transform-origin: top left;
}

.logo-card:hover {
  transform: scale(1.04);
  box-shadow: 0 16px 48px rgba(37, 99, 235, 0.32);
}

[data-tema="scuro"] .logo-card {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
}

.logo-name {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 1rem;
  color: var(--brand-deep);
  white-space: nowrap;
  text-align: center;
  transition: color 0.4s ease;
}

[data-tema="scuro"] .logo-name { color: var(--brand-bright); }

/* Pills tema — impilate verticalmente, hover in scale */
.theme-pills {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

.theme-pill {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.72rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.12em;
  background: transparent;
  color: var(--brand-deep);
  transition: transform 0.35s var(--ease-out-quart),
              background 0.3s ease, color 0.3s ease,
              box-shadow 0.3s ease, opacity 0.3s ease,
              border-color 0.3s ease;
  white-space: nowrap;
  transform-origin: center;
}

.pill-light {
  background: transparent;
  color: var(--brand-deep);
  border-color: var(--border);
}

.pill-dark {
  background: transparent;
  color: var(--brand-deep);
  border-color: var(--border);
}

[data-tema="scuro"] .pill-light,
[data-tema="scuro"] .pill-dark { color: var(--brand-bright); border-color: var(--border-strong); }

.theme-pill:hover {
  transform: scale(1.06);
  opacity: 1;
  background: var(--border-subtle);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.18);
}

.theme-pill.attiva {
  background: var(--brand-deep);
  color: #ffffff;
  border-color: var(--brand-deep);
  opacity: 1;
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.32);
}

[data-tema="scuro"] .theme-pill.attiva {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

/* =====================
   HAMBURGER — fixed top-right, hover in scale
   ===================== */
.hamburger {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.45s var(--ease-out-quart),
              background 0.3s ease, box-shadow 0.4s ease,
              border-color 0.3s ease;
  box-shadow: var(--shadow);
  padding: 0;
  transform-origin: center;
}

[data-tema="scuro"] .hamburger {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
}

.hamburger:hover {
  transform: scale(1.1);
  box-shadow: 0 16px 48px rgba(37, 99, 235, 0.32);
}

.hamburger.open {
  transform: scale(1.06);
}

.hamburger .icon-palette {
  width: 32px; height: 32px;
  color: var(--brand-deep);
  transition: transform 0.4s var(--ease-out-quart), color 0.4s ease;
}

[data-tema="scuro"] .hamburger .icon-palette { color: var(--brand-bright); }

.hamburger:hover .icon-palette {
  transform: scale(1.08);
}

/* =====================
   NAV OVERLAY — scivola da destra
   ===================== */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 148;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.nav-backdrop.open { opacity: 1; pointer-events: all; }

.nav-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 320px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-strong);
  z-index: 149;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 90px 16px 50px;
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.25);
}

[data-tema="scuro"] .nav-overlay { border-left: none; }

.nav-overlay.open { transform: translateX(0); }

/* Nascondiamo la X: la tavolozza stessa chiude il menu */
.overlay-close { display: none; }

.nav-overlay .nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  width: 100%;
}

.nav-overlay .nav-links li {
  width: 100%;
  display: flex;
  justify-content: center;
}

.nav-overlay .nav-links li a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 14px 22px;
  width: 100%;
  max-width: 240px;
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  border-radius: 10px;
  transition: color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.nav-overlay .nav-links li a:hover {
  color: var(--brand-bright);
  background: var(--border-subtle);
}

.nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  display: inline-block;
  vertical-align: middle;
}

.nav-overlay .nav-links li a:hover .nav-icon {
  transform: scale(1.12);
}

/* Animazione staggered all'apertura */
.nav-overlay .nav-links li a {
  opacity: 0;
  transform: translateX(20px);
  transition: color 0.3s ease, background 0.3s ease,
              opacity 0.35s ease, transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-overlay.open .nav-links li a { opacity: 1; transform: translateX(0); }
.nav-overlay.open .nav-links li:nth-child(1) a { transition-delay: 0.06s; }
.nav-overlay.open .nav-links li:nth-child(2) a { transition-delay: 0.10s; }
.nav-overlay.open .nav-links li:nth-child(3) a { transition-delay: 0.14s; }
.nav-overlay.open .nav-links li:nth-child(4) a { transition-delay: 0.18s; }
.nav-overlay.open .nav-links li:nth-child(5) a { transition-delay: 0.22s; }
.nav-overlay.open .nav-links li:nth-child(6) a { transition-delay: 0.26s; }

/* =====================
   HERO
   ===================== */
.hero {
  text-align: center;
  padding: 140px 20px 110px;
  position: relative;
}

.hero h2 {
  font-family: 'Cinzel', serif;
  font-weight: 400;
  font-size: 3.4rem;
  letter-spacing: 0.1em;
  margin-bottom: 22px;
  line-height: 1.2;
  color: var(--text);
}

.hero p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.35rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Stellina decorativa rimossa */

/* =====================
   TITOLI PAGINA
   ===================== */
.page-title {
  text-align: center;
  padding: 120px 20px 56px;
  position: relative;
}

.page-title h2 {
  font-family: 'Cinzel', serif;
  font-weight: 400;
  font-size: 2.6rem;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
  color: var(--text);
}

.page-title p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.2rem;
  color: var(--text-muted);
}

/* =====================
   WIDGET CATEGORIE
   ===================== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 44px;
}

.cat-widget {
  display: block;
  text-decoration: none;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 3/4;
  cursor: pointer;
  transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1),
              border-color 0.45s ease;
  border: 1px solid var(--border-strong);
}

.cat-widget:hover { transform: translateY(-6px); border-color: var(--gold-dim); }

.cat-widget img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 18px;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.cat-widget:hover img { transform: scale(1.04); }

.cat-widget-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 46px 20px 22px;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
  border-radius: 0 0 18px 18px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.cat-widget-label span {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--overlay-text);
  transition: color 0.4s ease, letter-spacing 0.4s ease;
}

.cat-widget:hover .cat-widget-label span {
  color: var(--overlay-text-hover);
  letter-spacing: 0.36em;
}

/* =====================
   GALLERIA
   ===================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  padding: 44px;
  grid-auto-flow: dense;
  align-items: start;
}

.card {
  text-align: center;
  display: flex;
  flex-direction: column;
  background: transparent;
}

.card img {
  width: 100%; height: auto;
  max-height: 600px;
  object-fit: contain;
  display: block;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.45s ease;
}

.card h3 {
  font-family: 'Cinzel', serif;
  font-weight: 400;
  color: var(--text);
  font-size: 0.72rem;
  margin-top: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.card p {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-top: 5px;
}

.card.wide { grid-column: span 2; }
.card:hover { transform: none; }

.card:hover img {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
}

/* =====================
   MASONRY HOME
   ===================== */
.masonry-gallery {
  position: relative;
  padding: 0 44px 80px;
  min-height: 200px;
}

.masonry-gallery .gallery-loading {
  text-align: center;
  padding: 60px;
  color: var(--text-dim);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
}

.masonry-item { will-change: transform, opacity; cursor: pointer; }

.masonry-item img {
  display: block;
  width: 100%; height: auto;
  border-radius: 12px;
  transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}

.masonry-item:hover img { transform: translateY(-5px); }

/* =====================
   OVERLAY CATEGORIE (vecchio stile, mantenuto per retrocompat)
   ===================== */
.card-link {
  position: relative;
  display: block;
  text-decoration: none;
  overflow: hidden;
}

.card-link .card { margin: 0; }
.card-link.wide { grid-column: span 2; }
.card-link .img-wrapper { position: relative; width: 100%; overflow: hidden; }
.card-link .img-wrapper img {
  display: block; width: 100%; height: auto;
  object-fit: fill;
  transition: transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.card-link:hover .img-wrapper img { transform: translateY(-5px); }

.img-wrapper .card-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card-link:hover .card-overlay { opacity: 1; }

.overlay-text {
  font-family: 'Cinzel', serif;
  font-weight: 500;
  color: var(--overlay-text);
  font-size: 2rem;
  text-align: center;
  padding: 20px;
  letter-spacing: 0.15em;
}

/* =====================
   CONTATTI
   ===================== */
.contact {
  padding: 80px 20px;
  text-align: center;
}

.contact h2 {
  font-family: 'Cinzel', serif;
  font-weight: 400;
  font-size: 2.4rem;
  letter-spacing: 0.1em;
  color: var(--text);
}

.contact-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.15rem;
  margin-top: 14px;
  color: var(--text-muted);
}

.contact-box {
  background: var(--bg-card);
  color: var(--text);
  padding: 36px 40px;
  max-width: 420px;
  margin: 40px auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: background 0.4s ease;
}

.contact-form {
  max-width: 600px;
  margin: 0 auto 40px;
}

.contact-form .form-container {
  border: 1px solid var(--border-strong);
  padding: 48px 52px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  transition: background 0.4s ease;
  display: flex;
  flex-direction: column;
}

.contact-form .form-container h3 {
  font-family: 'Cinzel', serif;
  font-weight: 400;
  font-size: 1.4rem;
  letter-spacing: 0.14em;
  margin-bottom: 40px;
  text-align: center;
  color: var(--gold-bright);
}

.contact-form .form-group {
  margin-bottom: 30px;
}

.contact-form .form-group label {
  display: block;
  margin-bottom: 10px;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.contact-form .form-group input,
.contact-form .form-group textarea {
  width: 100%;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 1.05rem;
  font-family: 'Cormorant Garamond', serif;
  transition: border-color var(--transition);
  border-radius: 0 !important;
  -webkit-appearance: none;
  appearance: none;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-dim); }

.contact-form .form-group input:focus,
.contact-form .form-group textarea:focus {
  outline: none;
  border-bottom-color: var(--gold-bright);
}

.contact-form .form-group textarea { min-height: 90px; }

.btn-submit {
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  margin-top: 8px;
}

.btn-submit:hover {
  background: var(--gold);
  color: var(--bg);
}

.btn-submit:disabled { opacity: 0.35; cursor: not-allowed; background: transparent; color: var(--gold); }

.form-feedback {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1rem;
  min-height: 1.4rem;
  margin-top: 14px;
  text-align: center;
}

.feedback-success { color: #5a9a6a; }
.feedback-error   { color: #d47070; }

/* =====================
   COOKIE — modale centrato
   ===================== */
.cookie-backdrop {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: var(--overlay-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.cookie-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.cookie-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 56px 44px 36px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
  transform: scale(0.92) translateY(18px);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.4s ease;
  position: relative;
}

.cookie-backdrop.open .cookie-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
  transition-delay: 0.05s;
}

.cookie-icon {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  width: 68px;
  height: 68px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.18);
}

.cookie-icon svg {
  width: 42px;
  height: 42px;
}

.cookie-title {
  font-family: 'Cinzel', serif;
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-deep);
  margin-bottom: 18px;
  line-height: 1.3;
}

[data-tema="scuro"] .cookie-title { color: var(--brand-bright); }

.cookie-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  margin: 14px auto 0;
}

.cookie-desc {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.cookie-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cookie-accept,
.cookie-reject {
  padding: 11px 28px;
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 999px;
  transition: transform 0.35s var(--ease-out-quart),
              background 0.3s ease, color 0.3s ease,
              border-color 0.3s ease, box-shadow 0.3s ease;
  font-weight: 500;
}

.cookie-accept {
  background: var(--brand-deep);
  color: #ffffff;
  border: 1px solid var(--brand-deep);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}

.cookie-accept:hover {
  transform: scale(1.05);
  background: var(--brand-bright);
  border-color: var(--brand-bright);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.42);
}

.cookie-reject {
  background: transparent;
  color: var(--brand-deep);
  border: 1px solid var(--border-strong);
}

[data-tema="scuro"] .cookie-reject { color: var(--brand-bright); }

.cookie-reject:hover {
  transform: scale(1.05);
  background: var(--border-subtle);
  border-color: var(--brand);
}

@media (max-width: 480px) {
  .cookie-modal { padding: 50px 24px 30px; border-radius: 18px; }
  .cookie-title { font-size: 1.05rem; letter-spacing: 0.14em; }
  .cookie-desc { font-size: 0.95rem; }
  .cookie-actions { flex-direction: column-reverse; gap: 10px; }
  .cookie-accept, .cookie-reject { width: 100%; }
}

/* =====================
   LIGHTBOX IMMAGINI
   ===================== */
.lightbox-backdrop {
  position: fixed; inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.lightbox-backdrop.open { opacity: 1; pointer-events: all; }

.lightbox-box {
  position: relative; z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px; padding: 4px;
  max-width: 88vw; max-height: 82vh;
  display: flex; align-items: center; justify-content: center;
  transform: scale(0.9) translateY(16px); opacity: 0;
  transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.4s ease;
  box-shadow: 0 40px 100px rgba(0,0,0,0.5);
}

.lightbox-backdrop.open .lightbox-box {
  transform: scale(1) translateY(0); opacity: 1; transition-delay: 0.05s;
}

.lightbox-img-wrapper { border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: visible; }

.lightbox-img {
  display: block;
  max-width: 82vw; max-height: 78vh;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 12px;
  transform-origin: center;
  user-select: none; -webkit-user-drag: none;
}

.lightbox-close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px;
  background: transparent; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.35; transition: opacity 0.2s ease; z-index: 1;
}

.lightbox-close:hover { opacity: 0.9; }

.lightbox-close::before, .lightbox-close::after {
  content: ''; position: absolute;
  width: 16px; height: 1.5px;
  background: var(--text); border-radius: 2px;
}

.lightbox-close::before { transform: rotate(45deg); }
.lightbox-close::after  { transform: rotate(-45deg); }

.lightbox-pill {
  position: absolute; z-index: 2;
  top: 18px; left: 50%;
  transform: translateX(-50%) translateY(-10px);
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 7px 14px;
  opacity: 0;
  transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.lightbox-backdrop.open .lightbox-pill {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

.lightbox-zoom-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--border); color: var(--gold);
  font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease; flex-shrink: 0;
}

.lightbox-zoom-btn:hover { background: var(--border-strong); }

.lightbox-zoom-label {
  font-family: 'Cinzel', serif; font-size: 0.68rem;
  letter-spacing: 0.1em; color: var(--gold-dim);
  min-width: 38px; text-align: center;
}

/* =====================
   LIBRO — BIOGRAFIA
   ===================== */
.bio-eye-section {
  display: flex;
  justify-content: center;
  padding: 60px 20px 80px;
}

.eye-card {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 44px 56px 36px;
  cursor: pointer; position: relative; overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1),
              border-color 0.45s ease, background 0.45s ease;
}

.eye-card::before { display: none; }

.eye-card:hover {
  transform: translateY(-6px);
  border-color: var(--gold-dim);
  background: var(--bg-card);
}

.eye-card-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 24px; position: relative; z-index: 1;
}

.book-svg {
  width: 96px; height: auto; overflow: visible;
  color: var(--gold);
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), color 0.4s ease;
}

.eye-card:hover .book-svg {
  transform: translateY(-4px) scale(1.06);
  color: var(--gold-bright);
}

.book-page-left,
.book-page-right {
  transform-origin: 50% 50%;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.eye-card:hover .book-page-left { transform: rotate(-3deg) translateX(-2px); }
.eye-card:hover .book-page-right { transform: rotate(3deg) translateX(2px); }

.eye-card-label {
  font-family: 'Cinzel', serif; font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--gold);
  transition: color 0.4s ease, letter-spacing 0.4s ease;
}

.eye-card:hover .eye-card-label { color: var(--gold-bright); letter-spacing: 0.42em; }

/* =====================
   LIGHTBOX BIOGRAFIA
   ===================== */
.bio-backdrop {
  position: fixed; inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  z-index: 300;
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 40px 0;
  opacity: 0; pointer-events: none;
  transition: opacity 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}

.bio-backdrop.open { opacity: 1; pointer-events: all; }

.bio-box-modal {
  position: relative; z-index: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 56px 56px 50px;
  max-width: 640px; width: 90vw;
  margin: auto; flex-shrink: 0;
  transform: scale(0.9) translateY(20px); opacity: 0;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.45s ease;
  box-shadow: 0 50px 120px rgba(0,0,0,0.3);
}

.bio-backdrop.open .bio-box-modal {
  transform: scale(1) translateY(0); opacity: 1; transition-delay: 0.06s;
}

.bio-titolo {
  font-family: 'Cinzel', serif; font-size: 1.1rem; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 32px;
}

.bio-titolo::after {
  content: ''; display: block;
  width: 40px; height: 1px;
  background: linear-gradient(90deg, var(--gold-dim), transparent);
  margin-top: 16px;
}

.bio-testo {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-weight: 300;
  font-size: 1.15rem; line-height: 2;
  color: var(--text-muted);
}

.bio-testo em { font-style: normal; color: var(--gold-bright); font-weight: 400; }

.bio-close {
  position: absolute; top: 18px; right: 20px;
  width: 34px; height: 34px;
  background: transparent; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.3; transition: opacity 0.2s ease;
}

.bio-close:hover { opacity: 0.9; }

.bio-close::before, .bio-close::after {
  content: ''; position: absolute;
  width: 16px; height: 1.5px;
  background: var(--text); border-radius: 2px;
}

.bio-close::before { transform: rotate(45deg); }
.bio-close::after  { transform: rotate(-45deg); }

/* =====================
   SOCIAL PILLS — overlap sopra rating-summary
   ===================== */
.social-pills-wrap {
  display: flex;
  justify-content: center;
  gap: 18px;
  position: relative;
  z-index: 5;
  padding: 36px 20px 0;
  margin-bottom: -45px;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 24px;
  border-radius: 999px;
  text-decoration: none;
  color: #ffffff;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: transform 0.4s var(--ease-out-quart), box-shadow 0.35s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.social-pill:hover {
  transform: scale(1.07) translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
}

.social-pill svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.social-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.social-facebook {
  background: #1877f2;
}

@media (max-width: 480px) {
  .social-pills-wrap { gap: 12px; padding-top: 28px; margin-bottom: -38px; }
  .social-pill { padding: 9px 18px; font-size: 0.6rem; letter-spacing: 0.14em; gap: 7px; }
  .social-pill svg { width: 16px; height: 16px; }
}

/* =====================
   PANORAMICA RECENSIONI — home
   ===================== */
.review-overview {
  padding: 30px 44px 20px;
  display: flex;
  justify-content: center;
}

.rating-summary {
  width: 100%;
  max-width: 520px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 40px 44px 38px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.45s var(--ease-out-quart);
  position: relative;
  overflow: hidden;
}

.rating-summary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.08) 0%, transparent 65%);
  pointer-events: none;
}

.rating-summary:hover { transform: translateY(-4px); border-color: var(--brand); }

.rating-big {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
  font-family: 'Cinzel', serif;
  color: var(--star);
}

.rating-avg {
  font-size: 3.6rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--star);
  text-shadow: 0 2px 12px rgba(234, 179, 8, 0.18);
}

.rating-sep {
  font-size: 1.6rem;
  color: var(--text-dim);
  font-weight: 400;
}

.rating-max {
  font-size: 1.6rem;
  color: var(--text-muted);
  font-weight: 400;
}

.rating-stars {
  position: relative;
  display: inline-block;
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: 0.18em;
  margin-bottom: 10px;
}

.rating-stars .star-bg {
  color: var(--star-dim);
}

.rating-stars .star-fg {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--fill, 0%);
  overflow: hidden;
  white-space: nowrap;
  color: var(--star);
  transition: width 0.9s cubic-bezier(0.23, 1, 0.32, 1);
}

.rating-count {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 22px;
}

.rating-cta {
  display: inline-block;
  padding: 10px 26px;
  border-radius: 999px;
  background: var(--brand-deep);
  color: #ffffff;
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: transform 0.35s var(--ease-out-quart),
              background 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}

.rating-cta:hover {
  transform: scale(1.06);
  background: var(--brand-bright);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.42);
}

/* =====================
   CAROSELLO RECENSIONI
   ===================== */
.reviews-carousel-section {
  padding: 40px 16px 90px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-heading {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: 0.22em;
  color: var(--text);
  margin-bottom: 36px;
  text-transform: uppercase;
}

.carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.carousel-arrow {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--brand-deep);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s var(--ease-out-quart),
              background 0.3s ease, border-color 0.3s ease,
              opacity 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow);
  z-index: 2;
}

.carousel-arrow svg { width: 22px; height: 22px; }

[data-tema="scuro"] .carousel-arrow { color: var(--brand-bright); }

.carousel-arrow:hover:not(.disabled) {
  transform: scale(1.1);
  background: var(--brand-deep);
  color: #ffffff;
  border-color: var(--brand-deep);
}

.carousel-arrow.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.carousel-track-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 10px 4px 22px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-loading, .carousel-empty {
  flex: 1;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.1rem;
}

.carousel-empty a { color: var(--brand); text-decoration: none; font-weight: 500; }
.carousel-empty a:hover { color: var(--brand-bright); text-decoration: underline; }

.review-widget {
  flex: 0 0 calc((100% - 44px) / 3);
  scroll-snap-align: start;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 28px 22px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.08);
  transition: transform 0.4s var(--ease-out-quart),
              border-color 0.3s ease, box-shadow 0.4s ease;
}

@media (max-width: 1024px) {
  .review-widget { flex: 0 0 calc((100% - 22px) / 2); }
}

@media (max-width: 640px) {
  .review-widget { flex: 0 0 100%; }
}

.review-widget:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.18);
}

.review-widget-stars {
  color: var(--star);
  font-size: 1.05rem;
  letter-spacing: 3px;
  margin-bottom: 14px;
}

.review-widget-stars-empty { color: var(--star-dim); }

.review-widget-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--text);
  flex: 1;
  margin-bottom: 18px;
}

.review-widget-text-empty { color: var(--text-dim); }

.review-widget-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  gap: 10px;
}

.review-widget-name {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-deep);
  word-break: break-word;
}

[data-tema="scuro"] .review-widget-name { color: var(--brand-bright); }

.review-widget-date {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  white-space: nowrap;
}

/* =====================
   FOOTER — nascosto
   ===================== */
.footer { display: none; }

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
  .logo-card { padding: 8px 11px; top: 11px; left: 11px; gap: 5px; border-radius: 11px; }
  .logo-name { font-size: 0.58rem; letter-spacing: 0.14em; }
  .theme-pills { gap: 4px; }
  .theme-pill { padding: 4px 8px; font-size: 0.52rem; letter-spacing: 0.07em; }

  .hamburger { width: 44px; height: 44px; top: 12px; right: 12px; border-radius: 11px; }
  .hamburger .icon-palette { width: 24px; height: 24px; }

  .nav-overlay { width: min(240px, 68vw); padding: 80px 12px 40px; }
  .nav-overlay .nav-links li a { padding: 12px 16px; font-size: 0.7rem; gap: 12px; max-width: 200px; letter-spacing: 0.16em; border-radius: 10px; }
  .nav-overlay .nav-links { gap: 4px; }

  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    padding: 20px; gap: 16px;
  }

  .hero { padding: 120px 20px 70px; }
  .hero h2 { font-size: 2.2rem; }
  .page-title { padding: 110px 20px 40px; }
  .page-title h2 { font-size: 2rem; }

  .cat-grid { grid-template-columns: repeat(2, 1fr); padding: 20px; gap: 14px; }
  .masonry-gallery { padding: 0 16px 60px; }

  .eye-card { padding: 36px 40px 28px; }
  .bio-box-modal { padding: 46px 24px 40px; }
  .overlay-text { font-size: 1.5rem; }
  .card.wide, .card-link.wide { grid-column: span 2; }

  .contact { padding: 60px 20px; }
  .contact-form { padding: 0 4px; }
  .contact-form .form-container { padding: 32px 24px; }

  .review-overview { padding: 20px 16px 10px; }
  .rating-summary { padding: 30px 24px 28px; border-radius: 18px; }
  .rating-avg { font-size: 3rem; }
  .rating-stars { font-size: 1.4rem; }

  .reviews-carousel-section { padding: 24px 10px 70px; }
  .section-heading { font-size: 1.15rem; letter-spacing: 0.18em; margin-bottom: 24px; }
  .carousel-arrow { width: 38px; height: 38px; }
  .carousel-arrow svg { width: 18px; height: 18px; }
  .carousel-wrapper { gap: 6px; }
  .review-widget { padding: 22px 22px 18px; }
  .review-widget-text { font-size: 1rem; }
}

@media (max-width: 480px) {
  .logo-card { padding: 7px 9px; gap: 4px; border-radius: 10px; top: 10px; left: 10px; }
  .logo-name { font-size: 0.52rem; letter-spacing: 0.12em; }
  .theme-pill { padding: 3px 7px; font-size: 0.48rem; letter-spacing: 0.06em; }
  .hamburger { width: 42px; height: 42px; border-radius: 11px; top: 10px; right: 10px; }
  .hamburger .icon-palette { width: 22px; height: 22px; }
  .hero h2 { font-size: 1.8rem; }
  .page-title h2 { font-size: 1.6rem; }
  .gallery { grid-template-columns: repeat(2, 1fr); padding: 12px; gap: 10px; }
  .cat-grid { padding: 14px; gap: 10px; }
  .card.wide { grid-column: span 1; }
  .btn-submit { align-self: stretch; text-align: center; }
}
