:root {
  color-scheme: dark;
  --black: #000000;
  --panel: #080808;
  --panel-strong: #101010;
  --white: #f4f2ef;
  --muted: #b8b1c4;
  --purple: #b996ff;
  --lavender: #b996ff;
  --purple-deep: #6020c0;
  --gold: #f2a326;
  --line: rgba(244, 242, 239, 0.8);
  --soft-line: rgba(244, 242, 239, 0.16);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.52);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--black);
  color: var(--white);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(16px);
}

.top-bar {
  height: 42px;
  background: var(--purple);
}

.header-inner,
main {
  width: min(1480px, calc(100% - 36px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}

.brand-mark {
  width: 16px;
  height: 16px;
  border: 2px solid var(--gold);
  rotate: 45deg;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--gold);
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.social-link span {
  font-size: 0.74rem;
  font-weight: 620;
  letter-spacing: 0.08em;
  line-height: 1;
}

.social-link:hover,
.social-link:focus-visible {
  border-color: var(--purple);
  background: rgba(185, 150, 255, 0.14);
  color: var(--white);
}

.result-line button {
  min-height: 42px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0 24px;
  background: transparent;
  color: var(--gold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
  padding: clamp(52px, 7vw, 118px) 0 clamp(28px, 4vw, 58px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}

h1 {
  max-width: 960px;
  margin: 0;
  font-size: clamp(2.45rem, 5.8vw, 6.2rem);
  line-height: 0.98;
  font-weight: 650;
  letter-spacing: 0;
}

.emotion-map-section {
  display: grid;
  gap: 18px;
  margin-bottom: 26px;
}

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading-row h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.2vw, 2.5rem);
  line-height: 1.05;
}

.section-heading-row .eyebrow {
  margin-bottom: 8px;
}

.emotion-map {
  --marquee-duration: 42s;
  border: 2px solid var(--line);
  border-radius: 24px;
  padding: clamp(14px, 2vw, 22px);
  background:
    linear-gradient(135deg, rgba(185, 150, 255, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 42%),
    #000;
  overflow: hidden;
}

.emotion-map-all {
  --marquee-duration: 68s;
}

.emotion-dashboard {
  display: grid;
  gap: 0;
}

.emotion-ones-panel {
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.36);
}

.emotion-choice {
  border: 1px solid var(--soft-line);
  color: var(--white);
  cursor: pointer;
  font: inherit;
  letter-spacing: 0;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.emotion-choice:hover,
.emotion-choice.is-selected {
  border-color: var(--lavender);
  background: rgba(185, 150, 255, 0.18);
}

.emotion-marquee-panel {
  overflow: hidden;
}

.unique-emotion-marquee {
  padding: 10px 0 12px;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.unique-emotion-track {
  display: flex;
  width: max-content;
  gap: 12px;
  animation: uniqueEmotionMarquee var(--marquee-duration) linear infinite;
}

.unique-emotion-marquee:hover .unique-emotion-track {
  animation-play-state: paused;
}

.unique-emotion-card {
  display: grid;
  gap: 7px;
  flex: 0 0 94px;
  width: 94px;
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.unique-emotion-thumb {
  display: block;
  aspect-ratio: 1;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #030303;
  overflow: hidden;
}

.unique-emotion-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.unique-emotion-card > span:last-child {
  overflow: hidden;
  color: var(--white);
  font-size: 0.84rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes uniqueEmotionMarquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-50% - 6px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .unique-emotion-track {
    animation: none;
  }
}

.collection-traits-heading {
  margin: 28px 0 14px;
}

.collection-traits-heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.2vw, 2.45rem);
  line-height: 1.05;
}

.hero-stats {
  display: grid;
  gap: 12px;
  min-width: 240px;
  color: var(--muted);
}

.hero-stats span {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid var(--soft-line);
  padding-bottom: 11px;
}

.hero-stats strong {
  color: var(--white);
  font-weight: 620;
}

.explorer-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 240px);
  gap: 12px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 28px;
}

.search-control,
.sort-menu,
.trait-search-control {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.search-control > span,
.sort-menu > span,
.trait-search-control > span,
.filter-section h2,
.filter-panel-head span {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  padding: 0 16px;
  background: var(--panel);
  color: var(--white);
  outline: none;
}

input:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}

.sort-menu {
  position: relative;
}

.sort-button,
.sort-options button,
.status-pill,
.trait-group-toggle,
.trait-option {
  border: 0;
  background: transparent;
  color: inherit;
}

.sort-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  padding: 0 16px;
  background: var(--panel);
  color: var(--white);
}

.chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.8;
}

.sort-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  width: min(260px, 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px;
  background: rgba(8, 8, 8, 0.98);
  box-shadow: var(--shadow);
}

.sort-options[hidden] {
  display: none;
}

.sort-options button {
  min-height: 38px;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  text-align: left;
}

.sort-options button:hover,
.sort-options button.is-active {
  background: rgba(185, 150, 255, 0.14);
  color: var(--white);
}

.result-line button {
  min-height: 42px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0 24px;
  background: transparent;
  color: var(--gold);
}

.explorer-layout {
  display: grid;
  grid-template-columns: minmax(250px, 330px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 26px;
}

.filter-panel {
  position: sticky;
  top: 136px;
  display: grid;
  gap: 22px;
  max-height: calc(100dvh - 160px);
  overflow: auto;
  border: 2px solid var(--line);
  border-radius: 28px;
  padding: 22px;
  background: rgba(0, 0, 0, 0.72);
}

.filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.filter-panel-head strong {
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 520;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: -6px;
}

.filter-actions button {
  min-height: 34px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  padding: 0 16px;
  background: transparent;
  color: var(--gold);
  font-size: 0.88rem;
}

.filter-actions button:hover {
  border-color: var(--line);
}

.filter-section {
  display: grid;
  gap: 14px;
}

.filter-section h2 {
  margin: 0;
}

.status-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 34px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.status-pill span {
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

.status-pill.is-active {
  border-color: var(--purple);
  background: var(--purple);
  color: var(--black);
}

.status-pill.is-active span {
  color: var(--black);
}

.trait-filters {
  display: grid;
  gap: 10px;
}

.trait-group {
  border: 1px solid var(--soft-line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel);
}

.trait-group-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  color: var(--white);
  text-align: left;
}

.trait-group-toggle strong {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.trait-group.is-open .trait-group-toggle {
  border-bottom: 1px solid var(--soft-line);
}

.trait-group.is-open .chevron {
  transform: translateY(2px) rotate(225deg);
}

.trait-group-panel {
  display: none;
  gap: 12px;
  padding: 12px;
}

.trait-group.is-open .trait-group-panel {
  display: grid;
}

.trait-search-control span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.trait-search {
  min-height: 40px;
}

.trait-option-list {
  display: grid;
  gap: 7px;
  max-height: 330px;
  overflow: auto;
  padding-right: 2px;
}

.trait-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 1px solid rgba(244, 242, 239, 0.12);
  border-radius: 12px;
  padding: 0 11px;
  color: var(--muted);
  text-align: left;
}

.trait-option:hover:not(:disabled),
.trait-option.is-selected {
  border-color: var(--purple);
  background: rgba(185, 150, 255, 0.13);
  color: var(--white);
}

.trait-option:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(244, 242, 239, 0.44);
  border-radius: 5px;
}

.trait-option.is-selected .checkmark {
  position: relative;
  border-color: var(--purple);
  background: var(--purple);
}

.trait-option.is-selected .checkmark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 10px;
  border-right: 2px solid var(--black);
  border-bottom: 2px solid var(--black);
  transform: rotate(45deg);
}

.trait-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-swatch {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(244, 242, 239, 0.5);
  border-radius: 999px;
  background: var(--swatch);
}

.trait-total {
  color: var(--gold);
  font-size: 0.84rem;
}

.gallery-column {
  min-width: 0;
}

.result-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 18px;
  color: var(--muted);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
  padding-bottom: 70px;
}

.portrait-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 9px;
  background: var(--panel);
  color: var(--white);
  text-align: left;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.portrait-card:hover {
  border-color: var(--purple);
  background: var(--panel-strong);
  transform: translateY(-2px);
}

.image-wrap {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 5px;
  background: #050505;
}

.image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-meta {
  display: grid;
  gap: 4px;
  min-height: 66px;
}

.token {
  color: var(--gold);
  font-size: 0.78rem;
}

.emotion {
  overflow: hidden;
  color: var(--white);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
}

.card-market {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.2;
}

.card-market strong {
  color: var(--gold);
  font-weight: 520;
}

.card-market .price {
  overflow: hidden;
  color: var(--white);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portrait-card.is-unlisted .card-market strong,
.portrait-card.is-unlisted .card-market .price {
  color: var(--muted);
}

.detail-dialog {
  width: min(1120px, calc(100% - 24px));
  height: min(860px, calc(100dvh - 24px));
  max-height: min(860px, calc(100dvh - 24px));
  border: 2px solid var(--line);
  border-radius: 26px;
  padding: 0;
  background: var(--black);
  color: var(--white);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.detail-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  color: var(--white);
  font-size: 1.35rem;
}

.detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.8fr);
  gap: 0;
  height: 100%;
  min-height: 0;
}

.detail-media {
  min-height: 420px;
  background: #030303;
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  justify-items: center;
  gap: 22px;
  padding: clamp(18px, 3vw, 32px);
}

.detail-media img {
  width: min(100%, 720px);
  height: auto;
  max-height: min(78vh, 720px);
  object-fit: contain;
  display: block;
}

.detail-panel {
  display: grid;
  align-content: start;
  gap: 22px;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(28px, 4vw, 54px);
  border-left: 1px solid var(--soft-line);
  scrollbar-color: rgba(185, 150, 255, 0.55) transparent;
  scrollbar-width: thin;
}

.detail-panel h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.original-name {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.detail-section {
  display: grid;
  gap: 12px;
}

.detail-section h3 {
  margin: 0;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.trait-list,
.rarity-list,
.market-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.trait-row,
.rarity-row,
.market-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--soft-line);
  padding-bottom: 10px;
}

.rarity-row {
  border: 1px solid rgba(185, 150, 255, 0.28);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(185, 150, 255, 0.08);
}

.rarity-row span {
  color: var(--muted);
}

.rarity-row strong {
  color: var(--gold);
  font-size: 1.05rem;
  font-weight: 650;
  white-space: nowrap;
}

.trait-button {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  text-align: left;
}

.trait-button span {
  color: var(--muted);
}

.trait-button strong {
  color: var(--white);
  font-weight: 520;
  text-align: right;
}

.detail-trait-row > span:first-child {
  color: var(--muted);
}

.detail-trait-row strong {
  color: var(--white);
  font-weight: 520;
  text-align: right;
}

.trait-value {
  display: grid;
  gap: 4px;
  justify-items: end;
  min-width: 0;
  text-align: right;
}

.trait-value em {
  color: var(--gold);
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1;
  white-space: nowrap;
}

.trait-button:hover {
  color: var(--purple);
}

.trait-button:hover > span:first-child,
.trait-button:hover strong {
  color: var(--purple);
}

.trait-row dt,
.market-row dt {
  color: var(--muted);
}

.trait-row dd,
.market-row dd {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  color: var(--white);
  text-align: right;
}

.trait-row dd strong {
  color: var(--white);
  font-weight: 620;
}

.trait-row dd span {
  color: var(--gold);
}

.primary-link {
  min-height: 50px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0 28px;
  color: var(--gold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.media-primary-link {
  justify-self: center;
}

.swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.swatch::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: var(--swatch);
}

.empty {
  grid-column: 1 / -1;
  min-height: 260px;
  display: grid;
  place-items: center;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  color: var(--muted);
}

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    max-width: 520px;
  }

  .explorer-layout {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 720px) {
  .top-bar {
    height: 28px;
  }

  .header-inner,
  main {
    width: min(100% - 24px, 1480px);
  }

  .brand {
    font-size: 0.72rem;
  }

  .hero {
    padding-top: 42px;
  }

  .section-heading-row {
    display: grid;
  }

  .emotion-map {
    border-radius: 22px;
    padding: 12px;
  }

  .unique-emotion-card {
    flex-basis: 84px;
    width: 84px;
    padding: 7px;
  }

  .explorer-tools {
    grid-template-columns: 1fr;
    border-radius: 22px;
    padding: 14px;
  }

  .filter-panel {
    border-radius: 22px;
    padding: 14px;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .detail-content {
    grid-template-columns: 1fr;
    height: auto;
  }

  .detail-panel {
    border-left: 0;
    border-top: 1px solid var(--soft-line);
    overflow: visible;
  }

  .detail-media {
    min-height: 300px;
  }

  .detail-dialog {
    height: auto;
    overflow: auto;
  }

  .media-primary-link {
    justify-self: stretch;
  }
}
