:root {
  --bg: #0d1217;
  --panel: #141b22;
  --panel-2: #18212a;
  --border: #25313c;
  --border-2: #354552;
  --text: #e8eef3;
  --muted: #93a2b0;
  --faint: #7e8d9a;
  --accent: #e2aa4d;
  --accent-strong: #efbc67;
  --good: #74c99d;
  --bad: #e38989;
  --info: #86b6d8;
  --shadow: rgba(0, 0, 0, 0.28);
  --radius: 12px;
}

[data-theme="light"] {
  --bg: #f2f4f6;
  --panel: #ffffff;
  --panel-2: #f7f9fa;
  --border: #dde4ea;
  --border-2: #c5d1db;
  --text: #18222b;
  --muted: #4f5e6b;
  --faint: #5f6e7a;
  --accent: #a86f13;
  --accent-strong: #8d5c0d;
  --good: #217a55;
  --bad: #b03f3f;
  --info: #2f6f96;
  --shadow: rgba(22, 34, 45, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scrollbar-color: var(--border-2) transparent;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.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;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1500px;
  height: 64px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
  color: inherit;
  text-decoration: none;
}

.vibe-credit {
  padding-left: 14px;
  border-left: 1px solid var(--border);
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
}

.vibe-name {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(90deg, #ffd6e8 0%, #ff9bce 32%, #ff63ad 62%, #d68cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px rgba(255, 99, 173, 0.25));
}

[data-theme="light"] .vibe-name {
  background-image: linear-gradient(90deg, #d94a92 0%, #d23b9f 45%, #9a5bd9 100%);
  filter: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.brand-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.brand-sub {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.2;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 310px;
  height: 36px;
  padding: 0 9px 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--faint);
}

.search:focus-within {
  border-color: var(--border-2);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.search input::placeholder {
  color: var(--faint);
}

.search kbd {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--faint);
  font-family: inherit;
  font-size: 10.5px;
  line-height: 1.3;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  border-color: var(--border-2);
  color: var(--text);
}

.icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: block;
}

/* ---------- shell / sidebar ---------- */

.shell {
  display: grid;
  flex: 1 0 auto;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 32px;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 24px 0;
}

.sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  padding-right: 4px;
}

.nav-group + .nav-group {
  margin-top: 16px;
}

.nav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 5px 10px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-group-count {
  color: var(--faint);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--panel);
  color: var(--text);
}

.nav-item.is-active {
  border-left-color: var(--accent);
  background: var(--panel);
  color: var(--text);
}

.nav-item.is-active .nav-item-name {
  font-weight: 600;
}

.nav-item.is-active::after {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--accent);
}

.nav-empty {
  margin: 10px;
  color: var(--faint);
  font-size: 12px;
}

/* ---------- category header ---------- */

.main {
  min-width: 0;
}

.cat-head {
  display: grid;
  grid-template-columns: 332px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.cat-media {
  margin: 0;
  min-width: 0;
}

.img-wrap {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.img-fallback {
  color: var(--border-2);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
  filter: saturate(0.5) contrast(1.03) brightness(0.88);
}

[data-theme="light"] .img-wrap img {
  filter: saturate(0.72) contrast(1.02);
}

.cat-media figcaption {
  overflow: hidden;
  margin-top: 7px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-media figcaption a {
  color: var(--faint);
  text-decoration: none;
}

.cat-media figcaption a:hover {
  color: var(--muted);
  text-decoration: underline;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow #catGroup {
  color: var(--accent);
}

.eyebrow .sep {
  color: var(--border-2);
}

.cat-copy h2 {
  margin: 7px 0 0;
  font-size: clamp(32px, 3.4vw, 44px);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.elite {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 780px;
  margin-top: 18px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}

.elite-star {
  color: var(--accent);
  font-size: 13px;
  line-height: 1.5;
}

.elite-content {
  min-width: 0;
}

.elite-label {
  display: block;
  margin-bottom: 3px;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.elite-text {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.elite-fx {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 5px;
}

/* ---------- content ---------- */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 326px;
  gap: 28px;
  align-items: start;
  margin-top: 24px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-head h3 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.path-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease;
}

.path-card:hover {
  border-color: var(--border-2);
}

.path-card.is-selected {
  border-color: var(--accent);
  background: var(--panel-2);
}

.path-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px 11px;
}

.path-name {
  display: block;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.path-meta {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 10.5px;
}

.path-check {
  display: grid;
  place-items: center;
  flex: none;
  width: 19px;
  height: 19px;
  margin-top: 2px;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  color: transparent;
}

.path-check .icon {
  width: 11px;
  height: 11px;
  stroke-width: 2.4;
}

.path-card.is-selected .path-check {
  border-color: var(--accent);
  background: var(--accent);
  color: #131920;
}

.tier-list {
  display: block;
  padding: 0 15px 10px;
}

.tier-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 27px;
  height: 18px;
  margin-top: 1px;
  padding: 0 5px;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tier-row.is-role .tier-badge {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
}

.fx-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 5px;
  min-width: 0;
}

.fx {
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 11.5px;
  line-height: 1.35;
  white-space: normal;
}

.fx.good {
  border-color: color-mix(in srgb, var(--good) 21%, transparent);
  background: color-mix(in srgb, var(--good) 9%, transparent);
  color: var(--good);
}

.fx.bad {
  border-color: color-mix(in srgb, var(--bad) 21%, transparent);
  background: color-mix(in srgb, var(--bad) 9%, transparent);
  color: var(--bad);
}

.fx.neutral {
  border-color: var(--border);
  color: var(--muted);
}

/* ---------- summary ---------- */

.summary {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.summary .eyebrow {
  font-size: 9.5px;
}

.summary h3 {
  margin: 5px 0 1px;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.summary-sub {
  color: var(--muted);
  font-size: 11.5px;
}

.level-switch {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  margin: 14px 0 0;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.level-switch button {
  padding: 5px 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
}

.level-switch button:hover {
  color: var(--text);
}

.level-switch button.is-active {
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--border-2);
  color: var(--accent);
}

.summary-level-note {
  margin: 6px 0 12px;
  color: var(--faint);
  font-size: 10.5px;
}

.totals {
  border-top: 1px solid var(--border);
}

.total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}

.total-row:last-child {
  border-bottom: 0;
}

.total-label {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.total-value {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.total-value.good {
  color: var(--good);
}

.total-value.bad {
  color: var(--bad);
}

.total-empty {
  padding: 10px 0;
  color: var(--faint);
  font-size: 12px;
}

.summary-note {
  margin: 11px 0 13px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.45;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #14191e;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-primary .icon {
  width: 14px;
  height: 14px;
}

.btn-ghost {
  padding: 8px 14px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
}

.btn-ghost:hover {
  border-color: var(--accent);
}

.noscript {
  margin: 20px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- empty state ---------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  max-width: 520px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}

.empty h2 {
  margin: 10px 0 8px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.empty-copy {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- footer ---------- */

.footer {
  width: 100%;
  max-width: 1500px;
  margin: 36px auto 0;
  padding: 0 24px;
}

.footer-inner {
  padding: 16px 0 26px;
  border-top: 1px solid var(--border);
}

.footer p {
  margin: 0;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.6;
}

.footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer a:hover {
  color: var(--text);
}

.footer code {
  color: var(--muted);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.95em;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 100;
  padding: 8px 14px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: var(--panel-2);
  box-shadow: 0 10px 28px var(--shadow);
  color: var(--text);
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

@media (max-height: 940px) {
  /* Keep the full category list in flow on short screens instead of letting
     a tall sticky sidebar slide under the top bar at the end of the page. */
  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 1400px) {
  .shell {
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 28px;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1fr) 292px;
    gap: 24px;
  }
}

@media (max-width: 1240px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .summary {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 980px) {
  .topbar-inner {
    height: auto;
    padding: 11px 16px;
  }

  .search {
    width: 250px;
  }

  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 18px 16px 0;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--border);
  }

  #nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .nav-group {
    margin: 0;
  }

  .nav-group-title {
    margin: 0 0 3px;
  }

  .nav-group-items {
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .nav-group-items::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: none;
    width: auto;
    padding: 5px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    white-space: nowrap;
    font-size: 12.5px;
  }

  .nav-item.is-active {
    border-color: var(--accent);
    border-left-color: var(--accent);
  }

  .nav-item.is-active::after {
    display: none;
  }

  .cat-head {
    grid-template-columns: 300px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar-inner {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px 12px;
  }

  .topbar-tools {
    order: 3;
    width: 100%;
  }

  .search {
    width: 100%;
  }

  .search kbd {
    display: none;
  }

  .shell {
    padding: 14px 14px 0;
  }

  .cat-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding-bottom: 20px;
  }

  .cat-media {
    max-width: 430px;
  }

  .cat-copy h2 {
    font-size: 32px;
  }

  .elite {
    max-width: none;
  }

  .path-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer {
    padding: 0 14px;
  }

  .brand-cluster {
    gap: 10px;
  }

  .vibe-credit {
    padding-left: 10px;
    font-size: 9.5px;
  }
}

@media (max-width: 360px) {
  .brand-sub {
    display: none;
  }

  .cat-media {
    max-width: none;
  }

  .vibe-credit {
    padding-left: 8px;
    font-size: 9px;
  }
}

@media print {
  .topbar,
  .sidebar,
  .summary,
  .footer,
  .empty {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
  }

  .shell {
    display: block;
    padding: 0;
  }

  .content-grid {
    display: block;
  }

  .path-grid {
    grid-template-columns: 1fr 1fr;
  }

  .path-card {
    break-inside: avoid;
    border-color: #c8c8c8;
  }

  .fx.good,
  .fx.bad,
  .fx.neutral {
    border: 0;
    background: none;
    color: #111;
    padding: 0;
  }
}
