/* Porta d'ingresso: il fascicolo sigillato */
html, body.door { height: 100%; }
body.door { overflow-x: hidden; background: #07060a; }

.scene { position: fixed; inset: 0; z-index: 0; background: radial-gradient(120% 70% at 70% 0%, #120e1a 0%, #07060b 60%); }
.scene .firenze { position: absolute; left: 0; bottom: 0; width: 100%; height: max(46vh, 300px); }
.door .fog { position: fixed; z-index: 1; height: 45%; }

.firenze .tw { animation: twinkle 4s ease-in-out infinite; }
.firenze .flick { animation: flick 7s steps(1) infinite; }
.firenze .fz-shimmer rect { animation: shimmer 3.4s ease-in-out infinite; }
.firenze .fz-moon-hit { cursor: pointer; pointer-events: all; }
.firenze .fz-dome { transition: fill 1.6s var(--ease-out); }
.firenze .fz-dome-glow { opacity: 0; transition: opacity 1.6s var(--ease-out); }
.firenze .fz-ribs { transition: stroke 1.6s; }
.firenze.lit .fz-dome { fill: url(#fz-dome); }
.firenze.lit .fz-dome-glow { opacity: 1; }
.firenze.lit .fz-ribs { stroke: #f6e2b8; }
.firenze .fz-moon > circle:nth-child(2) { transition: fill 2s; }
.firenze.eclipse .fz-moon > circle:nth-child(2) { fill: #9b2a22; }
.firenze.eclipse .fz-moon > circle:first-child { opacity: .25; }
@keyframes twinkle { 50% { opacity: .1; } }
@keyframes flick { 0%, 100% { opacity: .7; } 48% { opacity: .7; } 50% { opacity: 0; } 53% { opacity: .7; } 70% { opacity: .1; } 72% { opacity: .7; } }
@keyframes shimmer { 50% { opacity: .05; transform: translateX(6px); } }

.tape-top { top: 8vh; transform: rotate(-7deg); }
.tape-bottom { bottom: 10vh; transform: rotate(4deg); background: linear-gradient(180deg, #e0bb31, #c99d18); }
.tapes { position: fixed; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.door .tape { opacity: .94; }

.stage {
  position: relative; z-index: 10; min-height: 100%;
  display: grid; place-items: center; padding: 70px 18px 90px;
}

/* Il fascicolo */
.dossier {
  --tilt: -1.4deg;
  position: relative; width: min(540px, 100%);
  padding: 62px 46px 40px;
  color: var(--paper-ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(80,60,40,.07) 31px 32px),
    radial-gradient(120% 90% at 30% 10%, #f6f0e4 0%, var(--paper) 55%, var(--paper-2) 100%);
  border-radius: 3px;
  box-shadow:
    0 1px 0 rgba(255,255,255,.6) inset,
    0 40px 80px -20px rgba(0,0,0,.85),
    0 18px 30px -12px rgba(0,0,0,.6);
  transform: rotate(var(--tilt));
  animation: arrive 1.4s var(--ease-out) both .2s;
}
.dossier::before { /* macchia di caffè */
  content: ''; position: absolute; right: 26px; bottom: 30px; width: 110px; height: 110px; border-radius: 50%;
  border: 7px solid rgba(110,70,30,.08); filter: blur(.6px); transform: rotate(20deg) scaleY(.92); pointer-events: none;
}
@keyframes arrive {
  from { opacity: 0; transform: translateY(40px) rotate(2deg) scale(.96); filter: blur(6px); }
  to { opacity: 1; transform: rotate(var(--tilt)); filter: none; }
}
.dossier-tab {
  position: absolute; top: -30px; left: 26px; padding: 7px 18px 10px;
  background: var(--paper-2); border-radius: 5px 5px 0 0;
  font-family: var(--f-type); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: #5b5146;
  box-shadow: 0 -6px 14px -8px rgba(0,0,0,.5);
}
.riservato {
  position: absolute; top: 26px; right: 22px; padding: 4px 10px 2px;
  border: 2px solid rgba(140,28,34,.75); color: rgba(140,28,34,.8);
  font-family: var(--f-sans); font-weight: 800; font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  transform: rotate(9deg); mix-blend-mode: multiply;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.kicker {
  margin: 0 0 14px; font-family: var(--f-sans); font-size: 11.5px; font-weight: 600;
  letter-spacing: .3em; text-transform: uppercase; color: var(--blood);
}
.title { margin: 0; line-height: .86; font-weight: 400; }
.title-pre {
  display: block; font-family: var(--f-sans); font-size: 22px; font-weight: 500;
  letter-spacing: .5em; text-transform: uppercase; color: #3b342e; margin-bottom: 4px;
}
.title-name {
  display: block; font-family: var(--f-display); font-style: italic; font-weight: 500;
  font-size: clamp(54px, 13vw, 92px); letter-spacing: -.02em; color: var(--paper-ink);
  font-variation-settings: 'opsz' 96;
}
.meta {
  display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 22px 0 18px; padding: 12px 0;
  border-top: 1px solid rgba(29,26,24,.25); border-bottom: 1px solid rgba(29,26,24,.25);
  font-size: 14px;
}
.meta div { display: flex; gap: 8px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.lede { margin: 0 0 24px; font-size: 20px; line-height: 1.45; color: #2c2622; }

.unlock { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.field { position: relative; flex: 1 1 220px; }
.field input {
  width: 100%; padding: 10px 2px 9px; border: 0; background: transparent; outline: none;
  font-family: var(--f-type); font-size: 22px; letter-spacing: .08em; color: var(--paper-ink);
  border-bottom: 1px solid rgba(29,26,24,.45);
}
.field input::placeholder { color: rgba(29,26,24,.35); letter-spacing: .04em; }
.field-line {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--blood);
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease-out);
}
.field input:focus + .field-line { transform: scaleX(1); }
.unlock .btn { flex: 0 0 auto; }

.verdict { min-height: 1.5em; margin: 16px 0 0; font-size: 15px; color: var(--blood); }

/* Timbro "Accesso negato" */
.stamp {
  position: absolute; left: 50%; top: 52%; z-index: 4; pointer-events: none;
  padding: 10px 22px 6px; border: 5px double var(--blood-2); color: var(--blood-2);
  font-family: var(--f-sans); font-weight: 900; font-size: 40px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  display: none; opacity: 0; transform: translate(-50%, -50%) rotate(-14deg);
  mix-blend-mode: multiply;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.7' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.6 1.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.7' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.6 1.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.stamp.hit { display: block; animation: stamp 2.6s var(--ease-out) forwards; }
@keyframes stamp {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-14deg) scale(2.2); }
  12% { opacity: .92; transform: translate(-50%, -50%) rotate(-14deg) scale(1); }
  75% { opacity: .92; transform: translate(-50%, -50%) rotate(-14deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(-14deg) scale(1); }
}
.dossier.shake { animation: shake .55s var(--ease-out); }
@keyframes shake {
  0%, 100% { transform: rotate(var(--tilt)); }
  20% { transform: translateX(-10px) rotate(var(--tilt)); }
  40% { transform: translateX(8px) rotate(var(--tilt)); }
  60% { transform: translateX(-5px) rotate(var(--tilt)); }
  80% { transform: translateX(3px) rotate(var(--tilt)); }
}

/* Sigillo di ceralacca */
.seal {
  position: absolute; top: -48px; left: 50%; width: 104px; height: 104px; margin-left: -52px; z-index: 5;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,.45));
}
.seal-half { position: absolute; inset: 0; transition: transform 1.1s var(--ease-out), opacity 1.1s; }
.seal-half svg { width: 100%; height: 100%; overflow: visible; }
.seal-half.l { clip-path: polygon(0 0, 52% 0, 46% 22%, 55% 40%, 45% 58%, 53% 78%, 48% 100%, 0 100%); }
.seal-half.r { clip-path: polygon(52% 0, 100% 0, 100% 100%, 48% 100%, 53% 78%, 45% 58%, 55% 40%, 46% 22%); }
.dossier.open .seal-half.l { transform: translate(-34px, 40px) rotate(-38deg); opacity: 0; }
.dossier.open .seal-half.r { transform: translate(34px, 46px) rotate(30deg); opacity: 0; }
.dossier.open { animation: lift 1.3s var(--ease-in-out) .45s forwards; }
@keyframes lift {
  to { opacity: 0; transform: translateY(-60px) rotate(-3deg) scale(.94); filter: blur(4px); }
}

.flash { position: fixed; inset: 0; z-index: 95; pointer-events: none; background: var(--blood); opacity: 0; }
.flash.go { animation: wipe 1.6s var(--ease-in-out) 1s forwards; }
@keyframes wipe {
  0% { opacity: 0; clip-path: circle(0% at 50% 40%); }
  60% { opacity: 1; clip-path: circle(140% at 50% 40%); background: var(--blood); }
  100% { opacity: 1; clip-path: circle(140% at 50% 40%); background: #000; }
}

.door-foot {
  position: fixed; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 10;
  display: flex; justify-content: center; align-items: center; gap: 14px;
  font-family: var(--f-sans); font-size: 11px; letter-spacing: .4em; text-transform: uppercase; color: rgba(230,207,152,.75);
}
.door-foot i { width: 22px; height: 1px; background: currentColor; opacity: .5; }

@media (max-width: 560px) {
  body { font-size: 17px; }
  .stage { place-items: start center; padding: 92px 16px 120px; }
  .dossier { padding: 46px 22px 24px; --tilt: -.8deg; }
  .seal { width: 78px; height: 78px; margin-left: -39px; top: -38px; }
  .riservato { top: 14px; bottom: auto; right: 10px; font-size: 9px; letter-spacing: .2em; padding: 3px 7px 1px; }
  .kicker { font-size: 9.5px; letter-spacing: .22em; margin-bottom: 10px; }
  .title-pre { font-size: 16px; }
  .title-name { font-size: 54px; }
  .meta { font-size: 12.5px; margin: 16px 0 14px; padding: 9px 0; gap: 4px 16px; }
  .lede { font-size: 17px; margin-bottom: 14px; }
  .field input { font-size: 19px; }
  .verdict { font-size: 13.5px; margin-top: 12px; }
  .dossier::before { display: none; }
  .tape-top { top: 34px; }
  .tape-bottom { bottom: 64px; }
  .unlock .btn { width: 100%; }
  .tape { height: 36px; font-size: 12px; }
  .stamp { font-size: 28px; }
  .door-foot { font-size: 9.5px; gap: 9px; letter-spacing: .3em; }
}
@media (max-height: 700px) { .tape-top { top: 2vh; } .tape-bottom { bottom: 4vh; } }
