:root {
  --ink: #151712;
  --muted: #64675e;
  --paper: #f4f1e9;
  --paper-deep: #e9e4d8;
  --card: #fcfaf5;
  --line: #d6d0c3;
  --orange: #ff5a1f;
  --orange-dark: #d94410;
  --blue: #3366cc;
  --green: #24856c;
  --yellow: #e7b94c;
  --dark: #171b17;
  --dark-card: #222722;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(21, 23, 18, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 23, 18, .035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: var(--sans);
  line-height: 1.5;
}
button, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 10px 14px;
  background: white;
  border: 2px solid var(--ink);
}
.skip-link:focus { top: 12px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  width: min(1400px, calc(100% - 48px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(21, 23, 18, .22);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 760;
  letter-spacing: -.03em;
  font-size: 20px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 29px;
  height: 29px;
  background: var(--orange);
  color: #fff;
  border-radius: 50%;
  font-size: 23px;
  line-height: 1;
}
.site-header nav { display: flex; gap: 30px; font-size: 14px; font-weight: 600; }
.site-header nav a { text-decoration: none; }
.site-header nav a:hover { color: var(--orange-dark); }

.hero {
  width: min(1400px, calc(100% - 48px));
  min-height: 610px;
  margin: 0 auto;
  padding: 88px 0 78px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: clamp(48px, 8vw, 130px);
}
.eyebrow {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .13em;
  color: var(--orange-dark);
}
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(36, 133, 108, .14);
}
.hero h1 {
  margin: 0;
  font-size: clamp(53px, 6.4vw, 94px);
  line-height: .94;
  letter-spacing: -.067em;
  max-width: 790px;
}
.hero h1 em { font-family: Georgia, serif; font-weight: 400; color: var(--orange); }
.hero-intro {
  max-width: 610px;
  margin: 30px 0 34px;
  color: var(--muted);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.6;
}
.hero-actions { display: flex; align-items: center; gap: 26px; }
.primary-button, .run-button {
  border: 0;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-weight: 720;
  box-shadow: 4px 4px 0 var(--orange);
  transition: transform .15s ease, box-shadow .15s ease;
}
.primary-button { padding: 15px 20px; }
.primary-button span { padding-left: 22px; }
.primary-button:hover, .run-button:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--orange); }
.text-link { font-weight: 700; text-underline-offset: 5px; }

.hero-question {
  position: relative;
  padding: 27px 29px 20px;
  background: var(--card);
  border: 1px solid var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
  transform: rotate(1deg);
}
.hero-question::before {
  content: "";
  position: absolute;
  width: 88px;
  height: 23px;
  top: -14px;
  left: 42%;
  background: rgba(255, 211, 110, .75);
  transform: rotate(-3deg);
}
.question-label { display: flex; justify-content: space-between; font: 700 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.question-number { color: var(--orange); }
.hero-question blockquote { margin: 37px 0 24px; font: 31px/1.3 Georgia, serif; letter-spacing: -.02em; }
.hero-question blockquote strong { font-weight: 400; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.mini-legend { display: flex; gap: 22px; color: var(--muted); font-size: 12px; }
.mini-legend i { display: inline-block; width: 18px; height: 3px; margin: 0 6px 3px 0; }
.legend-postgres { background: var(--blue); }
.legend-mysql { background: var(--orange); }
.hero-sparkline { width: 100%; margin-top: 17px; overflow: visible; }
.hero-sparkline path { fill: none; vector-effect: non-scaling-stroke; }
.spark-grid { stroke: #ddd7ca; stroke-width: 1; }
.spark-postgres { stroke: var(--blue); stroke-width: 4; }
.spark-mysql { stroke: var(--orange); stroke-width: 4; }

.dataset-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--ink);
  color: white;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
}
.dataset-strip div { min-height: 108px; padding: 25px clamp(20px, 4vw, 60px); border-right: 1px solid #46483f; display: flex; flex-direction: column; justify-content: center; }
.dataset-strip div:last-child { border-right: 0; }
.metric-label { color: #aeb1a7; font: 700 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.dataset-strip strong { margin-top: 6px; font-size: clamp(17px, 2vw, 25px); letter-spacing: -.03em; }

.workspace-section { padding: 92px 24px 105px; background: var(--paper); }
.section-heading { width: min(1320px, 100%); margin: 0 auto 44px; display: flex; justify-content: space-between; align-items: end; gap: 40px; }
.section-heading h2 { margin: 0; font-size: clamp(40px, 5vw, 66px); line-height: 1; letter-spacing: -.055em; }
.section-heading > p { max-width: 500px; margin: 0; color: var(--muted); font-size: 17px; }
.workspace-shell {
  width: min(1320px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  border: 1px solid var(--ink);
  background: var(--card);
  box-shadow: 8px 8px 0 var(--ink);
}
.preset-panel { border-right: 1px solid var(--ink); background: var(--paper-deep); }
.panel-title { padding: 17px 20px; border-bottom: 1px solid var(--ink); font: 700 11px var(--mono); letter-spacing: .11em; text-transform: uppercase; }
.preset-list { padding: 10px; display: grid; gap: 5px; }
.preset-button {
  width: 100%;
  padding: 14px 12px;
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 8px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--muted);
}
.preset-button:hover { background: rgba(255,255,255,.5); color: var(--ink); }
.preset-button.active { background: var(--card); border-color: var(--ink); color: var(--ink); box-shadow: 3px 3px 0 var(--orange); }
.preset-icon { color: var(--orange-dark); font-family: var(--mono); }
.preset-button strong { display: block; font-size: 13px; line-height: 1.35; }
.preset-button small { display: block; margin-top: 3px; color: inherit; font-size: 11px; }
.query-workspace { min-width: 0; padding: clamp(20px, 3.2vw, 42px); }
.query-heading { display: flex; justify-content: space-between; gap: 24px; align-items: start; margin-bottom: 22px; }
.query-kicker { margin: 0 0 6px; color: var(--orange-dark); font: 700 10px var(--mono); letter-spacing: .12em; }
.query-heading h3 { margin: 0; font-size: 29px; letter-spacing: -.035em; }
.query-heading p:last-child { margin: 5px 0 0; color: var(--muted); }
.snapshot-control { min-width: 260px; display: grid; gap: 5px; color: var(--muted); font: 700 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.snapshot-control select { width: 100%; padding: 10px; border: 1px solid var(--line); background: white; color: var(--ink); font: 12px var(--mono); text-transform: none; letter-spacing: 0; }
.editor-wrap { border: 1px solid var(--ink); background: #1e211d; color: #f2f0e8; }
.editor-toolbar, .editor-footer { min-height: 43px; padding: 9px 13px; display: flex; align-items: center; justify-content: space-between; color: #b7baaf; font: 700 10px var(--mono); letter-spacing: .08em; }
.editor-toolbar { border-bottom: 1px solid #40433d; }
.editor-footer { border-top: 1px solid #40433d; }
.icon-button { padding: 5px 8px; color: #d8d9d2; border: 1px solid #555950; background: transparent; cursor: pointer; font: 11px var(--mono); }
.icon-button:hover { border-color: var(--orange); color: white; }
#sql-editor {
  display: block;
  width: 100%;
  min-height: 185px;
  resize: vertical;
  padding: 18px;
  border: 0;
  outline: 0;
  background: #1e211d;
  color: #f4f1e9;
  font: 13px/1.7 var(--mono);
  tab-size: 2;
}
#sql-editor:focus { box-shadow: inset 0 0 0 2px var(--orange); }
.run-button { padding: 9px 13px; box-shadow: 3px 3px 0 var(--orange); font-size: 12px; }
.run-button:disabled { opacity: .55; cursor: wait; }
.run-button kbd { margin-left: 10px; padding: 2px 5px; border: 1px solid #555; border-radius: 2px; color: #c8c9c2; font: 10px var(--mono); }
.run-icon { font-size: 9px; padding-right: 5px; }
.query-status { min-height: 38px; display: flex; align-items: center; gap: 8px; color: var(--muted); font: 11px var(--mono); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #97998f; }
.query-status.running .status-dot { background: var(--yellow); animation: pulse 1s infinite; }
.query-status.success .status-dot { background: var(--green); }
.query-status.error { color: #a52e1d; }
.query-status.error .status-dot { background: #c93c27; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.8); } }
.results-card { border: 1px solid var(--line); background: #fff; }
.results-toolbar { min-height: 64px; padding: 13px 16px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.results-toolbar > div:first-child { display: grid; }
.results-label { color: var(--orange-dark); font: 700 9px var(--mono); letter-spacing: .12em; }
.results-toolbar strong { font-size: 14px; }
.results-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font: 11px var(--mono); }
.view-toggle { display: flex; border: 1px solid var(--line); }
.view-toggle button { padding: 6px 9px; border: 0; background: transparent; cursor: pointer; font: 10px var(--mono); }
.view-toggle button.active { color: white; background: var(--ink); }
.chart-container { min-height: 360px; padding: 24px 20px 14px; overflow: hidden; }
.empty-result { min-height: 300px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.chart-svg { width: 100%; min-width: 620px; height: 320px; overflow: visible; }
.chart-grid { stroke: #e6e2d9; stroke-width: 1; }
.chart-axis-text { fill: #777a70; font: 10px var(--mono); }
.chart-line { fill: none; stroke-width: 3; vector-effect: non-scaling-stroke; }
.chart-point { stroke: white; stroke-width: 2; }
.chart-bar { opacity: .9; }
.chart-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin-top: -4px; color: var(--muted); font: 11px var(--mono); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; }
.table-container { max-height: 400px; overflow: auto; }
.table-container table { width: 100%; border-collapse: collapse; font: 12px/1.45 var(--mono); }
.table-container th { position: sticky; top: 0; background: var(--paper-deep); text-align: left; z-index: 1; }
.table-container th, .table-container td { padding: 10px 12px; border-bottom: 1px solid #ebe7de; vertical-align: top; }
.table-container td { max-width: 390px; overflow-wrap: anywhere; }

.how-section { padding: 100px 24px; background: var(--dark); color: #f7f4eb; }
.light-heading .eyebrow { color: #ff7b4c; }
.light-heading > p { color: #aeb2a8; }
.pipeline { width: min(1320px, 100%); margin: 60px auto 54px; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); list-style: none; border: 1px solid #4a4e47; }
.pipeline li { position: relative; min-height: 145px; padding: 22px 15px; display: flex; flex-direction: column; justify-content: end; border-right: 1px solid #4a4e47; }
.pipeline li:last-child { border-right: 0; }
.pipeline-highlight { background: var(--orange); color: white; }
.pipeline-number { position: absolute; top: 15px; left: 15px; color: #8d9188; font: 10px var(--mono); }
.pipeline-highlight .pipeline-number { color: #ffe1d7; }
.pipeline strong { font-size: 17px; }
.pipeline small { color: #aeb2a8; }
.pipeline-highlight small { color: #ffe1d7; }
.pipeline-arrow { position: absolute; z-index: 2; right: -12px; top: 60px; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #555a52; border-radius: 50%; background: var(--dark); color: #bfc2b9; }
.principles { width: min(1320px, 100%); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.principles article { padding: 27px; border: 1px solid #454941; background: var(--dark-card); }
.principles article > span { color: var(--orange); font-size: 30px; }
.principles h3 { margin: 16px 0 8px; font-size: 20px; }
.principles p { margin: 0; color: #aeb2a8; font-size: 14px; }
footer { padding: 35px 5%; display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; gap: 30px; background: #0f120f; color: #c6c9bf; border-top: 1px solid #32362f; font-size: 12px; }
footer p { margin: 0; text-align: center; }
footer > a { justify-self: end; color: white; font-weight: 700; text-underline-offset: 4px; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 65px; }
  .hero-question { max-width: 650px; }
  .workspace-shell { grid-template-columns: 1fr; }
  .preset-panel { border-right: 0; border-bottom: 1px solid var(--ink); }
  .preset-list { display: flex; overflow-x: auto; }
  .preset-button { min-width: 210px; }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .pipeline li:nth-child(3) { border-right: 0; }
  .pipeline li:nth-child(-n+3) { border-bottom: 1px solid #4a4e47; }
  .dataset-strip { grid-template-columns: repeat(2, 1fr); }
  .dataset-strip div:nth-child(2) { border-right: 0; }
  .dataset-strip div:nth-child(-n+2) { border-bottom: 1px solid #46483f; }
}

@media (max-width: 700px) {
  .site-header { width: calc(100% - 30px); height: 65px; }
  .site-header nav a:not(:last-child) { display: none; }
  .hero { width: calc(100% - 30px); padding: 52px 0 65px; gap: 56px; }
  .hero h1 { font-size: clamp(48px, 15vw, 68px); }
  .hero-question blockquote { font-size: 25px; }
  .dataset-strip { grid-template-columns: 1fr 1fr; }
  .dataset-strip div { min-height: 93px; padding: 18px 16px; }
  .section-heading { align-items: start; flex-direction: column; }
  .workspace-section, .how-section { padding-left: 15px; padding-right: 15px; }
  .query-heading { flex-direction: column; }
  .snapshot-control { min-width: 100%; }
  .query-workspace { padding: 16px; }
  .editor-footer > span { display: none; }
  .results-toolbar { align-items: start; flex-direction: column; }
  .results-meta { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .chart-container { padding-left: 10px; overflow-x: auto; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipeline li, .pipeline li:nth-child(3) { border-right: 1px solid #4a4e47; border-bottom: 1px solid #4a4e47; }
  .pipeline li:nth-child(even) { border-right: 0; }
  .pipeline li:nth-last-child(-n+2) { border-bottom: 0; }
  .principles { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr; text-align: center; }
  footer p { text-align: center; }
  footer > a { justify-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
