/* GemmaKit marketing site — shared styles
   Type: Inter Tight (UI) + JetBrains Mono (code/labels)
   Color: warm paper neutral + clay accent
*/

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* light theme — warm paper */
  --bg: #F5F2EC;
  --bg-elevated: #FBF9F4;
  --bg-sunk: #EFEBE3;
  --rule: #1a181410;
  --rule-strong: #1a181420;
  --ink: #1A1814;
  --ink-muted: #1a181499;
  --ink-soft: #1a18146b;
  --accent: oklch(0.58 0.13 38);
  --accent-soft: oklch(0.58 0.13 38 / 0.08);
  --accent-ink: oklch(0.32 0.08 38);
  --good: oklch(0.55 0.10 155);
  --warn: oklch(0.62 0.12 65);

  --font-sans: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --container: 1240px;
  --gutter: 32px;
  --col-gap: 24px;

  --radius: 4px;
  --radius-lg: 8px;
}

[data-theme="dark"] {
  --bg: #14120F;
  --bg-elevated: #1B1916;
  --bg-sunk: #0F0D0B;
  --rule: #f5f2ec14;
  --rule-strong: #f5f2ec26;
  --ink: #F2EEE5;
  --ink-muted: #f2eee5a8;
  --ink-soft: #f2eee566;
  --accent: oklch(0.72 0.13 38);
  --accent-soft: oklch(0.72 0.13 38 / 0.12);
  --accent-ink: oklch(0.85 0.10 38);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.005em;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

::selection { background: var(--accent); color: var(--bg); }

/* ─────────── Layout ─────────── */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.rule { border-top: 1px solid var(--rule); }
.rule-strong { border-top: 1px solid var(--rule-strong); }

/* spec-mark / eyebrow removed */

/* ─────────── Top bar ─────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklch, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.topbar-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }

.brand-mark {
  width: 22px;
  height: 22px;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-mark .gk-bowl { fill: var(--ink); }
.brand-mark .gk-spark { fill: var(--accent); }
.brand-mark .gk-bg { fill: var(--ink); }
.brand-mark .gk-fg { fill: var(--bg); }
[data-theme="dark"] .brand-mark .gk-bowl { fill: var(--ink); }

.nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--ink-muted);
}
.nav a { transition: color .15s; }
.nav a.active { color: var(--ink); }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--rule-strong);
  background: color-mix(in oklch, var(--bg-elevated) 82%, transparent);
  border-radius: var(--radius-lg);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--ink-muted);
  box-shadow: 0 1px 0 color-mix(in oklch, var(--ink) 8%, transparent);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease, transform .18s ease;
}
.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
  background: var(--bg-elevated);
  box-shadow: 0 10px 24px color-mix(in oklch, var(--ink) 10%, transparent);
  transform: translateY(-1px);
}
.theme-toggle:active {
  transform: translateY(0) scale(0.96);
  box-shadow: 0 1px 0 color-mix(in oklch, var(--ink) 8%, transparent);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.theme-toggle-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  transition: transform .2s ease;
}
.theme-toggle-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  stroke: currentColor;
}
.theme-toggle:hover .theme-toggle-icon {
  transform: rotate(12deg) scale(1.08);
}

/* ─────────── Buttons ─────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.btn-link {
  padding: 0;
  background: transparent;
  border: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--ink-soft);
  border-radius: 0;
  padding-bottom: 1px;
}
.btn-link:hover { color: var(--accent); border-color: var(--accent); }

.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ─────────── Section primitives ─────────── */

section { position: relative; }

.section {
  padding: 80px 0;
  border-top: 1px solid var(--rule);
}
.section.compact { padding: 48px 0; }
.section.tall { padding: 120px 0; }

.section-head {
  margin-bottom: 48px;
  max-width: 760px;
}
.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
  max-width: 22ch;
}
.section-head .h2-sub {
  margin-top: 16px;
  color: var(--ink-muted);
  font-size: 17px;
  max-width: 56ch;
  line-height: 1.55;
}

/* ─────────── Headings ─────────── */

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0;
}
h1 { font-size: clamp(40px, 5.5vw, 72px); letter-spacing: -0.035em; line-height: 1.02; }
h3 { font-size: 18px; font-weight: 500; letter-spacing: -0.015em; }
p { margin: 0; }

/* ─────────── Code blocks ─────────── */

.code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
}

.code-block {
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}
.code-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-sunk);
  padding: 0 8px;
  align-items: stretch;
  min-width: 0;
  overflow-x: auto;
}
.code-tab {
  flex: 0 0 auto;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color .15s;
}
.code-tab:hover { color: var(--ink-muted); }
.code-tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.code-tab-spacer { flex: 1; }
.code-copy {
  flex: 0 0 auto;
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  cursor: pointer;
  align-self: center;
}
.code-copy:hover { color: var(--ink); }
.code-body {
  padding: 20px 24px;
  overflow-x: auto;
  white-space: pre;
}
.code-body .tk-key { color: var(--accent); }
.code-body .tk-str { color: var(--good); }
.code-body .tk-com { color: var(--ink-soft); font-style: italic; }
.code-body .tk-fn  { color: oklch(0.55 0.12 245); }
[data-theme="dark"] .code-body .tk-fn { color: oklch(0.78 0.12 235); }

/* ─────────── Footer ─────────── */

.footer {
  border-top: 1px solid var(--rule);
  padding: 64px 0 48px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--col-gap);
}
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; color: var(--ink-muted); }
.footer-col ul a:hover { color: var(--ink); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-soft);
  letter-spacing: 0;
}
.footer-bottom:first-child { margin-top: 0; }
.footer-bottom span:first-child { flex: 0 0 auto; }
.footer-bottom span:last-child {
  max-width: 68ch;
  text-align: left;
}
.footer-bottom a {
  color: var(--ink-muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.footer-bottom a:hover { color: var(--ink); }

/* ─────────── Utility ─────────── */

.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  color: var(--ink-muted);
  background: var(--bg-elevated);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0;
  border: 1px solid var(--rule-strong);
  color: var(--ink-muted);
  background: var(--bg-elevated);
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.divider-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}
.divider-mono::after {
  content: '';
  flex: 1;
  border-top: 1px dashed var(--rule-strong);
}

/* ─────────── Page index strip (the spec-sheet vibe) ─────────── */

.specstrip {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0;
  color: var(--ink-soft);
}
.specstrip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.specstrip-row > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  min-width: 0;
}

/* ─────────── Responsive ─────────── */

@media (max-width: 900px) {
  .nav { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 44px; }
}

@media (max-width: 760px) {
  :root { --gutter: 24px; }
  .topbar-inner { padding: 12px var(--gutter); }
  .topbar-right .btn-ghost { display: none; }
  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-top: 48px;
  }
  .footer-bottom:first-child { margin-top: 0; }
  .footer-bottom span:last-child {
    max-width: 100%;
    text-align: left;
  }
}

@media (max-width: 520px) {
  :root { --gutter: 20px; }
  .topbar-inner { gap: 12px; }
  .brand { font-size: 15px; }
  .topbar-right { gap: 8px; }
  .theme-toggle {
    width: 36px;
    height: 36px;
  }
  .theme-toggle-icon,
  .theme-toggle-icon svg {
    width: 20px;
    height: 20px;
  }
  .topbar-right .btn-primary {
    max-width: 112px;
    padding-inline: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .specstrip-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .specstrip-row > div { gap: 6px 16px; }
}
