/*
  Oryvenne · pagina "presto online" · la giostra.
  Il nome grande al centro, i prodotti che girano su un anello inclinato con la tacca d'oro a ore tre:
  lo stesso anello del Sigillo, visto di sbieco. Carta e avorio, Montserrat per il testo,
  Bodoni Moda solo nel logotipo. Caratteri ospitati qui: nessuna richiesta a servizi esterni.
  La geometria della giostra la calcola assets/giostra.js; qui ci sono solo i valori di partenza.
*/
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("font/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("font/montserrat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("font/bodoni-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("font/bodoni-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --carta: #fbf8f2; --avorio: #f5efe4; --lastra: #efe5d5; --piano: #e6dac7; --luce: #fffdf9;
  --ink: #0e0b08; --testo: #3b352d; --fumo: #625a4f;
  --oro: #b08d57; --oro-t: #775a2c; --oro-p: #cca86b;
  --filo: rgba(14, 11, 8, 0.12); --filo2: rgba(14, 11, 8, 0.24);
  --ombra: 58, 38, 12;
  --sans: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --logo: "Bodoni Moda", "Bodoni 72", Didot, Georgia, serif;
  --gs: max(40px, env(safe-area-inset-left, 0px));
  --gd: max(40px, env(safe-area-inset-right, 0px));
  --curva: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--avorio); }
body {
  min-height: 100svh; display: flex; flex-direction: column; overflow-x: clip;
  background:
    radial-gradient(58% 46% at 50% 44%, var(--luce) 0%, rgba(255, 253, 249, 0) 100%),
    linear-gradient(180deg, var(--carta) 0%, var(--carta) 46%, var(--avorio) 100%);
  color: var(--ink); font-family: var(--sans); font-size: 16px; font-weight: 450; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
/* Grana di carta, appena visibile. */
body::after { content: ""; position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .28 0 0 0 0 .2 0 0 0 0 .1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--oro-p); color: var(--ink); }
:focus-visible { outline: 2px solid var(--oro); outline-offset: 4px; border-radius: 999px; }
.salta { position: absolute; left: 16px; top: -64px; z-index: 10; background: var(--ink); color: var(--carta); padding: 10px 18px; border-radius: 999px; font-weight: 600; transition: top 0.15s; }
.salta:focus { top: 10px; }

/* Etichette: maiuscole spaziate, come negli occhielli del negozio. */
.marchio span, .etichetta, .presto, .marca, .suggerimento { font-size: 11px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; }

/* ---------- testata ---------- */
.testa { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(26px, env(safe-area-inset-top, 0px)) var(--gd) 0 var(--gs); }
.marchio { display: inline-flex; align-items: center; gap: 14px; }
.marchio img { width: 42px; height: 42px; }
.marchio span { color: var(--oro-t); }
.teaser-apri { display: inline-flex; align-items: center; gap: 14px; }
.tondo { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--filo2);
  transition: background 0.35s var(--curva), color 0.35s var(--curva), border-color 0.35s var(--curva); }
.tondo svg { width: 15px; height: 15px; fill: currentColor; margin-left: 2px; }
.teaser-apri:hover .tondo { background: var(--ink); border-color: var(--ink); color: var(--carta); }

/* ---------- il palco ---------- */
main { flex: 1; display: flex; flex-direction: column; }
.palco { position: relative; flex: 1; min-height: 500px; overflow: hidden; isolation: isolate;
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.palco.presa { cursor: grabbing; }

.presto { position: absolute; left: 50%; top: var(--oy, 22%); z-index: 60; transform: translate(-50%, -100%);
  display: flex; align-items: center; gap: 16px; white-space: nowrap; color: var(--oro-t); }
.presto span { margin-right: -0.22em; }
.presto::before, .presto::after { content: ""; width: 28px; height: 1.5px; background: var(--oro); }

/* Il logotipo: Bodoni Moda al taglio più contrastato. La giostra gli passa dietro e davanti. */
.nome { position: absolute; left: 50%; top: var(--ny, 40%); z-index: 50; pointer-events: none;
  transform: translate(-50%, -50%) translateX(var(--px, 0px));
  font-family: var(--logo); font-weight: 400; font-size: var(--fs, clamp(48px, 10.5vw, 180px)); font-variation-settings: "opsz" 96;
  line-height: 1; letter-spacing: 0.1em; white-space: nowrap; color: var(--ink); }
.nome > span { display: inline-block; margin-right: -0.1em; }
.nome i { display: inline-block; font-style: normal; }

.giostra { position: absolute; inset: 0; }
.pavimento { position: absolute; left: 0; top: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(204, 168, 107, 0.2), rgba(204, 168, 107, 0.07) 62%, rgba(204, 168, 107, 0)); }
.orbita { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.orbita ellipse { fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; }
.s-lontano { stop-color: var(--ink); stop-opacity: 0.08; }
.s-fianco { stop-color: var(--ink); stop-opacity: 0.3; }
.s-vicino { stop-color: var(--ink); stop-opacity: 0.46; }
.tacca { position: absolute; left: -3px; top: -1px; width: 18px; height: 2px; background: var(--oro); }

.pezzi { list-style: none; }
.giostra:not(.viva) .pezzi, .giostra:not(.viva) .tacca { visibility: hidden; }
/* Senza script restano il nome e il testo: niente didascalia né comandi di una giostra che non c'è. */
html:not(.giostra-viva) .didascalia, html:not(.giostra-viva) .comandi { visibility: hidden; }
.pezzo { position: absolute; left: 0; top: 0; transform-origin: 50% 100%; will-change: transform, opacity; }
.pezzo img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%;
  pointer-events: none; user-select: none; -webkit-user-drag: none; }
/* Ombra di contatto: un'ellisse morbida sotto la base, scala insieme al pezzo. */
.ombra { position: absolute; left: 50%; bottom: 0; width: 132%; aspect-ratio: 4.6; transform: translate(-50%, 46%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--ombra), 0.36), rgba(var(--ombra), 0.14) 52%, rgba(var(--ombra), 0)); }

.didascalia { position: absolute; left: 50%; top: var(--dy, 86%); z-index: 101; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; white-space: nowrap; }
/* Il cambio di nome dissolve i pezzi della didascalia, non la didascalia: così l'ingresso non riparte. */
.didascalia > span { transition: opacity 0.26s ease, translate 0.26s ease; }
.didascalia.cambia > span { opacity: 0; translate: 0 4px; }
.didascalia .marca { color: var(--fumo); margin-right: -0.22em; }
.didascalia .filo { width: 22px; height: 1px; background: var(--oro); }
.didascalia .prod { font-size: 14px; font-weight: 500; letter-spacing: 0.01em; color: var(--ink); }

/* ---------- in fondo ---------- */
.fondo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 40px;
  margin: 0 var(--gd) 0 var(--gs); padding-block: 22px; border-top: 1px solid var(--filo); }
.dice { font-size: 15px; line-height: 1.6; color: var(--testo); text-wrap: balance; }
.comandi { display: flex; align-items: center; gap: 16px; }
.suggerimento { color: var(--fumo); }
.pausa { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--filo2);
  transition: background 0.35s var(--curva), color 0.35s var(--curva), border-color 0.35s var(--curva); }
.pausa:hover { background: var(--ink); border-color: var(--ink); color: var(--carta); }
.pausa svg { grid-area: 1 / 1; width: 16px; height: 16px; }
.i-ferma path { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.i-gira path { fill: currentColor; }
.pausa[aria-pressed="false"] .i-gira, .pausa[aria-pressed="true"] .i-ferma { display: none; }

.piede { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; font-size: 12px; color: var(--fumo);
  padding: 0 var(--gd) max(22px, env(safe-area-inset-bottom, 0px)) var(--gs); }

/* ---------- il teaser ---------- */
dialog.teaser { margin: auto; padding: 0; border: 0; background: transparent; max-width: none; max-height: none; overflow: visible; }
dialog.teaser::backdrop { background: rgba(14, 11, 8, 0.8); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.cornice { position: relative; }
dialog.teaser video { display: block; width: min(calc(100vw - 32px), calc(80svh * 9 / 16), 480px); height: auto; aspect-ratio: 9 / 16; border-radius: 18px; background: var(--ink); }
.chiudi { position: absolute; right: 0; bottom: calc(100% + 12px); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  color: var(--carta); border: 1px solid rgba(251, 248, 242, 0.4); transition: background 0.3s, color 0.3s; }
.chiudi:hover { background: var(--carta); color: var(--ink); }
.chiudi svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
dialog.teaser[open] { animation: compare 0.5s var(--curva) backwards; }

/* ---------- ingresso ---------- */
@media (prefers-reduced-motion: no-preference) {
  .nome i { animation: lettera 1.5s var(--curva) backwards; }
  .nome i:nth-child(1) { animation-delay: 0.12s; } .nome i:nth-child(2) { animation-delay: 0.19s; }
  .nome i:nth-child(3) { animation-delay: 0.26s; } .nome i:nth-child(4) { animation-delay: 0.33s; }
  .nome i:nth-child(5) { animation-delay: 0.4s; } .nome i:nth-child(6) { animation-delay: 0.47s; }
  .nome i:nth-child(7) { animation-delay: 0.54s; } .nome i:nth-child(8) { animation-delay: 0.61s; }
  .orbita ellipse { stroke-dasharray: 1; animation: traccia 2.4s var(--curva) 0.3s backwards; }
  .tacca { animation: compare 0.9s ease 0.3s backwards; }
  .presto { animation: compare 1.1s var(--curva) 1s backwards; }
  .didascalia { animation: compare 1.1s var(--curva) 1.7s backwards; }
  .testa, .fondo, .piede { animation: compare 1.3s var(--curva) 1.2s backwards; }
}
@keyframes lettera { from { opacity: 0; translate: 0 0.28em; filter: blur(12px); } }
@keyframes traccia { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes compare { from { opacity: 0; translate: 0 10px; } }

/* ---------- tablet e telefono ---------- */
@media (max-width: 760px) {
  :root { --gs: max(20px, env(safe-area-inset-left, 0px)); --gd: max(20px, env(safe-area-inset-right, 0px)); }
  .testa { padding-top: max(18px, env(safe-area-inset-top, 0px)); }
  .marchio { gap: 11px; }
  .marchio img { width: 38px; height: 38px; }
  .marchio span, .etichetta { font-size: 10px; letter-spacing: 0.2em; }
  .teaser-apri { gap: 10px; }
  .tondo, .pausa { width: 42px; height: 42px; }
  .palco { min-height: 470px; }
  .presto { gap: 12px; }
  .presto::before, .presto::after { width: 20px; }
  .fondo { flex-direction: column; align-items: center; text-align: center; gap: 16px; padding-block: 20px 18px; }
  .dice { font-size: 14.5px; }
  .piede { justify-content: center; text-align: center; }
}
@media (max-width: 400px) {
  .etichetta { display: none; }
  .marchio span { font-size: 9.5px; letter-spacing: 0.18em; }
  .didascalia { gap: 10px; }
  .didascalia .prod { font-size: 13px; }
}
@media print { body::after { display: none; } }
