/* The Eagle XR 3D viewer (templates/_xr3d.html, static/js/xr3d.js): the /xr3d page, the landing's plate and sheet,
   the checkout's sheet, and the MPXR landing's "View in 3D" (static/mpxr/shop.css, which scopes the shop's tokens to
   its sheet). Loaded right after site.css (base.html), whose tokens it uses; its own rules are all .x3d* and .xrw*. */

/* Eagle XR in 3D (/xr3d, xr3d.html): the model turning on the concrete stage, the finish picker, Buy */
.x3d { padding-top: 40px; padding-bottom: 80px; }
.x3d__line { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.x3d__name { font-size: var(--fs-ui); font-weight: 600; }
.x3d__line .mono { font-size: 13px; color: var(--ink-2); }
.x3d__lead { margin-top: 12px; max-width: 52ch; font-size: var(--fs-lead); line-height: 1.5; color: var(--ink-2); }
.x3d__stage { position: relative; margin-top: 28px; }
/* the shared viewer (_xr3d.html): page, landing plate, checkout sheet */
.x3d-v { position: relative; }
.x3d__model { display: block; width: 100%; height: 100%; background: transparent; --poster-color: transparent; outline: none; }
.x3d-v--page .x3d__model { height: min(68vh, 640px); min-height: 340px; }
.x3d-v--plate { height: 100%; }
.x3d-v--sheet .x3d__model { height: min(56vh, 520px); min-height: 300px; }
.x3d__model:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.x3d__ar { position: absolute; right: 16px; top: 16px; background: var(--paper); }
.x3d__table { position: absolute; right: 16px; top: 64px; background: var(--paper); }
/* in the phone's own AR (Place on a table) model-viewer keeps its children on screen: "View on your wall" there would
   ask for the camera the AR session holds (it crashed on a Galaxy S24) */
.x3d__model[ar-status="session-started"] .x3d__ar, .x3d__model[ar-status="object-placed"] .x3d__ar { display: none; }
/* model-viewer's own AR button (bottom right) shows when ours leaves its slot (xr3d.js, the camera view): it would
   start the phone's AR and skip the camera view */
.x3d__model::part(default-ar-button) { display: none; }
.x3d__load { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.x3d__load span { display: block; height: 100%; width: 100%; background: var(--teal); transform-origin: left;
  animation: x3d-load 1.2s var(--ease) infinite; }
.x3d-v[data-ready] .x3d__load { display: none; }
.x3d__wait { display: none; position: absolute; left: 0; right: 0; top: 50%; margin: 0; transform: translateY(-50%);
  text-align: center; font-size: var(--fs-small); color: var(--ink-2); pointer-events: none; }
.x3d-v[data-mounted]:not([data-ready]) .x3d__wait { display: block; }
@keyframes x3d-load { from { transform: scaleX(0); } to { transform: scaleX(1); opacity: 0; } }
.x3d__note { margin: 10px 0 0; font-size: var(--fs-axis); color: var(--ink-2); }
/* the camera view (xrwall.js): full screen, the rear camera filling it and the XR drawn over it. It takes every touch
   (Close; a finger sliding across scans), none reaches the page under it */
.xrw { position: fixed; inset: 0; z-index: 2147483000; background: #000; touch-action: none; overscroll-behavior: contain;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  /* a popover over a 3D sheet (xr3d.js lift): none of the browser's popover box (centred, sized to fit, framed) */
  width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: hidden; color: #fff; }
.xrw[hidden] { display: none; }
.xrw__video, .xrw__xr { position: absolute; inset: 0; width: 100%; height: 100%; }
.xrw__video { object-fit: cover; }
.xrw__close { pointer-events: auto; position: absolute; right: 16px; top: max(16px, env(safe-area-inset-top)); z-index: 4;
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  background: rgba(20, 25, 29, .6); color: #fff; cursor: pointer; }
/* the start hint over the camera, the first few seconds (xrwall.js: is-hint) */
.x3d__arhint { display: flex; opacity: 0; visibility: hidden; transition: opacity 400ms linear, visibility 0s 400ms; position: absolute; left: 50%; top: 58%; transform: translateX(-50%); z-index: 3;
  width: min(320px, calc(100% - 40px)); align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 12px;
  background: rgba(20, 25, 29, .78); color: #fff; font: 400 15px/1.4 var(--font-sans); pointer-events: none;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.x3d__arhint b { font-weight: 600; }
.x3d__arhint-more { display: block; margin-top: 6px; font-size: 13px; color: rgba(255, 255, 255, .78); }
.xrw.is-hint .x3d__arhint { opacity: 1; visibility: visible; transition: opacity 200ms linear; }
.x3d__arhint-dot { flex: none; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(77, 219, 221, .6); animation: x3d-seek 1.4s ease-out infinite; }
@keyframes x3d-seek { to { box-shadow: 0 0 0 14px rgba(77, 219, 221, 0); } }
@media (prefers-reduced-motion: reduce) { .x3d__arhint-dot { animation: none; } }
/* the simulated live image along the bottom, marked as a simulation; the "move" prompt until it builds up (is-moved) */
.x3d__arscan { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; pointer-events: none;
  padding: 12px 0 max(14px, env(safe-area-inset-bottom)); background: rgba(13, 15, 16, .9); color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.x3d__arscan-tag { display: flex; align-items: center; gap: 8px; margin: 0 16px 10px; font: 600 12px/1.2 var(--font-mono);
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; color: #ffb547; }
.x3d__arscan-dot { width: 8px; height: 8px; border-radius: 50%; background: #ffb547; flex: none; }
.x3d__arscan-field { position: relative; height: 150px; }
.xrw__move { position: absolute; left: 50%; top: 50%; z-index: 4; margin: 0; transform: translate(-50%, -50%); white-space: nowrap;
  padding: 8px 14px; border-radius: 999px; background: rgba(20, 25, 29, .85); color: #fff; font: 600 14px/1.2 var(--font-sans); }
.xrw.is-moved .xrw__move { display: none; }
/* the upright image (up and down the wall) along the right edge, between Close and the image below (xrwall.js sets
   its bottom and turns the field in it) */
.xrw__vscan { position: absolute; right: 0; top: calc(max(16px, env(safe-area-inset-top)) + 60px); bottom: 240px; width: 92px; z-index: 3;
  overflow: hidden; border-radius: 10px 0 0 10px; background: rgba(13, 15, 16, .9); }
.xrw__vfield { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
@media (min-width: 700px) { .xrw__vscan { width: 132px; } }
.xrw__move-finger, .xrw.is-finger .xrw__move-dev { display: none; }
.xrw.is-finger .xrw__move-finger { display: inline; }
.x3d__arscan-note { margin: 10px 16px 0; font: 400 13px/1.4 var(--font-sans); color: rgba(255, 255, 255, .72); }
.x3d__views { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; gap: 8px; }
.x3d__turn { position: absolute; left: 16px; top: 16px; }
.x3d__view, .x3d__turn {
  flex: none; min-height: 40px; padding: 0 14px; box-shadow: 0 1px 2px rgba(31, 37, 42, .08); border: 1px solid var(--field); border-radius: var(--r-control); background: var(--paper);
  color: var(--ink-2); font: 600 var(--fs-small)/1 var(--font-sans); cursor: pointer; touch-action: manipulation;
  transition: color var(--t-press) linear, border-color var(--t-press) linear, background-color var(--t-press) linear;
}
.x3d__view:hover, .x3d__turn:hover { color: var(--ink); border-color: var(--ink); }
.x3d__view[aria-pressed="true"] { color: #fff; background: var(--ink); border-color: var(--ink); }
.x3d__view:focus-visible, .x3d__turn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.x3d__turn { display: inline-flex; align-items: center; gap: 8px; }
.x3d__turn-ico { width: 10px; height: 10px; flex: none;
  background: linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65%); }
.x3d__turn[aria-pressed="false"] .x3d__turn-ico { background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
/* the plate on the landing is smaller: compact controls */
.x3d-v--plate .x3d__views { left: 8px; right: 8px; bottom: 8px; gap: 6px; flex-wrap: wrap; }
.x3d-v--plate .x3d__turn { left: 8px; top: 8px; }
.x3d-v--plate .x3d__ar { right: 8px; top: 8px; }
.x3d-v--plate .x3d__table { right: 8px; top: 52px; }
.x3d-v--plate .x3d__view, .x3d-v--plate .x3d__turn { min-height: 32px; padding: 0 10px; font-size: 12px; }
/* the finishes beside a 3D viewer: four small pictures of the device, each over its name; the picked one lifts and
   carries a teal rule */
.x3d__pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 520px; margin-top: 16px; }
.x3d__opt { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 4px 0 8px; border: 0;
  border-bottom: 2px solid transparent; background: none; color: var(--ink-2); font: 600 13px/1.25 var(--font-sans);
  text-align: center; text-wrap: balance; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.x3d__th { display: block; width: 100%; max-width: 64px; }
.x3d__th img { display: block; width: 100%; height: auto; opacity: .78; transition: opacity var(--t-press) linear, transform 200ms var(--ease); }
.x3d__opt:hover { color: var(--ink); }
.x3d__opt:hover .x3d__th img { opacity: 1; }
.x3d__opt[aria-checked="true"] { color: var(--ink); border-bottom-color: var(--teal); }
.x3d__opt[aria-checked="true"] .x3d__th img { opacity: 1; transform: translateY(-2px); }
.x3d__opt:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .x3d__th img { transition: none; } }
.x3d__buy { margin-top: 28px; }
@media (max-width: 767px) {
  .x3d { padding-top: 24px; }
  .x3d__stage { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); }
  .x3d-v--page .x3d__model { height: 62vh; min-height: 300px; }
  .x3d-v--plate .x3d__views { flex-wrap: nowrap; }
  .x3d__views { left: 0; right: 0; padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; scroll-padding: 0 var(--gutter); }
  .x3d__views::-webkit-scrollbar { display: none; }
  .x3d__view, .x3d__turn { min-height: 38px; padding: 0 12px; font-size: 13px; }
  .x3d__turn { left: var(--gutter); }
  .x3d__note { padding: 0 0; }
  .x3d__buy .btn { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { .x3d__load span { animation: none; } }
