/* Gembind marketing site — extends the store-listing art direction:
   night-purple drench, the product as the light source, Sora, one green accent.
   Section visuals are native HTML/CSS ports of the app's onboarding heroes
   (src/paywall/OnboardingHeroes.tsx) using the same bundled card art.
   No build step; plain CSS. */

:root {
  --night-1: #260b53;
  --night-2: #2d1251;
  --night-3: #3c1877;
  --night-4: #5a22ab;
  --ink: #ffffff;
  --body: rgba(255, 255, 255, 0.84);
  --muted: rgba(255, 255, 255, 0.62);
  --green: #5ed39b;
  --green-bright: #34e0a1;
  --gold: #f5c451;
  --gold-ink: #231a04;
  --cta-ink: #07130c;
  --app-bg: #0a0b0e;
  --app-card2: #16181e;
  --app-dim: rgba(235, 235, 245, 0.55);
  --legal-bg: #0a0b0e;
  --card-aspect: 245 / 337; /* TCGdex art */
  --z-nav: 10;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.45, 0, 0.55, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  color: var(--body);
  background:
    radial-gradient(56rem 44rem at 88% 98%, rgba(195, 156, 253, 0.4), transparent 70%),
    radial-gradient(64rem 50rem at 72% 6%, rgba(138, 87, 225, 0.5), transparent 70%),
    radial-gradient(44rem 60rem at 0% 32%, rgba(198, 179, 236, 0.28), transparent 70%),
    linear-gradient(168deg, var(--night-1) 0%, var(--night-2) 30%, var(--night-3) 62%, var(--night-4) 100%);
  background-color: var(--night-2);
  overflow-x: clip;
}

img { display: block; }
a { color: var(--green); }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- nav ---------- */

.nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.4rem;
  padding-bottom: 1.4rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav-right { display: flex; align-items: center; gap: 1.5rem; }
.nav-right .support {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
}
.nav-right .support:hover { color: var(--ink); }
.pill {
  background: var(--green);
  color: var(--cta-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.pill:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(94, 211, 155, 0.35); }

/* ---------- hero ---------- */

.hero { position: relative; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding-top: clamp(7rem, 14vw, 9.5rem);
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
}

h1 {
  color: var(--ink);
  font-weight: 800;
  font-size: clamp(2.5rem, 5.6vw, 3.75rem);
  line-height: 1.09;
  letter-spacing: -0.02em;
  text-wrap: balance;
  text-shadow: 0 6px 40px rgba(20, 6, 50, 0.55);
}
.accent { color: var(--green); }

.lede {
  margin-top: 1.1rem;
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  line-height: 1.68;
  max-width: 34rem;
  text-wrap: pretty;
}

.badges {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
}
.badges img { height: 54px; width: auto; }
.badges .play img { height: 80px; margin: -13px; } /* official PNG bakes in padding */

.trust-line {
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: 0.875rem;
  letter-spacing: 0.01em;
}

/* soft diagonal light beams, from the store composite backdrop */
.beam {
  position: absolute;
  left: -30%;
  width: 160%;
  height: 150px;
  background: linear-gradient(rgba(214, 196, 245, 0), rgba(214, 196, 245, 0.2), rgba(214, 196, 245, 0));
  transform: rotate(-32deg);
  filter: blur(38px);
  pointer-events: none;
}
.beam.b1 { top: 26%; }
.beam.b2 { top: 62%; height: 110px; opacity: 0.7; }

/* ---------- demo art (shared) ---------- */

.art {
  position: relative;
  display: flex;
  justify-content: center;
}
.glow {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  width: 130%;
  max-width: 34rem;
  height: 90%;
  background: radial-gradient(closest-side, rgba(138, 87, 225, 0.5), transparent);
  filter: blur(40px);
  pointer-events: none;
}

/* ---------- scan hero: card under the scanner + appraisal ---------- */

.scan-demo {
  position: relative;
  width: min(320px, 86vw);
  background: var(--app-bg);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 26px;
  padding: 26px 22px 22px;
  box-shadow: 0 30px 80px rgba(8, 3, 24, 0.6), 0 0 90px rgba(138, 87, 225, 0.28);
}
.scan-stage { display: flex; justify-content: center; }
.scan-card {
  position: relative;
  width: 62%;
  aspect-ratio: var(--card-aspect);
}
.scan-card > img {
  width: 100%;
  height: 100%;
  border-radius: 4% / 3%;
}
.scan-frame { position: absolute; inset: -9px; animation: fade-in 0.3s ease-out 0.15s backwards; }
.br {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 0 solid var(--green-bright);
}
.br.tl { top: 0; left: 0; border-top-width: 2.5px; border-left-width: 2.5px; border-top-left-radius: 7px; }
.br.tr { top: 0; right: 0; border-top-width: 2.5px; border-right-width: 2.5px; border-top-right-radius: 7px; }
.br.bl { bottom: 0; left: 0; border-bottom-width: 2.5px; border-left-width: 2.5px; border-bottom-left-radius: 7px; }
.br.br-c { bottom: 0; right: 0; border-bottom-width: 2.5px; border-right-width: 2.5px; border-bottom-right-radius: 7px; }
@keyframes fade-in { from { opacity: 0; } }

.scan-beam {
  position: absolute;
  left: -6px; right: -6px;
  top: -36px;
  height: 34px;
  opacity: 0;
  pointer-events: none;
  animation: beam-run 1.15s var(--ease-inout) 0.6s;
}
.scan-beam::before {
  content: '';
  position: absolute;
  inset: 0 0 2px 0;
  background: linear-gradient(rgba(52, 224, 161, 0), rgba(52, 224, 161, 0.3));
}
.scan-beam::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--green-bright);
  box-shadow: 0 0 8px rgba(52, 224, 161, 0.9);
}
@keyframes beam-run {
  0% { top: -36px; opacity: 0; }
  10% { opacity: 1; }
  88% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.card-name {
  margin-top: 16px;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.card-set { margin-top: 2px; color: var(--app-dim); font-size: 0.8125rem; }

.appraisal {
  margin-top: 14px;
  background: var(--app-card2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px;
  animation: rise-in 0.42s var(--ease-out) 2s backwards;
}
.appraisal .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.appraisal .label {
  color: var(--app-dim);
  font-weight: 600;
  font-size: 0.8125rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(94, 211, 155, 0.12);
  color: var(--green);
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 3px 9px;
}
.chip svg { width: 11px; height: 11px; }
.price {
  margin-top: 5px;
  color: var(--green);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.01em;
}
.sources { margin-top: 4px; color: var(--app-dim); font-size: 0.75rem; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
}

/* ---------- grade hero: tilted card + estimate panel ---------- */

.grade-demo {
  position: relative;
  width: min(440px, 92vw);
  display: flex;
  align-items: center;
}
.grade-card {
  position: relative;
  z-index: 2;
  /* fixed basis, no shrink — RN flex items never shrink, and squeezing this
     box distorts the card art's aspect on narrow screens */
  flex: 0 0 41%;
  margin-right: -7%;
  transform: rotate(-8deg);
  filter: drop-shadow(0 10px 18px rgba(245, 196, 81, 0.4));
}
/* height:auto so the HTML height attribute can't override aspect-ratio */
.grade-card img { width: 100%; height: auto; aspect-ratio: var(--card-aspect); border-radius: 4% / 3%; }
.grade-panel {
  flex: 1;
  min-width: 0;
  background: #0e0f13;
  border: 1px solid rgba(245, 196, 81, 0.25);
  border-radius: 20px;
  padding: 15px 15px 15px 11%;
  box-shadow: 0 30px 80px rgba(8, 3, 24, 0.6);
}
.grader-pills { display: flex; gap: 6px; }
.grader-pills span {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(235, 235, 245, 0.5);
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 4px 11px;
}
.grader-pills .on { background: var(--gold); color: var(--gold-ink); }
.grade-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}
.ring-wrap { text-align: center; flex-shrink: 0; }
.ring {
  position: relative;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
}
.ring svg { position: absolute; inset: 0; }
.ring-num {
  color: var(--gold);
  font-weight: 800;
  font-size: 1.65rem;
}
.ring-label {
  display: block;
  margin-top: 7px;
  color: var(--app-dim);
  font-weight: 600;
  font-size: 0.5625rem;
  letter-spacing: 0.14em;
}
.bars { flex: 1; min-width: 0; display: grid; gap: 8px; }
.bar-row { display: flex; justify-content: space-between; }
.bar-row .l { color: var(--app-dim); font-size: 0.6875rem; }
.bar-row .s { color: var(--gold); font-weight: 700; font-size: 0.71875rem; }
.bar-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--gold);
  width: var(--pct);
  transform-origin: 0 50%;
}
.pre .bar-fill { transform: scaleX(0); }
.in .bar-fill {
  transform: scaleX(1);
  transition: transform 0.55s var(--ease-out) var(--d, 0.35s);
}

/* ---------- binder hero: self-turning 3×3 spread ---------- */

.binder {
  position: relative;
  width: min(360px, 88vw);
  border-radius: 18px;
  background: linear-gradient(135deg, #2b2e38, #16181d 55%, #0c0d11);
  padding: 12px 24px 12px 30px;
  box-shadow: 0 30px 80px rgba(8, 3, 24, 0.6), 0 18px 26px rgba(0, 0, 0, 0.45);
}
.binder .spine {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 24px;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(90deg, #05060a, #191b21);
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  padding: 16% 0;
}
.binder .spine i {
  width: 12px;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(#f3f3f7, #878790);
}
.binder .stitch {
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  pointer-events: none;
}
.pocket-panel {
  position: relative;
  border-radius: 10px;
  padding: 7px;
  background: linear-gradient(135deg, #101216, #08090c);
  border: 1px solid rgba(255, 255, 255, 0.05);
  perspective: 1100px;
}
.spread {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.spread.under {
  position: absolute;
  inset: 7px;
}
.spread.under::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0) 60%);
  opacity: 0.5;
  transition: opacity 0.95s var(--ease-inout);
  pointer-events: none;
}
.turning .spread.under::after { opacity: 0; }
.spread.leaf {
  position: relative;
  transform-origin: 0 50%;
  backface-visibility: hidden;
  transition: transform 0.95s var(--ease-inout);
}
.turning .spread.leaf { transform: rotateY(-100deg); }
.spread.leaf::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  transition: opacity 0.95s var(--ease-inout);
  pointer-events: none;
}
.turning .spread.leaf::after { opacity: 0.55; }
.pocket {
  position: relative;
  aspect-ratio: var(--card-aspect);
  border-radius: 6px;
  overflow: hidden;
  background: #15171d;
  border: 1px solid #262a33;
}
.pocket img { width: 100%; height: 100%; object-fit: contain; }
.pocket::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(225deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
}

/* ---------- sparkles ---------- */

.sp {
  position: absolute;
  pointer-events: none;
  opacity: var(--o, 0.8);
  animation: twinkle var(--d, 5s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: var(--o, 0.8); transform: scale(1); }
  50% { opacity: calc(var(--o, 0.8) * 0.3); transform: scale(0.85); }
}

/* ---------- feature sections ---------- */

.feature { position: relative; }
.feature .wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding-top: clamp(4rem, 9vw, 7rem);
  padding-bottom: clamp(4rem, 9vw, 7rem);
}
.feature.flip .copy { order: 2; }
.feature.flip .art { order: 1; }

h2 {
  color: var(--ink);
  font-weight: 800;
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
  text-shadow: 0 6px 40px rgba(20, 6, 50, 0.55);
}
.feature .lede { max-width: 30rem; }

/* ---------- closing / download ---------- */

.download { text-align: center; }
.download .wrap {
  padding-top: clamp(4rem, 9vw, 7rem);
  padding-bottom: clamp(5rem, 10vw, 8rem);
}
.download h2 { margin-bottom: 0.4rem; }
.download .lede { margin-left: auto; margin-right: auto; }
.download .badges { justify-content: center; }

/* ---------- footer ---------- */

footer {
  background: rgba(12, 4, 34, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}
footer .wrap {
  padding-top: 2.6rem;
  padding-bottom: 2.6rem;
  display: grid;
  gap: 1.4rem;
}
.foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.foot-links { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.foot-links a {
  color: var(--body);
  text-decoration: none;
  font-size: 0.9375rem;
}
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
.disclaimer {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.65;
  max-width: 62ch;
}

/* ---------- entrances ---------- */

.rise { animation: rise 0.9s var(--ease-out) both; }
.rise.d1 { animation-delay: 0.08s; }
.rise.d2 { animation-delay: 0.16s; }
.rise.d3 { animation-delay: 0.26s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

/* scroll reveals: JS adds .pre only to elements still below the fold, so
   content is always visible without JS / in crawlers */
.pre { opacity: 0; transform: translateY(26px); }
.in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .sp { animation: none; }
  .scan-frame, .appraisal { animation: none; }
  .scan-beam { animation: none; opacity: 0; }
  .spread.leaf, .spread.leaf::after, .spread.under::after { transition: none; }
  .pre { opacity: 1; transform: none; }
  .in { transition: none; }
  .in .bar-fill { transition: none; }
  .pill { transition: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .hero .wrap,
  .feature .wrap {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero .wrap { padding-top: 6.5rem; }
  .feature.flip .copy { order: 1; }
  .feature.flip .art { order: 2; }
  .lede { margin-left: auto; margin-right: auto; }
  .badges { justify-content: center; }
  .nav-right .support { display: none; }
  .beam { display: none; }
  .card-name, .card-set { text-align: left; }
}

@media (max-width: 420px) {
  /* keep the subgrade bars readable next to the ring on small phones */
  .ring { width: 62px; height: 62px; }
  .ring-num { font-size: 1.3rem; }
  .grade-row { gap: 10px; }
  .grade-panel { padding-left: 9%; }
}

/* ---------- legal pages ---------- */

.legal-page {
  background: var(--legal-bg);
  color: #c9cdd6;
}
.legal-page .nav { position: static; background: none; }
.legal-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.375rem 6rem;
  font-size: 1rem;
  line-height: 1.7;
}
.legal-main h1 {
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
  text-shadow: none;
}
.legal-main h2 {
  font-size: 1.15rem;
  margin: 2.1rem 0 0.5rem;
  letter-spacing: -0.01em;
  text-shadow: none;
}
.legal-main p, .legal-main li { margin-bottom: 0.6rem; }
.legal-main ul { padding-left: 1.25rem; }
.legal-main .updated { color: #8b909b; font-size: 0.8125rem; }
.legal-main .contact { margin-top: 2.75rem; color: #8b909b; font-size: 0.875rem; }
