/* ══════════════════════════════════════════════════════════
   WRISTLA · Landing v2 (public login page only)
   ──────────────────────────────────────────────────────────
   Loaded from portal/login.html AFTER portal.css/wristla.css,
   so equal-specificity rules here win the cascade. Everything
   is additive: with JS off (or Motion missing) the page renders
   fully visible and static. Scroll-reveal pre-hiding is gated
   behind html.lp-js, added only by landing-motion.js once the
   Motion runtime is confirmed.
   ══════════════════════════════════════════════════════════ */

html:has(.lp-hero) { scroll-behavior: smooth; }

/* The global `html, body { height: 100% }` caps the body box at one
   viewport, which silently disables the topbar's position: sticky after
   the first screen. Landing visitors reach the auth triggers from deep
   scroll positions, so the nav must actually stick here. */
html:has(.lp-hero),
html:has(.lp-hero) body {
  height: auto;
}

/* ── 1 · Hero ─────────────────────────────────────────────── */

/* The photo moves to a dedicated layer (parallax target) so the
   section itself no longer needs background-attachment: fixed —
   which iOS disables and some compositors capture poorly. */
.lp-hero {
  background: var(--bg) !important;
  min-height: min(92svh, 1000px);
}

.lp-hero__bg {
  position: absolute;
  inset: -12% 0 -6% 0;
  z-index: 0;
  overflow: hidden;
  will-change: transform;
}

.lp-hero__bg i {
  position: absolute;
  inset: 0;
  background: url('/static/media/road-bg.jpg') center / cover no-repeat;
  transform: scale(1.06);
}

/* Cinematic settle on load + ultra-slow drift afterwards. */
.lp-js .lp-hero__bg i {
  animation:
    lp-kenburns 2.2s cubic-bezier(0.16, 1, 0.3, 1) both,
    lp-bg-drift 26s 2.2s ease-in-out infinite alternate;
}

@keyframes lp-kenburns {
  from { transform: scale(1.16); }
  to   { transform: scale(1.06); }
}

@keyframes lp-bg-drift {
  from { transform: scale(1.06) translateY(0); }
  to   { transform: scale(1.1) translateY(-1.5%); }
}

/* Readability veil replaces the section's old ::before overlay. */
.lp-hero::before { content: none !important; }

.lp-hero__veil {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    180deg,
    rgba(7, 9, 15, 0.78) 0%,
    rgba(7, 9, 15, 0.55) 35%,
    rgba(7, 9, 15, 0.55) 60%,
    rgba(7, 9, 15, 0.92) 100%
  );
}

/* Aurora accents — brand-tinted atmospheric glow drifting over
   the photo (kept above the veil, below content). */
.lp-hero__aurora {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  mix-blend-mode: screen;
}

.lp-hero__aurora i {
  position: absolute;
  width: 46vw;
  min-width: 380px;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.3;
  will-change: transform;
}

.lp-hero__aurora i:nth-child(1) {
  left: -12%;
  top: 8%;
  background: radial-gradient(circle, oklch(0.82 0.15 200 / 0.55), transparent 65%);
  animation: lp-aurora-a 19s ease-in-out infinite alternate;
}

.lp-hero__aurora i:nth-child(2) {
  right: -14%;
  top: 30%;
  background: radial-gradient(circle, oklch(0.70 0.18 275 / 0.5), transparent 65%);
  animation: lp-aurora-b 23s ease-in-out infinite alternate;
}

.lp-hero__aurora i:nth-child(3) {
  left: 28%;
  bottom: -34%;
  background: radial-gradient(circle, oklch(0.68 0.22 330 / 0.34), transparent 65%);
  animation: lp-aurora-c 27s ease-in-out infinite alternate;
}

@keyframes lp-aurora-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(9vw, 6vh, 0) scale(1.18); }
}

@keyframes lp-aurora-b {
  from { transform: translate3d(0, 0, 0) scale(1.12); }
  to   { transform: translate3d(-7vw, -5vh, 0) scale(0.94); }
}

@keyframes lp-aurora-c {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vw, -7vh, 0) scale(1.15); }
}

.lp-hero__content {
  padding-top: 96px;
  padding-bottom: 88px;
  max-width: 680px;
}

.lp-hero .auth-hero-fullscreen__headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  background: linear-gradient(115deg, #ffffff 55%, color-mix(in oklab, var(--accent) 55%, #ffffff) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Word-reveal slots created by landing-motion.js. All motion is plain
   CSS transitions triggered by the .lp-in class — compositor-driven,
   so it can never strand content half-hidden the way a stalled JS
   animation loop can. --wi is the word index set by JS. */
.lp-w {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.lp-w__in { display: inline-block; }

.lp-js .lp-hero:not(.lp-in) .lp-w__in { transform: translateY(115%); }

.lp-js .lp-w__in {
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(120ms + var(--wi, 0) * 55ms);
}

/* Hero items (lead, CTA row, stats, trust chip): staggered rise-in.
   --hi is the item index set by JS. */
.lp-js .lp-hero:not(.lp-in) .lp-hero__item {
  opacity: 0;
  transform: translateY(24px);
}

.lp-js .lp-hero__item {
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(420ms + var(--hi, 0) * 120ms);
}

.lp-hero .auth-hero-fullscreen__body {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* CTA row */
.lp-hero__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.lp-hero__cta .auth-trial-cta__btn {
  position: relative;
  overflow: hidden;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  border-radius: var(--radius-full);
  padding: 16px 38px;
}

/* Light sweep across the primary CTA every few seconds. */
.lp-hero__cta .auth-trial-cta__btn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-18deg);
  animation: lp-cta-sheen 4.6s ease-in-out infinite;
}

@keyframes lp-cta-sheen {
  0%, 64% { left: -60%; }
  86%, 100% { left: 130%; }
}

.lp-hero__cta .auth-trial-cta__btn:active { transform: translateY(0) scale(0.97); }

.lp-cta-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 15px 24px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.lp-cta-ghost:hover {
  border-color: var(--accent-dim);
  background: var(--accent-glow);
  color: #fff;
}

.lp-cta-ghost svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.lp-cta-ghost:hover svg { transform: translateY(2px); }

/* Trust signal → single glass chip with a shield icon. */
.lp-hero__trust {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 20px auto 0;
  padding: 9px 16px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 9, 15, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.82);
}

.lp-hero__trust svg {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--accent);
}

/* ── 2 · Marquee (compatibility strip) ────────────────────── */

.lp-marquee {
  overflow: hidden;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  padding: 15px 0;
  -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.lp-marquee__track {
  display: flex;
  align-items: center;
  gap: 44px;
  width: max-content;
  animation: lp-marquee 30s linear infinite;
}

.lp-marquee:hover .lp-marquee__track { animation-play-state: paused; }

.lp-marquee__track span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}

.lp-marquee__track svg {
  width: 10px;
  height: 10px;
  flex: none;
  color: var(--accent-dim);
}

@keyframes lp-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── 3 · Section rhythm ───────────────────────────────────── */

.auth-stack { gap: 0; }

.auth-promo { padding: 92px 0 !important; }

/* Numbered kicker above each section title. */
.lp-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.lp-kicker__num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-dim);
  background: var(--accent-glow);
}

.lp-kicker::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-dim), transparent 70%);
  opacity: 0.5;
}

/* Section titles: mono micro-caps → display type. */
.auth-promo__inner .h2,
.auth-plans-section .h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.12;
  text-transform: none;
}

.auth-promo__inner .auth-promo__section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
}

/* Stronger glass on the content cards: several section photos are
   bright, and the old 45%-opaque veil let them wash out the copy. */
.auth-promo__inner {
  border-radius: var(--radius-xl);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  background: rgba(7, 9, 15, 0.68);
  backdrop-filter: blur(26px) saturate(1.15);
  -webkit-backdrop-filter: blur(26px) saturate(1.15);
}

/* ── 4 · Scroll reveals (JS adds .lp-in, CSS does the motion) ── */

.lp-js [data-lp-reveal] {
  transition:
    opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.lp-js [data-lp-reveal]:not(.lp-in) {
  opacity: 0;
  transform: translateY(28px);
}

.lp-js [data-lp-stagger] > * {
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.lp-js [data-lp-stagger]:not(.lp-in) > * {
  opacity: 0;
  transform: translateY(16px);
}

.lp-js [data-lp-stagger].lp-in > :nth-child(2) { transition-delay: 0.06s; }
.lp-js [data-lp-stagger].lp-in > :nth-child(3) { transition-delay: 0.12s; }
.lp-js [data-lp-stagger].lp-in > :nth-child(4) { transition-delay: 0.18s; }
.lp-js [data-lp-stagger].lp-in > :nth-child(5) { transition-delay: 0.24s; }
.lp-js [data-lp-stagger].lp-in > :nth-child(6) { transition-delay: 0.3s; }
.lp-js [data-lp-stagger].lp-in > :nth-child(7) { transition-delay: 0.36s; }
.lp-js [data-lp-stagger].lp-in > :nth-child(n + 8) { transition-delay: 0.42s; }

/* Hero parallax without JS: scroll-driven animations where supported,
   static hero elsewhere. */
@supports (animation-timeline: view()) {
  .lp-hero__bg {
    animation: lp-parallax linear both;
    animation-timeline: view();
    animation-range: exit;
  }

  .lp-hero__content {
    animation: lp-content-out linear both;
    animation-timeline: view();
    animation-range: exit 0% exit 75%;
  }
}

@keyframes lp-parallax {
  to { transform: translateY(130px); }
}

@keyframes lp-content-out {
  to { opacity: 0.08; transform: translateY(-48px); }
}

/* ── 5 · Sticky trial bar ─────────────────────────────────── */

.lp-sticky {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translate(-50%, 150%);
  z-index: 110;
  width: max-content;
  max-width: calc(100vw - 24px);
  visibility: hidden;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s 0.45s;
}

.lp-sticky.lp-in {
  transform: translate(-50%, 0);
  visibility: visible;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s 0s;
}

.lp-sticky__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 10px 9px 20px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 30px var(--accent-glow);
}

.lp-sticky__note {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}

.lp-sticky__btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--bg);
  background: var(--accent);
  padding: 11px 24px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 18px var(--accent-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  white-space: nowrap;
}

.lp-sticky__btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 26px var(--accent-dim);
  transform: translateY(-1px);
}

.lp-sticky__btn:active { transform: scale(0.97); }

@media (max-width: 520px) {
  .lp-sticky__note { display: none; }
  .lp-sticky__inner { padding: 8px; }
}

/* ── 6 · Pricing ──────────────────────────────────────────── */

.auth-plans__plan {
  position: relative;
  padding: 22px 22px 20px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.auth-plans__plan:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg);
}

.auth-plans__price {
  font-family: var(--font-display);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Featured plan: slowly rotating gradient ring. Falls back to a
   static gradient border where @property is unsupported. */
@property --lp-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.auth-plans__plan--accent { border-color: transparent; }

.auth-plans__plan--accent::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--lp-angle, 0deg),
    oklch(0.82 0.15 200),
    oklch(0.70 0.18 275),
    oklch(0.68 0.22 330),
    oklch(0.70 0.18 275),
    oklch(0.82 0.15 200)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: lp-ring 7s linear infinite;
  pointer-events: none;
}

@keyframes lp-ring {
  to { --lp-angle: 360deg; }
}

.auth-plans__plan:hover .auth-plans__price { text-shadow: 0 0 22px var(--accent-glow); }

/* Keep map canvases dark while (or if) tiles aren't in yet — leaflet's
   default pane is light, which reads as a hole in the dark layout.
   L.map() attaches .leaflet-container to the host element itself, so
   match both the host and any nested container. */
.auth-promo--family .fp-map,
.auth-promo--family .fp-map.leaflet-container,
.auth-promo--family .fp-bg-map,
.auth-promo--family .fp-bg-map.leaflet-container,
.auth-promo--family .leaflet-container {
  background: #0a0e13 !important;
}

/* ── 7 · Micro-interactions ───────────────────────────────── */

.auth-promo__extra,
.auth-promo__factor {
  transition: transform 0.2s ease;
}

.auth-promo__extra:hover { transform: translateY(-2px); }

/* ── 8 · Reduced motion & small screens ───────────────────── */

@media (prefers-reduced-motion: reduce) {
  html:has(.lp-hero) { scroll-behavior: auto; }

  .lp-js .lp-hero__bg i,
  .lp-hero__bg,
  .lp-hero__content,
  .lp-hero__aurora i,
  .lp-marquee__track,
  .lp-hero__cta .auth-trial-cta__btn::after,
  .auth-plans__plan--accent::before {
    animation: none !important;
  }

  .lp-js .lp-w__in,
  .lp-js .lp-hero__item,
  .lp-js [data-lp-reveal],
  .lp-js [data-lp-stagger] > * {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 600px) {
  .lp-hero__content {
    padding-top: 56px;
    padding-bottom: 64px;
  }

  .lp-hero .auth-hero-fullscreen__headline { font-size: 32px; }

  .lp-hero__cta { gap: 10px; }

  .lp-hero__cta .auth-trial-cta__btn,
  .lp-cta-ghost {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .auth-promo { padding: 56px 0 !important; }

  .lp-marquee__track { gap: 28px; }
}
