/* Slicer Ninja — shared base + motion primitives.
   Colour, type and layout belong to each page; only mechanics live here. */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.38;                 /* tight, per brief: 1.3–1.45 */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, video, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.02; text-wrap: balance; font-weight: 700; }
p { text-wrap: pretty; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Small UI text — 13–14px per brief */
.ui { font-size: 13.5px; letter-spacing: .01em; }

/* ------------------------------------------------------------------ pill --
   Every button on every page is a pill. Colour is set per page. */
.pill {
  display: inline-flex; align-items: center; gap: .55em;
  padding: .92em 1.6em;
  border: 0; border-radius: 999px;
  font-size: 15px; font-weight: 650; letter-spacing: -.01em;
  cursor: pointer; white-space: nowrap;
  transition: transform .22s cubic-bezier(.22,1,.36,1), box-shadow .22s ease, background .22s ease, opacity .22s ease;
}
.pill:hover { transform: translateY(-2px); }
.pill:active { transform: translateY(0); }
.pill--ghost { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.pill .arrow { transition: transform .22s cubic-bezier(.22,1,.36,1); }
.pill:hover .arrow { transform: translateX(3px); }

/* Small pill used as an eyebrow / badge */
.chip {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .42em .9em;
  border-radius: 999px;
  font-size: 13px; font-weight: 550; letter-spacing: .01em;
}

/* ---------------------------------------------------------------- reveal --
   Opt in with data-reveal; direction via data-reveal="up|left|right|scale". */
[data-reveal] {
  opacity: 0;
  transform: translate3d(var(--rv-x, 0), var(--rv-y, 26px), 0) scale(var(--rv-s, 1));
  transition:
    opacity .72s cubic-bezier(.22,.61,.36,1) calc(var(--i, 0) * 70ms),
    transform .82s cubic-bezier(.22,.61,.36,1) calc(var(--i, 0) * 70ms),
    filter .82s ease calc(var(--i, 0) * 70ms);
  filter: blur(var(--rv-b, 6px));
  will-change: opacity, transform;
}
[data-reveal="left"]  { --rv-x: -40px; --rv-y: 0; }
[data-reveal="right"] { --rv-x:  40px; --rv-y: 0; }
[data-reveal="scale"] { --rv-y: 0; --rv-s: .92; }
/* Wipe reveal. This deliberately uses mask-size rather than clip-path: clip-path collapses
   the element's own intersection rect to zero, so the IntersectionObserver that is supposed
   to un-clip it never fires and the element stays invisible forever. A mask is a paint-time
   operation, so the geometry the observer sees is untouched. */
[data-reveal="clip"] {
  --rv-y: 0; --rv-b: 0px;
  -webkit-mask-image: linear-gradient(#000 0 0); mask-image: linear-gradient(#000 0 0);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 0 0; mask-position: 0 0;
  -webkit-mask-size: 100% 0%; mask-size: 100% 0%;
  transition: -webkit-mask-size 1s cubic-bezier(.22,.61,.36,1), mask-size 1s cubic-bezier(.22,.61,.36,1), opacity .45s ease;
}
[data-reveal="clip"].is-in { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }

[data-reveal].is-in {
  opacity: 1; filter: blur(0);
  transform: translate3d(0, 0, 0) scale(1);
}

/* --------------------------------------------------------------- marquee --
   Duplicate the track's children in markup; this scrolls one full copy. */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; width: max-content; animation: marquee var(--speed, 42s) linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee--rev .marquee__track { animation-direction: reverse; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }

/* --------------------------------------------------------------- compare --
   Before/after wipe. .a is revealed on the left of the handle, .b underneath. */
.compare { --x: 50%; position: relative; overflow: hidden; touch-action: pan-y; cursor: ew-resize; user-select: none; }
.compare > img { width: 100%; height: 100%; object-fit: cover; }
.compare > .a { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.compare__grip {
  position: absolute; top: 0; bottom: 0; left: var(--x);
  width: 2px; margin-left: -1px; background: #fff;
  box-shadow: 0 0 22px rgb(255 255 255 / .55);
}
.compare__grip::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 42px; height: 42px; margin: -21px 0 0 -21px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 6px 26px rgb(0 0 0 / .5);
}
.compare__tag {
  position: absolute; bottom: 16px; z-index: 2;
  padding: .4em .85em; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: rgb(0 0 0 / .62); backdrop-filter: blur(10px); color: #fff;
}

/* ------------------------------------------------------------------ deck --
   Scroll-jacked full-viewport slides (Tripo mechanic). */
.deck { position: relative; height: 100vh; height: 100dvh; overflow: hidden; }
.deck__slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transform: translate3d(0, 7%, 0) scale(.98);
  transition: opacity .78s cubic-bezier(.22,.61,.36,1), transform .78s cubic-bezier(.22,.61,.36,1), visibility 0s .78s;
}
.deck__slide.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s, 0s, 0s; z-index: 2; }
.deck__slide.was-active { transform: translate3d(0, -7%, 0) scale(.98); }
.deck__rail { position: fixed; right: 26px; top: 50%; translate: 0 -50%; z-index: 40; display: flex; flex-direction: column; gap: 11px; }
/* Fixed 26px box so the active dot grows by transform, not by height — no layout thrash
   and the rail never reflows as slides change. */
.deck-dot {
  width: 8px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.deck-dot::before {
  content: ''; width: 8px; height: 26px; border-radius: 999px;
  background: currentColor; opacity: .28;
  transform: scaleY(.31);
  transition: opacity .3s ease, transform .35s cubic-bezier(.22,1,.36,1);
}
.deck-dot.is-on::before { opacity: 1; transform: scaleY(1); }

/* The "keep scrolling" cue */
.cue { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; letter-spacing: .07em; text-transform: uppercase; opacity: .8; }
.cue svg { animation: cue-bob 1.7s ease-in-out infinite; }
@keyframes cue-bob { 0%, 100% { transform: translateY(0); opacity: .55 } 50% { transform: translateY(5px); opacity: 1 } }

/* ------------------------------------------------------------- utilities */
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
/* Subject cut-outs carry real alpha (converted from their black-field renders), so they
   sit on any background. This just gives them weight on a dark page. */
.knockout { filter: drop-shadow(0 24px 60px rgb(0 0 0 / .55)); }

.float { animation: float var(--dur, 6s) ease-in-out infinite; animation-delay: var(--delay, 0s); }
@keyframes float { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(var(--lift, -14px)) } }

.spin-slow { animation: spin 34s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; clip-path: none !important; }
}
