/* ============================================================
   Cricket Exchange (CRX) — marketing & compliance site
   Design system mirrors the Android app (theme/CexColors.kt)
   ============================================================ */

:root {
  --bg-void:      #17122A;
  --bg-rise:      #221C3C;
  --card:         #2A2348;
  --card-elev:    #342C56;
  --glass-tint:   rgba(255,255,255,.05);
  --glass-tint-2: rgba(255,255,255,.09);
  --glass-border: rgba(255,255,255,.12);
  --glass-border-2: rgba(255,255,255,.18);

  --violet:   #6B4FFF;
  --cyan:     #2EE2D0;
  --crimson:  #FF3D5A;
  --eyebrow:  #C8BCFF;
  --live:     #2EF08C;
  --back:     #4FA3FF;
  --lay:      #FF6E9A;
  --win:      #FFD45A;

  --ink:      #F4F1FF;
  --ink-soft: #B9B2D6;
  --ink-mute: #8B84A8;

  --maxw: 1120px;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 24px 60px -20px rgba(0,0,0,.65);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-void);
  line-height: 1.6;
  overflow-x: hidden;
  /* Ambient blooms — static, calm (matches app's "premium calm" motion) */
  background-image:
    radial-gradient(60rem 60rem at 80% -10%, rgba(107,79,255,.22), transparent 60%),
    radial-gradient(50rem 50rem at -10% 10%, rgba(46,226,208,.12), transparent 55%),
    radial-gradient(40rem 40rem at 50% 120%, rgba(255,61,90,.10), transparent 60%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Wordmark ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-size: 20px; letter-spacing: -.01em; }
.wordmark .mark { width: 26px; height: 26px; border-radius: 7px; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.wordmark b { font-weight: 800; }
.wordmark span { font-weight: 500; }
.wordmark .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--crimson);
  box-shadow: 0 0 0 4px rgba(255,61,90,.18); margin-left: 2px; }

/* ---------- Header ---------- */
header.site {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: rgba(23,18,42,.66);
  border-bottom: 1px solid var(--glass-border);
}
header.site .bar { display: flex; align-items: center; justify-content: space-between; height: 66px; }
nav.links { display: flex; align-items: center; gap: 28px; }
nav.links a { color: var(--ink-soft); font-size: 15px; font-weight: 500; transition: color .2s; }
nav.links a:hover { color: var(--ink); }
.nav-toggle { display: none; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 8px; }
.nav-toggle svg { width: 26px; height: 26px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 15px; padding: 12px 20px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .25s ease, background .25s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--violet), #8b6bff);
  box-shadow: 0 10px 30px -8px rgba(107,79,255,.6); }
.btn-primary:hover { box-shadow: 0 14px 40px -8px rgba(107,79,255,.75); }
.btn-ghost { color: var(--ink); background: var(--glass-tint); border-color: var(--glass-border); }
.btn-ghost:hover { background: var(--glass-tint-2); border-color: var(--glass-border-2); }

/* Google Play badge */
.play-badge {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 11px 22px 11px 18px; border-radius: 14px;
  background: #0c0a16; border: 1px solid var(--glass-border-2);
  transition: transform .15s ease, border-color .25s;
}
.play-badge:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.3); }
.play-badge svg { width: 26px; height: 28px; }
.play-badge .pb-text { display: flex; flex-direction: column; line-height: 1.15; }
.play-badge .pb-small { font-size: 11px; letter-spacing: .04em; color: var(--ink-soft); text-transform: uppercase; }
.play-badge .pb-big { font-size: 19px; font-weight: 600; color: #fff; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 84px 0 60px; }
.hero .grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--eyebrow); background: rgba(200,188,255,.08);
  border: 1px solid rgba(200,188,255,.22); padding: 7px 14px; border-radius: 999px;
}
.eyebrow .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live);
  box-shadow: 0 0 0 4px rgba(46,240,140,.18); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

.hero h1 { font-size: clamp(34px, 5.2vw, 56px); line-height: 1.05; letter-spacing: -.02em; font-weight: 800; margin: 22px 0 18px; }
.hero h1 .grad { background: linear-gradient(120deg, var(--cyan), var(--violet) 55%, var(--lay));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lede { font-size: clamp(16px, 2.2vw, 19px); color: var(--ink-soft); max-width: 36ch; }
.hero .cta { display: flex; align-items: center; gap: 16px; margin-top: 30px; flex-wrap: wrap; }
.hero .meta { margin-top: 22px; font-size: 13px; color: var(--ink-mute); }

/* Phone showcase */
.showcase { position: relative; display: flex; justify-content: center; }
.phone {
  position: relative; width: 286px; border-radius: 42px; padding: 11px;
  background: linear-gradient(160deg, #2d2750, #15101f);
  border: 1px solid var(--glass-border-2); box-shadow: var(--shadow);
}
.phone::before { content: ""; position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  width: 92px; height: 6px; border-radius: 99px; background: rgba(0,0,0,.5); z-index: 3; }
/* Tall phone screen. Uses the padding-bottom ratio hack (works in EVERY
   browser, unlike `aspect-ratio`) so the frame is always a true ~9:19.5
   phone regardless of the screenshot's own height. 216.6% ≈ 3120/1440. */
.phone .screen { position: relative; border-radius: 32px; overflow: hidden; background: var(--bg-void); height: 0; padding-bottom: 216.6%; }
.phone .screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.phone.tilt-back { position: absolute; left: -86px; top: 54px; width: 210px; transform: rotate(-9deg); opacity: .92; z-index: -1; filter: saturate(.95) brightness(.92); }

/* ---------- Section scaffolding ---------- */
section { padding: 72px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head .eyebrow { margin-bottom: 16px; }
.section-head h2 { font-size: clamp(26px, 3.6vw, 38px); letter-spacing: -.02em; font-weight: 800; line-height: 1.1; }
.section-head p { color: var(--ink-soft); margin-top: 14px; font-size: 17px; }

/* ---------- Feature grid ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: var(--glass-tint); border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 26px 24px; transition: transform .2s ease, border-color .25s, background .25s;
}
.feature:hover { transform: translateY(-4px); border-color: var(--glass-border-2); background: var(--glass-tint-2); }
.feature .ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 16px; }
.feature .ic svg { width: 24px; height: 24px; }
.feature h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.feature p { color: var(--ink-soft); font-size: 14.5px; margin-top: 8px; }

/* ---------- Screenshot gallery ---------- */
.gallery { display: flex; gap: 26px; overflow-x: auto; padding: 8px 4px 24px; scroll-snap-type: x mandatory; }
.gallery::-webkit-scrollbar { height: 8px; }
.gallery::-webkit-scrollbar-thumb { background: var(--card-elev); border-radius: 99px; }
.shot { flex: 0 0 auto; scroll-snap-align: center; text-align: center; }
.shot .phone { width: 248px; }
.shot figcaption { margin-top: 16px; color: var(--ink-soft); font-size: 14px; font-weight: 500; }
.shot figcaption b { color: var(--ink); display: block; font-weight: 700; font-size: 15.5px; }

/* ---------- Stat strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { text-align: center; padding: 24px 12px; border-radius: var(--radius-sm);
  background: var(--glass-tint); border: 1px solid var(--glass-border); }
.stat .n { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(120deg, var(--cyan), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .l { color: var(--ink-soft); font-size: 13.5px; margin-top: 4px; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band .panel {
  background: linear-gradient(135deg, rgba(107,79,255,.22), rgba(46,226,208,.1));
  border: 1px solid var(--glass-border-2); border-radius: 28px; padding: 56px 32px;
}
.cta-band h2 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; letter-spacing: -.02em; }
.cta-band p { color: var(--ink-soft); margin: 14px auto 28px; max-width: 46ch; }

/* ---------- Footer ---------- */
footer.site { border-top: 1px solid var(--glass-border); padding: 48px 0 40px; margin-top: 24px; }
footer.site .cols { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
footer.site .about { max-width: 320px; }
footer.site .about p { color: var(--ink-mute); font-size: 14px; margin-top: 14px; }
footer.site .fnav { display: flex; gap: 56px; flex-wrap: wrap; }
footer.site .fnav h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); margin-bottom: 14px; }
footer.site .fnav a { display: block; color: var(--ink-soft); font-size: 14.5px; padding: 5px 0; transition: color .2s; }
footer.site .fnav a:hover { color: var(--ink); }
footer.site .legal { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--glass-border);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--ink-mute); font-size: 13px; }

/* ---------- Legal / content pages ---------- */
.doc { padding: 56px 0 40px; }
.doc .wrap { max-width: 820px; }
.doc .eyebrow { margin-bottom: 18px; }
.doc h1 { font-size: clamp(30px, 4.4vw, 44px); font-weight: 800; letter-spacing: -.02em; }
.doc .updated { color: var(--ink-mute); font-size: 14px; margin-top: 12px; }
.doc .body { margin-top: 36px; }
.doc .body h2 { font-size: 22px; font-weight: 700; margin: 38px 0 12px; letter-spacing: -.01em; }
.doc .body h3 { font-size: 17px; font-weight: 700; margin: 24px 0 8px; color: var(--eyebrow); }
.doc .body p, .doc .body li { color: var(--ink-soft); font-size: 16px; }
.doc .body p { margin: 12px 0; }
.doc .body ul { margin: 12px 0 12px 22px; }
.doc .body li { margin: 7px 0; }
.doc .body a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.doc .body strong { color: var(--ink); }
.doc .callout { background: var(--glass-tint); border: 1px solid var(--glass-border);
  border-left: 3px solid var(--violet); border-radius: var(--radius-sm); padding: 18px 20px; margin: 22px 0; }
.doc .callout p { margin: 6px 0; }

/* Support cards */
.support-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 30px; }
.support-card { background: var(--glass-tint); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 26px 24px; }
.support-card h3 { font-size: 17px; font-weight: 700; }
.support-card p { color: var(--ink-soft); font-size: 15px; margin-top: 8px; }
.support-card a.mail { display: inline-block; margin-top: 14px; color: var(--cyan); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  nav.links { display: none; }
  nav.links.open {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    position: absolute; top: 66px; left: 0; right: 0; padding: 16px 24px 22px;
    background: rgba(23,18,42,.96); backdrop-filter: blur(18px); border-bottom: 1px solid var(--glass-border);
  }
  nav.links.open a { padding: 10px 0; font-size: 16px; width: 100%; }
  nav.links.open .btn { margin-top: 8px; }
  .nav-toggle { display: inline-flex; }
  .hero .grid { grid-template-columns: 1fr; gap: 8px; }
  .hero { padding: 48px 0 40px; }
  .showcase { order: -1; margin-bottom: 16px; }
  .phone.tilt-back { display: none; }
  .features { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .wrap { padding: 0 18px; }
  .hero .cta { gap: 12px; }
  .support-cards { grid-template-columns: 1fr; }
}
