@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@600;700;800&display=swap");

:root {
  --bg: #0b0c10;
  --surface: #12141a;
  --surface-2: #181c24;
  --surface-hover: #1f2430;
  --border: #262b36;
  --border-strong: #343b4a;
  --text: #f3f5f8;
  --text-soft: #ced4df;
  --muted: #a5adbc;
  --accent: #165ecc;
  --accent-hover: #1d6ee8;
  --accent-text: #ffffff;
  --brand-blue: #3a9cff;
  --link: #6ea8ff;
  --beta: #c53030;
  --beta-hover: #d83b3b;
  --ok: #1f8a5b;
  --ok-text: #8ce9be;
  --warn: #b7791f;
  --warn-text: #fbd38d;
  --bad: #c53030;
  --bad-text: #feb2b2;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-display: "Outfit", "DM Sans", system-ui, -apple-system, sans-serif;
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

::selection {
  background: #165ecc;
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid #6ea8ff;
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.2;
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 1.625rem; font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }

p {
  margin: 0;
  color: var(--text-soft);
}

code, pre, .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.site-wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 12, 16, 0.94);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-link:hover {
  text-decoration: none;
}
.brand-link span {
  color: var(--brand-blue);
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 2px;
  transition: color 0.15s ease;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  line-height: 1.25;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-beta {
  background: var(--beta);
  color: #ffffff;
}
.btn-beta:hover:not(:disabled) {
  background: var(--beta-hover);
}

.btn-secondary {
  background: #222631;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
  background: #2a303e;
}

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* Hero Section */
.hero {
  padding: 64px 0 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 44px;
  align-items: center;
}

.hero-lead {
  margin-top: 16px;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 52ch;
}

.hero-actions {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.preview-frame {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
}

.preview-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.section {
  padding: 40px 0;
}

.section-band {
  background: #0e1015;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-soft);
}

.badge-ok {
  background: rgba(31, 138, 91, 0.22);
  border-color: rgba(31, 138, 91, 0.55);
  color: var(--ok-text);
}

.badge-beta {
  background: rgba(197, 48, 48, 0.2);
  border-color: rgba(197, 48, 48, 0.55);
  color: var(--bad-text);
}

.badge-warn {
  background: rgba(183, 121, 31, 0.22);
  border-color: rgba(183, 121, 31, 0.55);
  color: var(--warn-text);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.feature-card h2,
.feature-card h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Skin ESP Showcase Section (EX Client real ESP style) */
.esp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
}

.esp-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.esp-copy p {
  color: var(--muted);
  font-size: 1rem;
  max-width: 48ch;
}

.compat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.compat-pill {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.875rem;
  font-weight: 500;
}

.esp-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 24px 20px;
  min-height: 360px;
}

.esp-entity {
  position: relative;
  display: inline-block;
  padding: 10px 14px 6px;
}

.esp-model-img {
  display: block;
  width: 220px;
  height: auto;
  position: relative;
  z-index: 2;
  user-select: none;
}

/* Matches SDK/Render/EspRenderer.cpp: 2px #248cf9 outline, 16% #248cf9 fill */
.esp-box {
  position: absolute;
  inset: 0;
  border: 2px solid #248cf9;
  background: rgba(36, 140, 249, 0.16);
  z-index: 1;
  pointer-events: none;
}

/* Matches DrawHealthBar(): left -6px to -2px bar, black 1px border, smooth green fill */
.esp-hp-bar {
  position: absolute;
  left: -10px;
  top: -1px;
  bottom: -1px;
  width: 5px;
  background: #141414;
  border: 1px solid #000000;
  display: flex;
  align-items: flex-end;
}

.esp-hp-fill {
  width: 100%;
  height: 88%;
  background: #40ff00;
}

/* Showcase & Module Cards */
.showcase-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.showcase-shot {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg);
}

.showcase-shot img {
  display: block;
  width: 100%;
  height: auto;
}

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

.mod-pill {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 9px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.module-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.module-card h3 {
  font-size: 1rem;
  color: var(--text);
}

.module-card p {
  font-size: 0.875rem;
  color: var(--muted);
}

/* FAQ & Setup */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.faq-item summary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--brand-blue);
  font-size: 1.125rem;
}

.faq-item[open] summary::after {
  content: "-";
}

.faq-item p {
  margin-top: 12px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.update-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.update-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.changelog-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--text-soft);
}
.changelog-list li {
  margin-bottom: 6px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-soft);
}

.input, .select, .textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  padding: 10px 12px;
  transition: border-color 0.15s ease;
}

.input::placeholder, .textarea::placeholder {
  color: #8f98a8;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: #6ea8ff;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-size: 0.875rem;
  background: var(--surface-2);
  color: var(--text);
}

.alert-error {
  background: rgba(197, 48, 48, 0.16);
  border-color: rgba(197, 48, 48, 0.55);
  color: #fed7d7;
}

.alert-ok {
  background: rgba(31, 138, 91, 0.16);
  border-color: rgba(31, 138, 91, 0.55);
  color: #c6f6d5;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 36px 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.footer-links a {
  color: var(--muted);
}
.footer-links a:hover {
  color: var(--text);
}

.legal-article {
  max-width: 72ch;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.legal-article section h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.legal-article section p,
.legal-article section ul {
  color: var(--text-soft);
  font-size: 0.9375rem;
}

.legal-article ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.legal-article li {
  margin-bottom: 6px;
}

/* Account Dashboard Download Card */
.account-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.account-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
}

.account-identity {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-title {
  font-size: 1.5rem;
}

.account-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.locked-notice-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-color: rgba(197, 48, 48, 0.55);
  background: rgba(197, 48, 48, 0.08);
}

.dashboard-grid[hidden],
.card[hidden],
[hidden] {
  display: none !important;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.download-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.download-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.download-title {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.download-version-accent {
  color: #6ea8ff;
}

.format-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.format-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.format-btn.active {
  background: var(--accent);
  color: #ffffff;
}

.detail-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.875rem;
  color: var(--text-soft);
  white-space: pre-wrap;
}

.cmd-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 900px) {
  .hero-grid,
  .esp-grid,
  .dashboard-grid,
  .feature-grid,
  .module-grid,
  .changelog-columns {
    grid-template-columns: 1fr;
  }
  h1 { font-size: 2rem; }
  .esp-stage { min-height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
