/* graphemely docs. Light and dark themes follow prefers-color-scheme, and the
   toggle (Voodoo.js v-theme-toggle) pins one with data-theme on <html>. */

:root {
  color-scheme: light;
  --bg: #fbfaff;
  --bg-alt: #f4f1ff;
  --card: #ffffff;
  --text: #1d1933;
  --muted: #5b5675;
  --border: #e6e1fb;
  --border-strong: #d3cbf7;
  --violet: #6a5ae0;
  --violet-strong: #5646d1;
  --violet-soft: rgba(106, 90, 224, 0.1);
  --on-violet: #ffffff;
  --coral: #d23a61;
  --green: #16804f;
  --warn: #a15c00;
  --code-bg: #f1eefe;
  --code-text: #2c2552;
  --mesh-1: rgba(106, 90, 224, 0.2);
  --mesh-2: rgba(229, 72, 111, 0.13);
  --mesh-3: rgba(38, 166, 120, 0.12);
  --shadow-sm: 0 1px 2px rgba(29, 25, 51, 0.06);
  --shadow: 0 1px 2px rgba(29, 25, 51, 0.05), 0 12px 32px -12px rgba(29, 25, 51, 0.16);
  --shadow-lg: 0 2px 4px rgba(29, 25, 51, 0.05), 0 24px 60px -20px rgba(57, 40, 150, 0.32);
  --radius: 16px;
  --radius-sm: 10px;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Helvetica, Arial, sans-serif;
  --mono: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  --step--1: 14px;
  --step-0: 17px;
  --step-1: 20px;
  --step-2: 24px;
  --step-3: clamp(28px, 3.4vw, 38px);
  --step-4: clamp(36px, 5.2vw, 56px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0e0c1a;
    --bg-alt: #13112a;
    --card: #17142d;
    --text: #f1eeff;
    --muted: #b0aacd;
    --border: #2a2550;
    --border-strong: #3b3570;
    --violet: #9c90ff;
    --violet-strong: #b8aeff;
    --violet-soft: rgba(156, 144, 255, 0.12);
    --on-violet: #120f24;
    --coral: #ff8aa6;
    --green: #4cc98f;
    --warn: #f2b25c;
    --code-bg: #201c3d;
    --code-text: #e4e0ff;
    --mesh-1: rgba(124, 108, 255, 0.28);
    --mesh-2: rgba(255, 92, 140, 0.14);
    --mesh-3: rgba(60, 200, 150, 0.1);
    --shadow-sm: none;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 24px 60px -18px rgba(0, 0, 0, 0.75);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0e0c1a;
  --bg-alt: #13112a;
  --card: #17142d;
  --text: #f1eeff;
  --muted: #b0aacd;
  --border: #2a2550;
  --border-strong: #3b3570;
  --violet: #9c90ff;
  --violet-strong: #b8aeff;
  --violet-soft: rgba(156, 144, 255, 0.12);
  --on-violet: #120f24;
  --coral: #ff8aa6;
  --green: #4cc98f;
  --warn: #f2b25c;
  --code-bg: #201c3d;
  --code-text: #e4e0ff;
  --mesh-1: rgba(124, 108, 255, 0.28);
  --mesh-2: rgba(255, 92, 140, 0.14);
  --mesh-3: rgba(60, 200, 150, 0.1);
  --shadow-sm: none;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 24px 60px -18px rgba(0, 0, 0, 0.75);
}

/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--step-0) / 1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--violet-strong);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s var(--ease);
}

a:hover {
  color: var(--coral);
}

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 2px;
  border-radius: 6px;
}

[v-cloak] {
  display: none !important;
}

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
}

h1 {
  font-size: var(--step-4);
  margin: 0 0 20px;
}

h2 {
  font-size: var(--step-3);
  margin: 56px 0 14px;
}

h3 {
  font-size: var(--step-1);
  margin: 28px 0 8px;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 16px;
}

.lead {
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--muted);
  max-width: 680px;
}

.lead strong {
  color: var(--text);
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.15em 0.4em;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--card);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 20;
}

.skip:focus {
  left: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.wrap.narrow {
  max-width: 820px;
}

/* Header */

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

header.site .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--text);
}

.brand img {
  width: 36px;
  height: 36px;
}

nav.site {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 15px;
  font-weight: 500;
}

nav.site a {
  color: var(--muted);
  text-decoration: none;
  padding: 7px 11px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
}

nav.site a:hover,
nav.site a[aria-current='page'] {
  color: var(--text);
  background: var(--violet-soft);
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  transition: border-color 0.15s var(--ease);
}

.icon-btn:hover {
  border-color: var(--violet);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.menu-toggle {
  display: none;
}

.theme-toggle .icon-sun {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .icon-sun {
    display: block;
  }

  :root:not([data-theme='light']) .theme-toggle .icon-moon {
    display: none;
  }
}

:root[data-theme='dark'] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme='dark'] .theme-toggle .icon-moon {
  display: none;
}

/* Buttons and small pieces */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}

.btn:hover {
  color: var(--text);
  border-color: var(--violet);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn.primary {
  background: linear-gradient(135deg, var(--violet), var(--violet-strong));
  border-color: transparent;
  color: var(--on-violet);
  box-shadow: 0 10px 24px -10px var(--violet);
}

.btn.primary:hover {
  color: var(--on-violet);
}

.cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet-strong);
  margin: 0 0 12px;
}

.label {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.label.bad {
  color: var(--coral);
}

.label.ok {
  color: var(--green);
}

.callout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--violet);
  background: var(--card);
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 20px 0;
}

/* Sections */

main {
  display: block;
}

.section {
  padding: 88px 0;
}

.section.alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section h2:first-child,
.section-head h2 {
  margin-top: 0;
}

.section-head {
  max-width: 720px;
  margin-bottom: 36px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-head p:last-child {
  color: var(--muted);
  font-size: 18px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.two-col h2 {
  margin-top: 0;
}

.eslint {
  margin-top: 64px;
  align-items: center;
}

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 96px;
  background:
    radial-gradient(48% 60% at 8% 0%, var(--mesh-1), transparent 70%),
    radial-gradient(36% 50% at 92% 12%, var(--mesh-2), transparent 70%),
    radial-gradient(44% 50% at 70% 100%, var(--mesh-3), transparent 70%);
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70% 60% at 50% 30%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 10%, transparent 75%);
  opacity: 0.5;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 48px;
  align-items: center;
}

.hero .code {
  max-width: 560px;
  margin: 28px 0 0;
}

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
}

.hero-art::before {
  content: '';
  position: absolute;
  width: 88%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--mesh-1), transparent 68%);
  filter: blur(8px);
}

.hero-art img {
  position: relative;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 24px 40px rgba(57, 40, 150, 0.25));
}

.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.badges img {
  display: block;
  height: 20px;
  width: auto;
}

.fact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fact::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

/* Showcase */

.showcase {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 40px;
  align-items: center;
}

.showcase .section-head {
  margin-bottom: 0;
}

.showcase .code {
  margin: 0;
  box-shadow: var(--shadow-lg);
}

.showcase .code pre {
  font-size: 13px;
}

.checks {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 10px;
}

.checks li {
  position: relative;
  padding-left: 30px;
}

.checks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-1.2 14.2-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4-7 7Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-1.2 14.2-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4-7 7Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Problem vs fix */

.compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.compare .code {
  margin: 0;
}

/* Steps */

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.steps li {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.steps h3 {
  margin: 14px 0 6px;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.step-n {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #6a5ae0, #d23a61);
}

/* Cards */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

a.card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

a.card:hover {
  color: inherit;
  border-color: var(--violet);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card img {
  width: 44px;
  height: 44px;
  padding: 6px;
  border-radius: 12px;
  background: var(--violet-soft);
}

.card h3 {
  margin: 14px 0 4px;
  font-size: 18px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

/* Tables */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
}

th,
td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  background: var(--bg-alt);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* FAQ accordion (Voodoo.js v-data) */

.faq {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.faq-item.open {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.faq-item h3 {
  margin: 0;
  font-size: 17px;
}

.faq-item button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 16px 18px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.faq-icon {
  flex: none;
  position: relative;
  width: 14px;
  height: 14px;
}

.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--violet);
  transition: transform 0.2s var(--ease);
}

.faq-icon::after {
  transform: rotate(90deg);
}

.faq-item button[aria-expanded='true'] .faq-icon::after {
  transform: rotate(0deg);
}

.faq-a {
  padding: 0 18px 16px;
  color: var(--muted);
}

.faq-a p {
  margin: 0;
}

/* Guides */

.article {
  padding: 56px 0 88px;
  background:
    radial-gradient(60% 420px at 10% 0%, var(--mesh-1), transparent 70%) no-repeat,
    radial-gradient(40% 360px at 95% 0%, var(--mesh-2), transparent 70%) no-repeat;
}

.article .wrap {
  max-width: 860px;
}

.article h1 {
  font-size: clamp(32px, 5vw, 50px);
}

.crumbs {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

.crumbs a {
  color: var(--muted);
}

.article .compare {
  margin: 20px 0;
}

/* Code: pre-rendered by scripts/highlight-docs.mjs with Shiki and the VS Code
   Light+ and Dark+ themes. Each token carries --shiki-light and --shiki-dark,
   and the rules below pick one to follow the site theme. */

.code {
  --editor-bar: #f3f3f3;
  --editor-tab: #ffffff;
  --editor-border: #e2e2e2;
  --editor-text: #616161;
  --editor-gutter: #237893;
  --editor-bad: rgba(229, 72, 111, 0.12);
  --editor-ok: rgba(26, 138, 90, 0.12);
  margin: 20px 0;
  border: 1px solid var(--editor-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.shiki,
.shiki span {
  color: var(--shiki-light);
  font-style: var(--shiki-light-font-style);
  font-weight: var(--shiki-light-font-weight);
  text-decoration: var(--shiki-light-text-decoration);
}

.code .shiki {
  background-color: var(--shiki-light-bg);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .code {
    --editor-bar: #252526;
    --editor-tab: #1e1e1e;
    --editor-border: #3a3a3a;
    --editor-text: #cccccc;
    --editor-gutter: #858585;
    --editor-bad: rgba(255, 127, 158, 0.14);
    --editor-ok: rgba(76, 201, 143, 0.14);
  }

  :root:not([data-theme='light']) .shiki,
  :root:not([data-theme='light']) .shiki span {
    color: var(--shiki-dark);
    font-style: var(--shiki-dark-font-style);
    font-weight: var(--shiki-dark-font-weight);
    text-decoration: var(--shiki-dark-text-decoration);
  }

  :root:not([data-theme='light']) .code .shiki {
    background-color: var(--shiki-dark-bg);
  }
}

:root[data-theme='dark'] .code {
  --editor-bar: #252526;
  --editor-tab: #1e1e1e;
  --editor-border: #3a3a3a;
  --editor-text: #cccccc;
  --editor-gutter: #858585;
  --editor-bad: rgba(255, 127, 158, 0.14);
  --editor-ok: rgba(76, 201, 143, 0.14);
}

:root[data-theme='dark'] .shiki,
:root[data-theme='dark'] .shiki span {
  color: var(--shiki-dark);
  font-style: var(--shiki-dark-font-style);
  font-weight: var(--shiki-dark-font-weight);
  text-decoration: var(--shiki-dark-text-decoration);
}

:root[data-theme='dark'] .code .shiki {
  background-color: var(--shiki-dark-bg);
}

.code-bar {
  display: flex;
  align-items: stretch;
  min-height: 38px;
  background: var(--editor-bar);
  border-bottom: 1px solid var(--editor-border);
  font: 13px/1 var(--sans);
}

.code-dots {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
}

.code-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
}

.code-dots i:nth-child(2) {
  background: #febc2e;
}

.code-dots i:nth-child(3) {
  background: #28c840;
}

.code-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 0 12px;
  background: var(--editor-tab);
  color: var(--editor-text);
  border-left: 1px solid var(--editor-border);
  border-right: 1px solid var(--editor-border);
  box-shadow: inset 0 2px 0 var(--violet);
  margin-bottom: -1px;
  white-space: nowrap;
}

.terminal .code-tab {
  background: none;
  border: 0;
  box-shadow: inset 0 -1px 0 var(--editor-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  font-weight: 600;
  margin: 0 0 -1px 2px;
  padding: 0 4px;
}

.file-icon {
  display: inline-grid;
  place-items: center;
  font: 700 10px/1 var(--sans);
}

.file-icon-js::before {
  content: 'JS';
  color: #b8960a;
}

.file-icon-ts::before {
  content: 'TS';
  color: #3178c6;
}

.terminal .file-icon {
  display: none;
}

.code-copy {
  position: relative;
  align-self: center;
  margin: 0 8px 0 auto;
  font: 600 12px/1 var(--sans);
  padding: 7px 11px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--editor-text);
  cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.code-copy:hover {
  border-color: var(--editor-border);
  background: var(--editor-tab);
}

.code-copy.v-copied {
  color: var(--green);
}

.code-copy.v-copied::after,
.code-copy.v-copy-failed::after {
  left: auto;
  right: calc(100% + 6px);
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
}

.code pre {
  margin: 0;
  padding: 14px 0;
  overflow-x: auto;
  font: 14px/1.65 var(--mono);
  font-variant-ligatures: none;
  tab-size: 2;
}

.code pre code {
  display: block;
  min-width: max-content;
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  counter-reset: line;
}

.code .line {
  display: inline-block;
  min-width: 100%;
  padding: 0 20px;
}

.code.numbered .line {
  padding-left: 0;
}

.code.numbered .line::before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: 3em;
  margin-right: 1.4em;
  text-align: right;
  color: var(--editor-gutter);
  user-select: none;
}

.terminal .line::before {
  content: '$ ';
  color: var(--editor-gutter);
  user-select: none;
}

.code .line.mark-bad {
  background: var(--editor-bad);
  box-shadow: inset 3px 0 0 var(--coral);
}

.code .line.mark-ok {
  background: var(--editor-ok);
  box-shadow: inset 3px 0 0 var(--green);
}

/* Install tabs (Voodoo.js v-tabs) */

.install-tabs {
  margin: 20px 0;
}

.tablist {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
}

.tablist [role='tab'] {
  font: 600 14px/1 var(--mono);
  padding: 9px 14px;
  border-radius: 8px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.tablist [role='tab']:hover {
  color: var(--text);
}

.tablist [role='tab'][aria-selected='true'] {
  background: var(--violet);
  color: var(--on-violet);
}

.install-tabs .code {
  margin-top: 12px;
}

/* Playground */

.playground > h2 {
  margin-top: 0;
}

.playground > p {
  color: var(--muted);
  font-size: 18px;
  max-width: 760px;
}

.pg {
  margin-top: 24px;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}

.samples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.samples button {
  font: 600 13px/1 var(--sans);
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.samples button:hover {
  border-color: var(--violet);
}

.samples button[aria-pressed='true'] {
  border-color: var(--violet);
  background: var(--violet-soft);
  box-shadow: inset 0 0 0 1px var(--violet);
}

.pg-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 280px);
  gap: 16px 28px;
  align-items: start;
  margin: 20px 0 24px;
}

.pg-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.pg-field label strong {
  color: var(--text);
  font-family: var(--mono);
}

.pg textarea {
  width: 100%;
  font: 22px/1.5 var(--sans);
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 14px 16px;
  resize: vertical;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.pg textarea:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 4px var(--violet-soft);
  outline: none;
}

.pg input[type='range'] {
  width: 100%;
  accent-color: var(--violet);
  margin-top: 14px;
}

.pg-stats {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.pg-stats strong {
  color: var(--text);
}

.ops {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 14px;
}

.op {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  min-width: 0;
}

.op-wide {
  grid-column: 1 / -1;
}

.op h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.op-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.op-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.op-col + .op-col {
  border-left: 1px dashed var(--border-strong);
  padding-left: 16px;
}

.op-side {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.op-col code {
  font-size: 13px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.op-value {
  display: block;
  width: 100%;
  min-height: 1.6em;
  font-size: 22px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.op-value:empty::before {
  content: 'empty string';
  font-size: 14px;
  font-style: italic;
  color: var(--muted);
}

.verdict {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.verdict.ok {
  color: var(--green);
}

.verdict.bad {
  color: var(--coral);
}

.verdict.warn {
  color: var(--warn);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 46px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.chip.bad {
  border-color: var(--coral);
}

.chip .glyph {
  font-size: 22px;
  line-height: 1.2;
}

.chip small {
  font: 11px/1.3 var(--mono);
  color: var(--muted);
  text-align: center;
}

/* Footer */

footer.site {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 64px 0 28px;
  font-size: 15px;
  color: var(--muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr) minmax(0, 0.8fr) minmax(0, 1.6fr);
  gap: 40px;
}

.footer-brand p {
  margin-top: 14px;
  max-width: 300px;
}

footer.site h2 {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin: 6px 0 14px;
}

footer.site ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

footer.site ul a {
  color: var(--muted);
  text-decoration: none;
}

footer.site ul a:hover {
  color: var(--violet-strong);
}

.footer-more li {
  display: grid;
  gap: 1px;
}

footer.site .footer-more a {
  color: var(--text);
  font-weight: 700;
}

.footer-more span {
  font-size: 14px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 48px;
  padding-top: 24px;
  background: linear-gradient(var(--border), var(--border)) var(--gutter) 0 / calc(100% - 2 * var(--gutter)) 1px no-repeat;
  font-size: 14px;
}

/* 404 */

.not-found {
  text-align: center;
  padding: 72px 0 96px;
}

.not-found .lead {
  margin: 0 auto;
}

.not-found .cta {
  justify-content: center;
}

/* Responsive */

@media (max-width: 960px) {
  .menu-toggle {
    display: grid;
    margin-left: auto;
  }

  nav.site {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 8px 16px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-size: 17px;
  }

  nav.site.open {
    display: flex;
  }

  nav.site a {
    padding: 12px 14px;
    border-radius: 10px;
  }

  .hero-grid,
  .showcase,
  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-art {
    order: -1;
  }

  .hero-art img {
    width: 200px;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  :root {
    --gutter: 16px;
  }

  .section {
    padding: 64px 0;
  }

  .hero {
    padding: 40px 0 56px;
  }

  .hero-art img {
    width: 160px;
  }

  .lead {
    font-size: 18px;
  }

  .compare,
  .steps,
  .pg-controls,
  .op-cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .op-col + .op-col {
    border-left: 0;
    border-top: 1px dashed var(--border-strong);
    padding-left: 0;
    padding-top: 12px;
  }

  .pg {
    padding: 16px;
  }

  .code pre {
    font-size: 13px;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }

  a.card:hover,
  .btn:hover {
    transform: none;
  }
}
