/* =========================================================================
   CrossPair website — brand stylesheet
   Tokens sampled from the PM-approved app UI (docs/ui-design-spec.md §1.2)
   so the site matches the Android app's dark navy + lime desk.
   ========================================================================= */

:root {
  /* brand tokens (app parity) */
  --canvas: #030b1a;
  --surface: #061227;
  --card: #0c1a35;
  --raised: #0a1933;
  --high: #122440;
  --outline: #2b3848;
  --outline-faint: #202d43;
  --lime: #a8f439;
  --lime-dim: #8fd12a;
  --cyan: #37d6e8;
  --text: #edf2fa;
  --text-2: #9aa7bc;
  --text-3: #566176;
  --positive: #7ed957;
  --negative: #f6465d;
  --on-lime: #061227;

  --radius-card: 16px;
  --radius-btn: 12px;
  --wrap: 1120px;
  --gutter: 20px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* numeric columns never shift as live values refresh (spec §1.3) */
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .6em; letter-spacing: -0.02em; }

h1 { font-size: clamp(2.1rem, 5.4vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }

p { margin: 0 0 1rem; }

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

.eyebrow {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 .8rem;
}

.muted { color: var(--text-2); }
.small { font-size: .875rem; }
.center { text-align: center; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--lime);
  color: var(--on-lime);
  padding: .7rem 1.1rem;
  border-radius: 0 0 var(--radius-btn) 0;
  font-weight: 700;
  z-index: 200;
}
.skip-link:focus { left: 0; }

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

/* ---------------------------------------------------------------- nav ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(3, 11, 26, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--outline-faint);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 800;
  font-size: 1.16rem;
  color: var(--text);
  letter-spacing: -0.01em;
  flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand .pair { color: var(--lime); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  margin-left: auto;
  list-style: none;
  padding: 0;
  font-size: .92rem;
  font-weight: 600;
}
.nav-links a { color: var(--text-2); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-x { color: var(--cyan) !important; }

/* -------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .78rem 1.35rem;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--lime); color: var(--on-lime); }
.btn-primary:hover { background: var(--lime-dim); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--outline);
}
.btn-ghost:hover { border-color: var(--lime); color: var(--lime); }

.btn-sm { padding: .55rem 1rem; font-size: .88rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }

/* ---------------------------------------------------------------- hero --- */
.hero {
  position: relative;
  padding: 3.4rem 0 3rem;
  background:
    radial-gradient(900px 420px at 78% -10%, rgba(55, 214, 232, .13), transparent 62%),
    radial-gradient(760px 420px at 12% 6%, rgba(168, 244, 57, .10), transparent 60%),
    var(--canvas);
  border-bottom: 1px solid var(--outline-faint);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: 2.6rem;
  align-items: center;
}

.hero h1 { margin-bottom: .5rem; }
.hero h1 .accent { color: var(--lime); }

.hero-lede {
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  color: var(--text-2);
  max-width: 46ch;
  margin-bottom: 1.6rem;
}

.hero-cta-note { font-size: .82rem; color: var(--text-3); margin: 0; }

.hero-art {
  border: 1px solid var(--outline);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
}
.hero-art img { width: 100%; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .65rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--outline);
  background: var(--card);
  color: var(--text-2);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.chip-lime { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.chip-cyan { border-color: rgba(55, 214, 232, .45); color: var(--cyan); }

/* ------------------------------------------------------------ sections --- */
section { padding: 4rem 0; }
section + section { border-top: 1px solid var(--outline-faint); }
.section-head { max-width: 62ch; margin-bottom: 2.2rem; }
.section-head p { color: var(--text-2); margin-bottom: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--outline);
  border-radius: var(--radius-card);
  padding: 1.4rem;
}
.card h3 { margin-bottom: .5rem; }
.card p:last-child { margin-bottom: 0; }
.card .muted { color: var(--text-2); }

.feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(168, 244, 57, .12);
  color: var(--lime);
  margin-bottom: .9rem;
}
.feature-icon svg { width: 20px; height: 20px; }

/* quote-token chips used in prose */
.qchip {
  display: inline-block;
  padding: .12rem .5rem;
  border-radius: 999px;
  background: rgba(55, 214, 232, .1);
  border: 1px solid rgba(55, 214, 232, .38);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: .82em;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- steps -- */
.steps { counter-reset: step; display: grid; gap: 1rem; padding: 0; margin: 0; list-style: none; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: .95rem;
  align-items: start;
  background: var(--raised);
  border: 1px solid var(--outline-faint);
  border-radius: var(--radius-card);
  padding: 1.05rem 1.2rem;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--lime);
  color: var(--on-lime);
  font-weight: 800;
  font-size: .95rem;
}
.steps h3 { margin-bottom: .25rem; font-size: 1rem; }
.steps p { margin-bottom: 0; color: var(--text-2); font-size: .92rem; }

/* ----------------------------------------------------------- screenshots - */
/* Desktop/tablet: every capture stays visible in a wrapping grid.
   Phones: the same figures become a swipeable, snap-scrolling strip. */
.shot-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.6rem 1.1rem;
  padding: .35rem .25rem 1.3rem;
}
.shot-strip > figure { scroll-snap-align: start; }

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
  gap: 1.4rem 1.1rem;
}

figure { margin: 0; }

/* CSS phone frame — no fake device chrome images anywhere */
.phone {
  position: relative;
  background: linear-gradient(180deg, #16233d 0%, #0a1730 100%);
  border: 1px solid var(--outline);
  border-radius: 26px;
  padding: 9px 8px 11px;
}
.phone::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 4px;
  border-radius: 999px;
  background: #060f1f;
}
.phone img {
  width: 100%;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--outline-faint);
}
figcaption {
  margin-top: .7rem;
  font-size: .84rem;
  color: var(--text-2);
  line-height: 1.45;
}
figcaption strong { color: var(--text); font-weight: 700; }

.gallery-note {
  margin-top: 1.2rem;
  color: var(--text-3);
  font-size: .84rem;
}

/* -------------------------------------------------------------- download - */
.download-card {
  background:
    radial-gradient(620px 260px at 88% 8%, rgba(168, 244, 57, .12), transparent 65%),
    var(--raised);
  border: 1px solid var(--outline);
  border-radius: var(--radius-card);
  padding: 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: 2rem;
  align-items: center;
}

.spec-list {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
  display: grid;
  gap: .45rem;
  font-size: .92rem;
  color: var(--text-2);
}
.spec-list strong { color: var(--text); font-weight: 600; }

.install-note {
  margin-top: 1.4rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--outline-faint);
  border-left: 3px solid var(--lime);
  border-radius: 10px;
}
.install-note h3 { font-size: .95rem; margin-bottom: .4rem; }
.install-note ol { margin: 0; padding-left: 1.2rem; color: var(--text-2); font-size: .92rem; }
.install-note li { margin-bottom: .3rem; }

.hash {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--text-2);
  word-break: break-all;
}

/* ---------------------------------------------------------------- banner - */
.square-banner {
  border: 1px solid var(--outline);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
}

/* ---------------------------------------------------------------- legal -- */
.legal { padding: 3rem 0 4rem; }
.legal .doc {
  max-width: 820px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--outline-faint);
  border-radius: var(--radius-card);
  padding: 2.4rem clamp(1.1rem, 4vw, 2.6rem);
}
.legal h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
.legal h2 {
  font-size: 1.15rem;
  margin: 2.1rem 0 .7rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--outline-faint);
}
.legal h2:first-of-type { border-top: 0; padding-top: 0; }
.legal p, .legal li { color: var(--text-2); }
.legal ul { padding-left: 1.2rem; margin: 0 0 1rem; }
.legal li { margin-bottom: .4rem; }
.legal code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--card);
  border: 1px solid var(--outline-faint);
  border-radius: 6px;
  padding: .1rem .35rem;
  color: var(--text);
}
.doc-meta { color: var(--text-3); font-size: .9rem; }
.doc-facts { margin-bottom: 1.6rem; }
.back-link { display: inline-block; margin-bottom: 1.4rem; font-weight: 600; font-size: .9rem; }

/* ---------------------------------------------------------------- footer - */
.site-footer {
  border-top: 1px solid var(--outline-faint);
  background: var(--surface);
  padding: 3rem 0 2.4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 2rem;
  margin-bottom: 2.2rem;
}
.footer-grid h4 {
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: .9rem;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; font-size: .92rem; }
.footer-grid a { color: var(--text-2); }
.footer-grid a:hover { color: var(--lime); text-decoration: none; }

.disclaimer {
  border-top: 1px solid var(--outline-faint);
  padding-top: 1.6rem;
  font-size: .84rem;
  color: var(--text-3);
  display: grid;
  gap: .55rem;
}
.disclaimer strong { color: var(--text-2); }
.copyright { font-size: .84rem; color: var(--text-3); margin: 1.4rem 0 0; }

/* ------------------------------------------------------------ responsive - */
@media (max-width: 1000px) {
  .shot-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero-grid, .download-card, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .hero-art { order: -1; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .nav-links { display: none; }
  .site-nav .wrap { justify-content: space-between; }
}

@media (max-width: 680px) {
  section { padding: 3rem 0; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .download-card { padding: 1.4rem; }
  .hero { padding: 2.2rem 0; }
  .shot-strip {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(200px, 76vw);
    gap: 1.1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* print keeps legal pages readable on paper */
@media print {
  body { background: #fff; color: #000; }
  .site-nav, .site-footer, .back-link { display: none; }
  .legal .doc { border: 0; background: #fff; padding: 0; }
  .legal p, .legal li, .doc-meta { color: #222; }
}
