/* ──────────────────────────────────────────────────────────────
   Uncensored model directory
   Everything reads theme tokens from styles.css / themes.css.
   Search field follows the RestoreBunny studio search.
   ────────────────────────────────────────────────────────────── */
.dir-page {
  --ring:       0 0 0 1px var(--line), 0 1px 1px color-mix(in srgb, var(--shadow) 5%, transparent);
  --ring-hover: 0 0 0 1px var(--line-2), 0 2px 6px -3px color-mix(in srgb, var(--shadow) 18%, transparent);
  --focus:      0 0 0 1px var(--line-2), 0 0 0 4px var(--accent-soft);
  --spring:     cubic-bezier(.16,1,.3,1);
  --nav-h:      66px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header ------------------------------------------------------- */
.dir-hero {
  padding-block: clamp(56px, 8vw, 104px) clamp(28px, 4vw, 40px);
  text-align: center;
}
.dir-eyebrow {
  display: inline-block;
  margin-bottom: 20px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  text-wrap: balance;
}
.dir-hero h1 {
  margin-inline: auto;
  font-family: var(--serif);
  font-weight: var(--display-weight);
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-size: clamp(40px, 6.6vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.028em;
  color: var(--ink);
}
.dir-hero h1 .italic { font-weight: 400; }
.dir-hero h1 .squig { bottom: -8px; }
.dir-hero h1 .squig path {
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: drawSquig 1.4s var(--ease) 0.5s forwards;
}
.dir-lede {
  max-width: 60ch;
  margin: 30px auto 0;
  font-size: clamp(16.5px, 1.4vw, 19px);
  line-height: 1.6;
  color: var(--ink-2);
}
.dir-lede strong { color: var(--ink); font-weight: 500; }
.dir-tries {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
}
.dir-tries > span {
  margin-right: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--subtle);
}
.dir-try {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--ring);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent);
  cursor: pointer;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.dir-try:hover { box-shadow: var(--ring-hover); transform: translateY(-1px); }

/* Sticky dock: search + category tabs -------------------------- */
.dir-shell { position: relative; }
.dir-dock {
  position: sticky;
  top: var(--nav-h);
  z-index: 40;
  padding-block: 10px 12px;
  transition: background-color .3s var(--ease), box-shadow .3s var(--ease);
}
.dir-dock.is-stuck {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.dir-dock-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.dir-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(640px, 100%);
  height: 52px;
  padding: 0 10px 0 16px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--ring);
  color: var(--mute);
  cursor: text;
  transition: box-shadow .25s var(--ease), color .2s var(--ease);
}
.dir-search:hover { box-shadow: var(--ring-hover); }
.dir-search:focus-within {
  box-shadow: 0 0 0 1px var(--line-2), 0 0 0 4px var(--accent-soft), 0 10px 30px -18px color-mix(in srgb, var(--shadow) 35%, transparent);
  color: var(--ink-2);
}
.dir-search > svg { flex-shrink: 0; width: 18px; height: 18px; }
.dir-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  font-size: 15.5px;
  color: var(--ink);
}
.dir-search input::placeholder { color: var(--subtle); opacity: 1; }
.dir-search input::-webkit-search-cancel-button { display: none; }
.dir-page kbd {
  flex: none;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font: 11px var(--mono);
  color: var(--mute);
}
.dir-clear {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--mute);
  cursor: pointer;
  transition: background-color .16s, color .16s;
}
.dir-clear:hover { background: var(--surface-2); color: var(--ink); }
.dir-clear svg { width: 15px; height: 15px; }
.dir-clear[hidden] { display: none; }

.dir-tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}
.dir-tabs::-webkit-scrollbar { display: none; }
.dir-tabs button {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color .16s ease, box-shadow .16s ease, color .16s ease;
}
.dir-tabs button:hover { background: var(--surface-2); color: var(--ink); }
.dir-tabs button[aria-pressed="true"] {
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px color-mix(in srgb, var(--shadow) 8%, transparent);
  color: var(--ink);
}
.dir-tabs svg,
.m-type svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.dir-tabs svg { color: var(--subtle); transition: color .16s; }
.dir-tabs button[aria-pressed="true"] svg { color: var(--accent); }
.dir-n {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--subtle);
  font-variant-numeric: tabular-nums;
}
.dir-n:empty { display: none; }
.dir-tabs button.is-zero { opacity: 0.5; }

/* Toolbar ------------------------------------------------------ */
.dir-body { padding-block: 18px clamp(72px, 10vw, 120px); }
.dir-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.dir-count { font-size: 14px; color: var(--mute); }
.dir-count strong { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.dir-count q { color: var(--ink); quotes: '“' '”'; }
.dir-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.dir-select { position: relative; display: inline-flex; }
.dir-select select {
  height: 34px;
  padding: 0 30px 0 12px;
  border: 0;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--ring);
  appearance: none;
  -webkit-appearance: none;
  font: 13px var(--sans);
  color: var(--ink-2);
  cursor: pointer;
  field-sizing: content;
  transition: box-shadow .2s var(--ease), color .2s var(--ease);
}
.dir-select select:hover { box-shadow: var(--ring-hover); }
.dir-select select:focus-visible { outline: none; box-shadow: var(--focus); }
.dir-select::after {
  content: '';
  position: absolute;
  top: 50%; right: 11px;
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: var(--mute);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.dir-select.is-set select { box-shadow: 0 0 0 1px var(--accent); color: var(--accent); }
.dir-sort select { box-shadow: none; background: transparent; padding-left: 8px; }
.dir-sort select:hover { box-shadow: var(--ring); background: var(--surface); }
.dir-sort.is-set select:not(:hover) { box-shadow: none; }

.dir-seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 11px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.dir-seg[hidden] { display: none; }
.dir-seg button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 12.5px;
  color: var(--mute);
  cursor: pointer;
  transition: background-color .16s, color .16s, box-shadow .16s;
}
.dir-seg button:hover { color: var(--ink); }
.dir-seg button[aria-pressed="true"] {
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px color-mix(in srgb, var(--shadow) 8%, transparent);
  color: var(--ink);
}

.dir-reset,
.dir-link {
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-underline-offset: 3px;
  cursor: pointer;
}
.dir-reset { margin-left: 4px; }
.dir-reset[hidden] { display: none; }
.dir-link { font-size: inherit; }

/* Model table -------------------------------------------------- */
.dir-table {
  --cols: 32px minmax(0, 1fr) 112px 52px 84px 72px 84px 60px 16px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--line),
    0 1px 2px color-mix(in srgb, var(--shadow) 4%, transparent),
    0 24px 60px -40px color-mix(in srgb, var(--shadow) 30%, transparent);
}
.dir-table[hidden] { display: none; }

.m-head,
.m-link {
  display: grid;
  grid-template-columns: var(--cols);
  align-items: center;
  gap: 14px;
  padding-inline: 16px;
}
.m-head {
  height: 40px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
  font: 500 10.5px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
}
.m-head > :nth-child(2) { justify-self: start; }
.m-head button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
  transition: color .16s;
}
.m-head button:hover { color: var(--ink-2); }
.m-head button[aria-pressed="true"] { color: var(--ink); }
.m-head button[aria-pressed="true"]::after { content: '↓'; font-family: var(--sans); }
.m-head .m-num { justify-self: end; }

.dir-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.m-row + .m-row { border-top: 1px solid var(--line); }
.m-link {
  position: relative;
  min-height: 62px;
  padding-block: 10px;
  color: var(--ink-2);
  transition: background-color .14s ease;
  animation: m-in .32s var(--spring) both;
  animation-delay: calc(var(--i, 0) * 14ms);
}
.m-link:hover,
.m-row.is-active .m-link { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.m-row.is-active .m-link::before {
  content: '';
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}
.m-link:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent-soft); }

.m-ava {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font: 500 11px var(--mono);
  letter-spacing: 0.02em;
  color: var(--mute);
  transition: background-color .14s, color .14s;
}
.m-link:hover .m-ava,
.m-row.is-active .m-ava { background: var(--surface); color: var(--ink); }

.m-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.m-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
}
.m-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-sub {
  min-width: 0;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--mute);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-sub .m-pub { color: var(--ink-2); }
.m-sub i { padding-inline: 6px; font-style: normal; color: var(--subtle); }
.m-sub .m-base { color: var(--subtle); }
.m-mobile { display: none; }
.m-main mark {
  border-radius: 3px;
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-soft);
  color: inherit;
}

.m-flag {
  flex: none;
  padding: 2px 5px;
  border-radius: 5px;
  font: 500 9.5px/1.2 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.m-flag.is-nsfw   { background: color-mix(in srgb, var(--danger) 11%, transparent); color: var(--danger); }
.m-flag.is-review { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); }

.m-type {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}
.m-type svg { flex: none; width: 14px; height: 14px; color: var(--subtle); }
.m-type.is-multi { color: var(--accent); }
.m-type.is-multi svg { color: var(--accent); }
.m-size,
.m-date { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-size:empty::before,
.m-fmt:empty::before { content: '—'; color: var(--subtle); }
.m-fmt {
  overflow: hidden;
  font: 500 11px var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-date { color: var(--mute); }
.m-num {
  justify-self: end;
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.m-likes { color: var(--mute); }
.m-go {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  color: var(--accent);
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: opacity .14s, transform .2s var(--spring);
}
.m-link:hover .m-go,
.m-row.is-active .m-go { opacity: 1; transform: none; }

/* Loading skeleton */
.m-skel {
  height: 62px;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--surface-2) 90%, transparent) 50%, transparent 100%) 0 0 / 50% 100% no-repeat,
    linear-gradient(var(--surface-2), var(--surface-2)) 64px 18px / 34% 10px no-repeat,
    linear-gradient(var(--surface-2), var(--surface-2)) 64px 36px / 20% 8px no-repeat,
    linear-gradient(var(--surface-2), var(--surface-2)) 16px 15px / 32px 32px no-repeat;
  animation: m-shimmer 1.4s ease-in-out infinite;
}
.m-skel:first-child { border-top: 0; }

/* Empty + paging */
.dir-empty {
  padding: 56px 20px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  text-align: center;
  font-size: 15px;
  color: var(--ink-2);
}
.dir-empty[hidden] { display: none; }
.dir-empty-title {
  margin-bottom: 10px;
  font-family: var(--serif);
  font-weight: var(--display-weight);
  font-size: 26px;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  color: var(--ink);
}
.dir-more { display: flex; justify-content: center; margin-top: 22px; }
.dir-more[hidden] { display: none; }
.dir-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  font-size: 14px;
  font-weight: 500;
  color: var(--bg);
  cursor: pointer;
  transition: background-color .25s var(--ease), transform .25s var(--ease);
}
.dir-more-btn:hover { background: var(--accent); color: var(--on-accent); transform: translateY(-1px); }
.dir-more-btn span { font: 12px var(--mono); opacity: 0.7; }
.dir-sentinel { height: 1px; }

/* Beyond + notes ----------------------------------------------- */
.dir-beyond-grid .help-card { justify-content: flex-start; }
.dir-beyond-grid .help-card > div { display: flex; flex-direction: column; gap: 12px; }
.dir-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}
.dir-links a {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  transition: background-color .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease);
}
.dir-links a:hover { background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.dir-notes { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.dir-notes li {
  position: relative;
  padding-left: 16px;
  font-size: 15px;
  line-height: 1.5;
  color: color-mix(in srgb, var(--on-accent) 82%, transparent);
}
.dir-notes li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.62em;
  width: 5px; height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--on-accent) 60%, transparent);
}
.dir-notes strong { font-weight: 500; color: var(--on-accent); }
.dir-beyond .help-card.ink .more { margin-top: 18px; }
.dir-method {
  max-width: 78ch;
  margin-top: 36px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--mute);
}
.dir-method em { font-style: normal; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }

/* Motion */
@keyframes m-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes m-shimmer { from { background-position: -50% 0, 64px 18px, 64px 36px, 16px 15px; } to { background-position: 150% 0, 64px 18px, 64px 36px, 16px 15px; } }

/* Responsive --------------------------------------------------- */
@media (max-width: 1080px) {
  .dir-table { --cols: 32px minmax(0, 1fr) 108px 52px 84px 80px 56px 16px; }
  .dir-table .m-date { display: none; }
}
@media (max-width: 860px) {
  .dir-table { --cols: 32px minmax(0, 1fr) 104px 52px 76px 16px; }
  .dir-table :is(.m-fmt, .m-likes) { display: none; }
  .dir-filters { flex-wrap: nowrap; margin-inline: calc(var(--gutter-x) * -1); padding-inline: var(--gutter-x); overflow-x: auto; scrollbar-width: none; }
  .dir-filters::-webkit-scrollbar { display: none; }
  .dir-filters > * { flex: none; }
}
@media (max-width: 640px) {
  .dir-table { --cols: 30px minmax(0, 1fr) auto; border-radius: 14px; }
  .m-head { display: none; }
  .dir-table :is(.m-type, .m-size, .m-go) { display: none; }
  .m-link { gap: 12px; padding-inline: 12px; }
  .m-ava { width: 30px; height: 30px; border-radius: 8px; }
  .m-mobile { display: inline; }
  .m-sub .m-base { display: none; }
}
@media (max-width: 720px) {
  .dir-hero { padding-top: 44px; }
  .dir-hero h1 { font-size: clamp(36px, 10.5vw, 52px); }
  .dir-lede { margin-top: 22px; font-size: 16px; }
  .dir-search { height: 48px; }
  .dir-search kbd { display: none; }
  .dir-search input { font-size: 16px; }
  .dir-tabs {
    justify-content: flex-start;
    width: calc(100% + var(--gutter-x) * 2);
    margin-inline: calc(var(--gutter-x) * -1);
    padding-inline: var(--gutter-x);
  }
  .dir-dock-inner { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .m-link, .m-skel { animation: none !important; }
}
