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

body {
  font-family: system-ui, sans-serif;
  background: #f5f5f0;
  color: #1a1a1a;
  line-height: 1.6;
}

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  background: #1e1e2e;
  color: #cdd6f4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 52px;
  z-index: 100;
  gap: 1rem;
}

.topbar .site-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.topbar nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.topbar nav a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.83rem;
  transition: color 0.15s;
}

.topbar nav a:hover,
.topbar nav a.active {
  color: #fff;
}

/* ── Page ── */
.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

.page-header {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.page-header p {
  color: #555;
  font-size: 0.93rem;
}

/* ── Section ── */
.section {
  margin-bottom: 3rem;
}

.section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section p {
  font-size: 0.92rem;
  color: #333;
  margin-bottom: 0.7rem;
}

/* ── Code ── */
code {
  font-family: 'Menlo', 'Fira Code', monospace;
  background: #e4e4e0;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.86em;
}

pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1.1rem 1.25rem;
  border-radius: 8px;
  font-family: 'Menlo', 'Fira Code', monospace;
  font-size: 0.86rem;
  overflow-x: auto;
  margin: 0.5rem 0 1.25rem;
  line-height: 1.7;
}

pre .comment { color: #6272a4; }
pre .prop    { color: #8be9fd; }
pre .val     { color: #f1fa8c; }
pre .at      { color: #ff79c6; }
pre .num     { color: #bd93f9; }

/* ── Callouts ── */
.callout {
  padding: 0.7rem 1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0.5rem 0 1.25rem;
}

.callout.yellow { background: #fef9c3; border-left: 4px solid #ca8a04; }
.callout.green  { background: #dcfce7; border-left: 4px solid #16a34a; }
.callout.blue   { background: #dbeafe; border-left: 4px solid #2563eb; }
.callout.red    { background: #fee2e2; border-left: 4px solid #dc2626; }

/* ── Demo shell ── */
.demo {
  background: #fff;
  border: 1.5px solid #e0e0d8;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 0.75rem 0 1.5rem;
}

.demo-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #999;
  margin-bottom: 1.1rem;
}

/* ── Side-by-side comparison ── */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.compare-col {
  background: #f5f5f0;
  border-radius: 6px;
  padding: 1rem;
}

.compare-col h4 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888;
  margin-bottom: 0.75rem;
}

hr { border: none; border-top: 1px solid #ddd; margin: 2.5rem 0; }

/* ── Reference table ── */
.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 0.75rem 0 1.5rem;
}

.ref-table th {
  background: #1e1e2e;
  color: #cdd6f4;
  text-align: left;
  padding: 0.5rem 0.85rem;
  font-weight: 600;
}

.ref-table td {
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid #e0e0d8;
}

.ref-table tr:last-child td { border-bottom: none; }
.ref-table tr:nth-child(even) td { background: #f5f5f0; }

.tag {
  display: inline-block;
  padding: 0.1em 0.5em;
  border-radius: 3px;
  font-size: 0.78em;
  font-weight: 700;
  font-family: monospace;
}

.tag.clamp   { background: #ede9fe; color: #5b21b6; }
.tag.media   { background: #dbeafe; color: #1e40af; }
.tag.both    { background: #dcfce7; color: #166534; }
