/* Graphite website — same monochrome palette as the app. */
:root {
  --bg: #0a0a0a;
  --surface-1: #111;
  --surface-2: #161616;
  --surface-3: #1c1c1c;
  --line: #242424;
  --line-2: #2e2e2e;
  --fg: #ececec;
  --fg-2: #bdbdbd;
  --fg-3: #8f8f8f;
  --fg-4: #6a6a6a;
  --accent: #ececec;
  --accent-fg: #0a0a0a;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
code, pre { font-family: var(--mono); }
code { font-size: 0.9em; padding: 0.1em 0.35em; border-radius: 4px; background: var(--surface-3); }
pre code { padding: 0; background: none; font-size: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

/* --- nav ------------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; }
.links { display: none; gap: 22px; font-size: 14px; }
.links a { color: var(--fg-3); text-decoration: none; }
.links a:hover { color: var(--fg); }
@media (min-width: 760px) { .links { display: flex; } }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang select {
  appearance: none; -webkit-appearance: none;
  height: 32px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface-1); color: var(--fg-2);
  font: 600 12px var(--sans); letter-spacing: 0.04em; cursor: pointer;
}
.gh {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 8px; text-decoration: none; font-size: 14px; color: var(--fg-2);
}
.gh:hover, .lang select:hover { color: var(--fg); border-color: var(--fg-4); }
@media (max-width: 420px) { .gh span { display: none; } }

/* --- buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--fg);
  font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { border-color: var(--fg-4); background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.primary:hover { background: #fff; }
.btn.ghost { background: transparent; color: var(--fg-2); }
.btn:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* --- hero ------------------------------------------------------------------- */
.hero { position: relative; padding-top: 64px; text-align: center; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0 0 auto; height: 900px; pointer-events: none; z-index: -1;
  background:
    radial-gradient(640px 340px at 50% -40px, rgba(255, 255, 255, 0.11), transparent 70%),
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 22px 22px;
  -webkit-mask-image: linear-gradient(#000 30%, transparent);
  mask-image: linear-gradient(#000 30%, transparent);
}
.eyebrow { margin: 0 0 14px; color: var(--fg-3); font: 600 12px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%; margin-bottom: 26px; padding: 5px 14px 5px 5px;
  border: 1px solid var(--line-2); border-radius: 999px; background: rgba(22, 22, 22, 0.8);
  color: var(--fg-2); font-size: 13.5px; text-decoration: none; transition: border-color 0.15s, color 0.15s;
}
.pill:hover { border-color: var(--fg-4); color: var(--fg); }
.pill > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-tag { flex: none; padding: 2px 9px; border-radius: 999px; background: var(--fg); color: var(--bg); font-weight: 700; font-size: 12px; }
.pill-arrow { flex: none; transition: transform 0.15s; }
.pill:hover .pill-arrow { transform: translateX(3px); }
h1 {
  margin: 0 auto; max-width: 900px;
  font-size: clamp(42px, 8.4vw, 88px); line-height: 1; letter-spacing: -0.045em; font-weight: 780;
}
.grad {
  background: linear-gradient(180deg, #fff 10%, #8a8a8a 110%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.typed-line {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 10px;
  margin: 26px auto 0; color: var(--fg-2); font-size: clamp(18px, 2.6vw, 24px); font-weight: 500;
}
.typed-box { display: inline-flex; align-items: baseline; min-width: 11ch; text-align: left; font-family: var(--mono); color: var(--fg); font-weight: 600; }
.caret { display: inline-block; width: 0.55em; height: 1.05em; margin-left: 2px; align-self: center; background: var(--fg); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lead { margin: 18px auto 0; max-width: 660px; color: var(--fg-3); font-size: clamp(16px, 2vw, 18px); }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 32px; }
.btn.big { min-height: 48px; padding: 0 22px; font-size: 16px; border-radius: 11px; }
.btn.primary.big { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 8px 30px rgba(255, 255, 255, 0.14); }
.fine { margin: 16px 0 0; color: var(--fg-4); font-size: 13px; }

.stats {
  list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; max-width: 880px;
  margin: 52px auto 0; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--line);
}
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats li { display: flex; flex-direction: column; gap: 4px; padding: 18px 14px; background: var(--surface-1); }
.stats b { font-size: 34px; line-height: 1; letter-spacing: -0.03em; font-weight: 760; }
.stats span { color: var(--fg-3); font-size: 13px; line-height: 1.4; }

.stage { position: relative; margin-top: 64px; }
.stage::before {
  content: ""; position: absolute; z-index: -1; left: 8%; right: 8%; top: 70px; height: 60%;
  background: radial-gradient(closest-side, rgba(129, 140, 248, 0.32), transparent), radial-gradient(closest-side at 70% 60%, rgba(45, 212, 191, 0.18), transparent);
  filter: blur(60px);
}
.tabs { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-bottom: 18px; padding: 4px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-1); }
.tabs button {
  height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: none; color: var(--fg-3);
  font: 600 13.5px var(--sans); cursor: pointer; transition: background 0.15s, color 0.15s;
}
.tabs button:hover { color: var(--fg); }
.tabs button[aria-selected="true"] { background: var(--surface-3); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }
.tabs button:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
@media (max-width: 560px) { .tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; } }
.shot {
  margin: 0; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden;
  background: var(--surface-1); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.hero-shot { box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04); }
.hero-shot img { animation: fade 0.35s ease; }
@keyframes fade { from { opacity: 0.2; } }
.shot figcaption { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--fg-3); font-size: 14px; text-align: left; }

.marquee {
  margin-top: 64px; overflow: hidden; border-block: 1px solid var(--line); background: var(--surface-1);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { list-style: none; display: flex; width: max-content; margin: 0; padding: 0; animation: marquee 60s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee li { padding: 18px 26px; color: var(--fg-3); font-size: 17px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.marquee li::before { content: "◆"; margin-right: 26px; color: var(--fg-4); font-size: 9px; vertical-align: 3px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Hero entrance: pure CSS, so it runs even before (or without) the script. */
.rise { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* Scroll reveal below the fold: only when JS runs, so the page reads fine without it. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

.final {
  display: flex; flex-direction: column; align-items: center; padding: 64px 22px; text-align: center;
  border: 1px solid var(--line); border-radius: 20px;
  background: radial-gradient(500px 220px at 50% 0, rgba(255, 255, 255, 0.08), transparent), var(--surface-1);
}
.final img { margin-bottom: 22px; filter: drop-shadow(0 10px 30px rgba(255, 255, 255, 0.12)); }
.final .sub { margin-left: auto; margin-right: auto; }

/* --- sections --------------------------------------------------------------- */
.section { padding-top: 112px; }
h2 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 720; }
.sub { margin: 14px 0 0; max-width: 680px; color: var(--fg-2); font-size: 17px; }
#features h2, #features .sub, #download h2, #download .sub { text-align: center; margin-left: auto; margin-right: auto; }

.grid { display: grid; gap: 14px; margin-top: 44px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-1); transition: border-color 0.2s, background 0.2s, opacity 0.6s ease, transform 0.6s ease; }
.grid .card:hover { border-color: var(--line-2); background: var(--surface-2); }
.card h3 { margin: 14px 0 6px; font-size: 16px; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--fg-3); font-size: 14.5px; line-height: 1.55; }
.grid .ic { box-sizing: content-box; padding: 9px; border: 1px solid var(--line-2); border-radius: 10px; background: linear-gradient(180deg, var(--surface-3), var(--surface-1)); }
.ic { width: 22px; height: 22px; fill: none; stroke: var(--fg); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .split { grid-template-columns: 5fr 6fr; gap: 56px; } }
.checks { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 16px; }
.checks li { position: relative; padding-left: 30px; color: var(--fg-3); font-size: 15px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--fg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12l4 4 8-9' fill='none' stroke='%230a0a0a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.checks b { color: var(--fg); font-weight: 600; }

.mcp {
  display: grid; gap: 20px; align-items: center; margin-top: 48px; padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-1);
}
@media (min-width: 900px) { .mcp { grid-template-columns: 2fr 3fr; } }
.mcp h3 { margin: 0 0 6px; font-size: 18px; }
.mcp p { margin: 0; color: var(--fg-3); font-size: 15px; }
pre {
  margin: 0; padding: 14px 16px; overflow-x: auto; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--fg-2);
  font-size: 13px; line-height: 1.6;
}
.muted { color: var(--fg-4); }


.dl { display: grid; gap: 14px; margin-top: 40px; }
@media (min-width: 900px) { .dl { grid-template-columns: repeat(3, 1fr); } }
.dl .card { display: flex; flex-direction: column; gap: 14px; }
.dl .card h3 { margin: 0; font-size: 20px; }
.dl .row { display: flex; flex-wrap: wrap; gap: 8px; }
.dl .btn { font-size: 14px; min-height: 38px; padding: 0 14px; }
.dl pre { font-size: 12.5px; }
details summary { cursor: pointer; color: var(--fg-2); font-size: 14px; }
details p { margin: 10px 0; }
[data-version-line] { color: var(--fg-4); }

/* --- footer ---------------------------------------------------------------- */
.foot { margin-top: 120px; border-top: 1px solid var(--line); color: var(--fg-4); font-size: 14px; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 28px; padding-bottom: 40px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px; }
.foot a { text-decoration: none; color: var(--fg-3); }
.foot a:hover { color: var(--fg); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .caret, .hero-shot img, .rise { animation: none; }
  .marquee-track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* --- databases ------------------------------------------------------------- */
.dbs { display: grid; gap: 14px; margin-top: 40px; }
@media (min-width: 900px) { .dbs { grid-template-columns: repeat(3, 1fr); } }
.dbs .card h3 { margin: 0 0 12px; font-size: 15px; color: var(--fg-2); letter-spacing: 0.02em; }
.dbs .card h3 + .chips + h3 { margin-top: 20px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg); color: var(--fg); font-size: 13.5px; }
.chips .beta { margin-left: 4px; color: var(--fg-4); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.dbs .note { margin: 14px 0 0; color: var(--fg-4); font-size: 13px; }
#databases h2, #databases .sub { text-align: center; margin-left: auto; margin-right: auto; }

/* Grid items default to min-width: auto, so a wide <pre> would stretch the page on phones. */
.grid > *, .split > *, .mcp > *, .dl > *, .dbs > * { min-width: 0; }

.dl-note { display: flex; gap: 14px; align-items: flex-start; margin-top: 16px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-1); }
.dl-note .ic { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.dl-note p { margin: 0; color: var(--fg-2); line-height: 1.6; }
.dl-note strong { color: var(--fg); margin-right: 4px; }

/* --- comparison ------------------------------------------------------------ */
.cmp-scroll { margin-top: 40px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-1); -webkit-overflow-scrolling: touch; }
.cmp-scroll:focus-visible { outline: 2px solid var(--fg-3); outline-offset: 2px; }
.cmp { width: 100%; min-width: 980px; border-collapse: collapse; font-size: 13.5px; line-height: 1.4; }
.cmp th, .cmp td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cmp tbody tr:last-child th, .cmp tbody tr:last-child td { border-bottom: 0; }
.cmp thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--fg-2); font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.cmp tbody th { color: var(--fg-2); font-weight: 500; width: 210px; }
/* the feature column stays put while the tools scroll */
.cmp th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface-1); box-shadow: 1px 0 0 var(--line); }
.cmp thead th:first-child { background: var(--surface-2); z-index: 2; }
.cmp .me { background: var(--surface-3); color: var(--fg); }
.cmp td:nth-child(2) { background: rgba(255, 255, 255, 0.035); }
.cmp td.y { color: var(--fg); font-weight: 600; }
.cmp td.p { color: var(--fg-2); }
.cmp td.t { color: var(--fg-2); }
.cmp td.n { color: var(--fg-4); }
.cmp td.num { color: var(--fg-2); font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.cmp td:nth-child(2).num { color: var(--fg); font-weight: 600; }

.sizes { margin-top: 28px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-1); }
.sizes h3 { margin: 0; font-size: 16px; }
.sizes > p { margin: 4px 0 18px; color: var(--fg-3); font-size: 14px; }
.bars { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.bar { display: grid; grid-template-columns: 150px 1fr 70px; align-items: center; gap: 12px; font-size: 13.5px; }
@media (max-width: 560px) { .bar { grid-template-columns: 1fr 64px; } .bar .bt { grid-column: 1 / -1; grid-row: 2; } }
.bn { color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bn small { color: var(--fg-4); font-size: 11.5px; }
.bt { height: 14px; border-radius: 4px; background: var(--surface-2); }
.bf { display: block; height: 100%; min-width: 4px; border-radius: 0 4px 4px 0; background: var(--fg-4); }
.bv { color: var(--fg-2); font: 12.5px var(--mono); text-align: right; }
.bar.me .bn, .bar.me .bv { color: var(--fg); font-weight: 650; }
.bar.me .bf { background: var(--fg); }
.bar:hover .bf { filter: brightness(1.25); }
.cmp-note { max-width: 900px; margin: 18px 0 0; color: var(--fg-4); font-size: 13px; line-height: 1.55; }
.cmp-note a { color: var(--fg-3); }
@media (max-width: 560px) {
  .cmp { font-size: 12.5px; min-width: 900px; }
  .cmp th, .cmp td { padding: 10px; }
  .cmp tbody th { width: 118px; min-width: 118px; }
}
.dl-src { margin: 14px 0 0; color: var(--fg-3); font-size: 13.5px; overflow-wrap: anywhere; }
.dl-src strong { color: var(--fg-2); }
.dl .row .btn { white-space: nowrap; }
