/* clay.css — claymorphism design system for /display-tools
 *
 * Performance rules baked in on purpose:
 *  - no webfont, no icon font, no framework: system stack only
 *  - shadows are static; only transform/opacity animate, so hover never
 *    repaints a shadow (the classic claymorphism CWV killer)
 *  - every tile has a fixed aspect-ratio => zero CLS
 *  - colour previews are CSS, not images => no LCP image request at all
 */

:root {
  --clay-bg: #eef0f8;
  --clay-surface: #f6f7fc;
  --clay-surface-2: #ffffff;
  --clay-ink: #232538;
  --clay-ink-soft: #4d5068;
  --clay-accent: #5b5bd6;
  --clay-accent-ink: #ffffff;
  --clay-line: #dcdff0;
  --clay-r: 26px;
  --clay-r-sm: 16px;
  --clay-shadow:
     8px 8px 20px rgba(70, 74, 120, .16),
    -6px -6px 16px rgba(255, 255, 255, .9),
    inset 2px 2px 4px rgba(255, 255, 255, .85),
    inset -3px -3px 8px rgba(70, 74, 120, .10);
  --clay-shadow-sm:
     4px 4px 12px rgba(70, 74, 120, .14),
    -3px -3px 10px rgba(255, 255, 255, .85),
    inset 1px 1px 3px rgba(255, 255, 255, .8),
    inset -2px -2px 5px rgba(70, 74, 120, .08);
  --clay-maxw: 1140px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --clay-bg: #191b26;
    --clay-surface: #22243233;
    --clay-surface-2: #262939;
    --clay-ink: #f2f3fa;
    --clay-ink-soft: #b9bcd2;
    --clay-accent: #a5a6ff;
    --clay-accent-ink: #1a1b26;
    --clay-line: #343850;
    --clay-shadow:
       8px 8px 20px rgba(0, 0, 0, .45),
      -6px -6px 16px rgba(255, 255, 255, .04),
      inset 2px 2px 4px rgba(255, 255, 255, .06),
      inset -3px -3px 8px rgba(0, 0, 0, .35);
    --clay-shadow-sm:
       4px 4px 12px rgba(0, 0, 0, .4),
      -3px -3px 10px rgba(255, 255, 255, .03),
      inset 1px 1px 3px rgba(255, 255, 255, .05),
      inset -2px -2px 5px rgba(0, 0, 0, .3);
  }
}

.clay-page {
  margin: 0;
  background: var(--clay-bg);
  color: var(--clay-ink);
  font: 400 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.clay-wrap { max-width: var(--clay-maxw); margin: 0 auto; padding: 0 20px; }

.clay-page a { color: var(--clay-accent); text-underline-offset: 3px; }
.clay-page h1, .clay-page h2, .clay-page h3 { line-height: 1.22; letter-spacing: -.015em; margin: 0 0 .5em; }
.clay-page h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem); font-weight: 800; }
.clay-page h2 { font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.85rem); font-weight: 700; }
.clay-page h3 { font-size: 1.15rem; font-weight: 700; }
.clay-page p  { margin: 0 0 1.1em; max-width: 72ch; color: var(--clay-ink-soft); }
.clay-page :focus-visible { outline: 3px solid var(--clay-accent); outline-offset: 3px; border-radius: 8px; }

/* ── breadcrumbs ─────────────────────────────────────────────── */
.clay-crumbs { padding: 18px 20px 0; max-width: var(--clay-maxw); margin: 0 auto; }
.clay-crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.clay-crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--clay-ink-soft); }
.clay-crumbs [aria-current="page"] { color: var(--clay-ink-soft); }

/* ── hero ────────────────────────────────────────────────────── */
.clay-hero { padding: 28px 0 8px; }
.clay-hero .clay-lede { font-size: 1.1rem; max-width: 68ch; }
.clay-hero-panel {
  background: var(--clay-surface-2);
  border-radius: var(--clay-r);
  box-shadow: var(--clay-shadow);
  padding: clamp(22px, 4vw, 40px);
}

/* ── panels & sections ───────────────────────────────────────── */
.clay-section { padding: 30px 0; }
.clay-panel {
  background: var(--clay-surface-2);
  border-radius: var(--clay-r);
  box-shadow: var(--clay-shadow);
  padding: clamp(20px, 3vw, 32px);
  margin-bottom: 26px;
}
.clay-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px; margin-bottom: 6px; }
.clay-panel-head h2 { margin: 0; }
.clay-panel-head .clay-count { font-size: .85rem; color: var(--clay-ink-soft); }
.clay-panel-head .clay-more { margin-left: auto; font-weight: 600; font-size: .95rem; }

/* ── tiles ───────────────────────────────────────────────────── */
.clay-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  margin-top: 18px;
}
.clay-tile {
  display: flex; flex-direction: column; gap: 6px;
  min-height: 152px;
  padding: 16px;
  border-radius: var(--clay-r-sm);
  background: var(--clay-surface-2);
  box-shadow: var(--clay-shadow-sm);
  color: var(--clay-ink);
  text-decoration: none;
  transform: translateZ(0);
  transition: transform .18s ease;
}
.clay-tile:hover, .clay-tile:focus-visible { transform: translateY(-3px) scale(1.012); }
.clay-tile:active { transform: translateY(0) scale(.99); }
.clay-tile-visual {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--clay-bg);
  box-shadow: inset 2px 2px 5px rgba(70,74,120,.16), inset -2px -2px 5px rgba(255,255,255,.7);
  color: var(--clay-accent);
}
.clay-tile.is-color .clay-tile-visual {
  background: var(--swatch);
  border: 1px solid var(--clay-line);
}
.clay-tile-name { font-weight: 700; font-size: 1rem; }
.clay-tile-desc { font-size: .84rem; color: var(--clay-ink-soft); line-height: 1.45; }

/* ── filter box ──────────────────────────────────────────────── */
.clay-filter { display: flex; gap: 12px; align-items: center; margin: 18px 0 4px; }
.clay-filter input {
  flex: 1 1 auto; max-width: 420px;
  font: inherit; font-size: 1rem;
  padding: 13px 18px; border: 0; border-radius: 999px;
  background: var(--clay-bg); color: var(--clay-ink);
  box-shadow: inset 3px 3px 7px rgba(70,74,120,.15), inset -3px -3px 7px rgba(255,255,255,.75);
}
.clay-filter-status { font-size: .88rem; color: var(--clay-ink-soft); }

/* ── buttons ─────────────────────────────────────────────────── */
.clay-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 26px;
  border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 700; text-decoration: none;
  background: var(--clay-accent); color: var(--clay-accent-ink);
  box-shadow: 6px 6px 14px rgba(70,74,120,.22), -4px -4px 12px rgba(255,255,255,.7),
              inset 1px 1px 2px rgba(255,255,255,.35);
  transition: transform .16s ease;
}
.clay-btn:hover { transform: translateY(-2px); }
.clay-btn-ghost { background: var(--clay-surface-2); color: var(--clay-ink); }

/* ── prose / FAQ ─────────────────────────────────────────────── */
.clay-prose h2 { margin-top: 1.4em; }
.clay-prose ul, .clay-prose ol { color: var(--clay-ink-soft); max-width: 72ch; padding-left: 1.2em; }
.clay-prose li { margin-bottom: .45em; }
.clay-faq details {
  background: var(--clay-surface-2); border-radius: var(--clay-r-sm);
  box-shadow: var(--clay-shadow-sm); padding: 14px 18px; margin-bottom: 12px;
}
.clay-faq summary { font-weight: 700; cursor: pointer; list-style: none; }
.clay-faq summary::-webkit-details-marker { display: none; }
.clay-faq summary::after { content: "+"; float: right; font-weight: 400; }
.clay-faq details[open] summary::after { content: "–"; }
.clay-faq p { margin: .7em 0 .2em; }

/* ── footer link block ───────────────────────────────────────── */
.clay-footer { margin-top: 34px; padding: 34px 0 46px; border-top: 1px solid var(--clay-line); }
.clay-footer-lead { font-weight: 600; color: var(--clay-ink); }
.clay-footer-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.clay-footer-col h2 { font-size: 1rem; margin-bottom: .4em; }
.clay-footer-col ul { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.clay-footer-col li { margin-bottom: .3em; }
.clay-footer-col [aria-current="page"] { color: var(--clay-ink-soft); }
.clay-updated { margin-top: 26px; font-size: .86rem; }

/* ── sibling strip on leaf pages ─────────────────────────────── */
.clay-siblings { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding: 0; list-style: none; }
.clay-siblings a {
  display: inline-block; padding: 8px 15px; min-height: 40px; line-height: 24px;
  border-radius: 999px; font-size: .9rem; font-weight: 600; text-decoration: none;
  background: var(--clay-surface-2); color: var(--clay-ink); box-shadow: var(--clay-shadow-sm);
  transition: transform .16s ease;
}
.clay-siblings a:hover { transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  .clay-page * { transition: none !important; animation: none !important; }
}
