/* Additive visual layer. Remove this file + enhance.js to roll back. */

:root {
  --ease-signature: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ========== Section 5 ========== */

/* Step 6 — button press (safest, ship first) */
.btn:active,
.play-badge-link:active,
.lane:active,
.nav-cta:active {
  transform: scale(0.97);
  transition: transform 0.1s ease;
}

/* Step 2 — glass cards */
.glass-card {
  background: rgba(20, 20, 31, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Step 1 — scroll reveal (js-reveal, not .reveal: that class already animates the hero) */
.js-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--dur-expressive) var(--ease-out-expo),
    transform var(--dur-expressive) var(--ease-out-expo);
}

.js-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Step 5 — short content fade-in only. No click delay. Downloads stay instant. */
@media (prefers-reduced-motion: no-preference) {
  .page-main {
    animation: enhance-in 160ms ease both;
  }
}

@keyframes enhance-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Step 3 — hero mesh, behind content */
.mesh-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.mesh-bg::before,
.mesh-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.mesh-bg::before {
  width: min(56vw, 520px);
  height: min(56vw, 520px);
  left: -12%;
  top: -28%;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.16), transparent 70%);
  animation: mesh-drift 28s ease-in-out infinite;
}

.mesh-bg::after {
  width: min(42vw, 380px);
  height: min(42vw, 380px);
  right: -8%;
  top: 8%;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.1), transparent 72%);
  animation: mesh-drift 24s ease-in-out infinite reverse;
}

@keyframes mesh-drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(36px, 18px); }
}

/* Step 4 — gold rounded-square frame on app icons */
.icon-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-sizing: content-box;
  line-height: 0;
}

.icon-frame .app-icon,
.icon-frame .app-icon-img,
.icon-frame .app-card-icon,
.icon-frame .app-hero-icon,
.icon-frame .pos-icon {
  margin-bottom: 0;
}

.card > .icon-frame {
  margin-bottom: 18px;
}

.hero-mock .icon-frame,
.store-icon-grid .icon-frame {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.hero-mock img,
.hero-mock .icon-frame img,
.store-icon-grid .icon-frame img {
  width: 100%;
  height: auto;
  aspect-ratio: unset;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  background: transparent;
}

.store-card-top .app-icon-link,
.store-card-top .icon-frame {
  flex: 0 0 77px;
  width: 77px;
  height: 77px;
}

.store-card-top .icon-frame {
  padding: 0;
  border: 0;
  border-radius: 0;
}

.store-card-top img {
  width: 77px;
  height: 77px;
  max-width: none;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
}

.store-actions .unsigned-link,
.card-foot .unsigned-link {
  flex-basis: 100%;
}

.unsigned-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.unsigned-link:hover {
  color: var(--gold);
}

.store-soon-note {
  margin-top: 18px;
}

.app-meta-list {
  margin: 0;
  padding-left: 1.15em;
  color: var(--muted);
}

.app-meta-list li + li {
  margin-top: 6px;
}

.app-change {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
}

.app-change:last-child {
  margin-bottom: 0;
}

.app-change dt {
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
}

.app-change dd {
  margin: 0;
  color: var(--muted);
}

/* ========== Phase 2 ========== */

/* Step 1 — cursor glow (created in JS, pointer:fine only) */
.cursor-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  left: 0;
  top: 0;
  margin-left: -250px;
  margin-top: -250px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
  opacity: 0.06;
  filter: blur(60px);
  pointer-events: none;
  z-index: 2;
  will-change: transform;
}

/* Step 2 — tilt cards (homepage .card; store cards already tilt in main.js) */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.15s ease, box-shadow 0.3s ease;
  will-change: transform;
}

/* Step 6 — download morph. Visual only. Never blocks the file. */
a[data-dl-app].is-downloaded {
  animation: dl-pop 200ms ease;
}

@keyframes dl-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Step 5 — equal shelf cards. Phone = 1 col, tablet+ = 2 col. */
.page-store #free-apps .shelf-grid,
.page-store #windows .bento-grid {
  align-items: stretch;
}

.page-store #free-apps .app-card,
.page-store #windows .app-card {
  width: 100%;
  min-width: 0;
  height: 100%;
}

@media (min-width: 768px) {
  .page-store #windows .bento-grid,
  .page-store #free-apps .shelf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .page-store #windows .bento-grid > .app-card,
  .page-store #free-apps .shelf-grid > .app-card {
    grid-column: auto;
  }

  .page-store .app-card .store-actions .btn-gold {
    flex: 1 1 100%;
  }
}

@media (min-width: 1100px) {
  .page-store #windows .bento-grid,
  .page-store #free-apps .shelf-grid {
    gap: 32px;
  }

  .page-store .app-card .store-actions .btn-gold {
    flex: 0 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .page-main {
    animation: none;
  }

  .mesh-bg::before,
  .mesh-bg::after,
  .btn:active,
  .play-badge-link:active,
  .lane:active,
  .nav-cta:active,
  a[data-dl-app].is-downloaded {
    animation: none;
    transition: none;
    transform: none;
  }

  .cursor-glow,
  .signature-border::before {
    display: none;
  }

  .hero-word,
  .soon-pulse {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ========== Section 7 ========== */

.soon-state {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.soon-pulse {
  width: clamp(48px, 8vw, 72px);
  height: clamp(48px, 8vw, 72px);
  flex: 0 0 auto;
  border: 1px solid var(--gold);
  border-radius: 50%;
  box-shadow: inset 0 0 0 8px rgba(201, 168, 76, 0.12);
}

.store-soon-note {
  display: flex;
  align-items: center;
  gap: 12px;
}

.paid-soon {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 4px;
}

.paid-soon .soon-pulse {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
}

.paid-soon-label {
  color: var(--gold);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
}

.jg-hero-solo .jg-hero-grid {
  max-width: 720px;
  grid-template-columns: 1fr;
}

.signature-border {
  position: relative;
  box-shadow: 0 0 0 1px rgba(201, 168, 76, 0.35);
}

.signature-border::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from 0deg, transparent, var(--gold), transparent 30%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.hero-word {
  display: inline-block;
}

.section-break {
  height: 36px;
  background: var(--ink-2);
  clip-path: polygon(0 40%, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}

.studio-email {
  color: var(--gold);
}

@media (prefers-reduced-motion: no-preference) {
  .soon-pulse {
    animation: soon-breathe 3s var(--ease-signature) infinite;
  }

  .signature-border::before {
    animation: signature-pulse 4s var(--ease-signature) infinite;
  }

  .hero-word {
    opacity: 0;
    transform: translateY(8px);
    animation: hero-word-in 0.5s var(--ease-signature) forwards;
    animation-delay: calc(var(--i, 0) * 60ms);
  }
}

@media (min-width: 720px) {
  .section-break {
    height: 48px;
  }
}

@media (min-width: 960px) {
  .section-break {
    height: 56px;
  }
}

@media (prefers-reduced-motion: no-preference) and (min-width: 720px) {
  .hero-word {
    transform: translateY(12px);
    animation-delay: calc(var(--i, 0) * 80ms);
  }
}

@keyframes soon-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes signature-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.75; }
}

@keyframes hero-word-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== Scoped hero + verified builds (gold, not ember/mint) ========== */

.jg-hero {
  overflow: visible;
}

.jg-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.42;
}

.jg-hero > .wrap,
.jg-hero > .marquee-block {
  position: relative;
  z-index: 1;
}

.jg-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  align-items: center;
}

.jg-hero h1 {
  font-family: "Space Grotesk", Inter, Outfit, system-ui, sans-serif;
  font-weight: 600;
  max-width: 16ch;
}

.jg-hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 22px;
}

.jg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.75);
  display: inline-block;
}

.jg-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 13px;
  color: var(--muted);
}

.jg-trust-row span {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-left: 22px;
}

.jg-trust-row span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 15px;
  height: 15px;
  margin-top: -8px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 10px rgba(201, 168, 76, 0.28);
}

.jg-trust-row span::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 7px;
  height: 4px;
  margin-top: -5px;
  border-left: 1.6px solid var(--gold);
  border-bottom: 1.6px solid var(--gold);
  transform: rotate(-45deg);
}

.jg-phone-stage {
  perspective: 1200px;
  display: flex;
  justify-content: center;
}

.jg-phone {
  width: min(250px, 72vw);
  height: min(510px, 146vw);
  max-height: 510px;
  border-radius: 34px;
  padding: 10px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
  background: linear-gradient(160deg, #1a1824, #0c0c12);
  border: 1px solid rgba(201, 168, 76, 0.28);
  box-shadow:
    0 40px 80px -20px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 60px -10px rgba(201, 168, 76, 0.32);
}

.jg-phone::after {
  content: "";
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
}

.jg-phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 26px 16px 16px;
  background:
    linear-gradient(200deg, rgba(201, 168, 76, 0.2), transparent 55%),
    linear-gradient(#16141c, #0c0c12);
}

.jg-phone-tag {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.jg-phone-title {
  margin: 0 0 18px;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 19px;
  font-weight: 600;
}

.jg-phone-card {
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 12px;
  color: var(--muted);
}

.jg-phone-card b {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.jg-verified-panel {
  margin-top: 28px;
  padding: 22px 22px 18px;
  border-radius: 18px;
  border: 1px solid rgba(201, 168, 76, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
}

.jg-verified {
  display: grid;
  gap: 16px;
}

.jg-verified-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.jg-verified-item b {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 13.5px;
}

.jg-verified-item a {
  color: var(--gold);
}

.jg-verified-mark {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.28);
}

.jg-verified-mark::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 8px;
  height: 4px;
  border-left: 1.6px solid var(--gold);
  border-bottom: 1.6px solid var(--gold);
  transform: rotate(-45deg);
}

.jg-verified-more {
  margin: 16px 0 0;
  font-size: 13px;
}

.jg-verified-more a {
  color: var(--gold);
}

.jg-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 10px;
}

.jg-card-meta .dl-count,
.jg-card-meta .unsigned-link {
  margin-top: 0;
}

.pc-trust-meta .pc-trust-label {
  margin: 0;
}

.pc-trust-ver {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.pc-trust-meta .dl-count {
  margin-top: 4px;
}

.pc-shelf .card-pc:first-child,
.page-store #windows .app-card.signature-border {
  box-shadow: 0 0 40px -18px rgba(201, 168, 76, 0.4);
}

@media (min-width: 720px) {
  .jg-verified {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (min-width: 860px) {
  .jg-hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 48px;
  }

  .jg-phone {
    width: 250px;
    height: 510px;
  }
}

@media (max-width: 859px) {
  .jg-phone-stage {
    order: -1;
  }

  .jg-phone {
    width: min(210px, 68vw);
    height: min(430px, 138vw);
  }

  .jg-hero h1 {
    max-width: 18ch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jg-phone {
    transition: none;
  }

  .jg-phone-card {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .jg-phone-card {
    animation: jg-phone-card-in 0.55s var(--ease-signature) both;
  }

  .jg-phone-card:nth-child(3) { animation-delay: 0.12s; }
  .jg-phone-card:nth-child(4) { animation-delay: 0.22s; }
  .jg-phone-card:nth-child(5) { animation-delay: 0.32s; }
}

@keyframes jg-phone-card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
