:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #fbfbfd;
  --text: #111111;
  --muted: #666666;
  --line: #d8d8dc;
  --ink: #1d1d1f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  font-weight: 650;
}

code,
pre {
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.library-shell {
  width: min(100% - 32px, 1100px);
  margin: 0 auto;
  padding: 56px 0;
}

.library-header {
  display: grid;
  gap: 14px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.library-eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.library-title {
  margin: 0;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1;
  letter-spacing: 0;
}

.library-intro {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.library-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.library-nav a,
.sf-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.library-grid {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.component-reference {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.component-meta {
  display: grid;
  align-content: start;
  gap: 12px;
}

.component-meta h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.component-meta p {
  margin: 0;
  color: var(--muted);
}

.component-preview {
  display: grid;
  gap: 14px;
}

.preview-frame {
  padding: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.markup-block {
  margin: 0;
  overflow-x: auto;
  padding: 14px;
  background: #111111;
  border-radius: 8px;
  color: #f5f5f7;
  font-size: 13px;
  line-height: 1.55;
}

.sf-section-header {
  display: grid;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.sf-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.sf-section-header h3,
.sf-card h3,
.sf-panel h3,
.sf-note h3,
.sf-link-card h3 {
  margin: 0;
  font-size: 20px;
}

.sf-section-header p,
.sf-card p,
.sf-panel p,
.sf-note p,
.sf-link-card p {
  margin: 0;
  color: var(--muted);
}

.sf-card,
.sf-panel,
.sf-note,
.sf-link-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sf-card-status {
  border-left: 4px solid #111111;
}

.sf-status-row,
.sf-metric-row,
.sf-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sf-status-badge,
.sf-tag {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  background: #ededf0;
  padding: 0 10px;
  color: #333333;
  font-size: 13px;
  font-weight: 650;
}

.sf-metric-value {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.sf-metric-label {
  margin: 0;
  color: var(--muted);
}

.sf-checklist {
  margin: 0;
  padding-left: 22px;
}

.sf-checklist li + li {
  margin-top: 8px;
}

.sf-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sf-note {
  background: #fbfbfd;
}

.sf-link-card {
  color: inherit;
  text-decoration: none;
}

.sf-button-primary {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}

@media (max-width: 820px) {
  .library-shell {
    width: min(100% - 24px, 1100px);
    padding: 36px 0;
  }

  .component-reference {
    grid-template-columns: 1fr;
    padding: 18px;
  }
}

