/* asql marketing page — design tokens + components.
   Two colors only: a deep blueprint navy and one safety orange. */

:root {
  --color-bg: #0d2b45;
  --color-surface: #123657;
  --color-text: #eaf2fb;
  --color-accent: #e1724a;
  --color-accent-hover: #ffb27a;
  --color-accent-dim: #143349;
  --color-link: #ff8a4d;
  --color-divider: color-mix(in srgb, #eaf2fb 16%, transparent);

  /* Navy tint ramp — light (near text) to dark (near bg). Used for
     text hierarchy and chrome; orange is reserved for emphasis. */
  --color-navy-100: #f4f9fd;
  --color-navy-200: #dbe9f5;
  --color-navy-300: #b9d0e6;
  --color-navy-400: #93b0cf;
  --color-navy-500: #6d8cae;
  --color-navy-600: #4d6a89;
  --color-navy-700: #34506c;
  --color-navy-800: #1f3752;
  --color-navy-900: #122840;
  --color-panel-dark: #0a2038;

  /* The output-preview cards (chart demo, flip-card backs, narrative
     figure) show a real asql report on its own paper theme, not the
     page's dark theme. */
  --color-paper: #ffffff;
  --color-paper-ink: #142b40;
  --color-paper-ink-dim: #5c7186;
  --color-paper-divider: color-mix(in srgb, #142b40 16%, transparent);

  --font-heading: "Barlow Condensed", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --space-2: 7px;
  --space-3: 10px;
  --space-4: 14px;
  --space-6: 20px;
  --space-8: 27px;

  --radius-md: 4px;

  --shadow-md: 0 3px 10px color-mix(in srgb, #000000 16%, transparent);
}

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; margin: 0; }
p { margin: 0; }
a { color: var(--color-link); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--color-accent-hover); }
img { display: block; max-width: 100%; }
figure { margin: 0; }
code, pre { font-family: var(--font-mono); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: var(--color-accent); color: var(--color-bg); }

/* — scroll-reveal — driven by script.js toggling .is-visible — */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s cubic-bezier(.22,.61,.36,1),
              transform 0.65s cubic-bezier(.22,.61,.36,1);
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* — blueprint frame: hairline border + corner registration marks — */
.blueprint {
  position: relative;
  border: 1px solid var(--color-divider);
}
.blueprint > .corner {
  position: absolute; width: 11px; height: 11px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.blueprint > .corner::before, .blueprint > .corner::after {
  content: ""; position: absolute; background: currentColor;
}
.blueprint > .corner::before { left: 5px; top: 0; width: 1px; height: 100%; }
.blueprint > .corner::after  { top: 5px; left: 0; width: 100%; height: 1px; }
.blueprint > .corner.tl { top: -6px; left: -6px; }
.blueprint > .corner.tr { top: -6px; right: -6px; }
.blueprint > .corner.bl { bottom: -6px; left: -6px; }
.blueprint > .corner.br { bottom: -6px; right: -6px; }

/* an output-preview card: shows a real report on its own paper theme */
.blueprint--paper {
  background: var(--color-paper);
  --color-text: var(--color-paper-ink);
  --color-divider: var(--color-paper-divider);
}
/* — eyebrow label — */
.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--color-accent);
}
.eyebrow-rule { width: 28px; height: 1px; background: var(--color-accent); display: block; }
.eyebrow--muted { color: var(--color-navy-400); font-size: 12px; }

/* — inline code chip — */
.chip {
  font-size: 0.88em;
  background: var(--color-navy-800);
  padding: 1px 5px;
}

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  background: transparent;
}
.btn-install {
  font-size: 14px; padding: 7px 14px;
  border: 2px solid var(--color-accent);
  background: var(--color-bg); color: var(--color-accent);
}
.btn-install:hover { background: var(--color-accent); color: var(--color-bg); }
.btn-ghost-docs {
  font-size: 14px; padding: 13px 18px;
  border: 1px solid var(--color-divider); color: var(--color-text);
}
.btn-ghost-docs:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }

/* — install / copy row — */
.install-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; scroll-margin-top: 90px; }
.install-box { display: flex; align-items: center; gap: 16px; padding: 14px 16px; background: var(--color-panel-dark); }
.install-cmd { font-size: 15px; color: var(--color-text); white-space: nowrap; }
.install-cmd .prompt { color: var(--color-navy-400); }
.install-note { font-size: 14px; color: var(--color-navy-300); }

.copy-btn {
  font-family: var(--font-heading); font-weight: 600; font-size: 13px;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 6px 12px; cursor: pointer;
  border: 1px solid var(--color-accent);
  background: transparent; color: var(--color-accent);
}
.copy-btn:hover { background: var(--color-accent-dim); }

.docker-note { margin-top: 14px; font-size: 13px; color: var(--color-navy-300); max-width: 640px; }
.docker-cmd {
  margin: 8px 0 0; padding: 10px 14px; background: var(--color-navy-800);
  border-radius: var(--radius-md); font-size: 0.85em; color: var(--color-text);
  white-space: pre-wrap; overflow-x: auto;
}

/* — header — */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-divider);
}
.nav-inner { display: flex; align-items: center; gap: 28px; padding: 14px 32px; }
.brand {
  font-family: var(--font-heading); font-weight: 600; font-size: 22px;
  letter-spacing: 0.02em; color: var(--color-text); margin-right: auto;
}
.brand:hover { color: var(--color-text); }
.nav-link { font-size: 14px; color: var(--color-navy-200); }
.nav-link:hover { color: var(--color-accent); }

/* — hero — */
.hero { padding: 96px 32px 0; max-width: 1180px; margin: 0 auto; }
.hero-intro { max-width: 880px; }
.hero-title {
  font-size: clamp(52px, 8vw, 104px); line-height: 0.96; letter-spacing: -0.02em;
  margin: 0 0 24px; border-bottom: 6px solid var(--color-accent);
  padding-bottom: 24px; display: inline-block;
}
.hero-lede {
  font-size: clamp(17px, 2vw, 21px); line-height: 1.5; max-width: 640px;
  margin: 0 0 36px; color: var(--color-navy-100); text-wrap: pretty;
}
.install-row { margin-top: 0; }

.demo-grid {
  margin: 64px 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 28px; align-items: start;
}
.panel-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--color-navy-400); margin-bottom: 18px;
}
.code-panel { background: var(--color-panel-dark); padding: 28px 26px; }
.code { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--color-navy-200); overflow-x: auto; }
.code .comment { color: var(--color-navy-400); }
.code .keyword { color: var(--color-accent); }
.code .literal { color: var(--color-navy-300); }
.code .blank { display: block; height: 1.7em; }
.code span[class] {} /* spans without a role class inherit .code color */

.chart-card { background: var(--color-paper); padding: 26px 24px 22px; }
.chart-title { font-family: var(--font-heading); font-weight: 600; font-size: 19px; margin-bottom: 4px; color: var(--color-paper-ink); }
.chart-subtitle { font-size: 12px; color: var(--color-paper-ink-dim); margin-bottom: 14px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-grid { stroke: #c9d8e6; stroke-width: 1; }
.chart-baseline { stroke: var(--color-navy-600); stroke-width: 1; }
.chart-axis-label { fill: var(--color-paper-ink-dim); font-family: var(--font-mono); font-size: 11px; }
.chart-lines { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-line--direct { stroke: var(--color-accent-dim); }
.chart-line--paid { stroke: var(--color-accent); }
.chart-line--partner { stroke: #2c455d; }
@keyframes drawline { to { stroke-dashoffset: 0; } }
.chart-lines path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.chart-lines.is-drawn path { animation: drawline 1.1s cubic-bezier(.4,0,.2,1) forwards; }

.chart-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; font-size: 12px; color: var(--color-navy-200); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-swatch { width: 14px; height: 2px; display: block; }
.legend-swatch--direct { background: var(--color-accent-dim); }
.legend-swatch--paid { background: var(--color-accent); }
.legend-swatch--partner { background: var(--color-navy-600); }

.demo-caption {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--color-navy-400); margin-top: 14px;
}
.demo-caption .accent-text { color: var(--color-accent); }

/* — section scaffolding — */
.section { max-width: 1180px; margin: 0 auto; padding: 120px 32px 0; scroll-margin-top: 80px; }
.section-title { font-size: clamp(32px, 4vw, 46px); letter-spacing: -0.015em; margin: 0 0 12px; }
.section-lede { max-width: 620px; font-size: 17px; color: var(--color-navy-200); margin: 0 0 48px; }
.body-text { font-size: 17px; color: var(--color-navy-200); text-wrap: pretty; }

/* — examples / carousel / flip cards — */
.carousel { position: relative; max-width: 720px; margin: 0 auto; }
.carousel-viewport { overflow: hidden; }
.carousel-track {
  display: flex; width: 200%;
  transform: translateX(calc(var(--carousel-index, 0) * -100% / var(--carousel-count, 2)));
  transition: transform 0.4s cubic-bezier(.22,.61,.36,1);
}
.flip-card { flex: 0 0 50%; max-width: 720px; margin: 0 auto; height: 480px; -webkit-perspective: 1600px; perspective: 1600px; }
.flip-card-inner {
  position: relative; width: 100%; height: 100%;
  -webkit-transform-style: preserve-3d; transform-style: preserve-3d;
  transition: -webkit-transform 0.6s cubic-bezier(.22,.61,.36,1), transform 0.6s cubic-bezier(.22,.61,.36,1);
}
.flip-card.is-flipped .flip-card-inner { -webkit-transform: rotateY(180deg); transform: rotateY(180deg); }
.flip-card-front, .flip-card-back {
  position: absolute; inset: 0;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  padding: 28px 26px; display: flex; flex-direction: column; overflow: hidden;
}
.flip-card-front { background: var(--color-panel-dark); }
.flip-card.is-flipped .flip-card-front { pointer-events: none; }
.flip-card-back {
  -webkit-transform: rotateY(180deg); transform: rotateY(180deg);
  padding: 18px 18px 16px;
  pointer-events: none;
}
.flip-card.is-flipped .flip-card-back { pointer-events: auto; }
.flip-card-code { flex: 1; min-height: 0; overflow: auto; font-size: 13px; -webkit-overflow-scrolling: touch; }
.flip-btn {
  cursor: pointer; font-family: var(--font-heading); font-weight: 600; font-size: 13px;
  letter-spacing: 0.04em; padding: 8px 14px; align-self: flex-start; margin-top: 14px;
  border: 1px solid var(--color-accent); background: transparent; color: var(--color-accent);
}
.flip-image { width: 100%; flex: 1; min-height: 0; object-fit: cover; object-position: top; border: 1px solid #e2e8ee; }
.flip-caption-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.flip-caption { font-size: 12px; color: var(--color-paper-ink-dim); }
.flip-btn--back {
  font-size: 12px; padding: 7px 12px; margin-top: 0;
  border-color: var(--color-divider); background: transparent; color: var(--color-text);
}

.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--color-divider); background: var(--color-bg); color: var(--color-text); font-size: 16px;
}
.carousel-prev { left: -18px; }
.carousel-next { right: -18px; }
.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.carousel-dot {
  width: 8px; height: 8px; padding: 0; border-radius: 50%; cursor: pointer;
  border: none; background: color-mix(in srgb, var(--color-text) 25%, transparent);
}
.carousel-dot.is-active { background: var(--color-text); }

/* — why grid — */
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 40px 48px; }
.why-index { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--color-accent); margin-bottom: 14px; }
.why-item h3 { font-size: 26px; line-height: 1.15; margin: 0 0 10px; }
.why-item p { font-size: 15px; color: var(--color-navy-200); text-wrap: pretty; }

/* — compiler — */
.compiler { margin: 120px 0 0; background: var(--color-panel-dark); color: var(--color-navy-200); scroll-margin-top: 60px; }
.compiler-inner { max-width: 1180px; margin: 0 auto; padding: 104px 32px 112px; }
.compiler-title { font-size: clamp(44px, 6.5vw, 86px); line-height: 1; letter-spacing: -0.02em; margin: 32px 0; max-width: 15ch; }
.compiler-lede { max-width: 620px; font-size: 18px; line-height: 1.55; color: var(--color-accent); margin: 0 0 72px; text-wrap: pretty; }
.compiler-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(46%, 1fr)); gap: 1px;
  background: var(--color-divider);
}
.compiler-item { background: var(--color-panel-dark); padding: 32px 28px 36px; }
.compiler-item h3 { font-size: 24px; line-height: 1.15; margin: 0 0 12px; color: var(--color-paper); }
.compiler-item p { margin: 0; font-size: 15px; color: var(--color-navy-300); text-wrap: pretty; }
.compiler-item code { font-size: 0.88em; color: var(--color-paper); background: transparent; padding: 0; }

/* — narrative — */
.narrative-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 56px; align-items: center;
}
.narrative-figure { max-height: 560px; overflow: hidden; }
.narrative-fade {
  position: absolute; inset: auto 0 0 0; height: 140px;
  background: linear-gradient(rgba(255,255,255,0), #ffffff);
  pointer-events: none;
}

/* — grows — */
.grows-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 48px; }

/* — footer — */
.site-footer {
  max-width: 1180px; margin: 112px auto 0; padding: 32px;
  border-top: 1px solid var(--color-divider);
  display: flex; flex-wrap: wrap; gap: 20px; align-items: baseline; justify-content: flex-end;
}
.footer-links { display: flex; gap: 24px; font-size: 14px; }
.footer-links a { color: var(--color-navy-200); }
.footer-links a:hover { color: var(--color-accent); }

/* — responsive — */
@media (max-width: 860px) {
  .nav-inner {
    padding: 12px 16px; gap: 18px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-inner::-webkit-scrollbar { display: none; }
  .brand { flex: 0 0 auto; }
  .nav-link, .btn-install { flex: 0 0 auto; white-space: nowrap; }

  .hero { padding: 72px 20px 0; }
  .section { padding: 88px 20px 0; }
  .compiler-inner { padding: 72px 20px 80px; }
  .site-footer { padding: 32px 20px; justify-content: flex-start; }

  .install-box { flex-wrap: nowrap; width: 100%; max-width: 100%; }
  .install-cmd {
    min-width: 0; flex: 1 1 auto;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  }
  .copy-btn { flex: 0 0 auto; }
  .install-row { width: 100%; }

  .carousel-arrow { display: none; }
}

@media (max-width: 540px) {
  .demo-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .narrative-grid { grid-template-columns: 1fr; }
  .compiler-grid { grid-template-columns: 1fr; }
  .flip-card { height: 420px; }
}
