body { background:var(--cream) var(--paper-face) 0 0 / 500px 500px; }
#paper.outer-paper { margin:0; box-shadow:none; }
body:not(.home) .wordmark { border:0; }
body.home {
  --edge:clamp(9px,1.12vw,22px);
  --tooth:clamp(3px,.35vw,6px);
  --sheet-gutter:clamp(17px,3.3vw,52px);
  --binding:#234a37;
}
.home #paper { width:100%; margin:0; padding:0; }
.salone-sheet { position:relative; }
.salone-intro { --screen-height:100vh; position:relative; z-index:2; }
@supports (height:100dvh) { .salone-intro { --screen-height:100dvh; } }

/* The binding of the current menu starts below the opening spread. */
.home #paper::before,.home #paper::after {
  content:""; position:absolute; inset-block:0; left:0; width:var(--edge); z-index:1;
  pointer-events:none;
  background:
    linear-gradient(#a29c77,#a29c77) 2px 0 / 1px 100% no-repeat,
    linear-gradient(var(--binding),var(--binding)) left / calc(100% - var(--tooth) + .3px) 100% no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 12'%3E%3Cpath d='M0 0 6 6 0 12Z' fill='%23234a37'/%3E%3C/svg%3E") right top / var(--tooth) calc(2 * var(--tooth)) repeat-y;
}
.home #paper::after { left:auto; right:0; transform:scaleX(-1); }

.salone-stage {
  --frame:1;
  position:relative; isolation:isolate;
  background:#dcd7cb url(assets/wallpaper.webp) 50% 0 / 1000px 1000px fixed;
}
.salone-cover { position:relative; display:flow-root; }
.tavolo-paper { opacity:var(--frame); }
.salone-stage[data-view="table"] .tavolo-paper { visibility:hidden; }
.tavolo-paper .tavolo-frame { padding-bottom:0; }
.tavolo-window.original-cover { display:flex; flex-direction:column; aspect-ratio:auto; }
.tavolo-photo-slot { position:relative; width:100%; aspect-ratio:3/2; flex:1 0 auto; }
.tavolo-window figcaption { pointer-events:none; }
.spirale-band[data-paused] .belt { animation-play-state:paused; }
.spirale-pause { position:absolute; inset:0; width:100%; appearance:none; background:transparent; border:0; border-radius:0; padding:0; }
.spirale-pause:focus-visible { outline:2px solid var(--green-dark); outline-offset:-4px; }
.salone-cover-photo {
  position:absolute; inset:0; overflow:hidden; isolation:isolate; container:tableau / size; background:#10180f;
}
.tavolo-photo-slot > .salone-cover-photo { height:var(--cover-height,100%); }
.salone-cover > .salone-cover-photo {
  z-index:4;
  inset:calc(var(--slot-top) * var(--frame)) calc(var(--slot-right) * var(--frame))
        calc(var(--slot-bottom) * var(--frame)) calc(var(--slot-left) * var(--frame));
}
@media (max-width:680px) {
  .salone-stage { background-attachment:scroll; background-size:720px; }
  .tavolo-window figcaption { flex:none; }
}
/* On a short landscape display keep the table visible underneath the masthead. */
@media (orientation:landscape) and (max-height:540px) {
  .tavolo-paper { margin-block-start:10px; padding-top:26px; }
  .tavolo-paper .nameplate { height:clamp(32px,7.7vh,45px); }
  .tavolo-paper .wordmark { height:39px; width:155px; }
  .tavolo-paper .wordmark b { font-size:23px; }
  .tavolo-paper .wordmark i { font-size:13px; }
  .tavolo-paper .nameplate-doodle { width:60px; height:40px; }
  .tavolo-paper .ticker { padding:6px 0; }
  .tavolo-paper .ticker::before { top:5px; }
  .home .tavolo-paper .runner-word { font-size:min(17vw,24vh); margin-right:-.98em; }
  .tavolo-paper .mast-caption { margin-block:3px 5px; font-size:13px; line-height:19px; }
}
/* One continuous photographic backplate under every scroll frame. On narrow
   windows anchor the edge props at the table edges and keep the dish central. */
.salone-cover-photo {
  --room-w:max(100cqw,min(234cqw,128cqh));
  --setting-w:max(100cqw,min(110cqw,145cqh));
  --room-gap:calc(100cqh - var(--room-w) * .666666667);
  --setting-gap:calc(100cqh - var(--setting-w) * .666666667);
  --crop-bias:calc(.86 - .37 * var(--frame,0));
  --room-y:calc(min(0px,var(--room-gap)) * var(--crop-bias));
  --setting-y:calc(min(0px,var(--setting-gap)) * var(--crop-bias) + max(0px,var(--setting-gap)) * .65);
}
html.motion-off .salone-cover-photo { --crop-bias:.86; }
@media (min-width:681px) {
  .salone-ready.motion-off .tavolo-photo-slot { aspect-ratio:auto; height:var(--still-photo-height,58vh); }
}
.scene-plane {
  position:absolute; pointer-events:none; width:var(--setting-w); aspect-ratio:3/2;
  top:var(--setting-y); left:calc((100cqw - var(--setting-w)) * .5);
}
.room-plane { z-index:0; top:var(--room-y); left:calc((100cqw - var(--room-w)) * .36); width:var(--room-w); }
.setting-room { display:block; width:100%; height:auto; max-width:none; }
.food-plane { z-index:1; }
.wine-plane,.olives-plane { left:0; z-index:2; }
.cutlery-plane { left:calc((100cqw - var(--setting-w)) * .72); z-index:2; }
.olives-plane { z-index:3; }
.setting-flake .drop { background-image:url(assets/tavola/garnish.webp); background-repeat:no-repeat; opacity:var(--in-flight,0); }
.setting-flake .table-shadow { background-image:url(assets/tavola/garnish-landed.webp); background-repeat:no-repeat; }
.setting-final { opacity:0; visibility:hidden; position:absolute; z-index:4; top:var(--room-y); left:0; width:100%; height:auto; max-width:none; pointer-events:none; }
@container tableau (min-aspect-ratio:3/2) {
  .salone-stage[data-complete][data-herbs="settled"] .setting-final { visibility:visible; opacity:1; transition:opacity .12s; }
}
html:not(.setting-start):not(.salone-ready) .setting-final { visibility:visible; opacity:1; inset:0; width:100%; height:100%; object-fit:cover; }
.setting-room,.setting-item { user-select:none; -webkit-user-drag:none; }
.setting-item { position:absolute; }
.setting-item .drop,.setting-item .table-shadow { display:block; position:absolute; inset:0; width:100%; height:100%; max-width:none; }
.setting-item .drop { transform:translate3d(var(--drift,0px),var(--lift,0px),0) rotate(var(--roll,0deg)); }
.setting-flake .drop {
  transform:translate3d(var(--drift,0px),var(--lift,0px),0) rotate(var(--roll,0deg))
    scale(var(--flake-size,1)) scaleX(var(--flake-turn,1));
  transform-origin:center;
  filter:brightness(var(--flake-light,1));
}
.table-shadow { opacity:var(--contact,1); }
.setting-start:not(.salone-ready):not(.motion-off) .setting-item,.setting-item[data-away] { visibility:hidden; }

.spirale-scroll {
  position:absolute; z-index:5; bottom:max(4px,env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%);
  display:flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; padding-inline:10px;
  appearance:none; border:0; background:transparent; cursor:pointer;
  color:#fff6e5; font:500 14px/1.3 var(--copy); text-shadow:0 1px 4px #321b12;
}
.spirale-scroll i { font:normal 1.22em/1 Georgia,serif; }
.spirale-scroll:focus-visible { outline:2px solid #173c2a; outline-offset:-2px; }
.spirale-scroll[hidden] { display:none; }

@supports (position:sticky) {
  .salone-ready:not(.motion-off) .salone-intro { height:calc(var(--screen-height) + var(--travel,0px)); }
  .salone-ready:not(.motion-off) .salone-stage,
  .salone-ready .salone-stage[data-view="table"] { height:var(--screen-height); overflow:hidden; }
  .salone-ready:not(.motion-off) .salone-stage { position:sticky; top:0; }
  .salone-ready .salone-cover { min-height:var(--screen-height); }
  .salone-ready:not(.motion-off) .salone-cover,
  .salone-ready .salone-stage[data-view="table"] .salone-cover { height:100%; }
  .salone-ready .tavolo-paper {
    display:flex; flex-direction:column;
    min-height:calc(var(--screen-height) - var(--outer)); padding-bottom:0;
  }
  .salone-ready .tavolo-frame { flex:1 0 auto; display:flex; flex-direction:column; }
  .salone-ready .tavolo-frame > .nameplate,.salone-ready .tavolo-frame > .mast { flex:none; }
  .salone-ready .tavolo-window { flex:1 0 auto; }
}
@supports (overflow:clip) {
  /* An arrow click or keyboard focus must never vertically scroll the
     sticky photo inside its own frame. Only the page controls the scene. */
  .salone-ready:not(.motion-off) .salone-stage,
  .salone-ready .salone-stage[data-view="table"] { overflow:clip; }
}
html:not(.salone-ready):not(.setting-start) .spirale-band .belt { animation:none; }
.motion-off .spirale-pause,html:not(.salone-ready):not(.setting-start) .spirale-pause { display:none; }
@media (prefers-reduced-motion:reduce) {
  .spirale-pause { display:none; }
  .setting-start .setting-item { visibility:visible; }
}
.salone-folio {
  position:relative; display:flow-root; max-width:76rem; margin-inline:auto;
  padding:clamp(16px,2.2vw,36px) max(var(--sheet-gutter),calc(var(--edge) + 16px)) clamp(42px,5vw,94px);
}
.home .colophon {
  width:min(calc(100% - 2 * max(var(--sheet-gutter),calc(var(--edge) + 16px))), calc(76rem - 2 * var(--sheet-gutter)));
  margin:0 auto; border-width:1px 0 0;
}
.home .booking-columns { margin-bottom:0; }

.reserve-phone { display:block; }
.phone-art { position:relative;display:block;width:80%;margin:2.6vw auto 1.3vw;aspect-ratio:1; }
.phone-art img { display:block;width:100%;height:auto; }
.phone-receiver { position:absolute;inset:0;transform-origin:53% 20%; }
.phone-receiver.is-ringing { animation:telephone-ring .86s linear 1; }
@keyframes telephone-ring {
  0%,39%,52%,100% {transform:none}
  4%,16% {transform:translateX(-1.0%) rotate(-.62deg)}
  10%,22% {transform:translateX(1.0%) rotate(.62deg)}
  28% {transform:translateX(-.65%) rotate(-.35deg)}
  34% {transform:translateX(.44%) rotate(.22deg)}
  57%,68% {transform:translateX(-.77%) rotate(-.46deg)}
  62%,73% {transform:translateX(.77%) rotate(.46deg)}
  78% {transform:translateX(-.41%) rotate(-.24deg)}
  84% {transform:translateX(.29%) rotate(.18deg)}
  91% {transform:translateX(-.12%)}
}
@media (max-width:680px) {
  .phone-art { width:min(76%,295px);margin:38px auto 24px; }
}
