/* copy CSS — site styles */

/* ───────── Fonts (self-hosted, SIL Open Font License, see assets/fonts/LICENSE.md) ───────── */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("fonts/bricolage-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("fonts/bricolage-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ───────── Tokens ───────── */
:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-2: #f2f2ef;
  --text: #16161a;
  --text-2: #4a4a55;
  --muted: #6b6b76;
  --border: #e6e6e1;
  --border-strong: #d2d2cc;
  --grid-line: rgba(22, 22, 26, 0.055);
  --accent: #c6f432;
  --accent-hover: #d3ff4d;
  --accent-ink: #121212;
  --accent-soft: rgba(198, 244, 50, 0.45);
  --hover: #4d7c0f;
  --ring: #4f5bd5;
  --code-bg: #111115;
  --code-text: #e7e7ea;
  --header-bg: rgba(250, 250, 248, 0.82);
  --shadow-sm: 0 1px 2px rgba(16, 16, 20, 0.05);
  --shadow-md: 0 1px 2px rgba(16, 16, 20, 0.04), 0 10px 28px -10px rgba(16, 16, 20, 0.16);
  --shadow-lg: 0 30px 80px -20px rgba(16, 16, 20, 0.45);
  --radius: 16px;
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --header-h: 64px;
  --logo-ink: #121212;
  --logo-bg: #c6f432;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c0e;
    --surface: #141417;
    --surface-2: #1d1d22;
    --text: #f3f3f4;
    --text-2: #c2c2ca;
    --muted: #8d8d98;
    --border: #26262c;
    --border-strong: #36363e;
    --grid-line: rgba(255, 255, 255, 0.05);
    --ring: #c6f432;
    --code-bg: #0a0a0c;
    --header-bg: rgba(12, 12, 14, 0.8);
    --shadow-md: 0 10px 28px -10px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
    --hover: #c6f432;
    --logo-ink: #c6f432;
    --logo-bg: transparent;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --hover: #c6f432;
  --logo-ink: #c6f432;
  --logo-bg: transparent;
  --bg: #0c0c0e;
  --surface: #141417;
  --surface-2: #1d1d22;
  --text: #f3f3f4;
  --text-2: #c2c2ca;
  --muted: #8d8d98;
  --border: #26262c;
  --border-strong: #36363e;
  --grid-line: rgba(255, 255, 255, 0.05);
  --ring: #c6f432;
  --code-bg: #0a0a0c;
  --header-bg: rgba(12, 12, 14, 0.8);
  --shadow-md: 0 10px 28px -10px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
html:has(dialog[open]) { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; transition: color 0.15s ease; }
/* Hover on anything clickable: the text turns green (deep green on light, lime on dark, both readable). Nothing else moves. */
a:hover { color: var(--hover); }
svg { display: block; flex: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
@media (min-width: 640px) {
  .container { padding-left: 28px; padding-right: 28px; }
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

mark {
  padding: 0 0.14em;
  border-radius: 0.14em;
  background: var(--accent);
  color: var(--accent-ink);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

kbd {
  display: inline-block;
  min-width: 22px;
  padding: 2px 7px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font: 500 0.75rem/1.4 var(--font-mono);
  text-align: center;
}

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: 600 0.9375rem/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn:active,
.icon-btn:active,
.search-btn:active,
.search-close:active,
.chip:active,
.tab:active {
  transform: scale(0.96);
  transition-duration: 0.06s;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}
.btn-primary:hover { color: var(--accent-ink); }

.btn-ghost {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}
.btn-ghost:hover { color: var(--hover); }

.btn-sm { min-height: 36px; padding: 0 13px; border-radius: 9px; font-size: 0.875rem; }
.btn-sm svg { width: 15px; height: 15px; }

/* Card copy button: neutral at rest so the previews lead; the whole button turns lime on hover or keyboard focus. */
.btn-card {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}
.btn-card:hover:not(.is-copied) { border-color: transparent; background: var(--accent); color: var(--accent-ink); }
.btn-card:focus-visible:not(.is-copied) {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.btn.is-copied,
.btn.is-copied:hover {
  background: var(--text);
  color: var(--bg);
  box-shadow: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.icon-btn:hover { color: var(--hover); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn[aria-pressed="true"] { color: #e11d48; }
.icon-btn[aria-pressed="true"] svg { fill: currentColor; }

/* ───────── Header ───────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--header-h);
}
/* Search: just an icon until it is used; then the field takes the categories' place. */
.header-search {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.search-btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}
.search-btn:hover { color: var(--hover); }
.search-btn svg { width: 18px; height: 18px; }
.header-search input {
  width: 0;
  min-width: 0;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: 500 0.9375rem var(--font-body);
  opacity: 0;
  -webkit-appearance: none;
  appearance: none;
}
.header-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.header-search input::placeholder { color: var(--muted); }
.search-close {
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}
.search-close:hover { color: var(--hover); }
.search-close svg { width: 18px; height: 18px; }
.header-search:focus-within input,
.header-search:has(input:not(:placeholder-shown)) input {
  width: 260px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  opacity: 1;
}
.header-search input:focus { border-color: var(--text); outline: none; }
.header-search:focus-within .search-close,
.header-search:has(input:not(:placeholder-shown)) .search-close { display: grid; }

/* Phones: wordmark, search, theme and the menu; every category lives in the menu */
@media (max-width: 639px) {
  /* Phones: the open field takes the logo's place */
  .header-inner:has(.header-search:focus-within) .logo,
  .header-inner:has(#search:not(:placeholder-shown)) .logo { display: none; }
  .header-search:focus-within,
  .header-search:has(input:not(:placeholder-shown)) { flex: 1; margin-left: 0; }
  .header-search:focus-within input,
  .header-search:has(input:not(:placeholder-shown)) input { flex: 1; width: auto; }
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 800 1.3125rem/1 var(--font-display);
  letter-spacing: -0.03em;
  text-decoration: none;
}
.logo { gap: 0.25em; white-space: nowrap; }
.logo b {
  padding: 0 0.16em 0.04em;
  border-radius: 0.18em;
  background: var(--logo-bg);
  color: var(--logo-ink);
  font-weight: 800;
}
.logo:hover { color: var(--text); }


.theme-toggle,
.menu-btn {
  border-color: transparent;
  background: transparent;
}

/* Menu: every category plus the links that don't fit in the bar */
.site-menu {
  position: fixed;
  inset: calc(var(--header-h) - 4px) max(16px, calc((100vw - 1240px) / 2 + 28px)) auto auto;
  width: min(320px, calc(100vw - 32px));
  max-height: calc(100dvh - var(--header-h) - 16px);
  margin: 0;
  padding: 14px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), display 0.18s allow-discrete, overlay 0.18s allow-discrete;
}
.site-menu:popover-open { opacity: 1; transform: none; }
@starting-style { .site-menu:popover-open { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.menu-h {
  margin: 4px 8px 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.menu-cats { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.menu-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.menu-cat span { color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.menu-cat.is-active, .menu-cat[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 600; }
.menu-cat:active { transform: scale(0.98); }
.menu-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 14px 8px 4px;
  border-top: 1px solid var(--border);
}
.menu-link { color: var(--text-2); font-size: 0.9375rem; font-weight: 500; text-decoration: none; }
@media (pointer: coarse) { .menu-cat { padding: 12px 10px; } }
.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; }
}

/* ───────── Hero ───────── */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 64px 0 44px;
  text-align: center;
}
@media (min-width: 720px) { .hero { padding: 96px 0 56px; } }
/* Phones: a shorter hero so the first snippets show above the fold */
@media (max-width: 639px) {
  .hero { padding: 32px 0 24px; }
  .hero h1 { font-size: 2.375rem; }
  .hero .lead { margin-top: 14px; font-size: 1rem; }
}

.hero h1 {
  max-width: 15ch;
  margin: 0 auto;
  font: 800 clamp(2.625rem, 7.4vw, 5.125rem)/1 var(--font-display);
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.hero h1 mark {
  display: inline-block;
  padding: 0 0.12em 0.04em;
  transform: rotate(-2deg);
}

.lead {
  max-width: 600px;
  margin: 22px auto 0;
  color: var(--text-2);
  font-size: clamp(1.0625rem, 2.1vw, 1.2188rem);
  line-height: 1.55;
  text-wrap: pretty;
}





/* Category chips: centered in the header between the logo and the actions */
.cat-chips {
  display: flex;
  flex: 1;
  min-width: 0;
  justify-content: safe center;
  gap: 6px;
  margin: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: 500 0.875rem/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.chip:hover { color: var(--hover); }
.chip.is-active,
.chip[aria-current="page"],
.chip.is-active:hover { border-color: var(--text); background: var(--text); color: var(--bg); }
.chip-saved svg { width: 14px; height: 14px; fill: #e11d48; stroke: #e11d48; }
.chip-saved span { color: inherit; opacity: 0.7; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
/* Narrow screens: the menu holds the categories; an open search takes the chips' place */
@media (max-width: 899px) { .cat-chips { display: none; } }
@media (max-width: 1099px) {
  .header-inner:has(.header-search:focus-within) .cat-chips,
  .header-inner:has(#search:not(:placeholder-shown)) .cat-chips { visibility: hidden; }
}

/* ───────── Gallery ───────── */
.gallery { padding-bottom: 88px; }
.result-count:empty { display: none; }
.gallery .grid { margin-top: 8px; }
.result-count {
  margin: 22px 0 14px;
  color: var(--muted);
  font-size: 0.875rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 272px), 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.card-media { position: relative; }
.preview {
  display: block;
  overflow: hidden;
  height: 212px;
}
.card .preview {
  border-bottom: 1px solid var(--border);
  cursor: zoom-in;
}

.card-tools {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.card:hover .card-tools,
.card:focus-within .card-tools,
.card-tools:has([aria-pressed="true"]) { opacity: 1; transform: none; }
@media (hover: none) { .card-tools { opacity: 1; transform: none; } }
.card-tools .icon-btn {
  width: 34px;
  height: 34px;
  border-color: rgba(0, 0, 0, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  color: #27272a;
}
.card-tools .icon-btn:hover { color: #4d7c0f; }
.card-tools .icon-btn[aria-pressed="true"] { color: #e11d48; }
.card-tools .icon-btn svg { width: 16px; height: 16px; }

.card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 13px 13px 16px;
}
.card-info { min-width: 0; }
.card-body { position: relative; z-index: 1; }
.copy-menu { position: relative; flex: none; }
.copy-options {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  display: grid;
  min-width: 168px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.15s;
}
/* Bridge the gap so the pointer can travel from the button to the options */
.copy-options::after { content: ""; position: absolute; inset: 100% 0 -10px; }
.copy-menu:hover .copy-options,
.copy-menu:focus-within .copy-options,
.copy-menu.is-open .copy-options {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
.copy-options button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: 500 0.875rem/1 var(--font-body);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.copy-options button svg { width: 15px; height: 15px; color: var(--muted); }
.copy-options button:hover,
.copy-options button:focus-visible { background: var(--accent); color: var(--accent-ink); outline: none; }
.copy-options button:hover svg,
.copy-options button:focus-visible svg { color: var(--accent-ink); }
@media (pointer: coarse) { .copy-options button { padding: 13px 12px; } }
.card-title {
  margin: 0 0 1px;
  font: 600 0.9688rem/1.3 var(--font-body);
  text-wrap: balance;
}
.card-title a { text-decoration: none; }
.card-cat {
  color: var(--muted);
  font-size: 0.8125rem;
  text-decoration: none;
}

.show-all {
  margin: 28px 0 0;
  text-align: center;
}
.show-all[hidden] { display: none; }

.empty {
  padding: 64px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-2);
  text-align: center;
}
.empty h2 { margin: 0 0 6px; font: 700 1.375rem/1.2 var(--font-display); color: var(--text); }
.empty p { margin: 0 0 18px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ───────── Sections ───────── */
.section { padding: 80px 0; }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head p { margin: 12px 0 0; color: var(--text-2); font-size: 1.0625rem; }
.section h2, .h2 {
  margin: 0;
  font: 800 clamp(1.875rem, 4.2vw, 2.75rem)/1.08 var(--font-display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.steps li::before {
  content: "0" counter(step);
  counter-increment: step;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 0.875rem/1 var(--font-mono);
}
.steps h3 { margin: 0 0 6px; font: 700 1.25rem/1.2 var(--font-display); letter-spacing: -0.01em; }
.steps p { margin: 0; color: var(--text-2); }

.split {
  display: grid;
  gap: 32px;
}
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1.4fr; gap: 64px; }
}

.faq { display: grid; gap: 10px; }
.faq details {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  color: var(--muted);
  font: 400 1.5rem/1 var(--font-mono);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 20px 20px; color: var(--text-2); }

/* ───────── Inner pages ───────── */
.page-hero { padding-top: 40px; padding-bottom: 28px; }
@media (min-width: 720px) { .page-hero { padding-top: 56px; } }
.page-hero h1, .snippet-head h1 {
  margin: 0;
  font: 800 clamp(2.25rem, 5.4vw, 3.75rem)/1.02 var(--font-display);
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.page-hero .lead, .snippet-head .lead { margin: 14px 0 0; }
/* Category pages: centered like the home hero */
.cat-hero { text-align: center; }
.cat-hero .crumbs { justify-content: center; }
.cat-hero .lead { max-width: 640px; margin-left: auto; margin-right: auto; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.875rem;
}
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--hover); }

.chips-row { margin-top: 0; }
.page-grid { padding-top: 28px; padding-bottom: 88px; }

.snippet-page { padding-top: 40px; padding-bottom: 88px; }
@media (min-width: 720px) { .snippet-page { padding-top: 56px; } }
.snippet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.snippet-head > div:first-child { max-width: 680px; }
.snippet-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font: 500 0.7812rem/1.4 var(--font-mono);
}

.snippet-layout { display: grid; gap: 20px; }
@media (min-width: 980px) {
  .snippet-layout { grid-template-columns: 1.05fr 1fr; align-items: start; }
  .snippet-layout > .preview { position: sticky; top: calc(var(--header-h) + 24px); }
}
.snippet-layout > .preview {
  height: 320px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
@media (min-width: 720px) { .snippet-layout > .preview { height: 440px; } }

.code-stack { display: grid; gap: 16px; min-width: 0; }

.howto { margin-top: 64px; max-width: 760px; }
.howto h2 { font-size: clamp(1.625rem, 3.4vw, 2.125rem); }
.howto ol { margin: 18px 0 0; padding-left: 22px; color: var(--text-2); }
.howto li { margin-bottom: 8px; padding-left: 4px; }
.howto code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  font: 0.9em var(--font-mono);
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 56px 0;
}
.pager a {
  display: block;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}
.pager small { display: block; margin-bottom: 2px; color: var(--muted); font-size: 0.8125rem; font-weight: 500; }
.pager .next { grid-column: 2; text-align: right; }

.related h2 { margin-bottom: 24px; font-size: clamp(1.625rem, 3.4vw, 2.125rem); }
.related-more { margin: 24px 0 0; }
.related-more a { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }
.related-more svg { width: 16px; height: 16px; }

/* Snippet details: features, custom properties, accessibility */
.howto p { color: var(--text-2); }
.howto h3 { margin: 28px 0 10px; font: 700 1.125rem/1.3 var(--font-display); }
.howto .code-block { margin-top: 12px; }
.howto pre code { padding: 0; border-radius: 0; background: none; font: inherit; }
.feature-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.feature-list li { margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.feature-list a { font-weight: 600; text-underline-offset: 3px; }
.feature-list span { color: var(--muted); font-size: 0.875rem; }
.var-table { width: 100%; border-collapse: collapse; font-size: 0.9062rem; }
.var-table th, .var-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.var-table th { color: var(--muted); font-size: 0.7812rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.var-table td { color: var(--text-2); overflow-wrap: anywhere; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.swatches li { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.swatches span { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.swatches code { padding: 0; background: none; }

/* Snippet requests */
.request-section { padding-top: 0; }
.request {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  padding: clamp(24px, 4vw, 44px);
  border-radius: 20px;
  background: var(--accent);
  color: var(--accent-ink);
}
.request > div { flex: 1 1 420px; max-width: 680px; }
.request h2 { margin: 0; color: var(--accent-ink); }
.request p { margin: 12px 0 0; color: rgba(18, 18, 18, 0.78); font-size: 1.0625rem; }
.request .btn-primary { background: var(--accent-ink); color: #fff; box-shadow: none; }
.request .btn-primary:hover { color: var(--accent); }
.request-sm { margin-top: 56px; }
.request-sm h2 { font: 800 clamp(1.375rem, 2.8vw, 1.75rem)/1.15 var(--font-display); letter-spacing: -0.02em; }

/* AI promo blocks */
.ai-promo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}
.ai-promo > div { flex: 1 1 420px; max-width: 680px; }
.ai-promo p { margin: 12px 0 0; color: var(--text-2); }
.ai-promo code { padding: 2px 6px; border-radius: 6px; background: var(--surface-2); font: 0.9em var(--font-mono); }
.ai-promo-sm { margin-top: 56px; }
.link-btn { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn.is-copied { color: var(--text); }
.link-btn:hover { color: var(--hover); }
.ai-promo-sm h2 { margin: 0; font-size: clamp(1.375rem, 2.8vw, 1.75rem); }
.ai-page { padding-bottom: 88px; }
.ai-page .howto:first-child { margin-top: 24px; }
.ai-page .code { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Legal pages (Impressum, Privacy) */
.legal .howto { margin-top: 40px; }
.legal .howto h2 { font-size: clamp(1.3125rem, 2.6vw, 1.5625rem); }
.legal address { color: var(--text-2); font-style: normal; line-height: 1.6; }
.legal ul { margin: 12px 0 0; padding-left: 22px; color: var(--text-2); }
.legal li { margin-bottom: 6px; }
.legal a { overflow-wrap: anywhere; text-underline-offset: 3px; }

/* ───────── Code ───────── */
.code-block {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #9a9aa5;
  font: 500 0.8125rem/1 var(--font-mono);
}

.btn-code {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: 600 0.8125rem/1 var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn-code svg { width: 14px; height: 14px; }
.btn-code:hover { color: #c6f432; }
.btn-code.is-copied { background: var(--accent); color: var(--accent-ink); }

.code {
  margin: 0;
  padding: 18px 20px 20px;
  overflow: auto;
  color: var(--code-text);
  font: 0.8438rem/1.7 var(--font-mono);
  tab-size: 2;
}
.code code { font: inherit; }

.tk-c { color: #6f6f7c; font-style: italic; }
.tk-sel { color: #c6f432; }
.tk-at { color: #ff8fd0; }
.tk-prop { color: #7cc7ff; }
.tk-num { color: #ffb86b; }
.tk-fn { color: #c5a3ff; }
.tk-hex { color: #ffb86b; }
.tk-str { color: #9ef0c3; }
.tk-pun { color: #85858f; }
.tk-tag { color: #ff8fd0; }
.tk-attr { color: #7cc7ff; }
.tk-imp { color: #ff6b6b; }
.sw {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 0.35em;
  border-radius: 3px;
  background: var(--sw);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
  vertical-align: -0.06em;
}

/* ───────── Modal ───────── */
.modal {
  width: min(1100px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
.modal::backdrop {
  background: rgba(8, 8, 10, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
/* Open/close motion lives in app.js: the dialog grows out of the card that opened it and shrinks back into it. */
.modal::backdrop { transition: opacity 0.2s ease; }
.modal.is-closing::backdrop { opacity: 0; }

.modal-inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 14px 14px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font: 800 1.375rem/1.2 var(--font-display); letter-spacing: -0.02em; }
.m-cat { color: var(--muted); font-size: 0.8125rem; }
.modal-actions { display: flex; flex: none; gap: 6px; }

.modal-body {
  display: grid;
  min-height: 0;
  overflow: auto;
}
@media (min-width: 880px) {
  .modal-body { grid-template-columns: 1fr 1fr; overflow: hidden; }
}
.modal .preview { height: 300px; }
@media (min-width: 880px) { .modal .preview { height: auto; min-height: 460px; } }

.m-code {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--code-bg);
}
.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 10px 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.tab {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9a9aa5;
  font: 500 0.8438rem/1 var(--font-mono);
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}
.tab:hover { color: #c6f432; }
.tab[aria-selected="true"] { background: rgba(255, 255, 255, 0.1); color: #fff; }
.tabs .m-ai { margin-left: auto; }
.btn-code-ai { background: var(--accent); color: var(--accent-ink); }
.btn-code-ai:hover { color: var(--accent-ink); }
.m-code .code { flex: 1; min-height: 220px; max-height: 460px; }
@media (min-width: 880px) { .m-code .code { max-height: none; } }

.modal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.875rem;
}
.modal-foot p { margin: 0; flex: 1 1 320px; }
.m-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.m-link svg { width: 15px; height: 15px; }
.m-hint { color: var(--muted); font-size: 0.8125rem; }
@media (hover: none) { .m-hint { display: none; } }

@media (max-width: 640px) {
  .modal {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .modal-inner { height: 100%; max-height: 100dvh; }
  .modal-body { flex: 1; }
  .modal-head { padding-left: 16px; }
  .modal-foot { padding: 12px 16px; }
}

/* ───────── Toast ───────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 12px 18px 12px 14px;
  border-radius: 12px;
  background: #121214;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.9062rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121212' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* Feedback: always one click away */
.feedback-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--text);
  font: 600 0.875rem/1 var(--font-body);
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
}
.feedback-btn svg { width: 16px; height: 16px; }
.feedback-btn:active { transform: scale(0.96); transition-duration: 0.06s; }
@media (max-width: 639px) {
  .feedback-btn { right: 14px; bottom: 14px; width: 44px; height: 44px; padding: 0; justify-content: center; }
  .feedback-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ───────── Footer ───────── */
.site-footer {
  padding: 64px 0 28px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 40px 32px;
}
.footer-brand p { max-width: 320px; margin: 14px 0 20px; color: var(--text-2); font-size: 0.9375rem; line-height: 1.6; }
.footer-h {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.7812rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-footer ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.footer-cats { grid-template-columns: repeat(2, minmax(0, max-content)); column-gap: 28px; }
.site-footer li a { color: var(--text-2); font-size: 0.9375rem; text-decoration: none; }
.site-footer li a:hover { color: var(--hover); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8438rem;
}
.footer-legal { display: flex; gap: 18px; }
.footer-legal a { color: inherit; text-decoration: none; }
.footer-legal a:hover { color: var(--hover); }
@media (max-width: 899px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
/* Phones: brand on top, then two columns; categories stack in one */
@media (max-width: 639px) {
  .site-footer { padding-top: 44px; }
  .footer-grid { gap: 32px 20px; }
  .footer-cats { grid-template-columns: minmax(0, 1fr); }
  .site-footer ul { gap: 8px; }
  .footer-bottom { margin-top: 36px; padding-bottom: 56px; } /* room for the Feedback button */
}

/* ───────── Motion preferences ───────── */
/* Theme switch: a short cross-fade (see app.js) */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.3s; }

/* Reduced motion: nothing slides, scales or rotates; fades and color changes stay as gentle feedback. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; }
  .btn:active, .icon-btn:active, .search-btn:active, .search-close:active,
  .chip:active, .tab:active { transform: none; }
  .card-tools, .site-menu, .copy-options { transform: none; }
  .feedback-btn:active { transform: none; }
  .menu-cat:active { transform: none; }
  .toast, .toast.show { transform: translate(-50%, 0); }
  .faq summary::after { transition: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.2s !important; }
}

/* Reduced transparency: solid surfaces, no blur */
@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 1px 0 var(--border); }
  .modal::backdrop { background: rgba(8, 8, 10, 0.85); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .card-tools .icon-btn { background: #fff; }
}

/* More contrast: stronger borders and text, solid header with a clear edge */
@media (prefers-contrast: more) {
  :root { --border: #8a8a93; --border-strong: #5c5c66; --muted: #3f3f48; --text-2: #26262c; --hover: #365314; }
  :root[data-theme="dark"] { --border: #6b6b76; --border-strong: #8d8d98; --muted: #c2c2ca; --text-2: #e4e4e8; --hover: #d9ff66; }
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 1px 0 var(--border-strong); }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --border: #6b6b76; --border-strong: #8d8d98; --muted: #c2c2ca; --text-2: #e4e4e8; --hover: #d9ff66; }
}
.mcp-install { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Touch screens: 44px tap targets */
@media (pointer: coarse) {
  .icon-btn,
  .card-tools .icon-btn { width: 44px; height: 44px; }
  .card-tools { gap: 8px; }
  .btn-sm { min-height: 44px; }
  .chip { position: relative; }
  .chip::after { content: ""; position: absolute; inset: -4px 0; }
  .card-cat { display: inline-block; padding: 6px 0; margin: -6px 0; }
}
