:root {
  /* Palette — every color is a brand.json palette member or derived from one */
  --p-ink: #1C1917;
  --p-bg: #FAFAF9;
  --p-primary: #5B21B6;
  --p-accent: #10B981;
  --p-warn: #F43F5E;

  /* Surfaces — warm-tinted greys derived from the palette ink */
  --bg: var(--p-ink);
  --ink: var(--p-bg);
  --muted: #A8A29E;
  --muted-2: #78716C;
  --card: #292524;
  --card-border: #3F3934;
  --code-bg: #211D1B;

  /* Semantic */
  --primary: var(--p-primary);
  --primary-hover: #6D28D9;
  --verified: var(--p-accent);
  --fail: var(--p-warn);

  --max: 1080px;
  --gap: 1.5rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "ss01", "cv01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--card-border); transition: border-color 0.12s, color 0.12s; }
a:hover { border-bottom-color: var(--verified); color: var(--verified); }

code, pre {
  font-family: "Geist Mono", ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  font-size: 0.875em;
  font-feature-settings: "ss02", "ss03";
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  max-width: var(--max);
  margin: 0 auto;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  border: none;
}
.topbar .brand img { display: block; }
.topbar nav { display: flex; gap: 1.5rem; }
.topbar nav a { color: var(--muted); border: none; }
.topbar nav a:hover { color: var(--ink); }

main { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

/* Hero */
.hero { padding: 5rem 0 3.5rem; }
.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  line-height: 1.05;
  margin: 0 0 1.5rem;
  letter-spacing: -0.035em;
  font-weight: 600;
  max-width: 22ch;
}
.hero .lede {
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 38rem;
  margin: 0 0 2.25rem;
}
.hero .lede strong { color: var(--ink); font-weight: 600; }
.hero .lede code { background: var(--code-bg); color: var(--ink); padding: 0.1em 0.4em; border-radius: 3px; }
.hero .cta { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; }

.btn {
  display: inline-block;
  padding: 0.65rem 1.1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { border-color: var(--card-border); color: var(--ink); }
.btn.ghost:hover { border-color: var(--verified); }

.badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 0.76rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  letter-spacing: 0.02em;
}
.badge.warn {
  color: var(--fail);
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.08);
}

/* Sections */
section { padding: 4rem 0; border-top: 1px solid var(--card-border); }
section h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.15;
  margin: 0 0 0.85rem;
  letter-spacing: -0.025em;
  font-weight: 600;
}
section h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.muted { color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.muted + .muted { margin-top: 0.4rem; }
.muted code { color: var(--ink); background: var(--code-bg); padding: 0.1em 0.4em; border-radius: 3px; }

/* Comparison */
.comparison .palette {
  display: inline-flex;
  gap: 4px;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.comparison .palette span {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.72rem;
  color: #fff;
}

.two-up {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  margin: 2rem 0 1rem;
}

.metric {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin-top: 0.25rem;
}
.metric .num {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}
.metric .lbl {
  color: var(--muted);
  font-size: 0.85rem;
}
.metric.pass .num { color: var(--verified); }
.metric.fail .num { color: var(--fail); }

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 1rem;
  padding: 0.5rem;
  background: var(--code-bg);
  border-radius: 4px;
  border: 1px solid var(--card-border);
}
.sw {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  outline: 1px solid rgba(255, 255, 255, 0.06);
  outline-offset: -1px;
}
.card.winner .swatches .sw {
  width: 22px;
  height: 22px;
  border-radius: 3px;
}
.sw-cap {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.6rem 0 0;
  line-height: 1.45;
}
.sw-cap strong { color: var(--fail); font-weight: 600; }
.card.winner .sw-cap strong { color: var(--verified); }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 1.25rem;
}
.card.winner {
  border-color: var(--verified);
  box-shadow: 0 0 0 1px var(--verified) inset;
}
.card h3 { margin: 0 0 0.85rem; font-size: 0.95rem; color: var(--muted); font-weight: 500; }
.card.winner h3 { color: var(--verified); }

.art {
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 1rem;
  background: #fff;
}
.art img { max-width: 92%; max-height: 92%; display: block; }

.caveat { margin-top: 1.5rem; }

/* Bundle / steps section */
.bundle h2 { letter-spacing: -0.02em; }

.steps {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0 1rem;
  font-size: 0.92rem;
}
.steps th, .steps td {
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--card-border);
  vertical-align: middle;
}
.steps th {
  font-weight: 500;
  color: var(--muted-2);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.steps tbody tr:hover { background: var(--card); }
.steps tbody tr.winner { background: rgba(16, 185, 129, 0.06); }
.steps tbody tr.winner td:first-child strong { color: var(--verified); }
.steps td:last-child { width: 1%; text-align: right; padding-right: 1.1rem; }
.step-count {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--fail);
}
.step-count.pass { color: var(--verified); }
.steps td code { background: var(--code-bg); padding: 0.1em 0.4em; border-radius: 3px; }

.bundle-caption { margin: 2.5rem 0 1.25rem; }

.bundle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.bundle-cell {
  margin: 0;
  background: #FAFAF9;
  border-radius: 8px;
  padding: 0.85rem 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  min-height: 110px;
  text-align: center;
  color: var(--muted-2);
  border: none;
  transition: outline 0.12s;
}
.bundle-cell:hover { outline: 2px solid var(--verified); outline-offset: 2px; }
.bundle-cell img { display: block; image-rendering: -webkit-optimize-contrast; }
.bundle-cell span {
  font-size: 0.72rem;
  color: var(--muted-2);
  line-height: 1.2;
}
.bundle-cell span code { font-size: 0.95em; color: #1C1917; background: transparent; }

.bundle-wide {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 880px;
  margin: 0 auto;
}
.bundle-wide-cell {
  margin: 0;
  background: #FAFAF9;
  border-radius: 8px;
  padding: 0.75rem;
  overflow: hidden;
}
.bundle-wide-cell:first-child { grid-column: 1 / -1; }
.bundle-wide-cell img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}
.bundle-wide-cell figcaption {
  margin-top: 0.55rem;
  font-size: 0.75rem;
  color: var(--muted-2);
  text-align: center;
  line-height: 1.4;
}
.bundle-wide-cell figcaption code { color: var(--muted); background: transparent; }

/* Install */
.install pre {
  background: var(--code-bg);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin: 0.5rem 0 1rem;
}
.install pre code { color: #E5E7EB; }
.install p { margin: 0.75rem 0; }

/* Tools */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-top: 1.5rem;
}
.tool-grid > div {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
}
.tool-grid h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.tool-grid h3 code { color: var(--verified); }
.tool-grid p { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* Callout */
.callout {
  text-align: center;
  border-bottom: 1px solid var(--card-border);
}
.callout p { color: var(--muted); margin: 0; font-size: 0.92rem; }

/* Footer */
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 0.85rem;
}
footer a { color: var(--muted); }

/* Mobile */
@media (max-width: 720px) {
  .two-up, .tool-grid { grid-template-columns: 1fr; }
  .topbar nav { gap: 1rem; font-size: 0.9rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .comparison h2 br { display: none; }
  .steps { font-size: 0.82rem; }
  .steps th, .steps td { padding: 0.6rem 0.55rem; }
  .steps td:last-child { padding-right: 0.55rem; }
  .step-count { font-size: 1.15rem; }
  .bundle-grid { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); gap: 0.5rem; }
  .bundle-cell { min-height: 90px; padding: 0.65rem 0.4rem 0.5rem; }
  .bundle-wide { grid-template-columns: 1fr; }
  .swatches { padding: 0.4rem; gap: 2px; }
  .sw { width: 11px; height: 11px; }
  .card.winner .swatches .sw { width: 18px; height: 18px; }
  footer { flex-direction: column; gap: 0.4rem; }
}
