/* Measured Skills tool site. Dark and light themes share one token set.
   Auto follows the system; [data-theme] on <html> overrides it. */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --border: #dde1e6;
  --border-2: #c2c8d0;
  --text: #111418;
  --text-2: #3d4450;
  --muted: #565e6b;
  --code: #1f2937;
  --strong: #000000;
  --accent: #c6f432;
  --accent-ink: #4f6114;
  --on-accent: #0e1012;
  --chip-bg: #eef5dc;
  --chip-border: #c3d98a;
  --warn-bg: #fff0de;
  --warn: #8a4100;
  --shadow: 0 24px 60px rgba(16, 24, 40, 0.1);
  --sans:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1012;
    --surface: #16191c;
    --surface-2: #1f2328;
    --border: #2a2f35;
    --border-2: #3a4047;
    --text: #e8eaed;
    --text-2: #b4bcc5;
    --muted: #9aa3ad;
    --code: #c9d1d9;
    --strong: #ffffff;
    --accent-ink: #c6f432;
    --chip-bg: #1e2a12;
    --chip-border: #3b4f1e;
    --warn-bg: #33240f;
    --warn: #fdba74;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1012;
  --surface: #16191c;
  --surface-2: #1f2328;
  --border: #2a2f35;
  --border-2: #3a4047;
  --text: #e8eaed;
  --text-2: #b4bcc5;
  --muted: #9aa3ad;
  --code: #c9d1d9;
  --strong: #ffffff;
  --accent-ink: #c6f432;
  --chip-bg: #1e2a12;
  --chip-border: #3b4f1e;
  --warn-bg: #33240f;
  --warn: #fdba74;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
}

a {
  color: inherit;
}

a:hover {
  color: var(--strong);
}

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

button {
  font: inherit;
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 14px;
  border-radius: 8px;
  z-index: 10;
}

/* Headings focused by script to move the reader; no ring. */
[tabindex="-1"]:focus {
  outline: none;
}

.skip-link:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 480px) {
  .shell {
    padding: 0 16px;
  }
}

/* Header */
.site-header .shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  font-size: 14px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  color: var(--text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 12px;
  min-height: 32px;
  font-size: 13px;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-2);
}

/* Type */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0;
}

.eyebrow-muted {
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.lede {
  margin: 0;
  font-size: 19px;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 620px;
}

/* Hero + palette */
.hero {
  padding-block: 64px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.03;
  letter-spacing: -0.035em;
  max-width: 900px;
}

.pill {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
}

.palette {
  width: 100%;
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  text-align: left;
  overflow: hidden;
}

.palette-input {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.palette-input input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 18px;
}

.palette-input input::placeholder {
  color: var(--muted);
}

.palette-results {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 340px;
  overflow-y: auto;
}

.result {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  background: transparent;
  border: 0;
  cursor: pointer;
  min-height: 44px;
}

.result:hover {
  background: var(--surface-2);
}

.result[aria-pressed="true"] {
  background: var(--surface-2);
}

.result-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-2);
  flex: none;
}

.result[aria-pressed="true"] .result-dot {
  background: var(--accent-ink);
}

.result-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.result-title {
  font-weight: 600;
  font-size: 15px;
}

.result-why {
  font-size: 13px;
  color: var(--muted);
}

.result-tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-ink);
}

.result:not([aria-pressed="true"]) .result-tag {
  display: none;
}

.palette-empty {
  padding: 14px;
  font-size: 14px;
  color: var(--muted);
}

.palette-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

kbd {
  font-family: var(--mono);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 5px;
}

.tries {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.try {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  min-height: 32px;
}

.try:hover {
  border-color: var(--border-2);
  color: var(--text);
}

/* Builder */
.builder {
  padding-block: 40px 64px;
  scroll-margin-top: 16px;
}

.builder-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}

.builder-side {
  flex: 1 1 340px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.builder-side h2 {
  font-size: 34px;
}

.builder-side p {
  margin: 0;
  color: var(--text-2);
  line-height: 1.6;
}

.modes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 0;
  margin: 0;
  padding: 0;
}

.mode {
  text-align: left;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 44px;
}

.mode:hover {
  border-color: var(--border-2);
}

.mode[aria-pressed="true"] {
  background: var(--surface);
  border-color: var(--accent-ink);
}

.mode-title {
  font-weight: 600;
  font-size: 15px;
}

.mode-scope {
  font-size: 13px;
  color: var(--muted);
}

.single-note {
  font-size: 13px;
  color: var(--muted);
}

.example {
  border: 1px dashed var(--border-2);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.example p {
  color: var(--text);
  font-size: 15px;
}

.panel {
  flex: 999 1 560px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tab {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  min-height: 36px;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--text);
}

.panel-body {
  padding: 18px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.finish {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.finish p {
  margin: 0;
  font-size: 14px;
  color: var(--strong);
}

.blanks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.blank label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.blank input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
}

.blank .hint {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.command-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-2);
}

.command-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-ink);
}

.request {
  margin: 0;
  max-height: 320px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--code);
  white-space: pre-wrap;
  word-break: break-word;
}

.request .blank-token {
  background: var(--surface-2);
  color: var(--accent-ink);
  border-radius: 4px;
  padding: 1px 5px;
}

.request .filled {
  background: var(--chip-bg);
  color: var(--strong);
  border-radius: 4px;
  padding: 1px 5px;
}

.request .command {
  color: var(--muted);
}

.limits {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}

.limits li {
  display: flex;
  gap: 8px;
}

.limits li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent-ink);
}

details.limits-box summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  padding: 4px 0;
}

details.limits-box[open] summary {
  margin-bottom: 8px;
}

.guidance {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.panel-foot {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.panel-foot span {
  font-size: 13px;
  color: var(--muted);
}

.button {
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  min-width: 150px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button:hover {
  color: var(--on-accent);
  filter: brightness(1.05);
}

/* Sections */
.section {
  padding-block: 48px;
}

.section h2 {
  font-size: 34px;
  margin-bottom: 10px;
}

.section-lede {
  margin: 0 0 28px;
  color: var(--text-2);
  max-width: 640px;
  line-height: 1.6;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  text-decoration: none;
}

.card strong {
  font-size: 19px;
}

.card p {
  margin: 0;
  color: var(--text-2);
  line-height: 1.6;
  font-size: 15px;
}

.card-num {
  font-family: var(--mono);
  font-size: 40px;
  color: var(--accent-ink);
  line-height: 1;
}

.card-list {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--code);
}

.ladder {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.ladder li {
  background: var(--bg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ladder span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.ladder p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* Catalog page */
.page-head {
  padding: 44px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-head h1 {
  font-size: clamp(32px, 4.5vw, 54px);
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 20px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  color: var(--muted);
}

.search-box input {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.button-quiet {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-2);
  margin-top: 12px;
}

.button-quiet:hover {
  background: var(--surface-2);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border: 0;
  margin: 0;
  padding: 0;
}

.chip-row legend {
  float: left;
  font-size: 12px;
  color: var(--muted);
  width: 72px;
  padding: 0;
}

.chip {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13px;
  cursor: pointer;
  min-height: 36px;
}

.chip .count {
  font-family: var(--mono);
  color: var(--muted);
  margin-left: 4px;
}

.chip[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.chip[aria-pressed="true"] .count {
  color: var(--bg);
}

.catalog-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  padding-bottom: 64px;
}

.catalog-list {
  flex: 999 1 560px;
  min-width: 0;
}

.list-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 10px;
  font-size: 13px;
  color: var(--muted);
}

.skill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.skill-row {
  width: 100%;
  text-align: left;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  padding: 13px 18px;
  background: var(--bg);
  border: 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  min-height: 44px;
}

.skill-list li:last-child .skill-row {
  border-bottom: 0;
}

.skill-row:hover,
.skill-row[aria-pressed="true"] {
  background: var(--surface);
}

.skill-row[aria-pressed="true"] {
  box-shadow: inset 3px 0 0 var(--accent-ink);
}

.skill-id {
  font-family: var(--mono);
  font-size: 14px;
  flex: 0 1 260px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.skill-desc {
  flex: 999 1 240px;
  min-width: 0;
  font-size: 14px;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: none;
}

.tag {
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  color: var(--text-2);
}

.tag-safe {
  background: var(--chip-bg);
  border-color: var(--chip-border);
  color: var(--accent-ink);
}

.tag-warn {
  background: var(--warn-bg);
  border-color: transparent;
  color: var(--warn);
}

.tag-explicit {
  border-style: dashed;
  border-color: var(--border-2);
}

.detail {
  flex: 1 1 340px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail h2 {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.detail p {
  margin: 0;
  line-height: 1.55;
  color: var(--text-2);
}

.detail-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.code {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--accent-ink);
  overflow-wrap: anywhere;
}

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 13px;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  font-family: var(--mono);
}

.used-by {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.used-by a {
  color: var(--accent-ink);
}

/* Prose pages */
.prose {
  max-width: 720px;
  padding: 44px 0 64px;
}

.prose h1 {
  font-size: clamp(30px, 4vw, 44px);
  margin: 10px 0 20px;
}

.prose h2 {
  font-size: 22px;
  margin: 28px 0 8px;
}

.prose p,
.prose li {
  color: var(--text-2);
  line-height: 1.7;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 24px;
}

.site-footer .shell {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 28px;
  padding-bottom: 44px;
  font-size: 13px;
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
}

.status {
  min-height: 1em;
}

.noscript {
  max-width: 720px;
  margin: 0 auto 24px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-2);
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
