/* MountainCSV marketing site — shared styles.
   Palette mirrors the app's own design tokens (src/index.css) so the
   website and the product feel like the same thing. */

:root {
  --bg: #fafafa;
  --panel: #ffffff;
  --panel-alt: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --accent-dark: #1d4ed8;
  --success: #16a34a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -8px rgba(0,0,0,.08);
  --shadow-lg: 0 20px 60px -20px rgba(0,0,0,.25);
  --max: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --panel: #161a21;
    --panel-alt: #1c212a;
    --border: #222833;
    --border-strong: #2f3744;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --text-faint: #6b7280;
    --accent: #60a5fa;
    --accent-soft: #1e3a5f;
    --accent-dark: #93c5fd;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -8px rgba(0,0,0,.5);
    --shadow-lg: 0 20px 60px -20px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --panel: #161a21; --panel-alt: #1c212a; --border: #222833;
  --border-strong: #2f3744; --text: #e5e7eb; --text-muted: #9ca3af; --text-faint: #6b7280;
  --accent: #60a5fa; --accent-soft: #1e3a5f; --accent-dark: #93c5fd;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -8px rgba(0,0,0,.5);
  --shadow-lg: 0 20px 60px -20px rgba(0,0,0,.6);
}
:root[data-theme="light"] {
  --bg: #fafafa; --panel: #ffffff; --panel-alt: #f3f4f6; --border: #e5e7eb;
  --border-strong: #d1d5db; --text: #1f2937; --text-muted: #6b7280; --text-faint: #9ca3af;
  --accent: #2563eb; --accent-soft: #dbeafe; --accent-dark: #1d4ed8;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -8px rgba(0,0,0,.08);
  --shadow-lg: 0 20px 60px -20px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; }
code {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1em .4em;
  font-size: .9em;
}
pre {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
}
pre code { border: none; background: none; padding: 0; }

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

/* ---------- Nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: .85rem;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--text-muted); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-cta {
  background: var(--accent); color: white; padding: 9px 18px; border-radius: 8px;
  font-weight: 600; font-size: .9rem;
}
.nav-cta:hover { background: var(--accent-dark); text-decoration: none; color: white; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 10px; font-weight: 600; font-size: .98rem;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; color: white; }
.btn-secondary { background: var(--panel); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--accent); text-decoration: none; color: var(--text); }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { padding: 88px 0 56px; text-align: center; }
.hero-logo { width: 220px; max-width: 62%; height: auto; margin: 0 auto 28px; display: block; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft); color: var(--accent-dark);
  padding: 6px 14px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  margin-bottom: 24px;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; line-height: 1.12; margin: 0 0 20px; letter-spacing: -0.02em; }
.hero h1 .accent { color: var(--accent); }
.hero p.lede { font-size: 1.2rem; color: var(--text-muted); max-width: 640px; margin: 0 auto 36px; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.hero-note { font-size: .85rem; color: var(--text-faint); }
.hero-shot {
  margin-top: 56px; border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}

/* ---------- Sections ---------- */
section { padding: 80px 0; }
section.alt { background: var(--panel-alt); }
.section-head { max-width: 680px; margin: 0 auto 52px; text-align: center; }
.section-head .kicker { color: var(--accent); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin: 10px 0 12px; letter-spacing: -0.01em; }
.section-head p { color: var(--text-muted); font-size: 1.08rem; margin: 0; }

/* ---------- Feature blocks (image + text alternating) ---------- */
.feature-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
  padding: 56px 0; border-bottom: 1px solid var(--border);
}
.feature-row:last-child { border-bottom: none; }
.feature-row.reverse .feature-text { order: 2; }
.feature-row.reverse .feature-shot { order: 1; }
.feature-shot img { border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.feature-text .icon-badge {
  width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 18px;
}
.feature-text h3 { font-size: 1.5rem; margin: 0 0 12px; letter-spacing: -0.01em; }
.feature-text p { color: var(--text-muted); font-size: 1.02rem; margin: 0 0 16px; }
.feature-text ul { margin: 0; padding-left: 20px; color: var(--text-muted); }
.feature-text ul li { margin-bottom: 8px; }
.feature-text ul li strong { color: var(--text); }

/*
 * Grid and flex children default to `min-width: auto`, which means they will
 * NOT shrink below their content's intrinsic width. The SQL <pre> inside a
 * feature column therefore set the column width, the row grew wider than a
 * phone screen, and the whole page could be dragged sideways — even though
 * the <pre> itself has overflow-x: auto. `min-width: 0` is what lets the
 * column shrink and hands the scrolling back to the <pre>.
 */
.feature-row > *, .card-grid > *, .hero-ctas > * { min-width: 0; }

@media (max-width: 860px) {
  .feature-row, .feature-row.reverse { grid-template-columns: 1fr; }
  .feature-row.reverse .feature-text, .feature-row.reverse .feature-shot { order: unset; }
}

@media (max-width: 720px) {
  /* Belt and braces: wrap code rather than relying on a scroll strip that is
     easy to miss on a touch screen. */
  pre { white-space: pre-wrap; word-break: break-word; }
  pre code { white-space: inherit; }
}

/* ---------- Grid of small feature cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.fcard {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.fcard .icon { font-size: 1.5rem; margin-bottom: 12px; }
.fcard h4 { margin: 0 0 8px; font-size: 1.05rem; }
.fcard p { margin: 0; color: var(--text-muted); font-size: .93rem; }
@media (max-width: 860px) { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .card-grid { grid-template-columns: 1fr; } }

/* ---------- Comparison table ---------- */
.cmp-table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cmp-table th, .cmp-table td { padding: 16px 20px; border-bottom: 1px solid var(--border); text-align: left; font-size: .96rem; }
.cmp-table th { background: var(--panel-alt); font-weight: 700; }
.cmp-table td:not(:first-child), .cmp-table th:not(:first-child) { text-align: center; }
.cmp-table tr:last-child td { border-bottom: none; }
.cmp-table .win { color: var(--success); font-weight: 700; }
.cmp-table .highlight-col { background: var(--accent-soft); font-weight: 600; }

/* ---------- Pricing ---------- */
.pricing-card {
  max-width: 440px; margin: 0 auto; background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 44px; text-align: center; box-shadow: var(--shadow-lg);
}
.pricing-card .price { font-size: 3.2rem; font-weight: 800; margin: 8px 0 0; letter-spacing: -0.02em; }
.pricing-card .price sup { font-size: 1.4rem; font-weight: 700; }
.pricing-card .price-note { color: var(--text-muted); margin-bottom: 28px; }
.pricing-card ul { list-style: none; padding: 0; margin: 28px 0; text-align: left; }
.pricing-card ul li { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; font-size: .96rem; }
.pricing-card ul li::before { content: "✓"; color: var(--success); font-weight: 800; }

/* ---------- Platform badges ---------- */
.platforms { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.platform-badge {
  display: flex; align-items: center; gap: 8px; padding: 10px 18px;
  border: 1px solid var(--border); border-radius: 999px; font-size: .9rem; font-weight: 600;
  background: var(--panel);
}

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item h4 { margin: 0 0 8px; font-size: 1.05rem; }
.faq-item p { margin: 0; color: var(--text-muted); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 48px 0 32px; }
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 32px; margin-bottom: 32px; }
.footer-col h5 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin: 0 0 14px; }
.footer-col a { display: block; color: var(--text-muted); margin-bottom: 10px; font-size: .93rem; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--text-faint); font-size: .85rem; border-top: 1px solid var(--border); padding-top: 24px; }
.footer-legal-note { font-size: .8rem; color: var(--text-faint); max-width: 720px; margin: 0 auto 24px; text-align: center; }

/* ---------- Callouts (used in user guide too) ---------- */
.callout { border-radius: var(--radius); padding: 16px 18px; margin: 20px 0; border: 1px solid var(--border); font-size: .95rem; }
.callout-tip { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.callout-tip strong { color: var(--accent-dark); }
.callout-note { background: var(--panel-alt); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }

/* ---------- Small screens ----------------------------------------------
 * The site was built for desktop widths: the nav packed five links into a
 * fixed flex row, and the comparison table is four columns with generous
 * padding — on a phone both forced the whole page to scroll sideways, which
 * is the most obvious "this is broken" signal a visitor can get.
 */

/* Wide content scrolls inside its own box, never the page. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 720px) {
  /*
   * Navigation on phones. This used to be `display: none` — brand and
   * Download only — on the theory that everything was reachable by
   * scrolling. In practice a visitor on a phone had no way to reach
   * Pricing, the User Guide or Support without scrolling the whole page.
   * Keep the links: brand + Download on the first row, the section links
   * on a second row that scrolls sideways if they don't fit. No burger,
   * no JavaScript.
   */
  .site-nav .wrap {
    height: auto;
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 8px;
    row-gap: 6px;
  }
  .nav-links {
    order: 3;
    width: 100%;
    gap: 18px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { white-space: nowrap; font-size: .9rem; }
  .wrap { padding: 0 16px; }
  .pricing-card { padding: 28px 20px; }
  .cmp-table th, .cmp-table td { padding: 12px 10px; font-size: .86rem; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { width: 100%; justify-content: center; }
}

@media (max-width: 420px) {
  .pricing-card .price { font-size: 2.4rem; }
}
