/* The gallery's own chrome. It is deliberately not a skin: the page stays in one palette so the
   five skins can be compared against something that does not move. Tokens here are the public
   design system's, so the gallery reads as part of Clobber rather than as a storybook. */

:root {
  --paper: #F4F3EE;
  --surface: #FFFFFF;
  --ink: #142029;
  --muted: #56646D;
  --rule: #D3D7D3;
  --rule-soft: #E4E6E2;
  --bid: #167A5B;
  --signal: #F0BB48;
  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-underline-offset: 3px; }

/* ---------------------------------------------------------------- top */

.top { position: sticky; top: 0; z-index: 20; }
.top-banner { background: var(--ink); }
.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.brand { font-family: var(--mono); font-weight: 500; }
.ver { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctl {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.ctl select, .ctl-btn {
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 8px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.ctl-btn:hover { border-color: var(--ink); }
.ctl-btn:active { background: var(--paper); }

/* ---------------------------------------------------------------- shell */

.shell {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 36px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}
.nav {
  position: sticky;
  top: 104px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 3px 8px;
  border-left: 2px solid transparent;
}
.nav a:hover { color: var(--ink); border-left-color: var(--rule); }
.nav a.on { color: var(--ink); border-left-color: var(--ink); font-weight: 600; }

.main { min-width: 0; }
section { margin: 0 0 64px; scroll-margin-top: 120px; }
h1 { font-size: clamp(2rem, 1.4rem + 2vw, 3rem); line-height: 1.05; letter-spacing: -.025em; margin: 0 0 12px; }
h2 { font-size: 1.6rem; letter-spacing: -.02em; margin: 0 0 10px; padding-top: 8px; border-top: 1px solid var(--rule); }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 8px; }
p { max-width: 70ch; margin: 0 0 12px; }
.lede { font-size: 1.15rem; max-width: 62ch; }
code { font-family: var(--mono); font-size: .9em; background: rgba(20,32,41,.06); padding: 1px 4px; border-radius: 3px; }
pre {
  margin: 0;
  padding: 14px 16px;
  background: #0E171E;
  color: #E6EDF3;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.note {
  border-left: 2px solid var(--signal);
  padding: 2px 0 2px 14px;
  color: var(--muted);
  font-size: .95rem;
}

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin: 20px 0; }

/* ---------------------------------------------------------------- demo stages */

.split { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.stage {
  background: var(--clobber-bg, var(--surface));
  border-radius: 6px;
  padding: 14px;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  transition: background 160ms;
}
.stage > .clb { flex: 1 1 auto; }
.stage.short { min-height: 0; }
.stage.tall { min-height: 380px; }
.stage.wide { min-height: 0; }
.page-stage { min-height: 0; margin-bottom: 18px; }
.code { min-width: 0; }
.wide-code { margin-top: 8px; }

.skin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.skin-cell { display: flex; flex-direction: column; gap: 6px; }
.skin-name { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.skin-cell .stage { min-height: 0; padding: 10px; gap: 8px; }

/* ---------------------------------------------------------------- log */

.log-wrap { border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); }
.log {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  padding: 10px 14px;
  height: 168px;
  overflow-y: auto;
  color: var(--muted);
}
.log b { color: var(--ink); font-weight: 500; }
.log .warn { color: #B5641F; }
.log .bad { color: #BD493B; }
.log .good { color: var(--bid); }

.foot { border-top: 1px solid var(--rule); padding-top: 16px; color: var(--muted); font-size: .9rem; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .nav a { border-left: none; border-bottom: 2px solid transparent; }
  .split { grid-template-columns: minmax(0, 1fr); }
}
