/* Neutral documentation shell. The chrome deliberately does NOT use the
   Farvidden design: it has its own --ui-* tokens and a system font stack.
   Brand tokens (--color-*, --font-*) appear only inside content specimens
   and swatches, so the brand is the content, never the frame. */

:root {
  --ui-bg: #ffffff;
  --ui-surface: #f6f6f4;
  --ui-text: #1a1a1e;
  --ui-muted: #70707a;
  --ui-border: #ececea;
  --ui-radius: 10px;
  --ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ui-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: var(--ui-font);
  font-size: 1rem;
  line-height: 1.65;
}

:focus-visible {
  outline: 2px solid var(--ui-text);
  outline-offset: 2px;
}

/* Shell layout */

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  flex: 0 0 15.5rem;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  background: var(--ui-bg);
  border-right: 1px solid var(--ui-border);
  padding: 1.75rem 1rem;
}

.sidebar-home {
  display: block;
  text-decoration: none;
  color: var(--ui-text);
  padding: 0.25rem 0.75rem;
}
.sidebar-home img { display: block; width: 6.25rem; max-width: 100%; }

.sidebar nav { display: flex; flex-direction: column; gap: 0.1875rem; }
.sidebar nav a {
  display: block;
  padding: 0.4375rem 0.75rem;
  border-radius: var(--ui-radius);
  color: var(--ui-muted);
  font-size: 0.875rem;
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.sidebar nav a:hover { color: var(--ui-text); background: var(--ui-surface); }
.sidebar nav a.active {
  color: var(--ui-text);
  font-weight: 600;
  background: var(--ui-surface);
}

@media (prefers-reduced-motion: reduce) {
  .sidebar nav a { transition: none; }
}

.site-footer {
  margin-top: 4.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ui-border);
  font-size: 0.75rem;
  color: var(--ui-muted);
}
.site-footer p { margin: 0.25rem 0; }

/* Contact details read as a block, not a bulleted list. */
.contact-block ul {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}
.contact-block li { margin: 0.125rem 0; }

/* Content column, centered in the space beside the sidebar */

main {
  flex: 1;
  min-width: 0;
  max-width: 46rem;
  margin: 0 auto;
  padding: 3.5rem 3rem 5rem;
}

@media (max-width: 48rem) {
  .layout { display: block; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--ui-border);
  }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; gap: 0.25rem; }
  main { padding: 1.75rem 1.25rem 4rem; }
}

/* Content typography (neutral) */

h1 {
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}
h2 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; margin: 2.75rem 0 0.875rem; }
a { color: var(--ui-text); }

code {
  font-family: var(--ui-mono);
  font-size: 0.8125rem;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  padding: 0.0625rem 0.3125rem;
}
pre {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  padding: 0.9375rem 1.125rem;
  overflow-x: auto;
}
pre code { background: none; border: none; padding: 0; }

.note {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  padding: 1.125rem 1.375rem;
  margin-top: 2.75rem;
}
.note h2 { margin-top: 0; font-size: 1rem; }
.note code { background: var(--ui-bg); }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ui-muted);
  border: 1px dashed var(--ui-muted);
  border-radius: 999px;
  padding: 0.0625rem 0.625rem;
  white-space: nowrap;
}

/* Brand content: swatches, specimens, logo samples.
   Values inside these frames come from the brand's tokens.css. */

.swatch-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  /* Three per row in the content column; long values wrap, never truncate. */
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 1rem;
}
.swatch {
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  overflow: hidden;
  background: var(--ui-bg);
}

/* The inset ring keeps white and off-white chips visible against the card. */
.swatch-chip {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  height: 5.5rem;
  padding: 0.5rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.07);
}
.swatch-chip .badge {
  background: rgba(255, 255, 255, 0.92);
  border-color: transparent;
  color: var(--ui-text);
  font-size: 0.6875rem;
}

.swatch-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  padding: 0.625rem 0.5rem 0.75rem;
}

/* Every field is a copy button: quiet until hovered, so the card still reads
   as a specimen rather than a toolbar. */
.swatch-body button {
  font-family: var(--ui-mono);
  font-size: 0.75rem;
  text-align: left;
  color: var(--ui-text);
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 0.125rem 0.375rem;
  cursor: pointer;
  max-width: 100%;
  overflow-wrap: anywhere;
  transition: background-color 0.12s ease;
}
.swatch-body button:hover { background: var(--ui-surface); }
.swatch-body .swatch-var,
.swatch-body .swatch-hex { color: var(--ui-muted); }
.swatch-body .swatch-var { font-size: 0.6875rem; }
.swatch-body .swatch-name { font-weight: 600; }

/* The confirmation sits over the chip, so it never reflows the value text. */
.swatch { position: relative; }
.swatch-chip { position: relative; }
.swatch.copied .swatch-chip::after {
  content: "Copied";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--ui-font);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ui-text);
  background: rgba(255, 255, 255, 0.88);
}

@media (prefers-reduced-motion: reduce) {
  .swatch-body button { transition: none; }
}

.logo-samples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 40rem) { .logo-samples { grid-template-columns: 1fr; } }
.logo-sample {
  margin: 0;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  padding: 2.25rem 1rem 0.875rem;
  text-align: center;
}
.logo-sample img { width: 80%; max-width: 16rem; }
.logo-on-light { background: var(--color-background-base); }
.logo-on-dark { background: var(--color-background-inverse); }
.logo-on-dark figcaption a { color: var(--color-text-inverse); }
figcaption { font-size: 0.8125rem; margin-top: 1.125rem; }

.specimen {
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: var(--color-background-base);
  padding: 1.125rem 1.375rem;
  margin-top: 1rem;
}
.specimen-label { color: var(--ui-muted); font-size: 0.8125rem; margin: 0; }
.specimen-sample { margin: 0.5rem 0; color: var(--color-text-base); }
.specimen-slab {
  font-family: var(--font-family-slab);
  font-weight: var(--font-weight-bold);
  font-size: 2.25rem;
  letter-spacing: 0.02em;
}
.specimen-sans {
  font-family: var(--font-family-sans);
  font-size: 1.25rem;
}
