:root {
  --bg: #1e1117;
  --deep: #12080c;
  --surface: #2a1820;
  --line: #3d2630;
  --rule: #33202a;
  --edge: #4a2e3a;
  --dash: #5a3c48;
  --faint: #6b4a56;
  --muted: #9c7c86;
  --caption: #b3929c;
  --sub: #c4a3ad;
  --soft: #e2c8cf;
  --text: #fbeef1;
  --accent: oklch(0.8 0.11 12);
  --accent-hi: oklch(0.88 0.08 12);
  --danger: oklch(0.78 0.14 25);
  --danger-line: oklch(0.7 0.15 25);
  --top: 22px;
  /* centered column with a minimum side gutter, like side(max, min) in the design */
  --home-pad: max(20px, calc((100vw - 760px) / 2));
  --home-pad-r: max(var(--home-pad), 40px);
  --wide-pad: max(14px, calc((100vw - 1120px) / 2));
  --wide-pad-head: max(12px, calc((100vw - 1120px) / 2));
}
@media (max-width: 599px) {
  :root { --top: 14px; }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); scrollbar-width: none; }
*::-webkit-scrollbar { width: 0; height: 0; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
a { color: var(--accent); text-decoration: none; }
a:where(:hover) { color: var(--accent-hi); }
h1, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--muted); }
.accent { color: var(--accent); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---- shared bits ---- */
.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(30, 17, 23, .92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.icon-btn {
  width: 44px;
  height: 44px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  color: var(--sub);
}
.icon-btn:hover { background: var(--surface); color: var(--sub); }
.icon-btn.light, .icon-btn.light:hover { color: var(--text); }
.spacer { flex: 1; }

.btn {
  height: 48px;
  padding: 0 24px;
  border-radius: 24px;
  font-size: 15px;
  display: flex;
  align-items: center;
}
.btn-primary, .btn-primary:hover { background: var(--accent); color: var(--bg); font-weight: 600; }
.btn-ghost, .btn-ghost:hover { border: 1px solid var(--edge); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }

.ad-slot {
  border-radius: 4px;
  border: 1px dashed var(--dash);
  background: repeating-linear-gradient(135deg, var(--surface) 0 10px, #241419 10px 20px);
  aspect-ratio: 300 / 250;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ad-slot-name { font-size: 11px; color: var(--sub); }
.ad-slot-size { font-size: 10px; color: var(--muted); }
.ad-label { display: flex; align-items: center; gap: 6px; padding: 0 2px; }
.ad-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  background: var(--line);
  color: var(--soft);
  padding: 2px 6px;
  border-radius: 4px;
}
.ad-sponsored { font-size: 12px; color: var(--muted); }

/* ---- footer ---- */
.foot { padding: 0 20px 28px; }
.foot-home { padding: 0 var(--home-pad-r) 28px var(--home-pad); }
.foot-in {
  max-width: 1120px;
  margin: 0 auto;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 24px;
  row-gap: 4px;
}
.foot-links { display: flex; flex-wrap: wrap; column-gap: 20px; }
.foot-links a, .foot-btn { font-size: 14px; color: var(--soft); min-height: 44px; display: flex; align-items: center; }
.foot-btn:hover { color: var(--accent-hi); }
.foot-copy { font-size: 12px; color: var(--muted); }

/* ---- home ---- */
.home-bar {
  padding: var(--top) var(--home-pad) 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.home-title-row { display: flex; align-items: baseline; justify-content: space-between; }
.brand { font-size: 26px; font-weight: 600; line-height: 1; }
.tagline { font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }
.search-pill, .search-pill:hover {
  height: 46px;
  border-radius: 23px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 5px 0 16px;
  gap: 8px;
  cursor: text;
  color: var(--muted);
  font-size: 15px;
}
.search-pill-text { flex: 1; }
.search-pill-icon {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background: var(--line);
  color: var(--sub);
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-body {
  padding: 0 var(--home-pad-r) 48px var(--home-pad);
  display: flex;
  flex-direction: column;
}
.sec {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
  scroll-margin-top: calc(var(--top) + 90px);
}
.sec-letter { font-size: 21px; font-weight: 600; line-height: 1; color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 15px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
  color: var(--text);
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.az {
  position: fixed;
  right: max(4px, calc((100vw - 760px) / 2 - 44px));
  top: calc(var(--top) + 110px);
  bottom: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  z-index: 6;
}
.az > * {
  width: 28px;
  flex: 1 1 0;
  max-height: 20px;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  overflow: hidden;
  font-weight: 600;
  color: var(--dash);
}
.az > a, .az > a:hover { color: var(--soft); }

/* ---- search ---- */
.search-bar {
  padding: var(--top) max(14px, calc((100vw - 700px) / 2)) 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-bar .icon-btn { width: 40px; }
.search-field {
  flex: 1;
  min-width: 0;
  height: 46px;
  border-radius: 23px;
  background: var(--surface);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  padding: 0 5px 0 16px;
  gap: 6px;
}
.search-field input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  -webkit-appearance: none;
  appearance: none;
}
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.clear-btn {
  width: 28px;
  height: 28px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sub);
  font-size: 18px;
  line-height: 1;
}
.submit {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--line);
  color: var(--muted);
  transition: background .15s;
}
.has-draft .submit { background: var(--accent); color: var(--bg); }
.search-body {
  padding: 8px max(20px, calc((100vw - 700px) / 2)) 40px;
  display: flex;
  flex-direction: column;
}
.suggest {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
  text-align: left;
  color: var(--accent);
}
.suggest-text { flex: 1; color: var(--text); }
.recent-head { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 0 4px; }
.recent-label { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.recent-clear { font-size: 13px; color: var(--sub); }
.recent {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--rule);
  color: var(--faint);
}
.recent-go, .recent-go:hover { flex: 1; font-size: 16px; color: var(--soft); overflow-wrap: anywhere; }
.recent-go b { color: var(--text); font-weight: 600; }
.recent-fill {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 16px;
}
.empty-note { padding: 24px 0; font-size: 15px; color: var(--muted); }
.ad-block { padding-top: 28px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ad-block .ad-slot { width: 300px; max-width: 100%; }

/* ---- category / search results ---- */
.cat-bar {
  padding: var(--top) var(--wide-pad-head) 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.list-head {
  padding: 0 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.list-title { font-size: 35px; font-weight: 600; line-height: 1; text-wrap: balance; overflow-wrap: anywhere; }
.crumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--sub); }
.crumbs a:hover { color: var(--accent); }
.related { padding: 0 max(16px, calc((100vw - 760px) / 2)) 40px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.related-title { font-size: 17px; font-weight: 600; color: var(--soft); }
.related .chips { justify-content: center; }
.list-rule { width: 48px; height: 1px; background: var(--accent); margin-top: 8px; }
/* A category's own text sits under the grid, so it doesn't push the GIFs down. */
.intro {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.intro-title { font-size: 17px; font-weight: 600; color: var(--soft); }
.intro p { font-size: 15px; line-height: 1.6; color: var(--sub); text-wrap: pretty; }
.home-intro { margin: 32px 0 0; padding: 0; }


.grid {
  padding: 0 var(--wide-pad) 16px;
  column-count: 4;
  column-gap: 12px;
}
@media (max-width: 999px) { .grid { column-count: 3; } }
@media (max-width: 599px) { .grid { column-count: 2; } }
.tile, .tile:hover {
  break-inside: avoid;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text);
}
.tile img {
  width: 100%;
  height: auto; /* with width/height attributes, the box keeps the GIF's shape before it loads */
  display: block;
  border-radius: 4px;
  background: var(--surface);
  min-height: 80px;
}
.cap { display: flex; gap: 8px; align-items: baseline; padding: 0 2px; }
.cap-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cap-title { font-size: 14px; font-weight: 600; line-height: 1.1; text-wrap: pretty; overflow-wrap: anywhere; }
.cap-domain { font-size: 12px; color: var(--caption); }
.pager {
  padding: 4px max(16px, calc((100vw - 560px) / 2)) 44px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pg {
  flex: 1;
  height: 46px;
  border-radius: 23px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
}
.pg-prev, .pg-prev:hover { border: 1px solid var(--edge); color: var(--text); }
a.pg-prev:hover { border-color: var(--accent); }
.pg-next, .pg-next:hover { background: var(--accent); color: var(--bg); font-weight: 600; }
.pg.off { opacity: .35; cursor: default; }
.pg-label { flex: none; min-width: 64px; text-align: center; font-size: 14px; color: var(--sub); }
.no-items { padding: 10px 24px 40px; text-align: center; font-size: 16px; color: var(--muted); }

/* ---- image detail ---- */
.detail {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--deep);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.detail.dragging { cursor: grabbing; }
.detail-top {
  padding: var(--top) var(--wide-pad-head) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.detail-tools { display: flex; }
.detail-crumbs {
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
}
.detail-crumbs a:last-child { overflow: hidden; text-overflow: ellipsis; color: var(--soft); }
.detail-related {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 24px;
  touch-action: pan-x; /* .detail blocks touch scrolling for the swipe gesture; this row scrolls sideways */
  scrollbar-width: none;
  justify-content: safe center;
}
.detail-related::-webkit-scrollbar { display: none; }
.detail-related .chip { flex: none; }
.stage-outer { flex: 1; min-height: 0; position: relative; padding: 24px 40px; }
.stage {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
}
.hero {
  display: block;
  height: auto; /* until detail.js sizes it */
  max-width: 100%;
  max-height: calc(100% - 72px);
  object-fit: cover;
  background: var(--surface);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .7);
  transition: opacity .15s, transform .15s;
  pointer-events: none;
}
.hero-cap {
  max-width: 100%;
  flex: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: opacity .15s;
}
.hero-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-domain, .hero-domain:hover { font-size: 12px; color: var(--muted); }
.banner-wrap { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 16px 14px; }
.banner {
  width: 300px;
  max-width: 100%;
  height: 100px;
  border: 1px dashed var(--dash);
  border-radius: 4px;
  background: repeating-linear-gradient(135deg, var(--bg) 0 10px, #1a0e13 10px 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.banner-size { font-size: 11px; color: var(--muted); }
.detail-nav {
  padding: 4px max(16px, calc((100vw - 640px) / 2)) 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.nav-btn {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-prev, .nav-prev:hover { border: 1px solid var(--edge); color: var(--text); }
a.nav-prev:hover { border-color: var(--accent); }
.nav-next, .nav-next:hover { background: var(--accent); color: var(--bg); }
.nav-btn.off { opacity: .3; cursor: default; }

/* ---- about / contact ---- */
.page-bar {
  padding: var(--top) var(--wide-pad-head) 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-brand { font-size: 17px; font-weight: 600; color: var(--text); }
.page {
  margin: 0 auto;
  padding: 20px 20px 56px;
  display: flex;
  flex-direction: column;
}
.about { max-width: 640px; gap: 36px; }
.contact { max-width: 560px; gap: 28px; }
.intro { display: flex; flex-direction: column; gap: 14px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.headline { font-size: 35px; font-weight: 600; line-height: 1.08; text-wrap: balance; }
.lede { font-size: 17px; line-height: 1.55; color: var(--soft); text-wrap: pretty; }
.contact .lede { font-size: 16px; }
.facts { display: flex; flex-direction: column; border-bottom: 1px solid var(--rule); }
.fact { display: flex; flex-direction: column; gap: 6px; padding: 18px 0; border-top: 1px solid var(--rule); }
.fact-title { font-size: 16px; font-weight: 600; }
.fact-text { font-size: 15px; line-height: 1.55; color: var(--sub); text-wrap: pretty; }
.about .btn { align-self: flex-start; }

.legal { max-width: 680px; gap: 32px; }
.legal-date { font-size: 13px; color: var(--muted); }
.prose { display: flex; flex-direction: column; gap: 28px; }
.prose section { display: flex; flex-direction: column; gap: 10px; }
.prose h2 { font-size: 19px; font-weight: 600; }
.prose p, .prose li { font-size: 15px; line-height: 1.6; color: var(--sub); text-wrap: pretty; }
.prose ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }

.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field-label { font-size: 13px; color: var(--sub); padding: 0; }
legend.field-label { margin-bottom: 8px; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; }
.topic input { position: absolute; opacity: 0; pointer-events: none; }
.topic span {
  display: block;
  padding: 10px 15px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.topic input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.topic input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.input {
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: 0;
}
.input:focus { border-color: var(--accent); }
.input.bad { border-color: var(--danger-line); }
input.input { height: 48px; padding: 0 14px; }
textarea.input { padding: 12px 14px; line-height: 1.5; resize: vertical; }
.field-err { font-size: 13px; color: var(--danger); }
.form-err { font-size: 14px; line-height: 1.5; color: var(--danger); }
.cf-turnstile { min-height: 65px; } /* the widget's height, so the button doesn't jump when it loads */
.send {
  height: 50px;
  border-radius: 25px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sent {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.sent-title { font-size: 20px; font-weight: 600; }
.sent-text { font-size: 15px; line-height: 1.55; color: var(--sub); }
.sent a { align-self: flex-start; font-size: 15px; min-height: 44px; display: flex; align-items: center; }

/* ---- 404 / error ---- */
.error {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
}
.err-brand { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.err-code { font-size: 112px; font-weight: 700; line-height: .9; letter-spacing: -.04em; color: var(--accent); }
.err-title { font-size: 26px; font-weight: 600; line-height: 1.15; text-wrap: balance; max-width: 420px; }
.err-text { font-size: 16px; line-height: 1.55; color: var(--sub); text-wrap: pretty; max-width: 400px; }
.err-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }

/* ---- cookie banner (vanilla-cookieconsent, static/cookieconsent.css) in the site's colors ---- */
#cc-main {
  --cc-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --cc-bg: var(--surface);
  --cc-primary-color: var(--text);
  --cc-secondary-color: var(--sub);
  --cc-link-color: var(--accent);
  --cc-modal-border-radius: 14px;
  --cc-btn-border-radius: 22px;
  --cc-btn-primary-bg: var(--accent);
  --cc-btn-primary-color: var(--bg);
  --cc-btn-primary-border-color: var(--accent);
  --cc-btn-primary-hover-bg: var(--accent-hi);
  --cc-btn-primary-hover-color: var(--bg);
  --cc-btn-primary-hover-border-color: var(--accent-hi);
  --cc-btn-secondary-bg: var(--line);
  --cc-btn-secondary-color: var(--text);
  --cc-btn-secondary-border-color: var(--line);
  --cc-btn-secondary-hover-bg: var(--edge);
  --cc-btn-secondary-hover-color: var(--text);
  --cc-btn-secondary-hover-border-color: var(--edge);
  --cc-separator-border-color: var(--line);
  --cc-toggle-on-bg: var(--accent);
  --cc-toggle-off-bg: var(--faint);
  --cc-toggle-on-knob-bg: var(--bg);
  --cc-toggle-off-knob-bg: var(--text);
  --cc-toggle-readonly-bg: var(--edge);
  --cc-toggle-readonly-knob-bg: var(--sub);
  --cc-toggle-readonly-knob-icon-color: var(--edge);
  --cc-toggle-enabled-icon-color: var(--bg);
  --cc-toggle-disabled-icon-color: var(--text);
  --cc-section-category-border: var(--line);
  --cc-cookie-category-block-bg: var(--deep);
  --cc-cookie-category-block-border: var(--line);
  --cc-cookie-category-block-hover-bg: var(--rule);
  --cc-cookie-category-block-hover-border: var(--edge);
  --cc-cookie-category-expanded-block-bg: var(--deep);
  --cc-cookie-category-expanded-block-hover-bg: var(--rule);
  --cc-overlay-bg: rgba(18, 8, 12, 0.75);
  --cc-footer-bg: var(--deep);
  --cc-footer-color: var(--sub);
  --cc-footer-border-color: var(--line);
  --cc-webkit-scrollbar-bg: var(--edge);
  --cc-webkit-scrollbar-hover-bg: var(--faint);
}
