@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/GeistMono.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
}

:root {
  color-scheme: light;
  --bg: #fcfcfb;
  --surface: #ffffff;
  --ink: #17181a;
  --dim: #6b6f74;
  --rule: #e6e5e1;
  --accent: #1f6f5c;
  --soft: #f4f4f1;
  --code: #eff4f2;
  font-family: "Geist", system-ui, sans-serif;
  font-size: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121314;
    --surface: #191a1c;
    --ink: #e9e8e4;
    --dim: #92968f;
    --rule: #2a2c2e;
    --accent: #57c7a8;
    --soft: #202225;
    --code: #202a27;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121314;
  --surface: #191a1c;
  --ink: #e9e8e4;
  --dim: #92968f;
  --rule: #2a2c2e;
  --accent: #57c7a8;
  --soft: #202225;
  --code: #202a27;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fcfcfb;
  --surface: #ffffff;
  --ink: #17181a;
  --dim: #6b6f74;
  --rule: #e6e5e1;
  --accent: #1f6f5c;
  --soft: #f4f4f1;
  --code: #eff4f2;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

a { color: inherit; text-underline-offset: 3px; }
button, textarea, input { font: inherit; }
button { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.wrap { width: min(100% - 32px, 1180px); margin-inline: auto; }
.narrow { width: min(100% - 32px, 800px); margin-inline: auto; }

.site-header {
  min-height: 64px;
  border-bottom: 1px solid var(--rule);
}
.nav {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.wordmark {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.cursor { color: var(--accent); font-family: "Geist Mono", monospace; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--dim); text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.icon-button, .plain-button, .primary-button, .segmented button {
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
}
.icon-button {
  width: 64px;
  height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}
.plain-button { padding: 8px 12px; }
.primary-button { padding: 12px 16px; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.icon-button:hover, .plain-button:hover { background: var(--soft); }

main { min-height: 70vh; }
.page-intro { padding: 96px 0 64px; border-bottom: 1px solid var(--rule); }
.eyebrow, .mono, kbd, code, .price, .version, th, td:first-child {
  font-family: "Geist Mono", ui-monospace, monospace;
}
.eyebrow { margin: 0 0 12px; color: var(--dim); font-size: .8125rem; text-transform: uppercase; letter-spacing: .08em; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.12; letter-spacing: -0.02em; }
h1 { max-width: 900px; font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.75rem); }
h3 { font-size: 1.125rem; }
.lede { max-width: 680px; margin: 24px 0 0; color: var(--dim); font-size: 1.125rem; }
.section { padding: 96px 0; border-bottom: 1px solid var(--rule); }
.section-heading { max-width: 700px; margin-bottom: 48px; }
.section-heading p { color: var(--dim); margin: 16px 0 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.claim { border-top: 1px solid var(--rule); padding-top: 24px; }
.claim p { color: var(--dim); margin: 12px 0 0; }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--rule); }
.flow-step { padding: 24px; }
.flow-step + .flow-step { border-left: 1px solid var(--rule); }
.flow-step .mono { color: var(--dim); font-size: .8125rem; }
.flow-step h3 { margin: 12px 0 8px; }
.flow-step p { margin: 0; color: var(--dim); }
.not-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.not-list p { color: var(--dim); }

.site-footer { padding: 48px 0; }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-note { margin: 16px 0 0; color: var(--dim); }

/* Embedded editor */
.hero { padding: 64px 0 96px; border-bottom: 1px solid var(--rule); }
.hero-copy { display: flex; justify-content: space-between; align-items: end; gap: 48px; margin-bottom: 48px; }
.hero-copy .lede { margin-bottom: 4px; }
.editor-shell { border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); overflow: hidden; }
.editor-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
  color: var(--dim);
  font-family: "Geist Mono", monospace;
  font-size: .75rem;
}
.toolbar-actions { display: flex; gap: 8px; align-items: center; }
.toolbar-button { border: 0; padding: 4px 8px; background: transparent; color: var(--dim); cursor: pointer; }
.toolbar-button[aria-pressed="true"], .toolbar-button:hover { color: var(--ink); background: var(--soft); }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; min-height: 590px; }
.editor-grid[data-preview-hidden="true"] { grid-template-columns: 1fr; }
.editor-grid[data-preview-hidden="true"] .preview-pane { display: none; }
.editor-pane { position: relative; min-width: 0; }
.editor-pane + .editor-pane { border-left: 1px solid var(--rule); }
#editor {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 590px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 32px;
  background: var(--surface);
  color: var(--ink);
  font-family: "Geist Mono", monospace;
  font-size: .9375rem;
  line-height: 1.65;
  tab-size: 2;
}
.preview {
  height: 100%;
  min-height: 590px;
  padding: 32px;
  overflow: auto;
  background: var(--bg);
}
.preview > :first-child { margin-top: 0; }
.preview h1 { font-size: 2.25rem; }
.preview h2 { font-size: 1.5rem; margin-top: 32px; }
.preview h3 { font-size: 1.125rem; margin-top: 24px; }
.preview p { margin: 16px 0; }
.preview blockquote { margin: 24px 0; padding-left: 16px; border-left: 2px solid var(--accent); color: var(--dim); }
.preview code { padding: 2px 4px; background: var(--code); border-radius: 3px; font-size: .875em; }
.preview pre { margin: 24px 0; padding: 16px; overflow-x: auto; border: 1px solid var(--rule); background: var(--surface); }
.preview pre code { padding: 0; background: transparent; }
.preview table, .content-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table-scroll { overflow-x: auto; }
.preview th, .preview td, .content-table th, .content-table td { padding: 8px 12px; border: 1px solid var(--rule); text-align: left; }
.preview th, .content-table th { background: var(--soft); }
.preview hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }
.preview a { color: var(--accent); }
.preview ul, .preview ol { padding-left: 24px; }
.editor-status { min-height: 36px; display: flex; justify-content: space-between; gap: 16px; padding: 8px 12px; border-top: 1px solid var(--rule); color: var(--dim); font-family: "Geist Mono", monospace; font-size: .75rem; }

.dialog-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: start center;
  padding: 14vh 16px 16px;
  background: rgb(0 0 0 / .38);
}
.dialog-backdrop[hidden], .slash-menu[hidden] { display: none; }
.command-dialog, .shortcut-dialog {
  width: min(100%, 560px);
  max-height: min(620px, 75vh);
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgb(0 0 0 / .16);
  animation: palette-in 150ms ease-out;
}
@keyframes palette-in { from { opacity: 0; transform: translateY(4px); } }
.palette-input { width: 100%; padding: 16px; border: 0; border-bottom: 1px solid var(--rule); outline: 0; background: transparent; color: var(--ink); }
.command-list { margin: 0; padding: 8px; list-style: none; }
.command-dialog .command-list {
  max-height: calc(min(620px, 75vh) - 65px);
  overflow-y: auto;
}
.command-option { display: flex; justify-content: space-between; gap: 16px; padding: 10px 12px; border-radius: 4px; cursor: pointer; }
.command-option[aria-selected="true"] { background: var(--soft); }
.command-option small { color: var(--dim); font-family: "Geist Mono", monospace; }
.palette-empty { padding: 24px; color: var(--dim); text-align: center; }
.slash-menu { position: absolute; z-index: 10; top: 16px; left: 24px; width: min(340px, calc(100% - 48px)); border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); }
.slash-menu .command-list { max-height: 280px; overflow-y: auto; }
.shortcut-dialog { padding: 24px; overflow: auto; }
.dialog-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 24px; }
.dialog-head button { border: 0; background: transparent; cursor: pointer; font-size: 1.25rem; }
.shortcut-grid { display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; }
kbd { display: inline-block; min-width: 24px; padding: 1px 6px; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 3px; background: var(--surface); font-size: .75rem; text-align: center; white-space: nowrap; }

/* Pricing and editorial pages */
.pricing-controls { display: flex; justify-content: center; margin: 48px 0 32px; }
.segmented { display: inline-flex; padding: 4px; border: 1px solid var(--rule); border-radius: 6px; }
.segmented button { border: 0; background: transparent; padding: 8px 12px; }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.price-card { display: flex; flex-direction: column; padding: 32px; border: 1px solid var(--rule); background: var(--surface); }
.price-card.featured { border-top: 3px solid var(--accent); padding-top: 30px; }
.price { margin: 24px 0 0; font-size: 2.5rem; line-height: 1; }
.price-period { color: var(--dim); font-size: .875rem; }
.price-card ul { flex: 1; margin: 32px 0; padding-left: 20px; }
.price-card .primary-button { display: block; text-align: center; text-decoration: none; }
.seat-note { margin: 24px 0 0; text-align: center; color: var(--dim); }
.faq { display: grid; grid-template-columns: 1fr 2fr; gap: 64px; }
.faq-list details { padding: 20px 0; border-top: 1px solid var(--rule); }
.faq-list details:last-child { border-bottom: 1px solid var(--rule); }
.faq-list summary { cursor: pointer; font-weight: 600; }
.faq-list p { color: var(--dim); }
.changelog { padding: 64px 0 96px; }
.release { display: grid; grid-template-columns: 160px 1fr; gap: 48px; padding: 40px 0; border-bottom: 1px solid var(--rule); }
.release-meta { color: var(--dim); }
.release-meta time { display: block; font-size: .875rem; }
.version { color: var(--accent); }
.release h2 { font-size: 1.5rem; }
.release ul { padding-left: 20px; color: var(--dim); }
.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 64px; padding: 64px 0 96px; }
.toc { position: sticky; top: 24px; align-self: start; }
.toc a { display: block; padding: 4px 0; color: var(--dim); text-decoration: none; }
.docs-content section { margin-bottom: 64px; }
.docs-content h2 { margin-bottom: 24px; }
.content-table td:first-child { white-space: nowrap; }
.syntax-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.syntax-list div { padding: 16px; border: 1px solid var(--rule); }
.syntax-list p { margin: 8px 0 0; color: var(--dim); }
.error-page { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 48px 16px; }
.error-page .mono { color: var(--accent); }

@media (max-width: 760px) {
  .nav { align-items: flex-start; padding: 16px 0; }
  .nav-links { gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
  .hero { padding-top: 48px; }
  .hero-copy, .footer-inner { display: block; }
  .hero-copy .lede { margin-top: 16px; }
  .grid-3, .not-list, .pricing-grid, .faq, .docs-layout { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow-step + .flow-step { border-left: 0; border-top: 1px solid var(--rule); }
  .editor-grid { grid-template-columns: 1fr; min-height: 480px; }
  .editor-pane + .editor-pane { border-left: 0; border-top: 1px solid var(--rule); }
  #editor, .preview { min-height: 480px; padding: 24px; }
  .editor-grid[data-mobile-view="write"] .preview-pane,
  .editor-grid[data-mobile-view="preview"] .write-pane { display: none; }
  .editor-grid[data-preview-hidden="true"] .preview-pane { display: block; }
  .editor-grid[data-preview-hidden="true"][data-mobile-view="write"] .preview-pane { display: none; }
  .release { grid-template-columns: 1fr; gap: 16px; }
  .docs-layout { gap: 32px; }
  .toc { position: static; }
  .syntax-list { grid-template-columns: 1fr; }
  .section, .page-intro { padding: 64px 0; }
  .footer-links { margin-top: 24px; }
}

@media (max-width: 520px) {
  .wrap, .narrow { width: min(100% - 24px, 1180px); }
  .nav { display: block; }
  .nav-links { margin-top: 12px; justify-content: flex-start; }
  .nav-links a { font-size: .875rem; }
  .editor-toolbar { align-items: flex-start; }
  .toolbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .editor-status { display: block; }
  .editor-status span:last-child { display: block; margin-top: 4px; }
  .price-card { padding: 24px; }
}

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