/* Creator directory (/ugc-creators/). Layers on tools.css: same 1160px shell,
   same ink/primary tokens, same .metric, .platform-chip, .related-tool parts.
   Bump the ?v= in scripts/generate-creator-directory.mjs when this changes. */

.directory-page {
  --dir-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dir-radius: 14px;
  --dir-tint: rgba(56, 71, 254, 0.06);
  --dir-tint-line: rgba(56, 71, 254, 0.18);
}

.dir-main {
  padding-bottom: 72px;
}

/* ---------- breadcrumb + head ---------- */

.dir-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  color: var(--ink-45);
  font-size: 13px;
  font-weight: 700;
}

.dir-breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--ink-30, rgba(18, 18, 18, 0.3));
}

.dir-breadcrumb a {
  color: var(--ink-60);
  text-decoration: none;
  transition: color 120ms ease;
}

.dir-breadcrumb a:hover,
.dir-breadcrumb a:focus-visible {
  color: var(--primary);
}

.dir-breadcrumb [aria-current="page"] {
  color: var(--ink);
}

.dir-head {
  padding-bottom: 26px;
}

.dir-head h1 {
  max-width: 900px;
}

.dir-head .platform-row {
  margin-top: 16px;
}

.dir-chip-date {
  color: var(--ink-45);
}

/* ---------- prose + panel ---------- */

.dir-body {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 40px;
  align-items: start;
  padding: 10px 0 8px;
}

.dir-prose h2 {
  color: var(--ink);
  font-size: clamp(1.5rem, 2.2vw, 1.9rem);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0;
}

.dir-prose h3 {
  margin-top: 26px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.dir-prose p {
  max-width: 62ch;
  margin-top: 12px;
  color: var(--ink-60);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 600;
}

.dir-definition {
  margin-top: 22px;
  padding: 16px 18px;
  border-left: 3px solid var(--primary);
  border-radius: 0 12px 12px 0;
  background: var(--dir-tint);
}

.dir-definition h3 {
  margin-top: 0;
}

.dir-definition p {
  margin-top: 6px;
  font-size: 15px;
}

.dir-panel {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
}

.dir-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.dir-stats .metric {
  min-height: 0;
  margin: 0;
}

.dir-stats .metric:first-child {
  grid-column: 1 / -1;
  background: var(--ink);
  border-color: var(--ink);
}

.dir-stats .metric:first-child dt {
  color: rgba(255, 255, 255, 0.62);
}

.dir-stats .metric:first-child dd {
  color: #fff;
  font-size: 28px;
}

.dir-stats dt {
  display: block;
  color: var(--ink-45);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dir-stats dd {
  display: block;
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.18;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

/* Follower band bars */
.dir-bands {
  margin: 0;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfbfc;
}

.dir-bands figcaption {
  color: var(--ink-45);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dir-bands ol {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.dir-bands li {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
}

.dir-band-label {
  color: var(--ink-60);
  white-space: nowrap;
}

.dir-band-track {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.06);
}

.dir-band-fill {
  display: block;
  width: var(--w, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #6b78ff);
  transform-origin: left center;
  animation: dir-bar-grow 640ms var(--dir-ease) both;
}

.dir-band-count {
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dir-spread h3 {
  color: var(--ink-45);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dir-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.dir-chips a,
.dir-chips span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms var(--dir-ease);
}

.dir-chips b {
  color: var(--ink-45);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.dir-chips a:hover,
.dir-chips a:focus-visible {
  border-color: var(--dir-tint-line);
  background: var(--dir-tint);
  outline: none;
}

.dir-chips a:active {
  transform: scale(0.97);
}

/* ---------- sections ---------- */

.dir-section {
  padding-top: 54px;
}

.dir-section-head {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.dir-section-head h2,
.dir-faq h2 {
  color: var(--ink);
  font-size: clamp(1.5rem, 2.2vw, 1.9rem);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0;
}

.dir-section-head p {
  max-width: 68ch;
  color: var(--ink-60);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 650;
}

/* ---------- sample cards ---------- */

.dir-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dir-card {
  animation: dir-rise 420ms var(--dir-ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

.dir-card-link {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 14px;
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--dir-radius);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms var(--dir-ease), box-shadow 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .dir-card-link:hover {
    border-color: rgba(56, 71, 254, 0.38);
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -18px rgba(18, 18, 18, 0.35);
  }

  .dir-card-link:hover .dir-card-arrow {
    color: var(--primary);
    transform: translateX(2px);
  }
}

.dir-card-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.dir-card-link:active {
  transform: scale(0.985);
}

.dir-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(56, 71, 254, 0.14), rgba(56, 71, 254, 0.04));
  color: var(--primary);
  font-size: 18px;
  font-weight: 900;
}

.dir-card-body {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.dir-handle {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dir-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.dir-card-meta .platform-chip {
  min-height: 24px;
  padding: 0 8px;
  font-size: 11px;
}

.dir-band {
  color: var(--ink-60);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.dir-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--ink-45);
  font-size: 12px;
  font-weight: 800;
}

.dir-card-tags span + span::before {
  content: "\00b7";
  margin-right: 10px;
}

.dir-card-arrow {
  display: grid;
  width: 20px;
  height: 20px;
  color: var(--ink-30, rgba(18, 18, 18, 0.3));
  transition: color 160ms ease, transform 160ms var(--dir-ease);
}

.dir-card-arrow svg {
  width: 100%;
  height: 100%;
}

/* ---------- gated block ---------- */

.dir-gate {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 28px;
  align-items: center;
  overflow: hidden;
  padding: 26px;
  border: 1px solid var(--dir-tint-line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(56, 71, 254, 0.05), rgba(56, 71, 254, 0.02));
}

.dir-gate-rows {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
  user-select: none;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
  mask-image: linear-gradient(180deg, #000 55%, transparent);
}

.dir-gate-rows li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(0, 0.8fr) 56px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(18, 18, 18, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  animation: dir-rise 420ms var(--dir-ease) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

.dir-gate-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(25, 28, 45, 0.16), rgba(56, 71, 254, 0.16));
  filter: blur(1.5px);
}

.dir-gate-line {
  display: block;
  width: var(--len, 60%);
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(25, 28, 45, 0.18), rgba(56, 71, 254, 0.18));
  filter: blur(3px);
}

.dir-gate-email {
  background: linear-gradient(90deg, rgba(56, 71, 254, 0.28), rgba(56, 71, 254, 0.12));
}

.dir-gate-pill {
  display: block;
  height: 22px;
  border-radius: 999px;
  background: rgba(8, 122, 80, 0.22);
  filter: blur(2.5px);
}

.dir-gate-copy {
  display: grid;
  gap: 10px;
}

.dir-gate-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 9px;
  border: 1px solid var(--dir-tint-line);
  border-radius: 12px;
  background: #fff;
  color: var(--primary);
}

.dir-gate-icon svg {
  width: 100%;
  height: 100%;
}

.dir-gate-copy h2 {
  color: var(--ink);
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0;
}

.dir-gate-copy p {
  max-width: 52ch;
  color: var(--ink-60);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 650;
}

.dir-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.dir-gate-actions .btn-dark,
.dir-gate-actions .btn-light {
  transition: transform 160ms var(--dir-ease), background 150ms ease, border-color 150ms ease;
}

.dir-gate-actions .btn-dark:active,
.dir-gate-actions .btn-light:active {
  transform: scale(0.97);
}

/* ---------- related ---------- */

.dir-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.dir-related-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dir-related-group {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--dir-radius);
  background: rgba(255, 255, 255, 0.86);
}

.dir-related-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-45);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dir-related-group h3 svg {
  width: 14px;
  height: 14px;
  color: var(--ink-60);
}

.dir-related-group ul {
  display: grid;
  gap: 2px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.dir-related-group li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 800;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease;
}

.dir-related-group li a b {
  flex: 0 0 auto;
  color: var(--ink-45);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.dir-related-group li a:hover,
.dir-related-group li a:focus-visible {
  background: var(--dir-tint);
  color: var(--primary);
  outline: none;
}

.dir-tools-heading {
  margin-top: 30px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.dir-related .related-tools {
  margin-top: 14px;
}

/* ---------- hub grids ---------- */

.dir-hub-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dir-hub-grid li {
  animation: dir-rise 420ms var(--dir-ease) both;
  animation-delay: calc(var(--i, 0) * 30ms);
}

.dir-hub-card {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--dir-radius);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms var(--dir-ease);
}

.dir-hub-card strong {
  font-size: 17px;
  line-height: 1.15;
  font-weight: 900;
}

.dir-hub-card span {
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.dir-hub-card small {
  margin-top: auto;
  color: var(--ink-45);
  font-size: 12px;
  font-weight: 800;
}

@media (hover: hover) and (pointer: fine) {
  .dir-hub-card:hover {
    border-color: rgba(56, 71, 254, 0.38);
    background: #fff;
    transform: translateY(-2px);
  }
}

.dir-hub-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.dir-hub-card:active {
  transform: scale(0.985);
}

/* ---------- FAQ + note ---------- */

.dir-faq-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.dir-faq-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.dir-faq-item h3 {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.3;
  font-weight: 900;
}

.dir-faq-item p {
  max-width: 70ch;
  margin-top: 8px;
  color: var(--ink-60);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 650;
}

.dir-faq-item a {
  color: var(--primary);
  font-weight: 800;
}

.dir-note {
  margin-top: 18px;
  color: var(--ink-45);
  font-size: 13px;
  font-weight: 700;
}

.dir-note a {
  color: var(--ink-60);
}

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

@keyframes dir-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dir-bar-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dir-card,
  .dir-gate-rows li,
  .dir-hub-grid li,
  .dir-band-fill {
    animation: none;
  }

  .dir-card-link,
  .dir-hub-card,
  .dir-chips a,
  .dir-card-arrow {
    transition: none;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .dir-body {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .dir-panel {
    position: static;
  }

  .dir-hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .dir-cards,
  .dir-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dir-gate {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .dir-gate-rows {
    max-height: 180px;
    overflow: hidden;
  }

  .directory-page .related-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .tools-page.directory-page .tools-shell {
    width: min(1160px, calc(100% - 32px));
  }

  .dir-cards,
  .dir-hub-grid,
  .dir-related-grid-2,
  .directory-page .related-tools {
    grid-template-columns: 1fr;
  }

  .dir-stats {
    grid-template-columns: 1fr 1fr;
  }

  .dir-bands li {
    grid-template-columns: 72px minmax(0, 1fr) 48px;
  }

  .dir-gate-actions .btn-dark,
  .dir-gate-actions .btn-light {
    width: 100%;
  }
}
