/* Studio Spunto · pagina Ristoranti (2026-11-10)
   1. La comanda: una scena fissa che avanza con lo scroll. Il tavolo ordina, la comanda esce in cucina, vola in cassa.
   2. Il conto delle commissioni: un calcolatore a forma di scontrino, che continua la carta uscita dalla cassa.
   Senza JavaScript, o con "riduci movimento", la scena non c'è: restano i tre passi in fila e il calcolatore.
   Movimento: solo transform, opacity e clip-path. */

/* ================================================================ 1 · la comanda */
.rs-story { --rs-ink: #efe8dc; --rs-dim: rgba(239, 232, 220, .64); --rs-gold: #d9b877; --rs-paper: #fbfaf6;
  --pw: min(380px, 84vw); --px: 74%; --x1: 15%; --x2: 44%; --x3: var(--px);
  position: relative; background: #181715; color: var(--rs-ink); }
.rs-stage { position: relative; padding: clamp(70px, 10vh, 120px) var(--h5-gutter); }
.rs-k { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--rs-gold); }
.rs-h { margin-top: 12px; font-family: var(--serif); font-weight: 400; font-size: clamp(2.1rem, 3.7vw, 3.7rem); line-height: 1.02; letter-spacing: -.02em; color: var(--rs-ink); text-wrap: balance; }
.rs-h .serif { font-style: italic; color: var(--rs-gold); -webkit-text-fill-color: var(--rs-gold); }
.rs-beats { list-style: none; margin: 44px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; }
.rs-beats b { font-size: 13px; font-weight: 600; letter-spacing: .14em; color: var(--rs-gold); font-variant-numeric: tabular-nums; }
.rs-beats h3 { margin-top: 10px; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(1.6rem, 2.5vw, 2.5rem); line-height: 1.08; letter-spacing: -.01em; color: var(--rs-ink); text-wrap: balance; }
.rs-beats p { margin-top: 12px; max-width: 40ch; font-size: 16px; line-height: 1.55; color: var(--rs-dim); }
.rs-clock, .rs-scene, .rs-note { display: none; }

/* --- con il movimento: scena fissa, lunga quattro schermi */
html.rs-live .rs-story { height: 430vh; }
html.rs-live .rs-stage { position: sticky; top: 0; height: 100vh; height: 100svh; padding: 0; overflow: hidden; }
html.rs-live .rs-clock { display: block; position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); margin: 0; font-family: var(--serif); font-size: clamp(190px, 38vw, 560px); line-height: 1; letter-spacing: -.04em; color: rgba(239, 232, 220, .045); white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none; user-select: none; }
html.rs-live .rs-clock i { font-style: normal; padding: 0 .02em; }
html.rs-live .rs-head { position: absolute; z-index: 3; left: var(--h5-gutter); top: calc(var(--nav-h) + 3.2vh); }
html.rs-live .rs-note { display: block; position: absolute; z-index: 3; right: var(--h5-gutter); top: calc(var(--nav-h) + 3.6vh); margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: rgba(239, 232, 220, .4); }
html.rs-live .rs-beats { position: absolute; z-index: 3; left: var(--h5-gutter); bottom: 5vh; width: min(460px, 42vw); margin: 0; display: block; }
html.rs-live .rs-beats li { position: absolute; left: 0; bottom: 0; width: 100%; opacity: 0; transform: translate3d(0, 18px, 0); transition: opacity .5s var(--h5-ease), transform .7s var(--h5-ease); }
html.rs-live .rs-story[data-beat="1"] .rs-beats li[data-b="1"],
html.rs-live .rs-story[data-beat="2"] .rs-beats li[data-b="2"],
html.rs-live .rs-story[data-beat="3"] .rs-beats li[data-b="3"] { opacity: 1; transform: none; transition-delay: .12s; }

html.rs-live .rs-scene { display: block; position: absolute; inset: 0; perspective: 1500px; }
.rs-track { position: absolute; inset: 0; will-change: transform; }
.rs-wire { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rs-wire path { fill: none; stroke: var(--rs-gold); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 5px rgba(217, 184, 119, .9)); }
.rs-wire .rs-w2 { stroke-width: 1.2; opacity: .55; transition: opacity .6s; }
.rs-story.landed .rs-wire .rs-w2 { opacity: 0; }

/* il telefono del tavolo 4 */
.rs-phone { --ph: min(50vh, 430px); position: absolute; left: var(--x1); top: 27vh; height: var(--ph); width: calc(var(--ph) * .5); padding: calc(var(--ph) * .018); border-radius: calc(var(--ph) * .085);
  background: linear-gradient(150deg, #3a3632, #100f0e 62%); box-shadow: 0 40px 70px -30px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(255, 255, 255, .07);
  transform: translateX(-50%) rotateY(16deg) rotateZ(-2.5deg); font-size: calc(var(--ph) / 31); transition: filter .6s, opacity .6s; }
.rs-scr { height: 100%; border-radius: calc(var(--ph) * .068); overflow: hidden; background: #f6f2ec; color: #1b1a17; display: flex; flex-direction: column; font-family: var(--font); }
.rs-app { margin: 0; display: flex; justify-content: space-between; align-items: baseline; padding: 1.5em 1.2em .9em; border-bottom: 1px solid rgba(27, 26, 23, .08); }
.rs-app b { font-size: 1.2em; font-weight: 650; }
.rs-app span { font-size: .9em; color: #57534c; }
.rs-items { list-style: none; margin: 0; padding: .4em 1.2em; flex: 1; }
.rs-items li { display: flex; align-items: baseline; gap: .7em; padding: .78em 0; border-bottom: 1px solid rgba(27, 26, 23, .06); opacity: 0; transform: translate3d(0, .6em, 0); transition: opacity .45s var(--h5-ease), transform .55s var(--h5-ease); }
.rs-items li b { flex: none; width: 1.7em; height: 1.7em; display: grid; place-items: center; border-radius: 50%; background: #1b1a17; color: #f6f2ec; font-size: .86em; font-weight: 650; }
.rs-items li span { flex: 1; font-weight: 600; }
.rs-items li em { font-style: normal; color: #57534c; font-variant-numeric: tabular-nums; }
.rs-story[data-beat] .rs-items li { opacity: 1; transform: none; }
.rs-story[data-beat] .rs-items li:nth-child(2) { transition-delay: .12s; }
.rs-story[data-beat] .rs-items li:nth-child(3) { transition-delay: .24s; }
.rs-sum { margin: 0; display: flex; justify-content: space-between; padding: .9em 1.2em .3em; color: #57534c; }
.rs-sum b { color: #1b1a17; font-variant-numeric: tabular-nums; }
.rs-send { position: relative; margin: .7em 1.2em 1.4em; height: 3.3em; border-radius: 1em; background: #1b1a17; color: #f6f2ec; font-weight: 600; overflow: hidden; transition: background .4s, transform .25s var(--h5-ease); }
.rs-send span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .45em; transition: opacity .35s, transform .45s var(--h5-ease); }
.rs-send .b { opacity: 0; transform: translate3d(0, 60%, 0); }
.rs-send .i { width: 1.15em; height: 1.15em; }
.rs-story.sent .rs-send { background: #8c6a2c; animation: rs-tap .5s var(--h5-ease); }
.rs-story.sent .rs-send .a { opacity: 0; transform: translate3d(0, -60%, 0); }
.rs-story.sent .rs-send .b { opacity: 1; transform: none; }
@keyframes rs-tap { 30% { transform: scale(.94); } }

/* la stampante in cucina */
.rs-printer { position: absolute; left: var(--x2); top: 63vh; width: min(25vh, 204px); height: min(11.5vh, 92px); transform: translateX(-50%); border-radius: 16px 16px 20px 20px;
  background: linear-gradient(170deg, #3d3934, #141312 72%); box-shadow: 0 30px 50px -22px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .09); z-index: 2; }
.rs-slot { position: absolute; left: 9%; right: 9%; top: 9px; height: 6px; border-radius: 4px; background: #050505; }
.rs-led { position: absolute; right: 18px; bottom: 18px; width: 8px; height: 8px; border-radius: 50%; background: #5b5650; transition: background .3s, box-shadow .3s; }
.rs-story.printing .rs-led { background: #7fd08a; box-shadow: 0 0 10px #7fd08a; animation: rs-blink .32s steps(2) infinite; }
@keyframes rs-blink { 50% { opacity: .35; } }
.rs-lb { position: absolute; left: 18px; bottom: 14px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(226, 219, 210, .6); }

/* la comanda: esce dalla fessura (clip-path) e poi vola in cassa (le variabili le muove ristoranti.js) */
.rs-ticket { position: absolute; left: var(--x2); top: calc(63vh + 11px); width: min(18.5vh, 152px); padding: 13px 12px 15px; background: var(--rs-paper); opacity: 0; z-index: 1;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .6); will-change: transform, clip-path;
  transform: translate(-50%, -100%) translate3d(var(--tx, 0px), var(--ty, 0px), 0) rotateZ(var(--rz, 0deg)) rotateX(var(--rx, 0deg)) scale(var(--sc, 1));
  clip-path: inset(-12px -60px var(--clip, 0%) -60px); }
.rs-ticket::before { content: ""; position: absolute; left: 0; right: 0; top: -6px; height: 6px; background: linear-gradient(135deg, transparent 4px, var(--rs-paper) 0) 0 0 / 8px 6px repeat-x, linear-gradient(225deg, transparent 4px, var(--rs-paper) 0) 0 0 / 8px 6px repeat-x; transform: scaleY(-1); }
.rs-ticket pre { margin: 0; font: 600 min(1.28vh, 10.5px)/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #2a2724; white-space: pre; overflow: hidden; }
.rs-ticket.fly { z-index: 4; }

/* il tablet in cassa */
.rs-till { position: absolute; left: var(--x3); top: 20vh; width: calc(var(--pw) + 44px); padding: 9px; transform: translateX(-50%); border-radius: 24px; z-index: 3;
  background: linear-gradient(160deg, #3a3632, #100f0e 66%); box-shadow: 0 40px 70px -30px rgba(0, 0, 0, .85), inset 0 0 0 1px rgba(255, 255, 255, .07); font-size: min(1.9vh, 14.5px); }
.rs-tscr { border-radius: 16px; overflow: hidden; background: #f6f2ec; color: #1b1a17; font-family: var(--font); }
.rs-orders { list-style: none; margin: 0; padding: .3em 1.2em; }
.rs-orders li { display: flex; justify-content: space-between; padding: .72em 0; border-bottom: 1px solid rgba(27, 26, 23, .07); font-weight: 600; }
.rs-orders em { font-style: normal; font-variant-numeric: tabular-nums; color: #57534c; }
.rs-orders .rs-new { margin: 0 -1.2em; padding-left: 1.2em; padding-right: 1.2em; background: rgba(201, 163, 90, .2); border-bottom-color: transparent; opacity: 0; transform: translate3d(0, -.7em, 0); transition: opacity .5s var(--h5-ease), transform .6s var(--h5-ease); }
.rs-story.landed .rs-orders .rs-new { opacity: 1; transform: none; }
.rs-cash { margin: 0; display: flex; justify-content: space-between; align-items: baseline; padding: .9em 1.2em .2em; color: #57534c; }
.rs-cash b { font-family: var(--serif); font-weight: 400; font-size: 2em; color: #1b1a17; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.rs-zero { margin: 0; display: flex; justify-content: space-between; padding: .2em 1.2em 1.1em; font-size: .92em; color: #57534c; }
.rs-zero b { color: #64491a; }
.rs-story.landed .rs-till { animation: rs-land .55s var(--h5-ease); }
@keyframes rs-land { 35% { transform: translateX(-50%) translate3d(0, 5px, 0) scale(.992); } }

/* la carta che esce dalla cassa e scende nella sezione dopo: stessa larghezza e stessa posizione dello scontrino del calcolatore */
.rs-strip { position: absolute; left: var(--x3); top: var(--strip-top, 60vh); width: var(--pw); height: calc(var(--strip, 0) * var(--strip-h, 40vh)); transform: translateX(-50%); z-index: 2; overflow: hidden;
  background: repeating-linear-gradient(to bottom, transparent 0 43px, rgba(42, 39, 36, .1) 43px 44px), var(--rs-paper); box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .7); }

/* il resto della scena resta in penombra: la luce segue la comanda */
html.rs-live .rs-phone, html.rs-live .rs-printer, html.rs-live .rs-till { transition: filter .7s, opacity .7s; filter: brightness(.5) saturate(.7); }
html.rs-live .rs-story[data-beat="1"] .rs-phone, html.rs-live .rs-story[data-beat="2"] .rs-printer, html.rs-live .rs-story[data-beat="3"] .rs-till { filter: none; }

/* ================================================================ 2 · il conto delle commissioni */
.rs-calc { --pw: min(380px, 84vw); --px: 74%; position: relative; padding-bottom: clamp(80px, 11vh, 140px); background: var(--bg); }
.rs-calc-g { display: grid; grid-template-columns: calc(var(--px) - var(--pw) / 2) var(--pw) minmax(0, 1fr); align-items: start; }
.rs-paper { position: relative; grid-column: 2; grid-row: 1; padding: 38px 26px 30px; background: #fbfaf6; color: #2a2724;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; box-shadow: 0 34px 60px -34px rgba(var(--h5-shadow), .6), 0 2px 12px rgba(var(--h5-shadow), .12); }
.rs-paper::after { content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 9px; background: linear-gradient(135deg, #fbfaf6 6px, transparent 0) 0 0 / 12px 9px repeat-x, linear-gradient(225deg, #fbfaf6 6px, transparent 0) 0 0 / 12px 9px repeat-x; }
.rp-brand { margin: 0; text-align: center; font-size: 11.5px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: #6b665e; }
.rp-t { margin: 14px 0 0; text-align: center; font-family: var(--serif); font-weight: 400; font-size: clamp(1.9rem, 2.6vw, 2.3rem); line-height: 1.04; letter-spacing: -.015em; color: #1b1a17; text-wrap: balance; }
.rp-sub { margin: 12px 0 0; text-align: center; font-family: var(--font); font-size: 13.5px; line-height: 1.45; color: #57534c; }
.rp-rows { margin-top: 22px; padding-top: 6px; border-top: 1.5px dashed rgba(42, 39, 36, .34); }
.rp-row { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 12px; padding: 14px 0 6px; }
.rp-l { font-size: 12px; line-height: 1.35; letter-spacing: .02em; text-transform: uppercase; color: #57534c; }
.rp-v { font-size: 16px; font-weight: 700; color: #1b1a17; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-row input { grid-column: 1 / -1; -webkit-appearance: none; appearance: none; width: 100%; height: 34px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.rp-row input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, #8c6a2c calc(var(--f, .5) * 100%), #ddd6ca 0); }
.rp-row input::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, #8c6a2c calc(var(--f, .5) * 100%), #ddd6ca 0); }
.rp-row input::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -10px; border-radius: 50%; border: 0; background: #1b1a17; box-shadow: 0 0 0 4px #fbfaf6, 0 0 0 5.5px #8c6a2c, 0 6px 12px rgba(var(--h5-shadow), .35); transition: transform .2s var(--h5-ease); }
.rp-row input::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; border: 0; background: #1b1a17; box-shadow: 0 0 0 4px #fbfaf6, 0 0 0 5.5px #8c6a2c, 0 6px 12px rgba(var(--h5-shadow), .35); }
.rp-row input:active::-webkit-slider-thumb { transform: scale(1.12); }
.rp-row input:focus-visible { outline: 2px solid #8c6a2c; outline-offset: 2px; border-radius: 8px; }
.rp-sum { margin: 14px 0 0; padding-top: 12px; border-top: 1.5px dashed rgba(42, 39, 36, .34); }
.rp-sum div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 5px 0; }
.rp-sum dt { font-size: 12px; line-height: 1.35; letter-spacing: .02em; text-transform: uppercase; color: #57534c; }
.rp-sum dd { margin: 0; font-size: 14.5px; font-weight: 700; color: #1b1a17; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-tot { margin: 14px 0 0; padding-top: 16px; border-top: 4px double rgba(42, 39, 36, .6); display: grid; gap: 4px; text-align: center; }
.rp-tot span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #57534c; }
.rp-tot b { font-family: var(--serif); font-weight: 400; font-size: clamp(3rem, 4.4vw, 3.7rem); line-height: 1; letter-spacing: -.02em; color: #1b1a17; font-variant-numeric: tabular-nums; }
.rp-tot.neg b { color: #6b665e; }
.rp-next { margin: 8px 0 0; min-height: 1.4em; text-align: center; font-family: var(--font); font-size: 13.5px; line-height: 1.4; color: #57534c; }
.rp-cta { display: flex; width: 100%; margin-top: 20px; justify-content: center; gap: 10px; font-family: var(--font); }
.rp-cta .i { width: 19px; height: 19px; }
.rp-foot { margin: 14px 0 0; font-family: var(--font); font-size: 12px; line-height: 1.45; color: #6b665e; text-align: center; }
.rp-code { display: block; width: 62%; height: 34px; margin: 20px auto 0; opacity: .8; background: repeating-linear-gradient(90deg, #2a2724 0 2px, transparent 2px 4px, #2a2724 4px 5px, transparent 5px 9px, #2a2724 9px 12px, transparent 12px 14px); }

/* il testo accanto resta fermo mentre lo scontrino scorre */
.rs-calc-copy { grid-column: 1; grid-row: 1; position: sticky; top: calc(var(--nav-h) + 30px); width: min(100%, 660px); justify-self: center; text-align: left; padding: clamp(60px, 11vh, 120px) 0 0; }
.rs-calc-h { font-family: var(--serif); font-weight: 400; font-size: clamp(1.9rem, 2.6vw, 2.7rem); line-height: 1.1; letter-spacing: -.02em; }
.rs-h1 { display: block; }
.rs-calc-h .serif { display: block; margin-top: .1em; }
.rs-h2 { display: block; }
@media (min-width: 1200px) { .rs-h1 { white-space: nowrap; } }
@media (max-width: 860px) { .rs-h2 { display: inline; } }
.rs-calc-h .serif { font-style: italic; color: var(--gold-ink); -webkit-text-fill-color: var(--gold-ink); }
.rs-calc-copy > p { margin: 20px 0 0; max-width: none; font-size: 17px; line-height: 1.6; color: var(--text-2); }
.rs-calc-f { list-style: none; margin: 28px 0 0; padding: 18px 0 0; display: grid; gap: 12px; border-top: 1px solid var(--h5-line); }
.rp-lost { margin-top: 18px; }
.rp-ask { margin-top: 22px; padding-top: 18px; border-top: 1.5px dashed rgba(42, 39, 36, .34); }
.rp-q { margin: 0; text-align: center; font-family: var(--serif); font-size: 1.35rem; line-height: 1.15; color: #1b1a17; text-wrap: balance; }
.rp-qs { margin: 8px 0 0; text-align: center; font-family: var(--font); font-size: 13px; line-height: 1.4; color: #57534c; }
.rs-calc-f li { display: flex; gap: 12px; align-items: flex-start; font-size: 15.5px; line-height: 1.45; font-weight: 600; color: var(--text); }
.rs-calc-f .i { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--gold-ink); }

/* ================================================================ telefono: la scena diventa una carrellata (sala, cucina, cassa) */
@media (max-width: 860px) {
  .rs-story, .rs-calc { --pw: min(340px, 84vw); --px: 50%; }
  .rs-story { --x1: 16.6667%; --x2: 50%; --x3: 83.3333%; }
  .rs-beats { grid-template-columns: 1fr; gap: 30px; }
  html.rs-live .rs-story { height: 400svh; }
  html.rs-live .rs-head { top: calc(var(--nav-h) + 6px); right: var(--h5-gutter); }
  .rs-h { font-size: clamp(1.75rem, 7.4vw, 2.3rem); margin-top: 8px; }
  html.rs-live .rs-note { top: auto; bottom: 12px; right: auto; left: var(--h5-gutter); font-size: 11px; }
  html.rs-live .rs-note { transition: opacity .4s; }
  html.rs-live .rs-story.landed .rs-note { opacity: 0; }
  html.rs-live .rs-beats { top: calc(var(--nav-h) + 96px); bottom: auto; right: var(--h5-gutter); width: auto; }
  html.rs-live .rs-beats li { bottom: auto; top: 0; }
  .rs-beats h3 { margin-top: 6px; font-size: 1.6rem; }
  .rs-beats p { margin-top: 8px; font-size: 15px; line-height: 1.45; }
  html.rs-live .rs-clock { top: 62%; font-size: 52vw; }
  .rs-track { width: 300%; transform: translate3d(calc(var(--cam, 0) * -33.3333%), 0, 0); }
  .rs-phone { --ph: min(45svh, 390px); top: 41svh; transform: translateX(-50%) rotateY(10deg) rotateZ(-2deg); }
  .rs-printer { top: 74svh; }
  .rs-ticket { top: calc(74svh + 11px); }
  .rs-till { top: 43svh; width: calc(var(--pw) + 26px); }
  html.rs-live .rs-phone, html.rs-live .rs-printer, html.rs-live .rs-till { filter: none; }
  .rs-paper { padding: 34px 22px 28px; }
  .rs-calc-g { display: block; }
  .rs-paper { width: var(--pw); margin: 0 auto; }
  .rs-calc-copy { position: static; width: auto; justify-self: auto; max-width: none; padding: 0 var(--h5-gutter); margin-top: 64px; }
}
@media (max-height: 640px) and (min-width: 861px) {
  html.rs-live .rs-beats p { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rs-items li, .rs-orders .rs-new { opacity: 1; transform: none; }
}
