:root {
  --bg: #0c0a09;
  --gold: #c9a66b;
  --gold-soft: #e4c98a;
  --gold-dim: rgba(201, 166, 107, 0.35);
  --ivory: #f4efe6;
  --muted: #a89f93;
  --line: rgba(201, 166, 107, 0.22);
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Outfit', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ivory);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul {
  list-style: none;
}

.container {
  width: min(1180px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* ── Video di sfondo ── */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg);
}

.scene-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55) saturate(0.85);
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}

.scene-video.is-ready {
  opacity: 1;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 70% at 50% 45%,
    transparent 0%,
    rgba(12, 10, 9, 0.4) 60%,
    rgba(12, 10, 9, 0.85) 100%
  );
  pointer-events: none;
}

.scene-grain {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* ── Effetto vedono-non-vedo ── */
.veil-canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.veil-static {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(12, 10, 9, 0.35) 0%,
    transparent 35%,
    transparent 65%,
    rgba(12, 10, 9, 0.4) 100%
  );
  animation: veil-breathe 6s ease-in-out infinite;
  pointer-events: none;
}

.veil-curtain {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 18vw;
  z-index: 3;
  background: linear-gradient(
    90deg,
    rgba(26, 14, 10, 0.92) 0%,
    rgba(40, 20, 14, 0.75) 60%,
    transparent 100%
  );
  pointer-events: none;
  animation: curtain-sway 8s ease-in-out infinite;
}

.veil-curtain--left {
  left: 0;
  transform-origin: left center;
}

.veil-curtain--right {
  right: 0;
  background: linear-gradient(
    270deg,
    rgba(26, 14, 10, 0.92) 0%,
    rgba(40, 20, 14, 0.75) 60%,
    transparent 100%
  );
  transform-origin: right center;
  animation-delay: -4s;
}

@keyframes veil-breathe {
  0%,
  100% {
    opacity: 0.88;
  }
  50% {
    opacity: 0.72;
  }
}

@keyframes curtain-sway {
  0%,
  100% {
    transform: scaleX(1);
    opacity: 0.85;
  }
  50% {
    transform: scaleX(1.04);
    opacity: 0.95;
  }
}

/* ── Contenuto ── */
.content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2.5rem 1.5rem 4rem;
  text-align: center;
}

.brand {
  margin-bottom: 3rem;
  animation: fade-up 1.2s var(--ease) both;
}

.brand-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fade-up 1s var(--ease) 0.15s both;
}

.brand-mark .logo-img {
  width: 5rem;
  height: 5rem;
}

.brand-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: fade-up 1s var(--ease) 0.3s both;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 10vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
}

.brand-title-line {
  display: block;
  opacity: 0;
  animation: reveal-title 1.4s var(--ease) 0.5s both;
}

.brand-title-line--alt {
  animation-delay: 0.75s;
  font-style: italic;
  color: var(--gold-soft);
}

.brand-tagline {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--muted);
  line-height: 1.7;
  max-width: 28rem;
  margin: 0 auto;
  opacity: 0;
  animation: fade-up 1s var(--ease) 1s both;
}

.brand-tagline em {
  font-style: italic;
  color: var(--ivory);
}

/* ── Invito ── */
.invite {
  margin-bottom: 1rem;
  opacity: 0;
  animation: fade-up 1s var(--ease) 1.2s both;
}

.invite-intro {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  line-height: 1.55;
  color: var(--ivory);
  max-width: 28rem;
  margin: 0 auto 1.25rem;
}

.invite-title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4vw, 2.05rem);
  font-weight: 500;
  color: var(--ivory);
  margin-bottom: 0.85rem;
  letter-spacing: 0.02em;
}

.invite-whisper {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.15rem, 2.5vw, 1.3rem);
  color: var(--muted);
  margin-bottom: 1.25rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

.invite-contact {
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-decoration: none;
}

.invite-contact:hover,
.invite-contact:focus-visible {
  color: var(--gold-soft);
  text-decoration: underline;
}

/* ── Logo ── */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-img {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  flex-shrink: 0;
  background-color: var(--gold-soft);
}

.logo-img-glyph {
  display: block;
  width: 82%;
  height: 82%;
  background-color: var(--bg);
  -webkit-mask-image: url('../assets/logo-tortiglione.png');
  mask-image: url('../assets/logo-tortiglione.png');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.footer-brand .logo-img {
  width: 2.75rem;
  height: 2.75rem;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  text-align: left;
}

.logo-text span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.25rem;
  font-weight: 400;
}

/* ── Footer ── */
.footer {
  position: relative;
  z-index: 10;
  background:
    linear-gradient(180deg, #0c0a09, #070605),
    radial-gradient(ellipse at 50% 100%, rgba(201, 166, 107, 0.08), transparent 50%);
  border-top: 1px solid var(--line);
  padding-top: clamp(3.5rem, 6vw, 5rem);
  text-align: left;
  opacity: 0;
  animation: fade-up 1s var(--ease) 1.5s both;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  align-items: start;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer-brand .logo {
  min-height: 1.35rem;
  margin-bottom: 0;
  align-items: flex-start;
}

.footer-brand .logo-text {
  font-size: 1.35rem;
  padding-top: 0.15rem;
}

.footer-tag {
  margin-top: 1rem;
  color: var(--muted);
  max-width: 18rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.socials {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.social {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--gold);
  cursor: default;
}

a.social {
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

a.social:hover,
a.social:focus-visible {
  background: rgba(201, 166, 107, 0.1);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.footer h4 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--gold-soft);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a,
.footer-links li {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.25s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--ivory);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--muted);
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.cookie-btn:hover,
.cookie-btn:focus-visible {
  border-color: var(--gold);
  color: var(--gold-soft);
}

/* ── Cookie banner ── */
.cookie-banner {
  position: fixed;
  inset: auto 1rem 1rem;
  z-index: 200;
  max-width: 420px;
  background: rgba(22, 18, 14, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  padding: 1.35rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.cookie-banner h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.45rem;
}

.cookie-banner p {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  line-height: 1.55;
}

.cookie-banner a {
  color: var(--gold-soft);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.cookie-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease),
    color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.btn-gold {
  background: linear-gradient(135deg, #d4b57a 0%, #c9a66b 45%, #a8874f 100%);
  color: #1a140e;
}

.btn-gold:hover,
.btn-gold:focus-visible {
  transform: translateY(-1px);
}

.btn-outline {
  border: 1px solid var(--gold-dim);
  color: var(--gold-soft);
  background: transparent;
}

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--gold);
  background: rgba(201, 166, 107, 0.08);
}

/* ── Pagine legali ── */
body.is-legal .scene,
body.is-legal .veil-canvas,
body.is-legal .veil-static,
body.is-legal .veil-curtain,
body.is-legal .content {
  display: none;
}

body.is-legal {
  display: flex;
  flex-direction: column;
}

body.is-legal .legal-page {
  order: 1;
}

body.is-legal .footer {
  order: 2;
  animation: none;
  opacity: 1;
}

.legal-page {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  padding: 4rem 0 4rem;
  background: var(--bg);
}

.legal-page h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.legal-page .updated {
  color: var(--muted);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.legal-page h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 1.75rem 0 0.65rem;
  color: var(--gold-soft);
  font-weight: 500;
}

.legal-page h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 1.25rem 0 0.5rem;
}

.legal-back {
  margin-bottom: 2rem;
}

.legal-page a {
  color: var(--gold-soft);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.legal-page a:hover,
.legal-page a:focus-visible {
  color: var(--gold);
}

.legal-page code {
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1em 0.35em;
}

.legal-table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  max-width: 100%;
}

.legal-table {
  width: 100%;
  min-width: 32rem;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.legal-table th,
.legal-table td {
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
  color: var(--muted);
}

.legal-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ivory);
  font-weight: 500;
}

.legal-page strong {
  color: var(--ivory);
  font-weight: 500;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
  margin-bottom: 0.75rem;
  max-width: 42rem;
  line-height: 1.65;
}

.legal-page ul {
  padding-left: 1.2rem;
  list-style: disc;
  margin-bottom: 1rem;
}

/* ── Animazioni ── */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal-title {
  from {
    opacity: 0;
    transform: translateY(2rem);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 540px) {
  .veil-curtain {
    width: 12vw;
  }

  .content {
    justify-content: flex-start;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .brand {
    margin-bottom: 2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .logo-text span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .veil-canvas {
    display: none;
  }
}
