/* /pos/mobile/ — Tuppence Roam, the till on a Stripe Reader S710 with the Snap Printer. Two WebGL
   stages (assets/js/mobile.js): .mob-film (pinned, scroll-driven: the till, the printer clicking on,
   a receipt, a roll change) and .mob-viewer (drag, zoom, print, lid, finish). html.mob-gl once WebGL
   runs; html.mob-no-gl falls back to the posters and plain text. Same stage pattern as /pos/ridge/. */

.mob {
  --mob-night: #05070d;
  --mob-glow: rgba(59, 91, 255, 0.3);
  --mob-accent: #9fb4ff;
}

/* ---------------------------------------------------------------- the film */
.mob-film {
  position: relative;
  height: 620vh;
  background: var(--mob-night);
  color: var(--text-inverse);
}
.mob-film__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(
      48% 62% at 68% 52%,
      var(--mob-glow) 0%,
      rgba(59, 91, 255, 0.08) 45%,
      rgba(59, 91, 255, 0) 70%
    ), radial-gradient(120% 90% at 50% 120%, #10162b 0%, var(--mob-night) 60%);
}
.mob-film__canvas,
.mob-film__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.mob-film__poster,
.mob-viewer__poster {
  object-fit: cover;
  transition: opacity 0.9s ease;
}
.mob-film__canvas,
.mob-viewer__canvas {
  opacity: 0;
  transition: opacity 1.1s ease;
}
.is-ready > .mob-film__sticky > .mob-film__canvas,
.mob-viewer.is-ready > .mob-viewer__canvas {
  opacity: 1;
}
.is-ready > .mob-film__sticky > .mob-film__poster,
.mob-viewer.is-ready > .mob-viewer__poster {
  opacity: 0;
  pointer-events: none;
}
.mob-film__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 7, 13, 0.8) 0%, rgba(5, 7, 13, 0.4) 34%, rgba(5, 7, 13, 0) 56%),
    linear-gradient(0deg, rgba(5, 7, 13, 0.55) 0%, rgba(5, 7, 13, 0) 22%);
}
.mob-film__caps {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.mob-cap {
  position: absolute;
  top: 50%;
  left: max(24px, calc((100vw - var(--container, 1200px)) / 2 + 24px));
  max-width: 30rem;
  transform: translateY(calc(-50% + 18px));
  opacity: 0;
  transition:
    opacity 0.6s ease,
    transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
}
.mob-cap.is-on,
html:not(.mob-gl) .mob-cap--intro {
  opacity: 1;
  transform: translateY(-50%);
  pointer-events: auto;
}
.mob-cap .h2 {
  color: #fff;
  margin: 8px 0 12px;
}
.mob-cap p {
  color: rgba(255, 255, 255, 0.76);
  font-size: 1.0625rem;
  line-height: 1.6;
  margin: 0;
}
.mob-cap .lead {
  color: rgba(255, 255, 255, 0.82);
  margin: 16px 0 28px;
}
.mob-cap__num {
  display: inline-block;
  font: 600 0.8125rem / 1 var(--font-sans);
  letter-spacing: 0.14em;
  color: var(--mob-accent);
}
.mob-title {
  color: #fff;
  margin-top: 14px;
  letter-spacing: -0.035em;
}
.mob-eyebrow {
  color: var(--mob-accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mob-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(159, 180, 255, 0.45);
  color: #dfe6ff;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}
.mob-film__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
}
.mob-film__progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue-400, #6f86ff), var(--mint-400));
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.mob-film__hint {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.6);
  font: 500 0.8125rem / 1 var(--font-sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 0.4s;
}
.mob-film.is-scrolled .mob-film__hint {
  opacity: 0;
}

@supports (height: 100svh) {
  .mob-film__sticky {
    height: 100svh;
  }
}

/* ---------------------------------------------------------------- facts */
.mob-facts .card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mob-fact__value {
  font: 800 2.25rem / 1 var(--font-display);
  letter-spacing: -0.03em;
  color: var(--ink-900);
}
.mob-fact__value--mark {
  display: inline-flex;
  align-items: flex-end;
}
.mob-fact__value--mark img {
  height: 36px;
  width: auto;
}
.mob-fact__value small {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0;
  margin-left: 6px;
  color: var(--ink-500);
}

/* ---------------------------------------------------------------- the viewer */
.mob-viewer {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 28px;
  overflow: hidden;
  background: radial-gradient(70% 80% at 50% 40%, #ffffff 0%, #eef1f7 55%, #e3e7f1 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 30px 60px -30px rgba(11, 16, 32, 0.35);
}
.mob-viewer__canvas,
.mob-viewer__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.mob-viewer__canvas {
  touch-action: pan-y;
  cursor: grab;
}
.mob-viewer__canvas:active {
  cursor: grabbing;
}
.mob-viewer__controls {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.mob-viewer__controls > * {
  pointer-events: auto;
}
.mob-seg {
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px -10px rgba(11, 16, 32, 0.35);
  gap: 2px;
}
.mob-seg button {
  border-color: transparent;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.mob-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(11, 16, 32, 0.18) inset;
}
.mob-swatch--chalk {
  background: #ebe9e4;
}
.mob-swatch--graphite {
  background: #2b2e34;
}
.mob-viewer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.mob-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--ink-200);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-800);
  cursor: pointer;
}
.mob-icon-btn:hover {
  background: #fff;
}
.mob-viewer__readout {
  position: absolute;
  top: 18px;
  left: 22px;
  margin: 0;
  font: 600 0.8125rem / 1.3 var(--font-sans);
  color: var(--ink-600);
  letter-spacing: 0.01em;
  pointer-events: none;
}

/* ---------------------------------------------------------------- the roll */
.mob-steps {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mob-steps .step p {
  color: var(--ink-600);
}

/* ---------------------------------------------------------------- specs */
.mob-table th {
  width: 190px;
  text-align: left;
  white-space: nowrap;
  color: var(--ink-900);
}

/* ---------------------------------------------------------------- no WebGL, or before it starts */
html.mob-no-gl .mob-film {
  height: auto;
}
html.mob-no-gl .mob-film__sticky {
  position: relative;
  min-height: 640px;
}
html.mob-no-gl .mob-cap:not(.mob-cap--intro),
html.mob-no-gl .mob-film__hint,
html.mob-no-gl .mob-film__progress,
html.mob-no-gl .mob-viewer__controls {
  display: none;
}
html.mob-no-gl .mob-cap--intro {
  opacity: 1;
  transform: translateY(-50%);
}

/* ---------------------------------------------------------------- phones */
@media (max-width: 759px) {
  .mob-film {
    height: 560vh;
  }
  .mob-film__sticky {
    background:
      radial-gradient(70% 45% at 50% 34%, var(--mob-glow) 0%, rgba(59, 91, 255, 0) 70%),
      radial-gradient(120% 90% at 50% 120%, #10162b 0%, var(--mob-night) 60%);
  }
  .mob-film__scrim {
    background: linear-gradient(
      0deg,
      rgba(5, 7, 13, 0.94) 0%,
      rgba(5, 7, 13, 0.72) 32%,
      rgba(5, 7, 13, 0) 58%
    );
  }
  .mob-cap {
    top: auto;
    bottom: 48px;
    left: 20px;
    right: 20px;
    max-width: none;
    transform: translateY(18px);
  }
  .mob-cap.is-on,
  html:not(.mob-gl) .mob-cap--intro,
  html.mob-no-gl .mob-cap--intro {
    transform: none;
  }
  .mob-cap .h2 {
    font-size: 1.75rem;
  }
  .mob-cap p {
    font-size: 1rem;
  }
  .mob-cap .lead {
    margin: 12px 0 20px;
  }
  .mob-title {
    font-size: 3rem;
  }
  .mob-film__hint {
    display: none;
  }
  /* the 3D view on top, the controls in the flow below it */
  .mob-viewer {
    aspect-ratio: auto;
    padding-top: min(118vw, 470px);
    border-radius: 22px;
  }
  .mob-viewer__canvas,
  .mob-viewer__poster {
    bottom: auto;
    height: min(118vw, 470px);
  }
  .mob-viewer__controls {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    padding: 4px 12px 14px;
    gap: 8px;
    justify-content: flex-start;
  }
  .mob-seg button {
    padding: 6px 11px;
  }
  .mob-viewer__readout {
    top: 14px;
    left: 16px;
  }
  .mob-table th {
    width: auto;
    white-space: normal;
  }
}

html.mob-snap .mob-cap,
html.mob-snap .mob-film__canvas,
html.mob-snap .mob-viewer__canvas,
html.mob-snap .mob-film__poster {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .mob-cap,
  .mob-film__canvas,
  .mob-viewer__canvas {
    transition-duration: 0.01s;
  }
}

/* The header over the dark film: site.css turns a dark page's header white once you scroll; over the
   film it stays dark and translucent instead (mobile.js sets html.mob-dark-head while it's over it). */
html.mob-dark-head body[data-header="dark"] .site-header.is-scrolled:not(.is-open) {
  background: rgba(7, 10, 22, 0.66);
  color: var(--text-inverse);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
html.mob-dark-head body[data-header="dark"] .site-header.is-scrolled:not(.is-open) .logo-dark {
  display: none !important;
}
html.mob-dark-head body[data-header="dark"] .site-header.is-scrolled:not(.is-open) .logo-light {
  display: block !important;
}
html.mob-dark-head
  body[data-header="dark"]
  .site-header.is-scrolled:not(.is-open)
  .main-nav__trigger,
html.mob-dark-head
  body[data-header="dark"]
  .site-header.is-scrolled:not(.is-open)
  .site-header__login {
  color: rgba(255, 255, 255, 0.9);
}
html.mob-dark-head body[data-header="dark"] .site-header.is-scrolled:not(.is-open) .btn--primary {
  background: var(--surface-card);
  color: var(--ink-900);
}
