/* TRACE · the products, up close (js/room/viewer.js; the words in index.html, <dialog class="pv">).
   One piece on paper to turn and zoom, a few samples of it, the plain facts, the DM. Same
   tokens as landing.css: paper, ink, olive; orange only ever means a route (the loading dot is
   the room's). Nothing frosted over the picture (it redraws every frame: room.css). */

/* the page stays where it is while a piece is open. (The body must not become a scroll box of its
   own: with the root's overflow hidden, the body's overflow-x would no longer pass up to the
   window, and the room's sticky stage would fall back to the top of its section, off the screen) */
html.pv-open{overflow:hidden}
html.pv-open body{overflow:visible}
html.pv-wait,html.pv-wait *{cursor:progress !important}

.pv{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;
  background:transparent;color:var(--ink);overflow:hidden;overscroll-behavior:contain;touch-action:none;
  font-family:var(--sans);-webkit-tap-highlight-color:transparent}
@supports (height:100dvh){.pv{height:100dvh}}
.pv::backdrop{background:transparent}
.pv:focus{outline:none}
.pv button{font:inherit;color:inherit}

/* the paper comes up behind the piece as it lifts out of the room (and goes as it goes back) */
.pv-bg{position:absolute;inset:0;opacity:0;
  background:radial-gradient(70% 62% at var(--cx,50%) var(--cy,46%),#FAF8F2 0%,#F3EFE5 52%,#E8E3D6 100%);transition:opacity .45s var(--ease)}
.pv.is-in .pv-bg{opacity:1}
.pv.is-out .pv-bg{opacity:0;transition:opacity .5s var(--ease) .3s}
.pv.is-out.quick .pv-bg{transition:opacity .36s var(--ease) 0s}
/* the picture is as tall as the screen can get (lvh), as the room's is: the same frame as the
   room's, and never drawn again when a phone's browser bar comes and goes (the piece would jump);
   the dialog (dvh) only shows its top part when the bar is out */
.pv-canvas,.pv-snap{position:absolute;left:0;top:0;width:100%;height:100vh;height:100lvh;display:block}
.pv-canvas{outline:none;cursor:grab;transition:opacity .4s var(--ease)}
/* (a piece that fades in, not lifted out of the room, waits for the room to go first; one that
   dissolves out of the room's own, or into it, does so as it moves) */
.pv-canvas.late{transition-delay:.14s}
.pv-canvas.blend{transition:opacity .34s var(--ease-io)}
.pv-canvas:active{cursor:grabbing}
.pv-canvas:focus-visible{outline:2px solid var(--olive);outline-offset:-6px;border-radius:14px}
.pv-snap{pointer-events:none;opacity:0}
.pv-snap.fade{transition:opacity .42s var(--ease)}
.pv-load{position:absolute;left:var(--cx,50%);top:var(--cy,50%);width:12px;height:12px;margin:-6px;border-radius:50%;background:var(--route);
  opacity:0;pointer-events:none;transition:opacity .25s}
.pv-load.show{opacity:1;animation:pulse 1.4s var(--ease-io) infinite}

/* ------------------------------------------------------------ the bar: four products, and close */
.pv-top{position:absolute;left:0;right:0;top:0;z-index:2;display:flex;align-items:center;justify-content:center;
  height:calc(var(--head-h) + 8px);padding:max(8px,env(safe-area-inset-top)) calc(var(--head-pad-r) + 56px) 0 calc(var(--head-pad) + 56px)}
/* (a piece turned close can reach up under the bar: the paper thickens there, and the tabs and
   the close button sit on solid paper) */
.pv-top::before{content:"";position:absolute;inset:0 0 -26px;z-index:-1;pointer-events:none;
  background:linear-gradient(rgba(243,239,229,.94) 55%,rgba(243,239,229,0))}
.pv-tabs{position:relative;display:flex;gap:2px;padding:4px;border-radius:999px;background:#E8E4D9;max-width:100%;overflow-x:auto;scrollbar-width:none}
.pv-tabs::-webkit-scrollbar{display:none}
.pv-tabs button{position:relative;z-index:1;flex:none;height:38px;padding:0 18px;border:0;border-radius:999px;background:none;color:var(--ink-2);
  font-size:14.5px;white-space:nowrap;cursor:pointer;transition:color .3s}
.pv-tabs button:hover{color:var(--ink)}
.pv-tabs button[aria-selected="true"]{color:var(--ink)}
.pv-tabs button:focus-visible{outline-offset:-2px;border-radius:999px}
.pv-mark{position:absolute;z-index:0;left:0;top:4px;width:0;height:38px;border-radius:999px;background:#FCFAF5;
  box-shadow:0 1px 2px rgba(32,36,28,.14),0 0 0 1px rgba(32,36,28,.05);transition:transform .5s var(--ease),width .5s var(--ease)}
.pv-s{display:none}
.pv-close{position:absolute;top:max(8px,env(safe-area-inset-top));right:var(--head-pad-r);display:grid;place-items:center;width:46px;height:46px;margin-top:calc((var(--head-h) - 46px) / 2);
  border:0;border-radius:50%;background:#E8E4D9;cursor:pointer;transition:background-color .25s,transform .35s var(--ease)}
.pv-close svg{width:22px;height:22px;fill:none;stroke:var(--ink);stroke-width:1.6;stroke-linecap:round}
.pv-close:hover{background:#DDD8CC;transform:rotate(90deg)}

/* ------------------------------------------------------------ under the piece: the hint, the tools */
.pv-tools{position:absolute;z-index:2;left:0;width:calc(var(--cx,50%) * 2);bottom:16px;height:42px;pointer-events:none}
.pv-hint{position:absolute;left:50%;bottom:54px;display:flex;align-items:center;gap:8px;height:38px;margin:0;padding:0 15px 0 11px;border-radius:999px;
  background:rgba(32,36,28,.84);color:var(--cream);font-size:13px;white-space:nowrap;opacity:0;transform:translate(-50%,8px);
  transition:opacity .35s var(--ease),transform .5s var(--ease)}
.pv-hint.show{opacity:1;transform:translate(-50%,0)}
.pv-hint svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.pv-hint-dot{fill:currentColor;stroke:none}
@media (prefers-reduced-motion:no-preference){
  .pv-hint.show .pv-hint-dot{animation:pv-drag 2.2s var(--ease-io) infinite}
}
@keyframes pv-drag{0%,100%{transform:translateX(-3.5px)}50%{transform:translateX(3.5px)}}
.pv-acts{position:absolute;right:var(--gutter);bottom:0;display:flex;gap:8px;pointer-events:auto}
.pv-tool{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:42px;min-width:42px;padding:0 15px 0 12px;border-radius:999px;
  border:1px solid rgba(32,36,28,.14);background:rgba(250,248,242,.94);font-size:13.5px;cursor:pointer;
  transition:background-color .25s,border-color .25s,transform .3s var(--ease)}
.pv-tool svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.pv-tool:hover{border-color:rgba(32,36,28,.32);background:#fff}
.pv-tool:active{transform:scale(.96)}
.pv-tool[aria-pressed="true"]{border-color:var(--olive);color:var(--olive-2)}
.pv-reset{padding:0;width:42px}

/* ------------------------------------------------------------ the panel: the words, the samples */
.pv-panel{position:absolute;z-index:2;top:calc(var(--head-h) + 8px);bottom:20px;right:max(var(--gutter),env(safe-area-inset-right));width:min(400px,33vw);
  display:flex;flex-direction:column;justify-content:center;opacity:0;transform:translateX(28px);
  transition:opacity .4s var(--ease),transform .7s var(--ease);touch-action:pan-y}
/* (the panel comes once the piece has flown clear of where it stands) */
.pv.is-in .pv-panel{opacity:1;transform:none;transition-delay:.45s}
.pv.is-out .pv-panel{transition-duration:.25s;transition-delay:0s}
.pv .pv-top,.pv .pv-tools{opacity:0;transition:opacity .35s var(--ease)}
.pv.is-in .pv-top,.pv.is-in .pv-tools{opacity:1;transition-delay:.28s}
.pv.is-out .pv-top,.pv.is-out .pv-tools{transition-delay:0s;transition-duration:.2s}
/* (on its way back nothing in it answers a tap: the piece is already flying home) */
.pv.is-out *{pointer-events:none}
.pv-scroll{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:4px 4px 4px 0}
.pv-secs{display:grid}
.pv-sec{grid-area:1 / 1;min-width:0;opacity:0;visibility:hidden;transform:translateY(10px);
  transition:opacity .3s var(--ease),transform .5s var(--ease),visibility 0s linear .3s}
.pv-sec[data-on="true"]{opacity:1;visibility:visible;transform:none;transition-delay:.08s,.08s,0s}
.pv-kicker{font-size:12px;letter-spacing:.24em;text-transform:uppercase;color:var(--ink-3)}
.pv-sec h2{margin-top:12px;font-size:clamp(34px,3.1vw,46px);line-height:1.02;letter-spacing:-.02em}
.pv-line{margin-top:14px;font-size:16.5px;line-height:1.5;color:var(--ink-2);max-width:26em;text-wrap:pretty}
.pv-label{margin-top:24px;font-size:11px;letter-spacing:.22em;text-transform:uppercase;color:var(--ink-3)}
.pv-samples{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.pv-cap{margin-top:10px;font-size:13.5px;color:var(--ink-2);min-height:1.4em;font-variant-numeric:tabular-nums}
.pv-shown{margin-top:22px}
/* a block: its race and its place */
.pv-chip{display:grid;gap:1px;min-height:50px;padding:7px 16px 8px;border-radius:14px;border:1px solid rgba(32,36,28,.14);background:rgba(250,248,242,.6);
  text-align:left;cursor:pointer;transition:border-color .25s,background-color .25s,box-shadow .25s,transform .3s var(--ease)}
.pv-chip b{font-weight:400;font-size:14.5px;line-height:1.25;color:var(--ink)}
.pv-chip span{font-size:12.5px;line-height:1.25;color:var(--ink-3)}
.pv-chip:hover{border-color:rgba(32,36,28,.32)}
.pv-chip[aria-checked="true"]{border-color:var(--olive);background:#FCFAF5;box-shadow:inset 0 0 0 .5px var(--olive)}
/* a tile, a tag: the piece itself, small */
.pv-thumb{display:grid;place-items:center;width:66px;height:66px;padding:0;border:0;border-radius:16px;background:rgba(32,36,28,.045);cursor:pointer;
  box-shadow:inset 0 0 0 1px transparent;transition:background-color .25s,box-shadow .25s,transform .35s var(--ease)}
.pv-thumb img{width:58px;height:58px;display:block}
.pv-thumb canvas{width:58px;height:auto;display:block;border-radius:8px;box-shadow:0 2px 5px -2px rgba(20,22,18,.5)}
.pv-thumb:hover{background:rgba(32,36,28,.08);transform:translateY(-1px)}
.pv-thumb[aria-checked="true"]{background:#FCFAF5;box-shadow:inset 0 0 0 1.5px var(--olive)}
.pv-swatches{justify-content:flex-start;gap:6px;margin-top:10px}
.pv-swatches button{height:36px;padding:0 13px 0 7px;gap:8px;font-size:13.5px;-webkit-backdrop-filter:none;backdrop-filter:none}
.pv-swatches i{width:19px;height:19px}
.pv-specs{display:grid;grid-template-columns:auto 1fr;gap:10px 20px;margin:24px 0 0;padding-top:20px;border-top:1px solid var(--rule)}
.pv-specs div{display:contents}
.pv-specs dt{padding-top:3px;font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:var(--ink-3);white-space:nowrap}
.pv-specs dd{margin:0;font-size:14.5px;line-height:1.45;color:var(--ink)}
.pv-cta{display:grid;justify-items:start;gap:12px;margin-top:26px}
.pv-own{font-size:13.5px;color:var(--ink-3)}

/* a tablet on its side, a small laptop: the panel takes a little more of the width */
@media (min-width:901px) and (max-width:1180px){.pv-panel{width:38vw}}

/* ------------------------------------------------------------ phones: the panel is a sheet
   at the bottom, the piece above it; the sheet keeps one height for all four products (the
   tallest), so the piece never jumps when the tab changes */
@media (max-width:900px){
  .pv-top{justify-content:flex-start;height:calc(var(--head-h) + 6px);padding:max(6px,env(safe-area-inset-top)) calc(var(--head-pad-r) + 54px) 0 var(--head-pad)}
  .pv-tabs button{height:36px;padding:0 15px;font-size:14px}
  .pv-mark{height:36px}
  .pv-close{width:44px;height:44px;margin-top:calc((var(--head-h) - 44px) / 2)}
  .pv-panel{top:auto;left:0;right:0;bottom:0;width:auto;max-height:min(50%,440px);justify-content:flex-start;
    border-radius:24px 24px 0 0;background:#F7F4ED;box-shadow:0 -1px 0 rgba(32,36,28,.08),0 -20px 44px -28px rgba(32,36,28,.4);
    transform:translateY(36px)}
  /* (the sheet scrolls: its last lines fade into the button's band, so it reads as more below) */
  .pv-scroll{padding:18px 18px 22px;-webkit-mask-image:linear-gradient(#000 calc(100% - 26px),transparent);mask-image:linear-gradient(#000 calc(100% - 26px),transparent)}
  .pv-kicker{font-size:11px;letter-spacing:.22em}
  .pv-sec h2{margin-top:6px;font-size:25px}
  .pv-line{margin-top:6px;font-size:14.5px}
  .pv-label{display:none}
  .pv-samples{flex-wrap:nowrap;overflow-x:auto;margin:12px -18px 0;padding:2px 18px 4px;scroll-snap-type:x proximity;scrollbar-width:none;touch-action:pan-x pan-y}
  .pv-samples::-webkit-scrollbar{display:none}
  .pv-samples>*{flex:none;scroll-snap-align:start}
  .pv-thumb{width:60px;height:60px;border-radius:14px}
  .pv-thumb img{width:52px;height:52px}
  .pv-thumb canvas{width:52px}
  .pv-chip{min-height:46px;padding:6px 14px 7px}
  .pv-chip b{font-size:14px}
  .pv-cap{margin-top:8px;font-size:13px}
  .pv-shown{margin-top:12px}
  .pv-swatches{flex-wrap:nowrap;overflow-x:auto;margin:10px -18px 0;padding:0 18px 2px;scrollbar-width:none}
  .pv-swatches::-webkit-scrollbar{display:none}
  .pv-swatches button{flex:none}
  .pv-specs{gap:7px 16px;margin-top:14px;padding-top:12px}
  .pv-specs dt{font-size:10.5px}
  .pv-specs dd{font-size:13.5px}
  /* (a band of paper under the button: Safari on iOS 26 tints its bar from the page's lowest
     pixels, and took the button's olive) */
  .pv-cta{position:relative;grid-template-columns:1fr;justify-items:stretch;gap:0;margin:0;padding:10px 18px calc(22px + env(safe-area-inset-bottom));
    border-top:1px solid rgba(32,36,28,.08);background:#F7F4ED}
  .pv::after{content:"";position:fixed;left:0;right:0;bottom:0;height:3px;background:#F7F4ED;pointer-events:none}
  .pv-own{display:none}
  .pv-cta .btn-dm{justify-content:space-between;height:52px}
  .pv-tools{bottom:calc(var(--sheet,45%) + 8px)}
  .pv-acts{right:14px}
  .pv-hint{font-size:12.5px}
}
@media (max-width:600px){
  .pv-l{display:none}
  .pv-s{display:inline}
}
/* (a tablet held upright: the sheet is wide, the button need not be) */
@media (min-width:601px) and (max-width:900px){
  .pv-cta{justify-items:start}
  .pv-cta .btn-dm{min-width:320px}
}
/* a short phone (an SE with Safari's bar out): the sheet gives the piece more room */
@media (max-width:900px) and (max-height:700px){
  .pv-panel{max-height:min(46%,360px)}
  .pv-line{display:none}
}
/* a phone on its side: the sheet becomes a column on the right */
@media (max-width:900px) and (orientation:landscape) and (max-height:500px){
  .pv-panel{top:calc(var(--head-h) + 4px);left:auto;width:min(360px,46vw);max-height:none;border-radius:20px 0 0 0}
  .pv-tools{bottom:10px}
}

@media (prefers-reduced-motion:reduce){
  .pv *,.pv-bg,.pv-panel{transition-duration:.01s !important;transition-delay:0s !important}
}
