/* pgeye marketing - minimal, no Bootstrap, mobile-first.
 * Goals: fast first paint, legible at any zoom level, dark-mode-aware,
 * under 5 KB.
 *
 * Colors live in /static/shared/palette.css and are loaded before this
 * file. We reference the --pg-* CSS variables directly. */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/shared/fonts/inter-variable.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/static/shared/fonts/jetbrains-mono-variable.woff2") format("woff2");
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter Variable", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--pg-text);
  background: var(--pg-bg);
  -webkit-font-smoothing: antialiased;
}

/* Tiled dot-grid background with sparse blue accent dots - adapted from
 * eyespy. Fixed to the viewport so it doesn't shift while scrolling.
 * Two SVGs (light + dark variants) swapped via prefers-color-scheme.
 * The print rule hides it so paper output stays clean. */
body {
  background-image: url("/static/shared/bg-light.svg");
  background-repeat: repeat;
  background-attachment: fixed;
}
@media (prefers-color-scheme: dark) {
  body {
    background-image: url("/static/shared/bg-dark.svg");
  }
}
@media print {
  body { background-image: none; }
}

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", monospace;
  font-size: 0.92em;
  background: var(--pg-code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Nav --- */
.topnav {
  border-bottom: 1px solid var(--pg-border);
  background: var(--pg-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--pg-text);
}
.brand:hover { text-decoration: none; }
.topnav-links { display: flex; align-items: center; gap: 1rem; }
.topnav-links a { color: var(--pg-text-dim); }
.topnav-links a:hover { color: var(--pg-text); }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.btn-lg { padding: 0.85rem 1.6rem; font-size: 1.05rem; }
.btn-primary {
  background: var(--pg-primary);
  color: #ffffff !important;
  border-color: var(--pg-primary);
}
.btn-primary:hover {
  background: var(--pg-primary-dark);
  border-color: var(--pg-primary-dark);
  text-decoration: none;
}
.btn-link {
  background: transparent;
  color: var(--pg-text-dim);
}
.btn-link:hover { color: var(--pg-text); text-decoration: none; }

.btn-disabled {
  opacity: 0.55;
  filter: grayscale(0.4);
  cursor: not-allowed;
  pointer-events: none;
}

/* "Closed Beta" stamp overlaying a disabled signup CTA. */
.signup-cta {
  position: relative;
  display: inline-block;
}
.beta-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  background: var(--pg-warning);
  color: #1a1102;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  border: 2px solid #1a1102;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  pointer-events: none;
}
.signup-cta-sm .beta-stamp {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-width: 1.5px;
}

/* --- Hero --- */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.9rem, 4vw + 0.5rem, 3.2rem);
  line-height: 1.1;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}
.hero .lede {
  font-size: 1.15rem;
  color: var(--pg-text-dim);
  max-width: 640px;
  margin: 0 auto 2rem;
}
.hero .cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Section scaffolding --- */
section.features, section.how {
  padding: 5rem 0;
  border-top: 1px solid var(--pg-border);
}
.section-title {
  font-size: 1.6rem;
  margin: 0 0 2rem;
  text-align: center;
  letter-spacing: -0.01em;
}

/* --- Feature callouts: alternating text/image rows --- */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
  padding: 3rem 0;
}
.feature-text h3 {
  font-size: clamp(1.4rem, 2vw + 0.5rem, 1.85rem);
  line-height: 1.2;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}
.feature-text p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--pg-text-dim);
  margin: 0;
  max-width: 38ch;
}
.feature-image {
  margin: 0;
}
.feature-image img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--pg-border);
  border-radius: 8px;
  background: var(--pg-bg);
  aspect-ratio: 16 / 10;
  object-fit: cover;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

/* Privacy section: before/after code cards stacked with an arrow between */
.privacy-flow {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.privacy-card {
  border: 1px solid var(--pg-border);
  border-radius: 8px;
  background: var(--pg-bg);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.privacy-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pg-text-dim);
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--pg-border);
  background: var(--pg-bg-alt);
}
.privacy-card pre {
  margin: 0;
  padding: 1.25rem 1.5rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--pg-text);
  background: transparent;
  overflow-x: auto;
}
/* Strip any inherited inline-code chrome from the inner <code> so the block
   reads as one editor pane, not a row of segmented chips. Do NOT touch
   <pre> here - it owns the block's padding. */
.privacy-card pre code,
.privacy-card pre code * {
  background: transparent !important;
  border: 0;
  padding: 0;
}
.privacy-card pre code {
  display: block;
  font-family: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace,
    SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
/* SQL syntax tokens. Colors map onto the brand palette so they shift with
   theme automatically. */
.privacy-card pre.sql .kw    { color: var(--pg-accent); font-weight: 600; }
.privacy-card pre.sql .str   { color: var(--pg-success); }
.privacy-card pre.sql .param { color: var(--pg-info); font-weight: 600; }
.privacy-arrow {
  text-align: center;
  font-size: 0.8rem;
  color: var(--pg-text-dim);
  letter-spacing: 0.02em;
}
.privacy-arrow::before {
  content: "↓";
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.1rem;
  color: var(--pg-primary);
}

/* Partition rollup section: reuses .privacy-card chrome, adds a tabular
   view that mocks a piece of the Tables list. */
.partition-flow { /* shares .privacy-flow layout via the inline class list */ }
.partition-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-family: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace,
    SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.partition-table td {
  padding: 0.4rem 0.9rem;
  border-bottom: 1px solid var(--pg-border);
}
.partition-table tr:last-child td {
  border-bottom: none;
}
.partition-table td:last-child {
  text-align: right;
  color: var(--pg-text-dim);
  font-variant-numeric: tabular-nums;
}
.partition-table td.muted {
  color: var(--pg-text-dim);
  opacity: 0.6;
}
.partition-table tr.ellipsis td {
  text-align: center;
  color: var(--pg-text-dim);
  font-style: italic;
  padding: 0.3rem 0.9rem;
}
.partition-table tr.rollup td {
  font-weight: 500;
  color: var(--pg-text);
}
.partition-table tr.rollup td:last-child {
  color: var(--pg-text);
}
.badge-chunks {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 400;
  font-family: var(--bs-font-sans-serif, system-ui), sans-serif;
  color: var(--pg-text-dim);
  background: var(--pg-bg-alt);
  border: 1px solid var(--pg-border);
  border-radius: 4px;
  vertical-align: middle;
}

@media (max-width: 760px) {
  .feature {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    padding: 2.25rem 0;
  }
  /* On narrow screens, every row should read text-then-image regardless
     of source order, so the user gets the headline before the picture. */
  .feature .feature-image { order: 2; }
  .feature .feature-text { order: 1; }
  .feature-text p { max-width: none; }
}

/* --- How --- */
.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}
.how-step h3 {
  font-size: 1.1rem;
  margin: 0.75rem 0 0.5rem;
}
.how-step p {
  color: var(--pg-text-dim);
  margin: 0;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--pg-primary);
  color: #ffffff;
  font-weight: 600;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--pg-border);
  padding: 2rem 0;
  color: var(--pg-text-dim);
}
.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-brand { font-weight: 600; }
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { color: var(--pg-text-dim); }
.footer-links a:hover { color: var(--pg-text); }

@media (max-width: 540px) {
  .hero { padding: 3rem 0 2.5rem; }
  section.features, section.how { padding: 3rem 0; }
  .footer .container { flex-direction: column; gap: 0.75rem; }
}

/* --- Pricing page --- */
.pricing-hero {
  padding: 4.5rem 0 2rem;
  text-align: center;
}
.pricing-hero h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}
.pricing-hero .lede {
  max-width: 640px;
  margin: 0 auto 1.5rem;
  color: var(--pg-text-dim);
  font-size: 1.1rem;
}
.trial-banner {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--pg-code-bg);
  border: 1px solid var(--pg-border);
  color: var(--pg-text);
  font-size: 0.95rem;
}

.pricing-cards { padding: 1rem 0 4rem; }
.billing-toggle {
  display: inline-flex;
  margin: 0 auto 2rem;
  border: 1px solid var(--pg-border);
  background: var(--pg-code-bg);
  width: fit-content;
}
.pricing-cards .container { text-align: center; }
.billing-opt {
  padding: 0.5rem 1.1rem;
  background: transparent;
  border: none;
  color: var(--pg-text-dim);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.billing-opt.is-active {
  background: var(--pg-bg);
  color: var(--pg-text);
  font-weight: 600;
}
.save-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  background: var(--pg-success);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  text-align: left;
  align-items: stretch;
  max-width: 760px;
  margin: 0 auto;
}
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.75rem;
  background: var(--pg-bg);
  border: 1px solid var(--pg-border);
}
.plan-featured {
  border-color: var(--pg-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.plan-tag {
  position: absolute;
  top: -0.6rem;
  left: 1.5rem;
  padding: 0.15rem 0.6rem;
  background: var(--pg-primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.plan-name {
  font-size: 1.35rem;
  margin: 0 0 0.25rem;
}
.plan-tagline {
  color: var(--pg-text-dim);
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
  min-height: 2.6em;
}
.plan-price {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}
.price-amount {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.price-unit {
  color: var(--pg-text-dim);
  font-size: 0.95rem;
}
.price-note {
  color: var(--pg-text-dim);
  font-size: 0.85rem;
  margin: 0 0 1.25rem;
  min-height: 1.2em;
}
.plan-cta {
  width: 100%;
  text-align: center;
  margin-bottom: 1.5rem;
}
.btn-outline {
  background: transparent;
  color: var(--pg-text);
  border-color: var(--pg-border);
}
.btn-outline:hover {
  background: var(--pg-code-bg);
  text-decoration: none;
}
.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--pg-text);
}
.plan-features li {
  padding: 0.4rem 0 0.4rem 1.4rem;
  position: relative;
  font-size: 0.95rem;
  border-top: 1px solid var(--pg-border);
}
.plan-features li:first-child { border-top: none; }
.plan-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 0.7rem;
  height: 0.35rem;
  border-left: 2px solid var(--pg-success);
  border-bottom: 2px solid var(--pg-success);
  transform: rotate(-45deg);
}

.fair-use {
  max-width: 640px;
  margin: 2rem auto 0;
  text-align: center;
  color: var(--pg-text-dim);
  font-size: 0.92rem;
}

.pricing-privacy {
  padding: 3rem 0;
  text-align: center;
  border-top: 1px solid var(--pg-border);
  border-bottom: 1px solid var(--pg-border);
}
.pricing-privacy .lede {
  max-width: 640px;
  margin: 0.75rem auto 0;
  color: var(--pg-text-dim);
}

.pricing-faq { padding: 4rem 0 5rem; }
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem 2.5rem;
  margin-top: 2rem;
}
.faq-item h3 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
}
.faq-item p {
  margin: 0;
  color: var(--pg-text-dim);
  font-size: 0.95rem;
}

@media (max-width: 540px) {
  .pricing-hero { padding: 3rem 0 1.5rem; }
  .plan { padding: 1.5rem 1.25rem; }
  .price-amount { font-size: 2rem; }
}
