/* Statistics Problem Solver Pro — marketing site
   Colors from the app icon and DESIGN.md. Light-only. System fonts. */

:root {
  --bg: #f4f6fa;
  --bg-alt: #eef1f7;
  --card: #ffffff;
  --accent: #3d7bf5;
  --accent-pressed: #1d4ed8;
  --accent-soft: #e8f0fe;
  --text: #14171f;
  --text-2: #6b7280;
  --line: rgba(20, 23, 31, 0.08);
  --success: #22c55e;
  --radius: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 18px 50px rgba(15, 23, 42, 0.1);
  --nav-h: 64px;
  --max: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 1.0625rem;
}

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

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-pressed);
}

h1,
h2,
h3,
h4 {
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1em;
  color: var(--text-2);
}

.container {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -40px;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

/* Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 246, 250, 0.86);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--nav-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.brand-name {
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  display: none;
  font-size: 0.75rem;
  color: var(--text-2);
  font-weight: 500;
  letter-spacing: 0;
}

.nav-links {
  display: none;
  gap: 0.15rem;
  margin-left: auto;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 560;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
}

.nav-cta {
  margin-left: auto;
  display: none;
}

.menu-btn {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.menu-btn span,
.menu-btn span::before,
.menu-btn span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  position: relative;
}

.menu-btn span::before,
.menu-btn span::after {
  content: "";
  position: absolute;
}

.menu-btn span::before {
  top: -6px;
}
.menu-btn span::after {
  top: 6px;
}

.mobile-drawer {
  display: none;
  padding: 0.25rem 0 1rem;
  border-top: 1px solid var(--line);
}

.mobile-drawer.open {
  display: block;
}

.mobile-drawer a {
  display: block;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  padding: 0.85rem 0.15rem;
  min-height: 44px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-pill);
  font-weight: 650;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-pressed);
  color: #fff;
}

.btn-ghost {
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.app-store-badge img {
  height: 44px;
  width: auto;
}

.app-store-badge:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

/* Hero */
.hero {
  padding: 2.25rem 0 3rem;
}

.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 0.85rem;
}

.kicker img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.35rem);
  margin-bottom: 0.7rem;
}

.hero-lead {
  font-size: 1.12rem;
  max-width: 38rem;
  margin-bottom: 1.4rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.trust {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.trust li {
  list-style: none;
  background: #fff;
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
}

.trust {
  padding: 0;
  margin: 0;
}

.trust span {
  display: block;
  color: var(--text-2);
  font-weight: 500;
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.hero-shot {
  justify-self: center;
  width: min(320px, 78vw);
  filter: drop-shadow(0 24px 40px rgba(15, 23, 42, 0.16));
}

.hero-shot img {
  width: 100%;
  border-radius: 28px;
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  max-width: 38rem;
  margin-bottom: 1.8rem;
}

.section-head h2 {
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.55rem;
}

/* Cards */
.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem 1.35rem;
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 1.08rem;
  margin-bottom: 0.4rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.icon-sq {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 800;
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
}

/* How it works */
.steps {
  display: grid;
  gap: 1rem;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  background: #fff;
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow);
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.step h3 {
  margin-bottom: 0.3rem;
  font-size: 1.05rem;
}

.step p:last-child {
  margin: 0;
}

/* Screenshots */
.shot-row {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.25rem 0 1rem;
  -webkit-overflow-scrolling: touch;
}

.shot-row figure {
  margin: 0;
  flex: 0 0 min(240px, 68vw);
  scroll-snap-align: start;
}

.shot-row img {
  width: 100%;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  background: #fff;
}

.shot-row figcaption {
  font-size: 0.8rem;
  color: var(--text-2);
  margin-top: 0.55rem;
  text-align: center;
}

/* Use cases */
.use-list {
  display: grid;
  gap: 0.75rem;
}

.use-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  min-height: 72px;
}

.use-item h3 {
  margin: 0 0 0.15rem;
  font-size: 1rem;
}

.use-item p {
  margin: 0;
  font-size: 0.88rem;
}

.use-item .chev {
  color: var(--accent);
  font-weight: 700;
}

/* Guides */
.guide-grid {
  display: grid;
  gap: 1rem;
}

.guide-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  min-height: 100%;
}

.guide-card:hover h3 {
  color: var(--accent);
}

.guide-card .tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.45rem;
}

.guide-card h3 {
  font-size: 1.05rem;
}

.guide-card p {
  flex: 1;
  font-size: 0.92rem;
}

.guide-card .more {
  font-weight: 650;
  font-size: 0.9rem;
  color: var(--accent);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.65rem;
}

.faq-list details {
  background: #fff;
  border-radius: 16px;
  padding: 0.15rem 1.1rem;
  box-shadow: var(--shadow);
}

.faq-list summary {
  cursor: pointer;
  font-weight: 650;
  padding: 1rem 0;
  list-style: none;
  min-height: 44px;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list details p {
  margin: 0 0 0.4rem;
}

.faq-list .learn {
  display: inline-block;
  font-weight: 650;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

/* Final CTA */
.final-cta {
  text-align: center;
  background: #fff;
  border-radius: 28px;
  padding: 2.4rem 1.4rem;
  box-shadow: var(--shadow);
}

.final-cta img.cta-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin: 0 auto 1rem;
}

.final-cta h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.final-cta .app-store-badge {
  display: inline-flex;
  margin-top: 0.4rem;
}

/* Footer */
.site-footer {
  padding: 2.5rem 0 7rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
}

.footer-brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.site-footer h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-2);
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin: 0.35rem 0;
}

.site-footer a {
  text-decoration: none;
  color: var(--text);
  font-weight: 550;
}

.copyright {
  margin-top: 1.6rem;
  color: var(--text-2);
  font-size: 0.82rem;
}

/* Sticky download bar */
.sticky-dl {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  transform: translateY(110%);
  transition: transform 0.25s ease;
}

.sticky-dl.show {
  transform: translateY(0);
}

.sticky-dl .inner {
  width: min(var(--max), 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sticky-dl img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.sticky-dl p {
  margin: 0;
  font-size: 0.82rem;
  flex: 1;
}

.sticky-dl strong {
  display: block;
  color: var(--text);
  font-size: 0.88rem;
}

.sticky-dl .btn {
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* Article / guides */
.crumbs {
  font-size: 0.85rem;
  color: var(--text-2);
  margin: 1.2rem 0 1.4rem;
}

.crumbs a {
  text-decoration: none;
  color: var(--text-2);
}

.crumbs a:hover {
  color: var(--accent);
}

.article {
  padding-bottom: 3rem;
}

.article-hero {
  max-width: 42rem;
}

.article-hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.lede {
  font-size: 1.12rem;
  color: var(--text);
}

.prose {
  max-width: 42rem;
}

.prose h2 {
  font-size: 1.35rem;
  margin-top: 2.1rem;
}

.prose h3 {
  font-size: 1.08rem;
  margin-top: 1.4rem;
}

.prose ul,
.prose ol {
  color: var(--text-2);
  padding-left: 1.2rem;
}

.prose li {
  margin: 0.35rem 0;
}

.prose code,
.formula {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--accent-soft);
  padding: 0.12em 0.4em;
  border-radius: 6px;
  color: var(--text);
}

.formula-block {
  font-family: var(--mono);
  background: var(--accent-soft);
  border: 1px solid rgba(61, 123, 245, 0.18);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  color: var(--text);
  overflow-x: auto;
  margin: 1rem 0;
}

.answer-box {
  background: var(--accent-soft);
  border: 1.5px solid var(--accent);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  margin: 1.2rem 0;
}

.answer-box .cap {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.answer-box p {
  margin: 0.25rem 0 0;
  color: var(--text);
  font-weight: 650;
}

.related {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.related a {
  background: #fff;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
  box-shadow: var(--shadow);
}

.inline-shot {
  width: min(280px, 70%);
  margin: 1.4rem auto;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
}

.article-cta {
  margin-top: 2.2rem;
  background: #fff;
  border-radius: 22px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.article-cta img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.article-cta h2 {
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
}

.article-cta p {
  margin: 0;
  font-size: 0.92rem;
}

/* Calc chips */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.calc-grid div {
  background: #fff;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}

@media (min-width: 760px) {
  .brand-sub {
    display: block;
  }

  .menu-btn {
    display: none;
  }

  .nav-links {
    display: flex;
  }

  .nav-cta {
    display: inline-flex;
    margin-left: 0.4rem;
  }

  .nav-cta .btn {
    min-height: 40px;
    padding: 0.45rem 1rem;
    font-size: 0.88rem;
  }

  .hero {
    padding: 3.2rem 0 4rem;
  }

  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 2.5rem;
  }

  .trust {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .grid-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }

  .steps {
    grid-template-columns: 1fr 1fr;
  }

  .shot-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: visible;
  }

  .shot-row figure {
    flex: none;
  }

  .guide-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }

  .calc-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .use-list {
    grid-template-columns: 1fr 1fr;
  }

  .sticky-dl {
    display: none;
  }

  .site-footer {
    padding-bottom: 2.5rem;
  }
}

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

  .sticky-dl {
    transition: none;
  }
}
