/* Shared landing-page primitives — loaded by all 3 variants */
@import url('colors_and_type.css');

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  scroll-behavior: smooth;
}

/* Sticky nav would otherwise sit on top of whatever an anchor lands on. */
html { scroll-padding-top: 96px; }

::selection { background: var(--orange-30); color: #fff; }

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 2px;
}

.skiplink {
  position: absolute; top: 8px; left: 8px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--orange); color: #fff;
  border-radius: 999px;
  font-size: 14px; font-weight: 600;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease-out);
}
.skiplink:focus-visible { transform: none; }

img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- Phone mockup ---------- */
/* Self-contained iPhone-shaped device bezel with a slot for content.
   Flexible: pass --phone-w to scale. */
.phone {
  --phone-w: 280px;
  width: var(--phone-w);
  aspect-ratio: 9 / 19.5;
  background: #0a0a0c;
  border-radius: calc(var(--phone-w) * 0.14);
  padding: calc(var(--phone-w) * 0.022);
  position: relative;
  box-shadow:
    0 0 0 1.5px #2a2d35,
    0 30px 60px rgba(0, 0, 0, 0.5),
    0 10px 30px rgba(255, 106, 0, 0.08);
  flex-shrink: 0;
}
.phone::before {
  /* notch / dynamic island */
  content: '';
  position: absolute;
  top: calc(var(--phone-w) * 0.035);
  left: 50%;
  transform: translateX(-50%);
  width: calc(var(--phone-w) * 0.3);
  height: calc(var(--phone-w) * 0.045);
  background: #000;
  border-radius: 999px;
  z-index: 10;
}
.phone__screen {
  width: 100%;
  height: 100%;
  border-radius: calc(var(--phone-w) * 0.12);
  overflow: hidden;
  background: var(--bg);
  position: relative;
}

/* ---------- Status bar (inside phone) ---------- */
.statusbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px 4px; font-size: 11px; font-weight: 700;
  color: #fff;
}
.statusbar__right { display: flex; gap: 4px; align-items: center; }
.statusbar__right svg { width: 14px; height: 14px; }

/* ---------- Store badges ---------- */
.storebadge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: #000;
  border: 1px solid #2a2d35;
  border-radius: 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  transition: transform 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}
.storebadge:hover { transform: translateY(-2px); border-color: var(--orange); }
.storebadge svg { width: 22px; height: 22px; }
.storebadge__sub { display: block; font-size: 10px; opacity: 0.7; font-weight: 400; line-height: 1; }
.storebadge__main { display: block; font-size: 15px; font-weight: 600; line-height: 1.1; margin-top: 2px; letter-spacing: -0.3px; }

/* Unreleased platform: keeps the badge for visual balance but is a <span>, not
   a link — nothing to click, and nothing that leads to a dead store listing. */
.storebadge--soon {
  opacity: 0.42;
  cursor: default;
  border-style: dashed;
}
.storebadge--soon:hover { transform: none; border-color: #2a2d35; }
.storebadge--soon .storebadge__sub {
  color: var(--orange);
  opacity: 1;
  font-weight: 700;
  letter-spacing: 1.2px;
}

/* ---------- Logo lockup ---------- */
.logomark {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 900; letter-spacing: -0.5px;
}
.logomark img { width: 32px; height: 32px; }

/* ---------- Utility ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Scroll choreography ----------
   Everything here is opt-in and gated behind the `.motion` class, which is set
   by an inline bootstrap only when JS runs and the reader hasn't asked for
   reduced motion. Without it the page renders complete and static. */

/* Reveal-on-scroll. Elements carry [data-reveal]; motion.js flips .is-revealed. */
.motion [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity 0.9s var(--ease-out) var(--reveal-delay, 0ms),
    transform 0.9s var(--ease-out) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.motion [data-reveal="fade"] { transform: none; }
.motion [data-reveal="left"]  { transform: translate3d(-32px, 0, 0); }
.motion [data-reveal="right"] { transform: translate3d(32px, 0, 0); }
.motion [data-reveal="scale"] { transform: scale(0.94); }

/* Headline treatment: the line is clipped and its inner text slides up into it,
   so type appears to rise off the baseline rather than fade in place. */
.motion [data-reveal="mask"] {
  opacity: 1;
  transform: none;
  display: block;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}
.motion [data-reveal="mask"] > * {
  display: block;
  transform: translate3d(0, 105%, 0);
  transition: transform 1s var(--ease-out) var(--reveal-delay, 0ms);
  will-change: transform;
}
.motion [data-reveal="mask"].is-revealed > * { transform: none; }

.motion [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* Parallax. motion.js writes --py; each element decides how to compose it so
   layout transforms already on the element (rotation, offset) survive. */
[data-parallax] { transform: translate3d(0, var(--py, 0px), 0); }

/* Hairline rule that draws itself out from the left as a section arrives. */
.rule {
  height: 1px;
  background: linear-gradient(90deg, var(--orange), transparent);
  transform-origin: left center;
  margin-bottom: 18px;
}
.motion .rule { transform: scaleX(0); transition: transform 1.1s var(--ease-out) var(--reveal-delay, 0ms); }
.motion .rule.is-revealed { transform: scaleX(1); }

/* ---------- Scroll progress ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 150;
  pointer-events: none;
  background: transparent;
}
.progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-tab), var(--gold));
  transform: scaleX(var(--progress, 0));
  transform-origin: left center;
}

/* ---------- Film grain ----------
   A fixed, non-interactive noise plate. Keeps the large flat dark fields and
   the gradient halos from banding, and reads as print stock. */
.grain {
  position: fixed; inset: -50%;
  z-index: 900;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.motion .grain { animation: grain-drift 700ms steps(2, end) infinite; }
@keyframes grain-drift {
  0%   { transform: translate3d(0, 0, 0); }
  50%  { transform: translate3d(-2%, 1.5%, 0); }
  100% { transform: translate3d(1.5%, -1%, 0); }
}

/* ---------- Pointer-tracked tilt ----------
   motion.js writes --rx/--ry on a container; children opt in. */
.tilt-scene { perspective: 1600px; perspective-origin: 50% 40%; }
.tilt-scene .phone {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.5s var(--ease-out);
  transform-style: preserve-3d;
}

/* Magnetic buttons — motion.js writes --mx/--my inside the hover radius. */
.magnetic { transform: translate3d(var(--mx, 0px), var(--my, 0px), 0); }
.storebadge.magnetic { transition: transform 0.35s var(--ease-out), border-color 0.15s var(--ease-out); }
.storebadge.magnetic:hover { transform: translate3d(var(--mx, 0px), calc(var(--my, 0px) - 2px), 0); }

/* ---------- Marquee ---------- */
.marquee {
  display: flex;
  overflow: hidden;
  user-select: none;
  gap: var(--marquee-gap, 40px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track {
  flex-shrink: 0;
  display: flex;
  gap: var(--marquee-gap, 40px);
  align-items: center;
  min-width: 100%;
  animation: marquee-run var(--marquee-speed, 40s) linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee-run {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(calc(-100% - var(--marquee-gap, 40px)), 0, 0); }
}

/* ---------- Reduced motion ----------
   `.motion` is never set in this case, so reveals stay visible. This mops up
   the handful of animations that don't depend on it. */
@media (prefers-reduced-motion: reduce) {
  html, body { scroll-behavior: auto; }
  .marquee__track { animation: none; }
  .grain { animation: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
