/* ---- la porta ---- */
.hero-door { position: relative; width: min(64vw, 270px); margin: 18px auto 0; }
.door-glow { position: absolute; left: 50%; top: 46%; width: 300%; aspect-ratio: 1; transform: translate(-50%, -50%) scale(.7); background: radial-gradient(closest-side, rgba(232,196,136,.4), rgba(232,196,136,.14) 42%, rgba(232,196,136,0) 72%); opacity: 0; pointer-events: none; transition: opacity 2.6s ease .9s, transform 3s var(--ease-out) .9s; }
.hero-door.is-open .door-glow { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.hero-door.is-closing .door-glow { transition-delay: 0s; transition-duration: 1.2s; }
.door-scene { position: relative; z-index: 1; }
.js .door-scene { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.door-frame { position: relative; }

.arch-outline { position: absolute; inset: -16px -16px 0 -16px; border: 1px solid var(--ottone); border-bottom: 0; border-radius: 999px 999px 0 0; opacity: .7; }
.js .arch-outline { display: none; }
.arch-line { position: absolute; left: -16px; top: -16px; width: calc(100% + 32px); height: calc(100% + 16px); overflow: visible; pointer-events: none; display: none; }
.js .arch-line { display: block; }
.arch-line path { fill: none; stroke: var(--ottone); stroke-width: 1.3; stroke-dasharray: 1 1; stroke-dashoffset: 1; stroke-linecap: round; }
.arch-line .al-in { stroke-width: .8; stroke-opacity: .55; }
.arch-line .keystone { fill: var(--ottone); opacity: 0; transform-box: fill-box; transform-origin: center; }
.is-ready .arch-line path { animation: draw 1.7s cubic-bezier(.6,.05,.3,1) .15s forwards; }
.is-ready .arch-line .al-in { animation-delay: .45s; }
.is-ready .arch-line .keystone { animation: keystone .7s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes keystone { 0% { opacity: 0; transform: rotate(45deg) scale(0); } 60% { opacity: 1; transform: rotate(45deg) scale(1.5); } 100% { opacity: 1; transform: rotate(45deg) scale(1); } }

.door {
  --ar: 5 / 6; --rv: 41.667%; --pr: 70%;
  position: relative; aspect-ratio: var(--ar); perspective: 1300px;
  border-radius: 50% 50% 0 0 / var(--rv) var(--rv) 0 0;
  background: #6a2a39;
  box-shadow: 0 0 0 5px var(--carta), 0 0 0 6px var(--line), 0 50px 70px -48px rgba(94,39,52,.45);
}
.door-in { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; background: #6a2a39; }
.door-in .pan { position: absolute; inset: -16px; transform: translate3d(var(--px, 0px), var(--py, 0px), 0); transition: transform .9s var(--ease-out); }
.door-in img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; transform: scale(1.2); filter: brightness(.62) saturate(.8); }
.door-light { position: absolute; inset: 0; background: radial-gradient(70% 52% at 50% 56%, rgba(255,242,218,.97), rgba(255,208,150,.6) 40%, rgba(255,170,110,0) 76%); mix-blend-mode: screen; opacity: 0; pointer-events: none; }
.door-rays { position: absolute; inset: -45%; background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,236,200,.3) 0deg 2.5deg, rgba(255,236,200,0) 2.5deg 12deg); -webkit-mask: radial-gradient(circle, #000 0, rgba(0,0,0,.55) 22%, transparent 48%); mask: radial-gradient(circle, #000 0, rgba(0,0,0,.55) 22%, transparent 48%); mix-blend-mode: screen; opacity: 0; pointer-events: none; }

.door-seam { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; z-index: 3; pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,240,210,0), rgba(255,236,200,.95) 16%, #fff4de 60%, rgba(255,230,190,.95));
  box-shadow: 0 0 10px 2px rgba(255,214,150,.8), 0 0 30px 8px rgba(255,190,120,.4);
  opacity: 0; transform: scaleY(.3); }
.js .door-seam { display: block; }

.leaf { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 2; transform-style: preserve-3d; display: none; }
.js .leaf { display: block; }
.leaf-l { left: 0; transform-origin: 0 50%; }
.leaf-r { right: 0; transform-origin: 100% 50%; }
.face { position: absolute; inset: 0; overflow: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.leaf-l .face-front, .leaf-r .face-back { border-radius: 100% 0 0 0 / var(--rv) 0 0 0; }
.leaf-r .face-front, .leaf-l .face-back { border-radius: 0 100% 0 0 / 0 var(--rv) 0 0; }
.face-front {
  background:
    linear-gradient(90deg, rgba(0,0,0,.24), rgba(0,0,0,0) 16%, rgba(255,255,255,.035) 50%, rgba(0,0,0,0) 84%, rgba(0,0,0,.3)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 2px, rgba(0,0,0,.02) 2px 5px),
    linear-gradient(180deg, #a04d60, #8a384a 55%, #7a3142);
}
.leaf-l .face-front { box-shadow: inset -1px 0 0 rgba(0,0,0,.5); }
.leaf-r .face-front { box-shadow: inset 1px 0 0 rgba(255,255,255,.07); }
.face-back { transform: rotateY(180deg); background: linear-gradient(90deg, rgba(255,214,160,.22), rgba(255,214,160,0) 55%), linear-gradient(180deg, #7a3142, #6a2a39); }
.face-back::before { content: ""; position: absolute; inset: 9% 13% 7%; border: 1px solid rgba(223,192,138,.32); border-radius: inherit; }

.panel { position: absolute; left: 16%; right: 11%; border: 1px solid rgba(223,192,138,.55);
  box-shadow: inset 0 0 0 4px rgba(0,0,0,.13), inset 0 0 0 5px rgba(223,192,138,.17), 0 1px 0 rgba(255,255,255,.05);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(0,0,0,.08)); }
.leaf-r .panel { left: 11%; right: 16%; }
.panel-top { top: 8%; height: 46%; }
.leaf-l .panel-top { border-radius: 100% 0 0 0 / var(--pr) 0 0 0; }
.leaf-r .panel-top { border-radius: 0 100% 0 0 / 0 var(--pr) 0 0; }
.panel-bot { top: 61%; bottom: 7%; border-radius: 2px; }

.crest { position: absolute; top: 21%; width: 96%; max-width: none; height: auto; opacity: .95; filter: drop-shadow(0 1px 0 rgba(0,0,0,.5)) drop-shadow(0 0 5px rgba(223,192,138,.25)); pointer-events: none; }
.leaf-l .crest { left: 52%; }
.leaf-r .crest { left: -48%; }

.handle { position: absolute; top: 56.5%; width: 14px; height: 14px; margin-top: -7px; }
.leaf-l .handle { right: 8%; }
.leaf-r .handle { left: 8%; }
.handle i { position: absolute; top: 50%; height: 5px; width: 26px; margin-top: -2.5px; border-radius: 3px; background: linear-gradient(180deg, #f6e1b0, #c39752 60%, #8c6427); box-shadow: 0 2px 3px rgba(0,0,0,.45); }
.leaf-l .handle i { right: 50%; transform-origin: 100% 50%; }
.leaf-r .handle i { left: 50%; transform-origin: 0 50%; }
.handle::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff1c8, #cfa35c 55%, #8c6427); box-shadow: 0 2px 4px rgba(0,0,0,.5), 0 0 0 2px rgba(0,0,0,.15); }

.shade { position: absolute; inset: 0; background: #3d1a23; opacity: 0; pointer-events: none; }
.face-back .shade { opacity: .7; }

.door-step { position: relative; margin: 0 -24px; height: 10px; background: var(--cipria-2); border-radius: 2px; box-shadow: 0 1px 0 var(--line), 0 18px 24px -18px rgba(94,39,52,.3); }
.door-step::before { content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 26px; background: radial-gradient(55% 100% at 50% 0, rgba(255,214,150,.8), rgba(255,214,150,0) 72%); opacity: 0; transition: opacity 1.6s ease .4s; }
.hero-door.is-open .door-step::before { opacity: 1; }
.hero-door.is-closing .door-step::before { transition-delay: 0s; transition-duration: .8s; }
.door-dust { position: absolute; left: -35%; top: -14%; width: 170%; height: 118%; pointer-events: none; z-index: 4; }

/* sequenza di apertura */
.is-open .door-seam { animation: seam 1.4s ease-out forwards; }
@keyframes seam { 0% { opacity: 0; transform: scaleY(.3); } 40% { opacity: 1; transform: scaleY(1); } 68% { opacity: 1; transform: scaleY(1) scaleX(1.6); } 100% { opacity: 0; transform: scaleY(1) scaleX(5); } }
.is-open .leaf-l .handle i { animation: lever-l 1.3s ease-in-out .3s; }
.is-open .leaf-r .handle i { animation: lever-r 1.3s ease-in-out .34s; }
@keyframes lever-l { 0%, 100% { transform: none; } 25%, 65% { transform: rotate(-34deg); } }
@keyframes lever-r { 0%, 100% { transform: none; } 25%, 65% { transform: rotate(34deg); } }
.is-open .leaf-l { animation: open-l 2.6s .8s both; }
.is-open .leaf-r { animation: open-r 2.6s .88s both; }
@keyframes open-l {
  0% { transform: rotateY(0); animation-timing-function: ease-out; }
  9% { transform: rotateY(4deg); animation-timing-function: cubic-bezier(.45,0,.18,1); }
  80% { transform: rotateY(-107deg); animation-timing-function: ease-in-out; }
  100% { transform: rotateY(-100deg); }
}
@keyframes open-r {
  0% { transform: rotateY(0); animation-timing-function: ease-out; }
  9% { transform: rotateY(-4deg); animation-timing-function: cubic-bezier(.45,0,.18,1); }
  80% { transform: rotateY(107deg); animation-timing-function: ease-in-out; }
  100% { transform: rotateY(100deg); }
}
.is-open .face-front .shade { animation: shade-in 2.2s ease-in 1s both; }
.is-open .face-back .shade { animation: shade-out 2.2s ease-out 1s both; }
@keyframes shade-in { from { opacity: 0; } to { opacity: .42; } }
@keyframes shade-out { from { opacity: .7; } to { opacity: .1; } }
.is-open .door-in img { animation: interior-in 3.2s cubic-bezier(.25,.6,.2,1) .95s both; }
@keyframes interior-in { from { transform: scale(1.2); filter: brightness(.62) saturate(.8); } to { transform: scale(1.04); filter: brightness(1) saturate(1); } }
.is-open .door-light { animation: flood 3.4s ease-out .9s both; }
@keyframes flood { 0% { opacity: 0; } 26% { opacity: .8; } 100% { opacity: .06; } }
.is-open .door-rays { animation: rays 4s ease-out 1s both; }
@keyframes rays { 0% { opacity: 0; transform: rotate(-10deg) scale(.85); } 28% { opacity: .95; } 100% { opacity: 0; transform: rotate(16deg) scale(1.12); } }

/* chiusura (al tocco) */
.is-closing .leaf-l { animation: close-l 1.5s cubic-bezier(.55,0,.35,1) both; }
.is-closing .leaf-r { animation: close-r 1.5s cubic-bezier(.55,0,.35,1) .06s both; }
@keyframes close-l { 0% { transform: rotateY(-100deg); } 90% { transform: rotateY(2deg); } 100% { transform: rotateY(0); } }
@keyframes close-r { 0% { transform: rotateY(100deg); } 90% { transform: rotateY(-2deg); } 100% { transform: rotateY(0); } }
.is-closing .face-front .shade { animation: shade-front-out 1.3s ease-out both; }
.is-closing .face-back .shade { animation: shade-back-in 1.3s ease-in both; }
.is-closing .door-in img { animation: interior-out 1.5s ease-in both; }
@keyframes shade-front-out { from { opacity: .42; } to { opacity: 0; } }
@keyframes shade-back-in { from { opacity: .1; } to { opacity: .7; } }
@keyframes interior-out { from { transform: scale(1.04); filter: brightness(1) saturate(1); } to { transform: scale(1.2); filter: brightness(.62) saturate(.8); } }

@media (prefers-reduced-motion: reduce) {
  .js .leaf, .js .door-seam, .door-dust, .door-light { display: none; }
  .door-in img { transform: none; filter: none; }
}

/* Versione A · «Cipria» — il sito di adesso, tutto chiaro: bordeaux tenue solo su testi, pulsanti e porta */
:root {
  --bg: #f8f1ec;
  --carta: #fdfaf7;
  --rosa: #f3e3e0;
  --vino: #8a384a;
  --vino-h: #76303f;
  --vino-testo: #5e2734;
  --oro: #b48a4a;
  --oro-chiaro: #dfc08a;
  --oro-testo: #86602a;
  --ink: #33212a;
  --muted: #705d62;
  --line: #e8d8d1;
  --line-2: #d9c5bd;
  --avviso-bg: #fbf1e3;
  --bar-bg: #fdfaf7;
  --ok: #2f7a4d;
  --display: "Cormorant Garamond", "Cormorant", Garamond, Georgia, serif;
  --sans: "Mulish", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gut: 20px;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  /* nomi usati dalla porta */
  --cipria: var(--bg); --cipria-2: #eddcd5; --ottone: var(--oro);
}

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(248, 241, 236, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.site-header.is-compact { border-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 70px; }
.brand { display: block; flex: none; }
.brand img { height: 38px; width: auto; }
.nav, .head-cta { display: none; }

/* hero */
.hero { padding: 30px 0 60px; position: relative; overflow: hidden; }
.hero-grid { display: grid; gap: 34px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 10.4vw, 4.8rem); letter-spacing: -0.01em; line-height: 1.02; }
.lead { font-size: 1.12rem; color: #55414a; max-width: 30em; }
.hero-cta { margin-top: 26px; }
.hero-cta .btn { width: 100%; }

/* fregio ad archi */
.arcade { height: 30px; background: var(--carta) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='30' viewBox='0 0 36 30'%3E%3Cpath d='M4 30V16.5a14 14 0 0 1 28 0V30' fill='none' stroke='%23b48a4a' stroke-width='1.3'/%3E%3C/svg%3E") repeat-x 0 100% / 36px 30px; border-bottom: 1px solid var(--oro); }

/* come si comincia: tre passi in riga */
.come { background: var(--carta); padding: 46px 0 50px; }
.passi { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }
.passi li { display: grid; grid-template-columns: 46px 1fr; gap: 16px; align-items: start; }
.passi .n { width: 46px; height: 56px; border: 1.5px solid var(--oro); border-bottom: 0; border-radius: 999px 999px 0 0; display: grid; place-items: center; padding-top: 6px; font-family: var(--display); font-weight: 600; font-size: 1.5rem; color: var(--vino); }
.passi h3 { font-size: 1.5rem; margin: 2px 0 4px; }
.passi p { margin: 0; color: var(--muted); font-size: .98rem; }

/* intestazioni di sezione */
.sec-head { max-width: 640px; margin-bottom: 36px; }
.sec-head > p:not(.kicker) { color: var(--muted); }

/* percorsi: fascia rosa chiara al posto di quella scura */
.percorsi { background: var(--rosa); padding: 70px 0 76px; }
.percorso { display: grid; gap: 24px; margin-bottom: 52px; align-items: center; }
.percorso:last-child { margin-bottom: 0; }
.arch-fig { margin: 0 8px; overflow: hidden; border-radius: 999px 999px 0 0; aspect-ratio: 4 / 5; max-width: 400px; box-shadow: 0 0 0 1px rgba(180, 138, 74, .7), 0 0 0 8px var(--rosa), 0 0 0 9px rgba(180, 138, 74, .4); }
.arch-fig img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.percorso:hover .arch-fig img { transform: scale(1.04); }
.percorso-n { font-family: var(--display); font-style: italic; color: var(--oro-testo); font-size: 1.4rem; margin-bottom: 4px; }
.percorso-text h3 { font-size: clamp(1.9rem, 5.4vw, 2.6rem); font-weight: 500; }
.percorso-text p { color: #55414a; max-width: 30em; }

/* prodotti */
.prodotti { background: var(--carta); padding: 70px 0 76px; }
.prod-grid { display: grid; gap: 40px; align-items: center; }
.prod-fig { position: relative; margin: 0 9px; max-width: 500px; }
.prod-fig img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 999px 999px 6px 6px; box-shadow: 0 0 0 8px var(--carta), 0 0 0 9px rgba(180, 138, 74, .55), 0 40px 60px -44px rgba(94, 39, 52, .5); }
.pin { position: absolute; left: var(--x); top: var(--y); width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--vino); color: #fff; font: 700 .8rem/30px var(--sans); text-align: center; box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 6px 14px rgba(94, 39, 52, .35); transition: transform .3s var(--ease-out), background .3s; }
.pin.is-active { transform: scale(1.3); background: var(--oro); }
.prod-text > p:not(.kicker) { color: var(--muted); max-width: 32em; }
.prod-list { list-style: none; margin: 22px 0 26px; padding: 0; border-top: 1px solid var(--line); }
.prod-list li { display: grid; grid-template-columns: 30px 1fr; gap: 16px; align-items: center; padding: 12px 8px 12px 0; border-bottom: 1px solid var(--line); transition: background .3s, padding .3s; }
.prod-list li.is-active { background: linear-gradient(90deg, rgba(138, 56, 74, .07), transparent); padding-left: 8px; }
.prod-list .n { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--vino); color: var(--vino); display: grid; place-items: center; font-weight: 700; font-size: .8rem; transition: background .3s, color .3s; }
.prod-list li.is-active .n { background: var(--vino); color: #fff; }
.prod-name { font-family: var(--display); font-size: 1.4rem; font-weight: 600; line-height: 1.2; color: var(--ink); margin: 0 0 2px; }
.prod-line { display: inline-flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.prod-line::before { content: ""; width: 18px; height: 6px; border-radius: 3px; background: var(--c); }

/* dove siamo */
.dove { padding: 70px 0 76px; }
.dove-grid { display: grid; gap: 26px; }
.dove-card { background: var(--carta); border: 1px solid var(--line); border-radius: 6px; padding: 24px 20px; display: grid; gap: 20px; }
.dove-card address { font-style: normal; font-family: var(--display); font-size: 1.7rem; font-weight: 600; line-height: 1.2; color: var(--vino-testo); }
.hours-title { font-family: var(--display); font-weight: 600; font-size: 1.4rem; color: var(--vino-testo); margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.dove-actions { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }

/* scrivici */
.scrivi { background: var(--rosa); padding: 70px 0 80px; }
.composer { background: var(--carta); border-radius: 10px; padding: 24px 20px; box-shadow: 0 40px 60px -48px rgba(94, 39, 52, .5); }
.composer-scelte { display: grid; gap: 22px; align-content: start; }
.composer-invio { display: grid; gap: 14px; }
.composer-invio .micro { margin: 0; text-align: center; }
.scrivi-alt { margin: 22px 0 0; text-align: center; color: var(--muted); font-size: .95rem; }
.scrivi-alt a { color: var(--vino); font-weight: 700; text-decoration: none; white-space: nowrap; }

/* footer chiaro */
.footer { background: var(--carta); color: var(--muted); border-top: 1px solid var(--line); }
.footer-grid { display: grid; gap: 26px; padding-top: 44px; padding-bottom: 24px; }
.footer-brand img { width: 136px; }
.footer-city { font: 700 .76rem/1.4 var(--sans); color: var(--oro-testo); letter-spacing: .22em; text-transform: uppercase; margin-bottom: 8px; }
.footer a { color: var(--vino); font-weight: 600; }
.footer-note { font-size: .84rem; }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 14px; padding-bottom: 20px; }

@media (min-width: 700px) {
  :root { --gut: 32px; }
  .hero-cta .btn { width: auto; }
  .passi { grid-template-columns: repeat(3, 1fr); gap: 34px; }
  .percorso { grid-template-columns: .9fr 1.1fr; gap: 50px; }
  .percorso-rev .arch-fig { order: 2; justify-self: end; }
  .dove-card { padding: 30px; }
  .composer { padding: 32px 30px; }
  .hero-door { width: 300px; }
}

@media (min-width: 900px) {
  .head-badge { display: none; }
  .nav { display: flex; gap: 4px; margin-left: auto; }
  .nav a { text-decoration: none; padding: 8px 12px; font: 600 .92rem var(--sans); color: var(--ink); position: relative; }
  .nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 1px; background: var(--oro); transform: scaleX(0); transition: transform .3s; }
  .nav a:hover::after { transform: scaleX(1); }
  .head-cta { display: inline-flex; padding: 12px 20px; font-size: .92rem; box-shadow: none; }
  .head-cta svg { width: 18px; height: 18px; }

  .hero { padding: 50px 0 84px; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 80px; }
  .hero-door { order: 2; width: 100%; max-width: clamp(270px, calc((100vh - 270px) * .694), 380px); margin-top: 16px; }
  .door { --ar: 5 / 7.2; --rv: 34.722%; --pr: 58%; }
  .door-step { margin: 0 -40px; height: 12px; }

  .come { padding: 60px 0 64px; }
  .percorsi, .prodotti, .dove { padding: 104px 0 110px; }
  .sec-head { margin-bottom: 56px; }
  .percorso { gap: 90px; margin-bottom: 84px; }
  .percorso-rev { grid-template-columns: 1.1fr .9fr; }
  .percorso-rev .percorso-text { padding-left: 12%; }
  .prod-grid { grid-template-columns: 1fr 1fr; gap: 90px; }
  .dove-grid { grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: stretch; }
  .dove-grid .map { aspect-ratio: auto; height: 100%; min-height: 520px; }
  .scrivi { padding: 104px 0 112px; }
  .composer { grid-template-columns: 1.1fr .9fr; gap: 54px; padding: 44px; align-items: center; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-bottom { display: flex; justify-content: space-between; }
}
