/* tabbysql.com. Colours, type and radii follow design/tokens.json:
   indigo does the work, amber means "Tabby is involved". */
/* Fonts are self-hosted (OFL, see assets/fonts) so the site loads nothing from third parties. */
@font-face { font-family: "Fredoka"; src: url("/assets/fonts/Fredoka-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("/assets/fonts/Fredoka-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-SemiBold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/JetBrainsMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/JetBrainsMono-Regular.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/JetBrainsMono-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --canvas: #F4F5F8;
  --surface: #FFFFFF;
  --subtle: #FAFAFC;
  --muted: #EAECF1;
  --line: rgba(23, 24, 31, 0.1);
  --ink: #17181F;
  --ink-2: #4F5466;
  --ink-3: #6B7183;
  --accent: #4A4BD8;
  --accent-hover: #3D3CB6;
  --accent-soft: #EEF0FF;
  --accent-text: #4A4BD8;
  --ask: #FFF7EB;
  --ask-strong: #FB9F33;
  --ask-text: #AF5410;
  --ask-line: #FFD394;
  --ok: #157A4E;
  --ok-soft: #DDF5E9;

  --display: "Fredoka", "Avenir Next Rounded", ui-rounded, system-ui, sans-serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(23, 24, 31, 0.06), 0 30px 60px -30px rgba(38, 40, 82, 0.35);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #101117; --surface: #17181F; --subtle: #1E2029; --muted: #282B37;
    --line: rgba(255, 255, 255, 0.1); --ink: #F4F5F8; --ink-2: #BCC1CD; --ink-3: #8F95A5;
    --accent: #5A5EEA; --accent-hover: #767CF4; --accent-soft: #262852; --accent-text: #9DA3FB;
    --ask: #2E2117; --ask-text: #FFB85C; --ask-line: #8C4314; --ok: #6FD3A2; --ok-soft: #14301F;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 30px 60px -30px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #101117; --surface: #17181F; --subtle: #1E2029; --muted: #282B37;
  --line: rgba(255, 255, 255, 0.1); --ink: #F4F5F8; --ink-2: #BCC1CD; --ink-3: #8F95A5;
  --accent: #5A5EEA; --accent-hover: #767CF4; --accent-soft: #262852; --accent-text: #9DA3FB;
  --ask: #2E2117; --ask-text: #FFB85C; --ask-line: #8C4314; --ok: #6FD3A2; --ok-soft: #14301F;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-text); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 em, h2 em { font-style: normal; color: var(--accent-text); }
p { margin: 0; }
code, kbd { font: 500 0.88em var(--mono); }
kbd { padding: 0.1em 0.45em; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); }
.wrap {
  max-width: 1160px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.eyebrow { font: 600 13px/1 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); }
.eyebrow.ask { color: var(--ask-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap;
  font: 600 15px/1 var(--body); color: #fff; background: var(--accent);
  padding: 13px 20px; border-radius: 999px; transition: background 0.15s;
}
.btn:hover { background: var(--accent-hover); }
.btn-small { padding: 10px 16px; font-size: 14px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none;
  background: var(--ink); color: var(--canvas); padding: 11px 22px 11px 18px; border-radius: 14px;
  font: 600 20px/1.05 var(--body); transition: transform 0.15s;
}
.store-btn small { display: block; font: 500 12px/1.2 var(--body); opacity: 0.8; }
.store-btn:hover { transform: translateY(-1px); }
.store-btn[aria-disabled="true"] { cursor: default; }
.store-btn[aria-disabled="true"]:hover { transform: none; }
.store-note { color: var(--ink-3); font-size: 14px; max-width: 46ch; }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 600 21px/1 var(--display); }
.brand img { border-radius: 8px; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 760px) { .nav-links { display: none; } .nav .btn { margin-left: auto; } }

/* Hero */
.hero { position: relative; padding: 72px 0 40px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, rgba(90, 94, 234, 0.22), transparent 70%),
              radial-gradient(closest-side at 30% 80%, rgba(251, 159, 51, 0.2), transparent 70%);
  pointer-events: none; z-index: -1;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(44px, 6.4vw, 78px); margin: 18px 0 22px; }
.lede { font-size: clamp(18px, 1.7vw, 21px); color: var(--ink-2); max-width: 34em; }
.store { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; margin-top: 34px; }
.engines { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--ink-2);
}
.chip b { font: 700 11px/1 var(--mono); padding: 5px 6px; border-radius: 7px; }
.pg { background: #EEF0FF; color: #4A4BD8; }
.my { background: #FFF7EB; color: #AF5410; }
.sq { background: #DDF5E9; color: #157A4E; }
.hero-tabby { position: relative; justify-self: center; width: min(420px, 100%); }
.hero-tabby img { width: 100%; height: auto; filter: drop-shadow(0 30px 40px rgba(38, 40, 82, 0.22)); animation: bob 5s ease-in-out infinite; }
.bubble {
  position: absolute; z-index: 1; top: 2%; left: -14%; max-width: 230px;
  background: var(--ask); color: var(--ask-text); border: 1px solid var(--ask-line);
  font: 500 15px/1.35 var(--body); padding: 12px 16px; border-radius: 18px 18px 18px 4px; box-shadow: var(--shadow);
}
.bubble code { color: var(--ink); }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-1deg); } }
@media (prefers-reduced-motion: reduce) { .hero-tabby img { animation: none; } }
@media (max-width: 560px) { .bubble { display: none; } }
@media (max-width: 860px) {
  .hero { padding-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-tabby { width: min(260px, 70%); order: -1; }
  .bubble { left: auto; right: -12%; top: 0; font-size: 13px; max-width: 180px; }
}

/* App window frame around a screenshot */
.window {
  margin: 56px 0 0; border-radius: 14px; overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.titlebar { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 14px; background: var(--subtle); border-bottom: 1px solid var(--line); }
.lights { display: flex; gap: 7px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; background: #FF5F57; }
.lights i:nth-child(2) { background: #FEBC2E; }
.lights i:nth-child(3) { background: #28C840; }
.titlebar span { flex: 1; text-align: center; font: 500 13px/1 var(--body); color: var(--ink-3); margin-right: 50px; }
.window img, .window video { width: 100%; height: auto; }

/* Sections */
section { padding: 96px 0; }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(34px, 4.4vw, 52px); margin: 14px 0 16px; }
.section-head p { color: var(--ink-2); font-size: 18px; }

/* Ask Tabby */
.ask-band { background: linear-gradient(180deg, var(--ask), var(--canvas)); border-top: 1px solid var(--ask-line); }
.ask-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.ask-copy h2 { font-size: clamp(34px, 4.4vw, 52px); margin: 14px 0 18px; }
.ask-copy > p { color: var(--ink-2); font-size: 18px; margin-bottom: 22px; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 32px; color: var(--ink-2); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.6 2.6L14 7.6' fill='none' stroke='%2322A36B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/20px no-repeat;
}
.ticks b { color: var(--ink); font-weight: 600; }
.ask-demo { position: relative; }
.ask-card {
  background: var(--surface); border: 1px solid var(--ask-line); border-radius: 18px; box-shadow: var(--shadow);
  padding: 20px; position: relative; z-index: 1;
}
.ask-q {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px;
  background: var(--ask); border: 1px solid var(--ask-line); color: var(--ink); font-size: 15px;
}
.ask-q img { width: 26px; height: 26px; }
.ask-q .typed { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-right: 2px solid var(--ask-strong); animation: caret 1s step-end infinite; padding-right: 2px; }
@keyframes caret { 50% { border-color: transparent; } }
.ask-a { margin-top: 16px; }
.ask-a h3 { font-size: 20px; margin-bottom: 4px; }
.ask-a .used { font-size: 13px; color: var(--ink-3); }
.ask-a .used b { color: var(--ask-text); font-weight: 500; }
.assume { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--ask); font-size: 14px; color: var(--ink-2); }
.assume b { display: block; color: var(--ask-text); font-weight: 600; font-size: 13px; }
pre.sql {
  margin: 12px 0 0; padding: 14px 16px; border-radius: 10px; background: var(--subtle); border: 1px solid var(--line);
  font: 400 14px/1.6 var(--mono); color: var(--ink); white-space: pre-wrap; word-break: break-word;
}
.kw { color: #C2368F; }
.fn { color: var(--accent-text); }
.str { color: var(--ok); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.checks span { font-size: 12px; font-weight: 500; color: var(--ok); background: var(--ok-soft); padding: 4px 9px; border-radius: 999px; }
.ask-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: 12px; color: var(--ink-3); }
.ask-foot .run { font: 600 13px/1 var(--body); color: #fff; background: var(--ask-strong); padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.ask-demo { padding-top: 92px; }
.ask-tabby { position: absolute; right: 28px; top: 0; width: 140px; z-index: 0; filter: drop-shadow(0 16px 20px rgba(0,0,0,.18)); }
@media (max-width: 900px) {
  .ask-grid { grid-template-columns: 1fr; }
  .ask-tabby { right: 12px; width: 120px; }
  .ask-demo { padding-top: 80px; }
}

/* Feature rows */
.features { display: grid; gap: 96px; }
.feature { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
.feature.flip > :first-child { order: 2; }
.feature h3 { font-size: clamp(28px, 3.2vw, 38px); margin: 12px 0 14px; }
.feature p { color: var(--ink-2); }
.feature p + p, .feature p + .ticks { margin-top: 14px; }
.feature .window { margin: 0; }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; gap: 28px; }
  .feature.flip > :first-child { order: 0; }
}

/* Small feature cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 96px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { font-size: 21px; margin: 14px 0 8px; }
.card p { color: var(--ink-2); font-size: 15px; }
.card .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.card .ico.amber { background: var(--ask); color: var(--ask-text); }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }

/* Tour video */
.tour { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tour .window { margin-top: 0; max-width: 1000px; margin-left: auto; margin-right: auto; }
.tour video { background: #F4F5F8; aspect-ratio: 16 / 9; }

/* Phones */
.phones { display: grid; grid-template-columns: 1fr auto auto; gap: 40px; align-items: center; }
.phones-copy h2 { font-size: clamp(34px, 4.4vw, 52px); margin: 14px 0 16px; }
.phones-copy p { color: var(--ink-2); font-size: 18px; }
.phones-copy img { width: 150px; margin-top: 28px; }
.phone {
  width: 250px; border-radius: 40px; padding: 10px; background: #17181F; box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.phone img { border-radius: 31px; width: 100%; height: auto; }
.phone.lift { transform: translateY(-36px); }
@media (max-width: 960px) {
  .phones { grid-template-columns: 1fr 1fr; }
  .phones-copy { grid-column: 1 / -1; }
  .phone { width: 100%; max-width: 250px; justify-self: center; }
  .phone.lift { transform: none; }
}

/* Privacy band */
.private { background: #17181F; color: #F4F5F8; }
.private .eyebrow { color: #9DA3FB; }
.private-grid { display: grid; grid-template-columns: auto 1fr; gap: 56px; align-items: center; }
.private-grid > img { width: 300px; }
.private h2 { font-size: clamp(34px, 4.4vw, 52px); margin: 14px 0 16px; }
.private h2 em { color: #FFB85C; }
.private p { color: #BCC1CD; font-size: 18px; max-width: 40em; }
.private ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.private li { background: #1E2029; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 18px; font-size: 15px; color: #BCC1CD; }
.private li b { display: block; color: #fff; font-weight: 600; margin-bottom: 4px; }
.private a { color: #9DA3FB; }
@media (max-width: 900px) {
  .private-grid { grid-template-columns: 1fr; gap: 20px; }
  .private-grid > img { width: 200px; }
  .private ul { grid-template-columns: 1fr; }
}

/* Download */
.cta { text-align: center; }
.cta img.tabby { width: 220px; margin: 0 auto 10px; }
.cta h2 { font-size: clamp(36px, 5vw, 60px); margin-bottom: 14px; }
.cta p { color: var(--ink-2); font-size: 18px; max-width: 34em; margin: 0 auto 30px; }
.cta .store-note { margin: 18px auto 0; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 32px 0 calc(32px + env(safe-area-inset-bottom, 0px)); color: var(--ink-3); font-size: 14px; }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; }
.foot .brand { font-size: 17px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }

/* Legal and support pages */
.doc { max-width: 760px; padding-top: 56px; padding-bottom: 96px; }
.doc-head { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.doc-head img { width: 84px; height: auto; }
.doc h1 { font-size: clamp(36px, 5vw, 50px); }
.doc .updated { color: var(--ink-3); font-size: 14px; margin-bottom: 28px; }
.doc .summary { background: var(--accent-soft); border-radius: 14px; padding: 18px 20px; color: var(--ink); margin-bottom: 8px; }
.doc h2 { font-size: 26px; margin: 40px 0 12px; }
.doc h3 { font-size: 19px; margin: 24px 0 8px; }
.doc p, .doc li { color: var(--ink-2); }
.doc p + p { margin-top: 12px; }
.doc ul { padding-left: 22px; margin: 12px 0; }
.doc li + li { margin-top: 6px; }
.doc b { color: var(--ink); font-weight: 600; }
