/* Swatchly design system — shared by server-rendered pages and the generator app. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/display.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-display: "Bricolage Grotesque", var(--font);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;

  --bg: oklch(0.99 0.003 275);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.965 0.006 275);
  --text: oklch(0.2 0.02 275);
  --text-muted: oklch(0.47 0.02 275);
  --border: color-mix(in oklch, var(--text) 11%, transparent);
  --border-strong: color-mix(in oklch, var(--text) 20%, transparent);
  --accent: oklch(0.53 0.22 280);
  --accent-hover: color-mix(in oklch, var(--accent), black 12%);
  --accent-soft: color-mix(in oklch, var(--accent) 10%, transparent);
  --on-accent: oklch(0.99 0 0);
  --good: oklch(0.55 0.15 155);
  --warn: oklch(0.62 0.15 70);
  --bad: oklch(0.56 0.2 25);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --shadow-sm: 0 1px 2px rgb(20 20 40 / 0.06), 0 1px 1px rgb(20 20 40 / 0.04);
  --shadow-md: 0 2px 4px rgb(20 20 40 / 0.06), 0 8px 24px rgb(20 20 40 / 0.1);
  --shadow-lg: 0 4px 8px rgb(20 20 40 / 0.06), 0 24px 64px rgb(20 20 40 / 0.18);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --header-h: 64px;
  --toolbar-h: 52px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: oklch(0.17 0.012 275);
    --surface: oklch(0.21 0.014 275);
    --surface-2: oklch(0.25 0.016 275);
    --text: oklch(0.93 0.008 275);
    --text-muted: oklch(0.72 0.015 275);
    --accent: oklch(0.7 0.16 280);
    --on-accent: oklch(0.15 0.02 280);
    --shadow-md: 0 2px 4px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.35);
    --shadow-lg: 0 4px 8px rgb(0 0 0 / 0.3), 0 24px 64px rgb(0 0 0 / 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: oklch(0.17 0.012 275);
  --surface: oklch(0.21 0.014 275);
  --surface-2: oklch(0.25 0.016 275);
  --text: oklch(0.93 0.008 275);
  --text-muted: oklch(0.72 0.015 275);
  --accent: oklch(0.7 0.16 280);
  --on-accent: oklch(0.15 0.02 280);
  --shadow-md: 0 2px 4px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.35);
  --shadow-lg: 0 4px 8px rgb(0 0 0 / 0.3), 0 24px 64px rgb(0 0 0 / 0.5);
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: 0.4; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
kbd {
  font-family: var(--mono);
  font-size: 0.8em;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  background: var(--surface);
}
.muted { color: var(--text-muted); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: var(--r-sm); }
.skip-link:focus { top: 8px; }

/* ---------- buttons & fields ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; line-height: 1.25; text-align: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-weight: 600; font-size: 14px; text-decoration: none;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), transform 80ms;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 32px; padding: 6px 12px; font-size: 13px; }
.btn.large { min-height: 52px; padding: 12px 24px; font-size: 16px; border-radius: var(--r-md); }
.btn > .icon { flex: none; }
.setting-block { display: grid; gap: 8px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm);
  color: var(--text-muted); transition: background 140ms, color 140ms;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.field { display: grid; gap: 8px; font-size: 14px; font-weight: 600; }
.field input, .field select, .code-head select, .copy-row input {
  height: 40px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface); font-weight: 400;
}
.field input:focus, .field select:focus, .copy-row input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.toggle-row { display: flex; align-items: center; gap: 12px; font-size: 14px; cursor: pointer; }
.toggle-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.chip { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); }
input[type="range"] { accent-color: var(--accent); width: 100%; }

/* ---------- site header (server-rendered) ---------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  padding: 8px clamp(8px, 2vw, 16px);
  pointer-events: none;
}
.header-inner {
  height: 100%; max-width: 80rem; margin-inline: auto;
  display: flex; align-items: center; gap: 16px;
  padding-inline: 12px 8px;
  border-radius: var(--r-lg);
  pointer-events: auto;
  /* The transition name lives here, not on .site-header: a view-transition-name makes an
     element a backdrop root, which would leave this glass layer with nothing to blur. */
  view-transition-name: site-header;
  background: color-mix(in oklch, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.8) blur(16px);
  -webkit-backdrop-filter: saturate(1.8) blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.page-generator .site-header { padding: 0; }
.page-generator .header-inner { max-width: none; border-radius: 0; border-width: 0 0 1px; box-shadow: none; padding-inline: clamp(12px, 2vw, 20px) 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 750; font-size: 20px; letter-spacing: -0.03em; text-decoration: none; }
.logo img { width: 28px; height: 28px; transition: transform var(--dur-2) var(--ease-out); }
.logo:hover img { transform: rotate(-8deg) scale(1.06); }
.site-nav { display: flex; gap: 2px; align-items: center; margin-left: 8px; }
.site-nav > a, .nav-menu-trigger {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; text-decoration: none; color: var(--text-muted);
  transition: color var(--dur-1), background var(--dur-1);
}
.site-nav > a:hover, .nav-menu-trigger:hover, .site-nav [aria-current="page"] { color: var(--text); background: var(--surface-2); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.nav-menu { position: relative; }
.nav-menu-trigger svg { transition: transform var(--dur-2) var(--ease-out); }
.nav-menu:hover .nav-menu-trigger svg, .nav-menu:focus-within .nav-menu-trigger svg { transform: rotate(180deg); }
.menu-panel {
  position: absolute; top: calc(100% + 10px); left: -200px; width: min(980px, calc(100vw - 48px));
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 8px; padding: 12px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(0.98); transform-origin: top left;
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), visibility 0s linear var(--dur-2);
}
.menu-panel::before { content: ""; position: absolute; inset: -12px 0 auto; height: 12px; }
.nav-menu:hover .menu-panel, .nav-menu:focus-within .menu-panel {
  opacity: 1; visibility: visible; transform: none; transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), visibility 0s;
}
.menu-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); text-decoration: none; transition: background var(--dur-1); }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); }
.menu-item strong { display: block; font-size: 14px; }
.menu-item small { display: block; font-size: 13px; color: var(--text-muted); }
.menu-ico { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); }

.mobile-nav { display: none; position: relative; }
.mobile-nav summary { list-style: none; cursor: pointer; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-sheet {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(320px, calc(100vw - 24px));
  display: grid; padding: 8px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: pop-in var(--dur-2) var(--ease-out);
}
.mobile-sheet a { padding: 12px; border-radius: var(--r-sm); font-weight: 600; text-decoration: none; }
.mobile-sheet a.sub { padding: 8px 12px 8px 24px; font-weight: 500; font-size: 14px; color: var(--text-muted); }
.mobile-sheet a:hover { background: var(--surface-2); }
@media (max-width: 860px) {
  .site-nav { display: none; }
  .mobile-nav { display: block; }
}
@media (max-width: 480px) { .header-cta { display: none; } }

/* ---------- generator layout ---------- */

.page-generator { overflow: hidden; height: 100dvh; display: flex; flex-direction: column; }
.page-generator .app-root { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.generator { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.generator.zen .toolbar { display: none; }
body:has(.generator.zen) .site-header { display: none; }

.toolbar {
  height: var(--toolbar-h); flex: none;
  display: flex; align-items: center; gap: 8px;
  padding-inline: clamp(8px, 2vw, 16px);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.tb-hint { color: var(--text-muted); font-size: 14px; margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-generate { display: none; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 14px; margin-right: auto; }
.tb-group { display: flex; gap: 2px; padding-left: 8px; border-left: 1px solid var(--border); }
.tb-group:first-of-type { border-left: 0; }
.tb-btn { position: relative; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px; border-radius: var(--r-sm); color: var(--text-muted); transition: background 140ms, color 140ms; }
.tb-btn:hover:not(:disabled), .tb-btn.active { background: var(--surface-2); color: var(--text); }
.tb-btn.active { color: var(--accent); }
.tb-label { font-size: 13px; font-weight: 600; display: none; }
@media (min-width: 1400px) { .tb-label { display: inline; } }
@media (max-width: 860px) {
  .tb-hint { display: none; }
  .tb-generate { display: inline-flex; }
  .tb-group { border-left: 0; padding-left: 0; }
}
@media (max-width: 560px) { .toolbar { overflow-x: auto; scrollbar-width: none; } }

.gen-body { flex: 1; min-height: 0; display: flex; position: relative; }
.columns { flex: 1; min-width: 0; display: flex; }
.columns.isolate { gap: 8px; padding: 8px; background: var(--bg); }
.columns.isolate .col { border-radius: var(--r-md); }

.col {
  position: relative; flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: clamp(24px, 8vh, 72px);
  transition: background-color 380ms var(--ease), color 380ms var(--ease), flex-grow 200ms var(--ease);
}
.col.drag-src { opacity: 0.55; }
.col-tools { display: flex; flex-direction: column; gap: 4px; margin-bottom: 24px; opacity: 0; transition: opacity 160ms; }
.col:hover .col-tools, .col:focus-within .col-tools, .col.locked .col-tools .lock { opacity: 1; }
.col.locked .col-tools { opacity: 1; }
.col.locked .col-tools .ct:not(.lock) { opacity: 0; }
.col:hover.locked .col-tools .ct:not(.lock) { opacity: 1; }
.ct { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md); color: inherit; opacity: 0.8; transition: background 140ms, opacity 140ms; }
.ct:hover { background: color-mix(in srgb, currentColor 12%, transparent); opacity: 1; }
.ct.grab { cursor: grab; }
.col-info { text-align: center; display: grid; gap: 4px; padding-inline: 8px; max-width: 100%; }
.col-hex {
  font-family: var(--font); font-weight: 700; font-size: clamp(18px, 2.4vw, 30px);
  letter-spacing: -0.01em; text-transform: uppercase; padding: 4px 12px; border-radius: var(--r-sm);
  font-variant-numeric: tabular-nums;
}
.col-hex:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.col-name, .col-sub { font-size: 13px; opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-sub { font-family: var(--mono); font-size: 12px; }

.col-add {
  position: absolute; z-index: 5; right: -22px; top: 50%; translate: 0 -50%;
  width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-md);
  opacity: 0; scale: 0.8; transition: opacity 140ms, scale 140ms var(--ease);
}
.col-add.end { right: 12px; }
.col:hover .col-add, .col-add:focus-visible { opacity: 1; scale: 1; }

/* shades + picker popovers */
.shades {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column;
  animation: fade-in 160ms var(--ease);
}
.shade { flex: 1; font-family: var(--mono); font-size: 12px; font-weight: 600; opacity: 0.95; }
.shade:hover { opacity: 1; font-size: 14px; }
.shade.current { font-weight: 800; box-shadow: inset 0 0 0 3px currentColor; }

.picker {
  position: absolute; z-index: 7; left: 50%; bottom: 120px; translate: -50% 0;
  width: min(280px, calc(100% - 16px)); min-width: 220px;
  display: grid; gap: 12px; padding: 16px;
  background: var(--surface); color: var(--text); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  animation: pop-in 160ms var(--ease);
}
.pk-top { display: flex; gap: 8px; align-items: center; }
.pk-top input[type="color"] { width: 40px; height: 40px; border: 0; padding: 0; border-radius: var(--r-sm); background: none; cursor: pointer; }
.pk-hex { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); font-family: var(--mono); text-transform: uppercase; }
.pk-close { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); }
.pk-row { display: grid; grid-template-columns: 44px 1fr 36px; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.pk-row output { text-align: right; font-family: var(--mono); }
.pk-hue { accent-color: var(--text); }

/* drawer */
.drawer {
  flex: none; width: 0; overflow: hidden; background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: width 220ms var(--ease);
}
.drawer.open { width: min(380px, 100vw); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 24px; min-width: 340px; }
.drawer-head h2 { font-size: 18px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px 24px; display: grid; align-content: start; gap: 16px; min-width: 340px; }
.drawer-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 8px; }
@media (max-width: 720px) {
  .drawer { position: absolute; inset: auto 0 0 0; z-index: 20; width: 100% !important; height: 0; border-left: 0; border-top: 1px solid var(--border); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-lg); transition: height 220ms var(--ease); }
  .drawer.open { height: min(70dvh, 560px); }
  .drawer-head, .drawer-body { min-width: 0; }
}

.slider-row { display: grid; grid-template-columns: 96px 1fr 44px; gap: 12px; align-items: center; font-size: 14px; font-weight: 600; }
.slider-row output { font-family: var(--mono); font-size: 13px; text-align: right; color: var(--text-muted); }

.choice-list { display: grid; gap: 8px; }
.choice { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; text-align: left; padding: 12px 16px; border-radius: var(--r-md); border: 1px solid var(--border); transition: border-color 140ms, background 140ms; }
.choice:hover { background: var(--surface-2); }
.choice.on { border-color: var(--accent); background: var(--accent-soft); }
.choice strong { font-size: 14px; }
.choice small { grid-column: 1 / -1; color: var(--text-muted); font-size: 13px; line-height: 1.45; }
.choice-meta { font-size: 12px; color: var(--text-muted); font-family: var(--mono); }

.score-card { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 16px; border-radius: var(--r-md); background: var(--surface-2); }
.score { font-size: 36px; font-weight: 800; letter-spacing: -0.03em; }
.score-card .muted { font-size: 13px; line-height: 1.4; }
.pair-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pair { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; }
.pair-demo { display: grid; place-items: center; height: 44px; border-radius: var(--r-sm); font-weight: 800; font-size: 18px; border: 1px solid var(--border); }
.pair-info { display: grid; }
.pair-info strong { font-family: var(--mono); font-size: 14px; }
.rating { font-size: 12px; font-weight: 600; }
.rating.r1 { color: var(--bad); } .rating.r2 { color: var(--warn); } .rating.r3, .rating.r4, .rating.r5 { color: var(--good); }

.lib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lib-item { display: flex; gap: 4px; align-items: center; }
.lib-open { flex: 1; min-width: 0; display: grid; gap: 8px; text-align: left; padding: 8px; border-radius: var(--r-md); }
.lib-open:hover { background: var(--surface-2); }
.lib-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip { display: flex; height: 40px; border-radius: var(--r-sm); overflow: hidden; }
.strip i { flex: 1; }
.empty { color: var(--text-muted); font-size: 14px; text-align: center; padding: 24px 8px; }

/* modal */
.backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgb(10 10 25 / 0.45); animation: fade-in 160ms var(--ease); }
.modal {
  width: min(720px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
  display: grid; gap: 16px; padding: 24px;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  animation: pop-in 200ms var(--ease);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { font-size: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal .strip { height: 64px; border-radius: var(--r-md); }

.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px; background: var(--surface-2); border-radius: var(--r-md); scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tab-body { display: grid; gap: 16px; align-content: start; min-height: 200px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; }
.code-head { display: flex; gap: 8px; flex-wrap: wrap; }
.code-head select { flex: 1; min-width: 160px; }
.code { margin: 0; max-height: 320px; overflow: auto; padding: 16px; border-radius: var(--r-md); background: var(--surface-2); font-family: var(--mono); font-size: 13px; line-height: 1.6; white-space: pre; }

.qv { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.qv-col { display: grid; gap: 4px; align-content: start; }
.qv-swatch { height: 96px; border-radius: var(--r-md); border: 1px solid var(--border); }
.qv-val { display: grid; text-align: left; padding: 8px; border-radius: var(--r-sm); font-size: 13px; }
.qv-val:hover { background: var(--surface-2); }
.qv-val small { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-muted); text-transform: uppercase; }
.qv-val span { font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.keys { display: grid; grid-template-columns: auto 1fr; gap: 12px 24px; margin: 0; align-items: center; }
.keys dd { margin: 0; color: var(--text-muted); font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; translate: -50% 16px;
  padding: 12px 16px; border-radius: var(--r-md);
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity 160ms, translate 200ms var(--ease);
}
.toast.show { opacity: 1; translate: -50% 0; }
.zen-exit { position: fixed; right: 16px; top: 16px; z-index: 30; padding: 8px 12px; border-radius: var(--r-sm); background: rgb(0 0 0 / 0.5); color: #fff; font-size: 13px; font-weight: 600; opacity: 0; transition: opacity 200ms; }
.zen-exit:hover, .zen-exit:focus-visible { opacity: 1; }

/* phones: colors stack as rows */
@media (max-width: 720px) {
  .columns { flex-direction: column; }
  .columns.isolate { gap: 4px; padding: 4px; }
  .col { flex-direction: row-reverse; align-items: center; justify-content: space-between; padding: 0 12px 0 16px; }
  .col-tools { flex-direction: row; margin: 0; opacity: 1; gap: 0; }
  .col.locked .col-tools .ct:not(.lock) { opacity: 1; }
  .ct { width: 40px; height: 40px; }
  .ct.grab { display: none; }
  .col-info { text-align: left; gap: 0; padding: 0; }
  .col-hex { font-size: 20px; padding: 0; justify-self: start; text-align: left; }
  .col-add { right: 50%; top: auto; bottom: -22px; translate: 50% 0; }
  .col-add.end { display: none; }
  .shades { flex-direction: row; }
  .shade { font-size: 0; }
  .picker { bottom: auto; top: 50%; translate: -50% -50%; position: fixed; }
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } }

/* ---------- server-rendered static palette (pre-hydration) ---------- */

.ssr-columns { flex: 1; display: flex; }
.ssr-columns > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: clamp(24px, 8vh, 72px); text-align: center; }
.ssr-columns strong { font-size: clamp(18px, 2.4vw, 30px); letter-spacing: -0.01em; }
.ssr-columns span { font-size: 13px; opacity: 0.75; }
@media (max-width: 720px) { .ssr-columns { flex-direction: column; } .ssr-columns > div { flex-direction: row; justify-content: space-between; padding: 0 16px; } }

/* ---------- content pages (landing, legal, SEO) ---------- */

.container { width: 100%; max-width: 76rem; margin-inline: auto; padding-inline: clamp(16px, 5vw, 32px); }
.container.narrow { max-width: 56rem; }
.display, .display-2, .page-head h1, .color-intro h1, .prose h1 { font-family: var(--font-display); font-weight: 750; letter-spacing: -0.035em; }
.display-2 { font-size: clamp(30px, 4.4vw, 52px); line-height: 1.04; max-width: 24ch; text-wrap: balance; }
.muted-ink { color: var(--text-muted); }
.section-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.section-head .display-2 { margin: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 6px 14px; border-radius: 999px; }
kbd { font-weight: 600; }
.btn kbd { margin-left: 4px; background: color-mix(in srgb, currentColor 14%, transparent); border-color: color-mix(in srgb, currentColor 25%, transparent); color: inherit; font-size: 12px; }

/* hero */
.hero { position: relative; overflow: clip; padding-block: clamp(56px, 9vw, 112px) clamp(48px, 7vw, 96px); text-align: center; }
.hero-bg { position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 15% 20%, color-mix(in oklch, #5b4bff 22%, transparent), transparent 70%),
    radial-gradient(35% 45% at 85% 15%, color-mix(in oklch, #ff5c8a 18%, transparent), transparent 70%),
    radial-gradient(40% 40% at 70% 70%, color-mix(in oklch, #ffb547 16%, transparent), transparent 70%),
    radial-gradient(35% 40% at 25% 75%, color-mix(in oklch, #22c4a1 16%, transparent), transparent 70%);
  filter: blur(8px);
}
.hero-inner { display: grid; justify-items: center; }
.hero h1 { margin-top: 24px; font-size: clamp(42px, 7.4vw, 92px); line-height: 0.98; text-wrap: balance; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, #5b4bff, #ff5c8a 40%, #ffb547 70%, #22c4a1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { margin-top: 24px; max-width: 58ch; font-size: clamp(17px, 2vw, 20px); color: var(--text-muted); text-wrap: pretty; }
.cta { margin-top: 32px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-demo { margin-top: clamp(40px, 6vw, 64px); width: 100%; border-radius: var(--r-xl); overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.hero-cols { display: flex; height: clamp(200px, 30vw, 340px); }
.hero-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; padding-bottom: 20px; text-decoration: none;
  transition: background-color 600ms var(--ease-out), color 600ms var(--ease-out), flex-grow var(--dur-3) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 45ms);
}
.hero-col:hover { flex-grow: 1.6; }
.hero-col span { font-weight: 700; font-size: clamp(12px, 1.6vw, 18px); letter-spacing: -0.01em; }
.hero-col small { font-size: 12px; opacity: 0.75; min-height: 1em; }
.hero-demo-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; font-size: 14px; color: var(--text-muted); }
.trust { list-style: none; margin: 28px 0 0; padding: 0; display: flex; gap: 8px 24px; justify-content: center; flex-wrap: wrap; color: var(--text-muted); font-size: 14px; }
.trust li::before { content: "✓"; margin-right: 6px; color: var(--good); font-weight: 800; }
@media (max-width: 640px) { .hero-col small { display: none; } .hero-demo-bar .hint { display: none; } }

/* sections */
.section { padding-block: clamp(64px, 9vw, 120px); }
.section-alt { background: var(--surface-2); }
.section .sub { margin-top: 16px; color: var(--text-muted); font-size: 18px; max-width: 62ch; }
.more { margin-top: 24px; }

/* bento */
.bento { margin-top: 40px; display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.tile { position: relative; display: grid; grid-template-rows: auto 1fr; gap: 24px; padding: 28px; min-height: 260px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); overflow: hidden; transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tile-wide { grid-column: span 2; }
.tile h3 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.tile p { margin-top: 8px; color: var(--text-muted); max-width: 44ch; }
.tile-dark { background: #14142b; color: #f3f2ff; border-color: transparent; }
.tile-dark p { color: #b9b8d6; }
@media (max-width: 900px) { .bento { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .bento { grid-template-columns: 1fr; } .tile-wide { grid-column: auto; } }
.mini-gen { display: flex; align-self: end; height: 120px; border-radius: var(--r-md); overflow: hidden; }
.mini-gen i { flex: 1; background: var(--c); position: relative; transition: flex-grow var(--dur-3) var(--ease-out); }
.tile:hover .mini-gen i:nth-child(3) { flex-grow: 1.8; }
.mini-gen i.locked::after { content: ""; position: absolute; left: 50%; bottom: 12px; width: 14px; height: 12px; translate: -50% 0; border-radius: 3px; background: #fff; box-shadow: 0 -7px 0 -3px transparent; }
.mini-gen i.locked::before { content: ""; position: absolute; left: 50%; bottom: 22px; width: 10px; height: 9px; translate: -50% 0; border: 2px solid #fff; border-bottom: 0; border-radius: 6px 6px 0 0; }
.mini-contrast { align-self: end; display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: var(--r-md); background: #f4e9cd; color: #1b264f; }
.mini-contrast .aa { font-family: var(--font-display); font-size: 44px; font-weight: 800; line-height: 1; }
.mini-contrast b { display: block; font-family: var(--mono); font-size: 18px; } .mini-contrast em { font-style: normal; font-size: 13px; font-weight: 700; color: #1f7a4d; }
.mini-cvd { align-self: end; display: grid; gap: 8px; }
.mini-cvd span { display: flex; height: 40px; border-radius: var(--r-sm); overflow: hidden; }
.mini-cvd i { flex: 1; background: var(--c); }
.mini-chips { align-self: end; display: flex; flex-wrap: wrap; gap: 8px; }
.mini-chips span { padding: 6px 12px; border-radius: 999px; font-family: var(--mono); font-size: 13px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); transition: transform var(--dur-2) var(--ease-out); }
.tile:hover .mini-chips span { transform: translateY(-2px); }
.tile:hover .mini-chips span:nth-child(even) { transform: translateY(2px); }
.mini-saved { align-self: end; display: grid; gap: 6px; }
.mini-saved span { display: flex; height: 26px; border-radius: 8px; overflow: hidden; transition: transform var(--dur-2) var(--ease-out); }
.mini-saved i { flex: 1; background: var(--c); }
.tile:hover .mini-saved span:nth-child(2) { transform: translateX(6px); }
.tile:hover .mini-saved span:nth-child(3) { transform: translateX(12px); }
.mini-scale { align-self: end; display: flex; height: 64px; border-radius: var(--r-md); overflow: hidden; }
.mini-scale i { flex: 1; background: var(--c); }
.mini-speed { align-self: end; display: grid; }
.mini-speed b { font-family: var(--font-display); font-size: 56px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; background: linear-gradient(90deg, #8a7dff, #ff7aa2, #ffc66b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mini-speed span { color: #b9b8d6; font-size: 14px; }

/* tool tiles */
.tool-tiles { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.tool-tile { height: 100%; display: grid; gap: 4px; padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); text-decoration: none; transition: border-color var(--dur-1), transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.tool-tile:hover { border-color: color-mix(in oklch, var(--accent) 45%, transparent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tool-tile .menu-ico { margin-bottom: 12px; }
.tool-tile small { color: var(--text-muted); font-size: 14px; }

.card { padding: 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); display: grid; gap: 8px; align-content: start; }
.card h3 { font-size: 18px; }
.card p { color: var(--text-muted); font-size: 15px; }
.steps { margin-top: 40px; display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: step; padding: 0; }
.steps li { list-style: none; display: grid; gap: 8px; padding: 24px; border-radius: var(--r-lg); border: 1px dashed var(--border-strong); }
.steps li::before { counter-increment: step; content: counter(step); width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; background: var(--text); color: var(--bg); font-weight: 800; }
.steps h3 { font-family: var(--font-display); font-size: 20px; }
.compare { width: 100%; border-collapse: collapse; font-size: 15px; }
.section .table-wrap { margin-top: 32px; }
.compare th, .compare td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.compare tr:last-child td { border-bottom: 0; }
.compare th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.compare td:nth-child(2) { font-weight: 700; color: var(--good); }
.faq { margin-top: 32px; display: grid; gap: 8px; }
.faq details { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); padding: 0 20px; transition: border-color var(--dur-1); }
.faq details[open] { border-color: var(--border-strong); }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--text-muted); transition: transform var(--dur-2) var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 18px; color: var(--text-muted); }
.faq details[open] p { animation: fade-up var(--dur-2) var(--ease-out); }
.cta-panel { position: relative; overflow: hidden; display: grid; justify-items: center; gap: 12px; padding: clamp(48px, 8vw, 96px) 24px; border-radius: var(--r-xl); text-align: center; color: #fff;
  background: radial-gradient(60% 80% at 20% 20%, #7b6dff, transparent 60%), radial-gradient(60% 80% at 80% 80%, #ff5c8a, transparent 60%), #3b2fd9; }
.cta-panel .display-2 { color: #fff; margin-inline: auto; }
.cta-panel p { color: rgb(255 255 255 / 0.85); font-size: 18px; }
.cta-panel .btn { margin-top: 16px; }
.btn.invert { background: #fff; color: #1d1757; border-color: transparent; }
.btn.invert:hover:not(:disabled) { background: #f0eeff; }

/* footer */
.site-footer { border-top: 1px solid var(--border); padding-block: 56px 32px; font-size: 14px; color: var(--text-muted); background: var(--bg); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer-brand { display: grid; gap: 12px; align-content: start; max-width: 34ch; }
.footer-brand .logo { color: var(--text); }
.site-footer h2 { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { text-decoration: none; transition: color var(--dur-1); }
.site-footer a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

.prose { max-width: 65ch; padding-block: 48px 96px; }
.prose h1 { font-size: clamp(34px, 5vw, 48px); margin-bottom: 24px; }
.prose h2 { font-size: 22px; margin-top: 40px; margin-bottom: 8px; }
.prose p, .prose li { color: var(--text-muted); }
.prose p + p { margin-top: 12px; }

/* embeds */
.embed { margin: 0; height: 100dvh; display: flex; font-family: var(--font); }
.embed a { flex: 1; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 12px; font-weight: 700; font-size: 13px; text-decoration: none; }
.embed .brand { position: fixed; right: 8px; top: 8px; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgb(0 0 0 / 0.45); color: #fff; text-decoration: none; }

/* ---------- SEO content pages: colors, palettes, explore ---------- */

.page { padding-block: 24px 96px; }
.page-head { padding-block: 16px 24px; display: grid; gap: 16px; }
.page-head h1, .color-intro h1 { font-size: clamp(30px, 4.5vw, 48px); font-weight: 800; letter-spacing: -0.03em; }
.page-head h1 .muted, .color-intro h1 .muted { font-weight: 600; }
.lead { font-size: 18px; color: var(--text-muted); max-width: 70ch; }
.block { padding-top: 48px; display: grid; gap: 16px; }
.block > h2 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; }
.block h3 { font-size: 16px; margin-top: 8px; }
.block.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.block.two > div { display: grid; gap: 12px; align-content: start; min-width: 0; }
.more { margin-top: 24px; }
.small-link { font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; }
.small-link:hover { text-decoration: underline; }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; font-size: 14px; color: var(--text-muted); }
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: 0.5; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }

.toc { position: sticky; top: var(--header-h); z-index: 5; display: flex; gap: 4px; overflow-x: auto; padding: 8px 0; margin-top: 32px; background: var(--bg); border-bottom: 1px solid var(--border); scrollbar-width: none; }
.toc a { flex: none; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--text-muted); }
.toc a:hover { background: var(--surface-2); color: var(--text); }
section[id] { scroll-margin-top: calc(var(--header-h) + 64px); }

.color-hero { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: clamp(24px, 4vw, 48px); align-items: center; padding-top: 24px; }
.color-swatch { aspect-ratio: 1; border-radius: var(--r-xl); display: flex; align-items: flex-end; padding: 24px; box-shadow: var(--shadow-md); border: 1px solid var(--border); }
.color-swatch-hex { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.color-intro { display: grid; gap: 16px; }
.color-intro .lead { font-size: 17px; }
@media (max-width: 760px) { .color-hero { grid-template-columns: 1fr; } .color-swatch { aspect-ratio: 2 / 1; } }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin: 0; }
.kv > div { display: grid; gap: 4px; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); }
.kv dt { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.kv dd { margin: 0; }
.copyable { font-family: var(--mono); font-size: 14px; text-align: left; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; }
.copyable:hover { background: var(--surface-2); }
.copyable.copied, .copy-btn.copied { color: var(--good); }

.strip-links { display: flex; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); }
.strip-links a { flex: 1; min-width: 0; height: 64px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; text-decoration: none; font-family: var(--mono); font-size: 11px; font-weight: 600; transition: flex-grow 160ms var(--ease); }
.strip-links a span { opacity: 0; transition: opacity 120ms; }
.strip-links a:hover, .strip-links a:focus-visible { flex-grow: 2.2; }
.strip-links a:hover span, .strip-links a:focus-visible span, .strip-links a[aria-current] span { opacity: 1; }
.strip-links a[aria-current] { box-shadow: inset 0 -4px 0 currentColor; }
.harmonies { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.harmony { display: grid; gap: 8px; align-content: start; }
.harmony h3 { margin: 0; }

.blind-list, .named-grid, .pgrid, .family-tiles, .pair-cards, .blind-strips, .checklist { list-style: none; margin: 0; padding: 0; }
.blind-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.blind-list li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.blind-list small { display: block; color: var(--text-muted); font-size: 13px; }
.sim { display: flex; width: 72px; height: 44px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); }
.sim i { flex: 1; }

.contrast-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.contrast-card { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.contrast-demo { display: grid; gap: 8px; padding: 24px; min-height: 140px; align-content: center; }
.contrast-demo .big { font-size: 40px; font-weight: 800; line-height: 1; }
.contrast-meta { display: grid; gap: 8px; padding: 16px 24px 24px; }
.contrast-meta strong { font-family: var(--mono); font-size: 20px; }
.wcag { border-collapse: collapse; font-size: 13px; width: 100%; }
.wcag th { text-align: left; font-weight: 600; color: var(--text-muted); padding: 4px 8px 4px 0; }
.wcag td { padding: 4px 16px 4px 0; }
.pass { color: var(--good); } .fail { color: var(--bad); }

.named-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.named-grid a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-md); text-decoration: none; border: 1px solid transparent; }
.named-grid a:hover { background: var(--surface); border-color: var(--border); }
.named-grid i { flex: none; width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--border); }
.named-grid span { display: grid; min-width: 0; }
.named-grid strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.named-grid small { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }

.family-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.family-tiles a { display: grid; align-content: end; gap: 2px; height: 120px; padding: 16px; border-radius: var(--r-lg); text-decoration: none; transition: transform 140ms var(--ease), box-shadow 140ms; }
.family-tiles a:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.family-tiles strong { font-size: 18px; }
.family-tiles span { font-size: 13px; opacity: 0.8; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.pcard a { display: grid; gap: 8px; text-decoration: none; padding: 8px; margin: -8px; border-radius: var(--r-lg); transition: background 140ms; }
.pcard a:hover { background: var(--surface-2); }
.pcard-strip { display: flex; height: 96px; border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.pcard-strip i { flex: 1; transition: flex-grow 160ms var(--ease); }
.pcard a:hover .pcard-strip i:hover { flex-grow: 1.8; }
.pcard-codes { display: flex; font-family: var(--mono); font-size: 10px; color: var(--text-muted); }
.pcard-codes span { flex: 1; text-align: center; min-width: 0; overflow: hidden; }
.pcard-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 13px; font-weight: 600; text-decoration: none; background: var(--surface); }
.tag:hover { border-color: var(--text-muted); }
.tag.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.explore-tags { margin-bottom: 32px; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin-top: 48px; }

.hex-search { display: flex; align-items: center; gap: 8px; max-width: 420px; padding: 4px 4px 4px 16px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface); }
.hex-search span { font-family: var(--mono); color: var(--text-muted); }
.hex-search input { flex: 1; min-width: 0; height: 40px; border: 0; background: none; font-family: var(--mono); font-size: 16px; text-transform: uppercase; }
.hex-search input:focus { outline: none; }
.hex-search:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }

.palette-hero { display: flex; height: clamp(220px, 34vw, 400px); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-lg); }
.palette-hero a { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 16px 8px 24px; text-decoration: none; text-align: center; transition: flex-grow 200ms var(--ease); }
.palette-hero a:hover { flex-grow: 1.5; }
.palette-hero strong { font-size: clamp(14px, 1.8vw, 22px); letter-spacing: -0.01em; }
.palette-hero span { font-size: 13px; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 640px) { .palette-hero { flex-direction: column; height: auto; } .palette-hero a { flex-direction: row; justify-content: space-between; height: 64px; padding: 0 16px; } }
.actions { margin-block: 24px 16px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.codes { width: 100%; border-collapse: collapse; font-size: 14px; }
.codes th, .codes td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.codes tr:last-child td { border-bottom: 0; }
.codes th { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.codes td:nth-child(n+3) { font-family: var(--mono); font-size: 13px; }
.cell-swatch { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; text-decoration: none; }
.cell-swatch i { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); }

.pair-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pair-cards li { display: flex; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.pair-cards li > span:last-child { display: grid; }
.pair-cards strong { font-family: var(--mono); font-size: 14px; }
.blind-strips { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.blind-strips li { display: grid; gap: 8px; font-size: 14px; font-weight: 600; }
.mini-strip { display: flex; height: 44px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); }
.mini-strip i { flex: 1; }

.codebox { position: relative; }
.codebox pre { margin: 0; padding: 16px; padding-right: 88px; max-height: 360px; overflow: auto; border-radius: var(--r-md); background: var(--surface-2); font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.codebox .copy-btn { position: absolute; top: 8px; right: 8px; }
.checklist { display: grid; gap: 12px; }
.checklist li { padding-left: 32px; position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--on-accent); background: var(--good); }
/* Grid/flex children must be allowed to shrink so long code lines scroll inside their box. */
.block > *, .codebox, .harmony, .contrast-card { min-width: 0; }
.block.two { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.harmonies, .contrast-grid, .blind-list { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }

/* ---------- tools ---------- */

.tool-root { min-height: 320px; }
.tool { display: grid; gap: 24px; }
.tool-fallback { padding: 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.tool-h2 { font-size: 20px; font-weight: 800; }
.howto { display: grid; gap: 8px; padding-left: 24px; margin: 0; color: var(--text-muted); max-width: 70ch; }
.howto li::marker { color: var(--accent); font-weight: 800; }
.prose-p { color: var(--text-muted); max-width: 72ch; }
.tool-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.tool-card { height: 100%; text-decoration: none; transition: border-color 140ms, transform 140ms var(--ease); }
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.warn { padding: 12px 16px; border-radius: var(--r-md); background: color-mix(in oklch, var(--warn) 14%, transparent); color: var(--text); font-size: 14px; }
.error { color: var(--bad); font-weight: 600; }

.tool-inputs { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.tool-inputs > .color-field, .tool-inputs > .field { flex: 1 1 220px; }
.color-field { display: grid; gap: 8px; font-size: 14px; font-weight: 600; }
.cf-row { display: flex; align-items: center; height: 48px; padding: 4px 12px 4px 4px; gap: 4px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface); }
.cf-row:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }
.cf-row.invalid { border-color: var(--bad); }
.cf-swatch { position: relative; flex: none; width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--border); overflow: hidden; cursor: pointer; }
.cf-swatch input { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); opacity: 0; cursor: pointer; }
.cf-hash { font-family: var(--mono); color: var(--text-muted); padding-left: 8px; }
.cf-hex { flex: 1; min-width: 0; border: 0; background: none; font-family: var(--mono); font-size: 16px; text-transform: uppercase; }
.cf-hex:focus { outline: none; }
.cf-hex.big { height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); flex: 1 1 140px; }
.swap { height: 48px; width: 48px; padding: 0; font-size: 18px; flex: none; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--surface-2); }
.seg button { height: 36px; padding: 0 12px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; color: var(--text-muted); text-transform: capitalize; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* contrast */
.contrast-result { display: grid; gap: 16px; padding: 24px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); }
.score-big { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.score-big .ratio { font-size: clamp(48px, 8vw, 72px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.score-big .ratio small { font-size: 0.45em; color: var(--text-muted); }
.score-big .rating { font-size: 18px; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badge-card { display: grid; gap: 2px; padding: 12px 16px; border-radius: var(--r-md); border: 1px solid var(--border); }
.badge-card.ok { background: color-mix(in oklch, var(--good) 10%, transparent); border-color: color-mix(in oklch, var(--good) 35%, transparent); }
.badge-card.bad { background: color-mix(in oklch, var(--bad) 8%, transparent); border-color: color-mix(in oklch, var(--bad) 30%, transparent); }
.badge-state { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.badge-card.ok .badge-state { color: var(--good); } .badge-card.bad .badge-state { color: var(--bad); }
.badge-card strong { font-size: 14px; } .badge-card small { color: var(--text-muted); font-family: var(--mono); }
.apca { font-size: 14px; }
.contrast-preview { display: grid; gap: 12px; padding: clamp(24px, 4vw, 48px); border-radius: var(--r-xl); border: 1px solid var(--border); transition: background-color 200ms, color 200ms; }
.pv-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.pv-title { font-size: clamp(24px, 3.5vw, 36px); font-weight: 800; }
.pv-body { font-size: 16px; max-width: 60ch; } .pv-small { font-size: 13px; }
.pv-ui { display: flex; gap: 12px; flex-wrap: wrap; }
.pv-button, .pv-outline { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: var(--r-sm); font-weight: 700; font-size: 14px; }
.pv-outline { border: 2px solid; }
.fixes { display: grid; gap: 12px; }
.fixes h2 { font-size: 20px; font-weight: 800; }

/* color picker */
.tool-picker { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.tool-picker .picker-strips { grid-column: 1 / -1; display: grid; gap: 8px; }
@media (max-width: 860px) { .tool-picker { grid-template-columns: 1fr; } }
.picker-main { display: grid; gap: 16px; }
.sv-square { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); cursor: crosshair; touch-action: none; background-image: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent); }
.sv-thumb { position: absolute; width: 24px; height: 24px; translate: -50% -50%; border-radius: 999px; border: 3px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.3), var(--shadow-md); pointer-events: none; }
.hue-range { -webkit-appearance: none; appearance: none; height: 16px; border-radius: 999px; background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.hue-range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 999px; background: #fff; border: 1px solid rgb(0 0 0 / 0.3); box-shadow: var(--shadow-md); }
.hue-range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 999px; background: #fff; border: 1px solid rgb(0 0 0 / 0.3); }
.picker-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.picker-side { display: grid; gap: 12px; }
.picker-preview { height: 120px; border-radius: var(--r-lg); border: 1px solid var(--border); }
.picker-name { font-size: 24px; font-weight: 800; }
.kv.compact { grid-template-columns: 1fr; gap: 4px; }
.kv.compact > div { grid-template-columns: 72px 1fr; align-items: center; padding: 8px 12px; }

/* image picker */
.dropzone { position: relative; display: grid; place-items: center; min-height: 320px; border-radius: var(--r-xl); border: 2px dashed var(--border-strong); background: var(--surface); transition: border-color 140ms, background 140ms; overflow: hidden; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.has-image { border-style: solid; min-height: 0; background: var(--surface-2); }
.img-canvas { display: none; max-width: 100%; max-height: 70vh; cursor: crosshair; }
.dropzone.has-image .img-canvas { display: block; }
.dz-empty { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 32px; }
.dz-title { font-size: 22px; font-weight: 800; }
.extract-controls { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.extract-controls .slider-row { flex: 1 1 280px; }
.extracted { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.extracted li { display: grid; gap: 4px; }
.ex-swatch { display: grid; align-content: end; height: 112px; padding: 12px; border-radius: var(--r-md); text-align: left; border: 1px solid var(--border); transition: transform 120ms var(--ease); }
.ex-swatch.sel { outline: 3px solid var(--accent); outline-offset: 2px; }
.ex-swatch strong { font-family: var(--mono); font-size: 14px; } .ex-swatch span { font-size: 12px; opacity: 0.8; }
.ex-name { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* gradients */
.gradient-preview { height: clamp(220px, 32vw, 360px); border-radius: var(--r-xl); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.gradient-bar { position: relative; height: 28px; border-radius: 999px; margin-inline: 12px; }
.gb-stop { position: absolute; top: 50%; width: 22px; height: 22px; translate: -50% -50%; border-radius: 999px; border: 3px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.25), var(--shadow-sm); }
.gradient-controls { display: flex; gap: 16px 24px; flex-wrap: wrap; align-items: center; }
.gradient-controls .slider-row { flex: 1 1 260px; }
.stops { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.stop-row { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(200px, 1.4fr) auto; gap: 16px; align-items: end; padding: 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); }
@media (max-width: 640px) { .stop-row { grid-template-columns: 1fr auto; } .stop-row .slider-row { grid-column: 1 / -1; grid-row: 2; } }
.gpal-out .strip-links a { height: 120px; }
.gpal-out .strip-links a span { opacity: 1; }
.gpal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-family: var(--mono); font-size: 14px; }
.gpal-list li { display: flex; align-items: center; gap: 8px; }
.gpal-list i { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border); }

/* tailwind */
.tw-scale { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); }
.tw-scale li { display: grid; align-content: end; gap: 2px; min-height: 120px; padding: 12px 8px; font-size: 12px; }
.tw-scale li.base { box-shadow: inset 0 -4px 0 currentColor; }
.tw-scale strong { font-size: 14px; } .tw-scale a { font-family: var(--mono); text-decoration: none; } .tw-scale small { opacity: 0.75; font-size: 10px; }
@media (max-width: 860px) { .tw-scale { grid-template-columns: 1fr; } .tw-scale li { min-height: 0; grid-template-columns: 48px 1fr auto; align-items: center; } }
.tw-preview { display: grid; gap: 12px; padding: 32px; border-radius: var(--r-xl); border: 1px solid; }
.tw-preview h3 { font-size: 24px; }
.tw-badge { justify-self: start; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.tw-btn { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: var(--r-sm); font-weight: 700; font-size: 14px; }
.tw-btn.outline { border: 1px solid; }
.tw-alert { padding: 12px 16px; border-radius: var(--r-md); border: 1px solid; font-size: 14px; }

/* visualizer */
.viz-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.viz-palette { display: flex; height: 48px; flex: 1 1 260px; max-width: 420px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); }
.viz-palette a { flex: 1; }
.viz-paste { display: flex; gap: 8px; }
.viz-paste input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); font-family: var(--mono); font-size: 13px; }
.viz-tabs { justify-self: start; }
.viz-stage { border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-md); background: var(--v-bg); color: var(--v-text); font-family: var(--font); }
.viz-stage h3 { color: var(--v-text); }
.m-pill { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px; background: var(--v-primary); color: var(--v-on-primary); font-style: normal; font-weight: 700; font-size: 13px; }
.m-pill.wide { width: 100%; justify-content: center; }
.m-ghost { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--v-secondary); color: var(--v-text); font-style: normal; font-weight: 700; font-size: 13px; }
.m-eyebrow { display: inline-block; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--v-accent) 25%, transparent); color: var(--v-text); font-size: 12px; font-weight: 700; }
.m-landing { padding: 24px clamp(16px, 4vw, 48px) 48px; display: grid; gap: 40px; }
.m-nav { display: flex; gap: 24px; align-items: center; font-size: 14px; } .m-nav b { margin-right: auto; font-size: 18px; } .m-nav span { opacity: 0.75; }
@media (max-width: 640px) { .m-nav span { display: none; } }
.m-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.m-hero h3 { font-size: clamp(28px, 4vw, 48px); line-height: 1.05; letter-spacing: -0.03em; margin: 16px 0; }
.m-hero p { opacity: 0.8; max-width: 44ch; }
.m-ctas { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.m-art { position: relative; aspect-ratio: 1; }
.m-blob { position: absolute; border-radius: 999px; }
.m-blob.a { inset: 5% 25% 30% 5%; background: var(--v-primary); }
.m-blob.b { inset: 35% 5% 5% 35%; background: var(--v-secondary); mix-blend-mode: multiply; }
.m-blob.c { inset: 55% 55% 10% 15%; background: var(--v-accent); }
@media (max-width: 640px) { .m-hero { grid-template-columns: 1fr; } .m-art { max-width: 240px; } }
.m-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.m-features > div { display: grid; gap: 4px; padding: 16px; border-radius: var(--r-md); background: color-mix(in srgb, var(--v-text) 5%, transparent); }
.m-features i { width: 28px; height: 28px; border-radius: 8px; background: var(--v-accent); }
.m-features p { font-size: 13px; opacity: 0.75; }
@media (max-width: 640px) { .m-features { grid-template-columns: 1fr; } }
.m-dash { display: grid; grid-template-columns: 180px 1fr; min-height: 420px; }
.m-dash aside { display: grid; align-content: start; gap: 4px; padding: 24px 16px; background: var(--v-text); color: var(--v-bg); font-size: 14px; }
.m-dash aside b { margin-bottom: 16px; font-size: 18px; }
.m-dash aside span { padding: 8px 12px; border-radius: 8px; opacity: 0.75; } .m-dash aside .on { background: var(--v-primary); color: var(--v-on-primary); opacity: 1; }
.m-dash section { display: grid; gap: 16px; padding: 24px; align-content: start; }
.m-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.m-kpis > div { display: grid; padding: 16px; border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--v-text) 15%, transparent); }
.m-kpis b { font-size: 22px; } .m-kpis small { opacity: 0.7; } .m-kpis .hl { background: var(--v-accent); color: var(--v-on-accent); border-color: transparent; }
.m-chart { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding: 16px; border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--v-text) 15%, transparent); }
.m-chart span { flex: 1; border-radius: 4px 4px 0 0; background: var(--v-primary); }
.m-chart span:nth-child(3n) { background: var(--v-secondary); }
.m-table p { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--v-text) 12%, transparent); font-size: 14px; }
.m-tag { font-style: normal; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--v-primary); color: var(--v-on-primary); }
.m-tag.alt { background: var(--v-accent); color: var(--v-on-accent); }
@media (max-width: 640px) { .m-dash { grid-template-columns: 1fr; } .m-dash aside { display: none; } .m-kpis { grid-template-columns: 1fr 1fr; } }
.m-phones { display: flex; gap: 32px; justify-content: center; padding: 32px 16px; flex-wrap: wrap; background: color-mix(in srgb, var(--v-text) 6%, var(--v-bg)); }
.m-phone { width: 260px; min-height: 480px; display: grid; align-content: start; gap: 12px; padding: 24px 16px; border-radius: 32px; background: var(--v-bg); border: 6px solid var(--v-text); }
.m-phone.dark { background: var(--v-text); color: var(--v-bg); border-color: var(--v-text); }
.m-top { display: flex; justify-content: space-between; align-items: baseline; } .m-top span { font-size: 12px; opacity: 0.7; }
.m-card { display: grid; gap: 4px; padding: 16px; border-radius: 16px; background: color-mix(in srgb, var(--v-secondary) 30%, transparent); }
.m-card.big { background: var(--v-primary); color: var(--v-on-primary); } .m-card.acc { background: var(--v-accent); color: var(--v-on-accent); }
.m-card b { font-size: 20px; } .m-card small { opacity: 0.8; font-size: 12px; }
.m-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.m-bar { display: block; height: 6px; border-radius: 999px; background: color-mix(in srgb, currentColor 20%, transparent); }
.m-bar i { display: block; height: 100%; border-radius: 999px; background: var(--v-accent); }
.m-cover { aspect-ratio: 1; border-radius: 16px; background: linear-gradient(135deg, var(--v-primary), var(--v-secondary) 60%, var(--v-accent)); }
.m-song { font-size: 18px; }
.m-player { display: flex; justify-content: space-around; align-items: center; font-size: 18px; }
.m-play { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 999px; font-style: normal; background: var(--v-primary); color: var(--v-on-primary); }
.m-poster { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.m-poster span { position: absolute; }
.p-circle { width: 46%; aspect-ratio: 1; border-radius: 999px; right: -6%; top: -12%; background: var(--v-primary); }
.p-rect { width: 30%; height: 55%; left: 8%; bottom: -10%; background: var(--v-secondary); transform: rotate(-8deg); }
.p-arc { width: 34%; aspect-ratio: 1; border-radius: 999px; border: 28px solid var(--v-accent); right: 22%; bottom: -16%; }
.p-dot { width: 7%; aspect-ratio: 1; border-radius: 999px; left: 44%; top: 18%; background: var(--v-text); }
.p-text { position: absolute; left: 6%; top: 10%; display: grid; gap: 4px; }
.p-text h3 { font-size: clamp(32px, 7vw, 80px); line-height: 0.9; letter-spacing: -0.04em; font-weight: 800; }
.p-text small { font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.m-type { display: grid; gap: 16px; padding: clamp(24px, 6vw, 72px); max-width: 760px; }
.m-type h3 { font-size: clamp(30px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 800; }
.m-type .lead-t { font-size: 20px; opacity: 0.85; }
.m-type a { color: var(--v-primary); text-decoration: underline; text-underline-offset: 3px; }
.m-type mark { background: var(--v-accent); color: var(--v-on-accent); padding: 0 4px; border-radius: 4px; }
.m-type blockquote { margin: 0; padding-left: 20px; border-left: 4px solid var(--v-secondary); font-size: 18px; font-style: italic; }
.stop-row > *, .tool-inputs > * { min-width: 0; }
.cf-hex { width: 100%; }

/* pairing pages */
.mono { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.matches { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 12px; }
.match { display: grid; grid-template-columns: 88px 1fr; gap: 16px; align-items: center; padding: 12px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.match-pair { display: flex; height: 64px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); }
.match-pair i { flex: 1; }
.match > div { display: grid; gap: 2px; min-width: 0; }
.match-role { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.match strong a { text-decoration: none; }
.match strong a:hover { text-decoration: underline; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 999px; margin-right: 8px; border: 1px solid var(--border); }

/* theme toggle (site header) */
.theme-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); color: var(--text-muted); transition: background 140ms, color 140ms; }
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

.footer-meta { display: grid; gap: 8px; }
.visits { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.visits[hidden] { display: none; }


/* ---------- motion layer ---------- */

/* Press feedback on every button-like control. */
.btn, .tb-btn, .ct, .icon-btn, .tab, .seg button, .choice, .shade, .tool-tile, .tile, .pcard a {
  transition-property: background-color, border-color, color, transform, box-shadow, opacity;
  transition-duration: var(--dur-1);
  transition-timing-function: var(--ease-out);
}
.btn:active:not(:disabled), .tb-btn:active:not(:disabled), .ct:active, .icon-btn:active, .tab:active, .seg button:active { transform: scale(0.97); }
.btn.primary { box-shadow: 0 1px 0 rgb(255 255 255 / 0.25) inset, 0 6px 16px -6px color-mix(in oklch, var(--accent) 70%, transparent); }
.btn.primary:hover:not(:disabled) { transform: translateY(-1px); }

/* Generator: colors cascade left→right on every generate. */
.col { transition-delay: calc(var(--i, 0) * 35ms); }
.col.drag-src { transition-delay: 0ms; }

/* Palette cards: the hovered card lifts, its swatches breathe. */
.pcard a:hover { transform: translateY(-2px); }
.pcard-strip { transition: box-shadow var(--dur-2) var(--ease-out); }
.pcard a:hover .pcard-strip { box-shadow: var(--shadow-md); }

/* Modals and drawers: enter with ease-out; toasts spring up. */
.modal { animation: pop-in var(--dur-3) var(--ease-out); }
.toast { transition: opacity var(--dur-2) var(--ease-out), translate var(--dur-3) var(--ease-out); }

/* Reveal on scroll, once, compositor-only (scroll-driven CSS where supported). */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .header-inner { background: color-mix(in oklch, var(--surface) 80%, transparent); }
}

@supports (animation-timeline: view()) {
  .reveal, .pgrid > li, .family-tiles > li, .named-grid > li {
    animation: fade-up linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 35%;
  }
}

/* Page-to-page: native cross-document view transitions (Chrome, Edge, Safari). */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 140ms var(--ease-in) both vt-out; }
::view-transition-new(root) { animation: 260ms var(--ease-out) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
  .reveal, .pgrid > li, .family-tiles > li, .named-grid > li { animation: none !important; }
  @view-transition { navigation: none; }
}

/* tools menu groups */
.menu-group { display: grid; align-content: start; gap: 2px; }
.menu-cat { padding: 4px 12px 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.menu-group .menu-item { padding: 8px 10px; }
.menu-group .menu-ico { width: 32px; height: 32px; }
.menu-all { grid-column: 1 / -1; justify-self: end; padding: 8px 12px; font-size: 14px; font-weight: 700; color: var(--accent); text-decoration: none; border-radius: var(--r-sm); }
.menu-all:hover { background: var(--accent-soft); }
@media (max-width: 1100px) { .menu-panel { grid-template-columns: repeat(2, 1fr); left: -120px; width: min(620px, calc(100vw - 48px)); } }

/* converter / namer */
.conv-input { display: flex; gap: 12px; align-items: end; }
.conv-input .field { flex: 1; }
.conv-input input[type="text"], .tool-namer .field input { height: 52px; font-family: var(--mono); font-size: 18px; }
.field input.invalid { border-color: var(--bad); }
.conv-swatch { position: relative; flex: none; width: 52px; height: 52px; border-radius: var(--r-md); border: 1px solid var(--border-strong); overflow: hidden; }
.conv-swatch input { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); opacity: 0; cursor: pointer; }
.conv-out { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.name-result, .mix-result, .random-main { display: grid; gap: 4px; padding: clamp(24px, 4vw, 40px); border-radius: var(--r-xl); border: 1px solid var(--border); transition: background-color 300ms var(--ease-out), color 300ms var(--ease-out); }
.name-result strong, .mix-result strong, .random-main strong { font-family: var(--font-display); font-size: clamp(32px, 5vw, 56px); letter-spacing: -0.03em; line-height: 1.05; }
.mix-label { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; }
.mix-result .btn-row, .random-main .btn-row { margin-top: 12px; }
.mix-result .btn, .random-main .btn { background: rgb(255 255 255 / 0.85); color: #14142b; border-color: transparent; }

/* tints */
.ramp { display: grid; gap: 12px; }
.ramp-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.ramp-list li { display: grid; gap: 4px; }
.ramp-cell { height: 72px; border-radius: var(--r-md); border: 1px solid var(--border); font-size: 12px; font-weight: 700; display: grid; place-items: end center; padding-bottom: 8px; }
.ramp-list a { font-family: var(--mono); font-size: 12px; text-decoration: none; color: var(--text-muted); }

/* random */
.random-main { min-height: 280px; align-content: end; }
.random-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.random-grid a { display: grid; align-content: end; gap: 2px; height: 120px; padding: 12px; border-radius: var(--r-md); text-decoration: none; transition: transform var(--dur-2) var(--ease-out); }
.random-grid a:hover { transform: translateY(-2px); }
.random-grid strong { font-family: var(--mono); font-size: 13px; } .random-grid span { font-size: 12px; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* contrast grid */
.cgrid { border-collapse: separate; border-spacing: 4px; font-family: var(--mono); font-size: 12px; }
.cgrid th { font-weight: 600; color: var(--text-muted); padding: 4px; white-space: nowrap; text-align: center; }
.cgrid th i { display: block; width: 100%; min-width: 56px; height: 14px; border-radius: 4px; margin-bottom: 4px; border: 1px solid var(--border); }
.cgrid tbody th { text-align: right; } .cgrid tbody th i { width: 28px; min-width: 0; display: inline-block; vertical-align: middle; margin: 0 6px 0 0; }
.cgrid td { min-width: 64px; height: 48px; text-align: center; border-radius: 8px; font-weight: 700; opacity: 0.35; outline: 1px solid var(--border); }
.cgrid td.pass { opacity: 1; box-shadow: inset 0 0 0 2px var(--good); }
.cgrid td.same { opacity: 0.15; }

/* mesh */
.mesh-preview { position: relative; height: clamp(260px, 38vw, 440px); border-radius: var(--r-xl); border: 1px solid var(--border); box-shadow: var(--shadow-md); overflow: hidden; }
.mesh-dot { position: absolute; width: 18px; height: 18px; translate: -50% -50%; border-radius: 999px; border: 3px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.2), var(--shadow-sm); }
.mesh-row { grid-template-columns: minmax(200px, 1fr) minmax(160px, 1fr) minmax(160px, 1fr); }
@media (max-width: 760px) { .mesh-row { grid-template-columns: 1fr; } }
.slider-row.grow { flex: 1 1 260px; }

/* color blindness simulator */
.cvd-kinds button { text-transform: none; }
.cvd-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; width: 100%; }
.cvd-pair.hidden { display: none; }
.cvd-pair figure { margin: 0; display: grid; gap: 8px; }
.cvd-pair canvas { width: 100%; height: auto; border-radius: var(--r-md); }
.cvd-pair figcaption { font-size: 13px; font-weight: 700; text-align: center; color: var(--text-muted); }
@media (max-width: 640px) { .cvd-pair { grid-template-columns: 1fr; } }

/* box shadow */
.shadow-stage { display: grid; place-items: center; height: clamp(260px, 34vw, 380px); border-radius: var(--r-xl); border: 1px solid var(--border); }
.shadow-box { width: min(260px, 60%); height: 160px; background: #fff; transition: box-shadow var(--dur-2) var(--ease-out), border-radius var(--dur-2) var(--ease-out); }
.shadow-row { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) auto; }

/* glass */
.glass-stage { position: relative; overflow: hidden; display: grid; place-items: center; height: clamp(280px, 36vw, 400px); border-radius: var(--r-xl); background: #1d1757; }
.g-blob { position: absolute; border-radius: 999px; filter: blur(2px); }
.g-blob.a { width: 46%; aspect-ratio: 1; left: 6%; top: -10%; background: #ff5c8a; }
.g-blob.b { width: 38%; aspect-ratio: 1; right: 4%; bottom: -14%; background: #22c4a1; }
.g-blob.c { width: 26%; aspect-ratio: 1; right: 30%; top: 8%; background: #ffb547; }
.glass-card { position: relative; display: grid; gap: 4px; width: min(340px, 80%); padding: 32px; color: #fff; }
.glass-card strong { font-family: var(--font-display); font-size: 26px; }
.glass-sliders { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px 24px; }

/* gradient gallery */
.ggrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.gcard { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); overflow: hidden; transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.gcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.gcard-swatch { aspect-ratio: 16 / 10; }
.gcard-body { display: grid; gap: 6px; padding: 14px 16px 16px; }
.gcard-body strong { font-size: 15px; }
.gcard-codes { display: flex; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.gcard-actions { display: flex; gap: 8px; margin-top: 4px; }
