/* ==========================================================================
   CheatVault — stylesheet
   Author: CheatVault
   Structure: 1 tokens · 2 reset · 3 layout · 4 header · 5 hero · 6 catalog
              7 cards · 8 guide · 9 faq · 10 footer · 11 utilities
   ========================================================================== */

/* 1. tokens ---------------------------------------------------------------- */
:root {
  --bg: #0b0c0d;
  --bg-soft: #0f1112;
  --surface: #131516;
  --surface-2: #171a1c;
  --surface-3: #1c2022;
  --line: #24282b;
  --line-strong: #343a3e;
  --text: #e7e9ea;
  --text-dim: #b3b9bd;
  --muted: #868d92;
  --muted-deep: #5f666b;
  --white: #ffffff;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 12px 32px -12px rgba(0, 0, 0, .8);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px #4a5257;
  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --wrap: 1120px;
  --header-h: 64px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* 2. reset ----------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -.021em;
  line-height: 1.15;
  color: var(--text);
}

p { margin: 0; }

code {
  padding: 1px 5px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: .88em;
  color: var(--text-dim);
}

a {
  color: inherit;
  text-decoration: none;
}

img { display: block; max-width: 100%; }

button, input, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

::selection {
  background: #2f3639;
  color: var(--white);
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}

/* 3. layout ---------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: 72px;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--line-strong);
}

.section-title {
  font-size: 26px;
  letter-spacing: -.028em;
}

.section-sub {
  max-width: 46ch;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14.5px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 12px 18px;
  background: var(--white);
  color: #000;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.skip:focus {
  left: 16px;
  top: 16px;
}

/* 4. header ---------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 12, 13, .82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -.02em;
}

.brand svg { flex: none; }

.brand-name span { color: var(--muted); }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.nav a {
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  transition: color .16s var(--ease), background-color .16s var(--ease);
}

.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search svg {
  position: absolute;
  left: 11px;
  color: var(--muted-deep);
  pointer-events: none;
}

.search input {
  width: 232px;
  height: 36px;
  padding: 0 44px 0 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text);
  transition: border-color .16s var(--ease), background-color .16s var(--ease);
}

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

.search input:hover { border-color: var(--line-strong); }

.search input:focus {
  outline: none;
  border-color: #4a5257;
  background: var(--surface-2);
  box-shadow: none;
}

.search kbd {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-deep);
}

.search input:focus ~ kbd { opacity: 0; }

.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
}

.nav-toggle:hover { border-color: var(--line-strong); color: var(--text); }

/* 5. hero ------------------------------------------------------------------ */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 56px;
  align-items: center;
  padding-block: 84px 80px;
}

.hero h1 {
  max-width: 15ch;
  margin-top: 18px;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.05;
}

.hero h1 em {
  font-style: normal;
  color: var(--muted-deep);
}

.hero-lede {
  max-width: 50ch;
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -.006em;
  white-space: nowrap;
  transition: background-color .16s var(--ease), border-color .16s var(--ease),
              color .16s var(--ease), transform .16s var(--ease);
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--white);
  border-color: var(--white);
  color: #0b0c0d;
}

.btn-primary:hover { background: #d5d9db; border-color: #d5d9db; }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }

.btn-sm {
  height: 34px;
  padding: 0 13px;
  font-size: 13px;
}

.btn-sm svg { flex: none; }

.btn-discord:hover { color: var(--white); }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--muted);
}

.hero-meta b {
  color: var(--text-dim);
  font-weight: 500;
}

.hero-panel {
  position: relative;
  padding: 20px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  letter-spacing: .06em;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #79b884;
  box-shadow: 0 0 0 3px rgba(121, 184, 132, .12);
}

.hero-list {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(36, 40, 43, .6);
  font-size: 13.5px;
}

.hero-list li:last-child { border-bottom: 0; }

.hero-list .k { color: var(--muted); }

.hero-list .v {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

.hero-panel-foot {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted-deep);
}

/* 6. catalog --------------------------------------------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  height: 32px;
  padding: 0 13px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color .16s var(--ease), border-color .16s var(--ease), background-color .16s var(--ease);
}

.chip:hover { color: var(--text); border-color: var(--line-strong); }

.chip[aria-pressed="true"] {
  background: var(--surface-3);
  border-color: var(--line-strong);
  color: var(--text);
}

.chip .count {
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-deep);
}

.chip[aria-pressed="true"] .count { color: var(--muted); }

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.select-wrap select {
  height: 32px;
  padding: 0 30px 0 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-dim);
  appearance: none;
  -webkit-appearance: none;
}

.select-wrap select:hover { border-color: var(--line-strong); }

.select-wrap svg {
  position: absolute;
  right: 10px;
  color: var(--muted-deep);
  pointer-events: none;
}

.result-count {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .05em;
  color: var(--muted-deep);
}

/* 7. cards ----------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color .18s var(--ease), background-color .18s var(--ease),
              transform .18s var(--ease), box-shadow .18s var(--ease);
}

.card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card[hidden] { display: none; }

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 18px 0;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar svg { width: 100%; height: 100%; }

.card-heading { min-width: 0; padding-top: 2px; }

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.015em;
}

.card-title .ver {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--muted);
}

.card-author {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted-deep);
}

.card-body {
  flex: 1;
  padding: 14px 18px 0;
}

.card-desc {
  min-height: 44px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.tag {
  padding: 2px 8px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .03em;
  color: var(--muted);
  white-space: nowrap;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
}

.btn-dl {
  flex: 1;
  height: 38px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13.5px;
}

.btn-dl:hover { background: var(--white); border-color: var(--white); color: #0b0c0d; }

.btn-dl[data-busy="true"] {
  pointer-events: none;
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--muted);
}

.btn-dl .size {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  opacity: .65;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: color .16s var(--ease), border-color .16s var(--ease), background-color .16s var(--ease);
}

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

.icon-btn.copied { color: #79b884; border-color: rgba(121, 184, 132, .4); }

.meta {
  padding: 0 18px 18px;
}

.meta summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted-deep);
  cursor: pointer;
  list-style: none;
  transition: color .16s var(--ease);
}

.meta summary::-webkit-details-marker { display: none; }

.meta summary:hover { color: var(--text-dim); }

.meta summary svg { transition: transform .18s var(--ease); }

.meta[open] summary svg { transform: rotate(90deg); }

.meta-body {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.meta-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  padding: 4px 0;
  font-size: 12px;
}

.meta-row dt { color: var(--muted-deep); }

.meta-row dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  word-break: break-all;
}

.empty {
  display: none;
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--muted);
}

.empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 600;
}

.empty.is-visible { display: block; }

/* 8. guide ----------------------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.step::before {
  counter-increment: step;
  content: "0" counter(step);
  display: block;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--muted-deep);
}

.step h3 {
  margin-bottom: 8px;
  font-size: 14.5px;
}

.step p {
  font-size: 13.5px;
  color: var(--muted);
}

.step code {
  padding: 1px 5px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
}

.notice {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.notice svg { flex: none; margin-top: 2px; color: var(--muted); }

.notice p {
  font-size: 13.5px;
  color: var(--muted);
}

.notice b { color: var(--text-dim); font-weight: 550; }

/* 9. faq ------------------------------------------------------------------- */
.faq {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.faq details {
  background: var(--surface);
  transition: background-color .16s var(--ease);
}

.faq details:hover { background: var(--surface-2); }

.faq details[open] { background: var(--surface-2); }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary svg {
  flex: none;
  color: var(--muted-deep);
  transition: transform .2s var(--ease);
}

.faq details[open] summary svg { transform: rotate(45deg); }

.faq .answer {
  padding: 0 20px 18px;
  max-width: 78ch;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* 10. footer --------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, .7fr));
  gap: 40px;
  padding-block: 52px 40px;
}

.footer-brand p {
  max-width: 34ch;
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}

.footer-col h4 {
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted-deep);
}

.footer-col ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col a {
  font-size: 13.5px;
  color: var(--text-dim);
  transition: color .16s var(--ease);
}

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

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted-deep);
}

.footer-bottom .dot { color: var(--line-strong); }

/* 11. utilities ------------------------------------------------------------ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 300;
  transform: translate(-50%, 12px);
  padding: 10px 16px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}

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

/* responsive --------------------------------------------------------------- */
@media (max-width: 940px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    padding-block: 64px;
  }

  .hero-panel { max-width: 420px; }

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

@media (max-width: 760px) {
  .nav,
  .search { display: none; }

  .nav-toggle { display: grid; }

  .site-header.is-open .nav {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    display: grid;
    gap: 2px;
    padding: 12px 24px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

  .site-header.is-open .nav a { padding: 10px 12px; }

  .site-header.is-open .search {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--header-h) + 132px);
    display: flex;
    padding: 0 24px 18px;
    background: var(--bg);
  }

  .site-header.is-open .search input { width: 100%; }

  .site-header.is-open .search kbd { display: none; }

  .section { padding-block: 56px; }

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

  .toolbar-right { width: 100%; margin-left: 0; }

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

  .hero-meta { gap: 6px 16px; }
}

@media (max-width: 480px) {
  .btn-discord .btn-label { display: none; }

  .btn-discord { width: 34px; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
