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

:root {
  --bg: #09090b;
  --card: #09090b;
  --border: #27272a;
  --border-2: #3f3f46;
  --fg: #fafafa;
  --fg-2: #a1a1aa;
  --fg-3: #71717a;
  --fg-4: #52525b;
  --radius: 6px;
  --radius-lg: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --nav-height: 56px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Layout */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header-container {
  display: flex;
  height: var(--nav-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.header-nav a {
  display: flex;
  color: var(--fg-3);
  transition: color 0.15s;
}

.header-nav a:hover {
  color: var(--fg);
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--fg-2);
  cursor: pointer;
  padding: 0.25rem;
}

.mobile-toggle:hover {
  color: var(--fg);
}

.site-layout {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.site-sidebar {
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  width: 240px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 2.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-group h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--fg-3);
  padding: 0.375rem 0.5rem;
  margin-left: -0.5rem;
  border-radius: var(--radius);
  transition:
    background 0.15s,
    color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--fg);
  background: #18181b;
}

.site-main {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 0 5rem;
  margin-left: 3rem;
}

/* UI Elements */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--fg-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  height: 32px;
  padding: 0 0.875rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font);
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
}

.btn-primary:hover {
  opacity: 0.9;
}

/* Home Sections */
.hero {
  padding: 4rem 0 6rem;
}

.hero-svg {
  width: 48px;
  height: 48px;
  margin-bottom: 2rem;
  color: var(--fg);
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  max-width: 640px;
}

.hero-sub {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: var(--fg-2);
  max-width: 520px;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.section {
  padding: 4rem 0;
}

.section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}

.section > p {
  color: var(--fg-3);
  font-size: 0.875rem;
  margin-bottom: 2.5rem;
  max-width: 600px;
}

/* Feature Grid */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.feat-cell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.feat-icon {
  margin-bottom: 1rem;
  color: var(--fg);
}

.feat-cell h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.feat-cell > p {
  font-size: 0.8125rem;
  color: var(--fg-3);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.feat-cell ul {
  list-style: none;
}

.feat-cell ul li {
  font-size: 0.75rem;
  color: var(--fg-4);
  padding: 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.feat-cell ul li svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-cell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.stat-n {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 0.25rem;
}

.stat-l {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-3);
}

/* Changelog specific */
.cl-head {
  padding: 4rem 0 6rem;
}

.cl-head h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 0.5rem;
}

.cl-head p {
  color: var(--fg-2);
  font-size: 1.125rem;
}

.ver {
  margin-bottom: 4rem;
  scroll-margin-top: calc(var(--nav-height) + 2rem);
}

.ver-h {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.ver-h h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.ver-date {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-4);
  display: block;
  margin-bottom: 1rem;
}

.ver-p {
  font-size: 0.875rem;
  color: var(--fg-2);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.ver-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.ver-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.ver-box h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ver-box ul {
  list-style: none;
}

.ver-box ul li {
  font-size: 0.8125rem;
  color: var(--fg-3);
  padding: 0.25rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.ver-box ul li svg {
  width: 14px;
  height: 14px;
  margin-top: 0.125rem;
  flex-shrink: 0;
  color: var(--fg-4);
}

.ver-sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 4rem;
}

/* Settings */
.settings-head {
  padding: 4rem 0 3rem;
}

.settings-head h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 0.5rem;
}

.settings-head p {
  color: var(--fg-2);
  font-size: 1.125rem;
}

.login-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  max-width: 480px;
}

.login-card p {
  color: var(--fg-3);
  font-size: 0.875rem;
  margin: 1rem 0 1.5rem;
  line-height: 1.6;
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  cursor: pointer;
  background: #5865f2;
  color: #fff;
  transition: background 0.15s;
}

.btn-discord:hover {
  background: #4752c4;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 32px;
  padding: 0 0.75rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font);
  border: 1px solid var(--border);
  cursor: pointer;
  background: transparent;
  color: var(--fg-3);
  transition: all 0.15s;
}

.btn-logout:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #18181b;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-3);
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-info strong {
  font-size: 0.875rem;
  display: block;
}

.user-info span {
  font-size: 0.75rem;
  color: var(--fg-4);
  font-family: var(--mono);
}

.settings-section {
  margin-bottom: 3rem;
}

.settings-section h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.settings-section > p {
  color: var(--fg-4);
  font-size: 0.8125rem;
  margin-bottom: 1.25rem;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  transition: border-color 0.15s;
}

.setting-row:hover {
  border-color: var(--border-2);
}

.setting-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.setting-label svg {
  flex-shrink: 0;
  color: var(--fg-3);
}

.setting-text h4 {
  font-size: 0.8125rem;
  font-weight: 500;
}

.setting-text p {
  font-size: 0.75rem;
  color: var(--fg-4);
  margin-top: 0.125rem;
}

.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: #27272a;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--fg-4);
  transition:
    transform 0.2s,
    background 0.2s;
}

.toggle input:checked + .toggle-track {
  background: #fafafa;
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(16px);
  background: #09090b;
}

.select-wrap {
  position: relative;
  flex-shrink: 0;
}

.select-wrap select {
  appearance: none;
  background: #18181b;
  color: var(--fg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.375rem 2rem 0.375rem 0.625rem;
  font-size: 0.75rem;
  font-family: var(--mono);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

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

.select-wrap::after {
  content: "";
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--fg-4);
  pointer-events: none;
}

/* Responsive Container */
@media (max-width: 992px) {
  .site-sidebar {
    width: 200px;
  }

  .site-main {
    margin-left: 2rem;
  }
}

@media (max-width: 768px) {
  .site-header-container,
  .site-layout {
    padding: 0 1.25rem;
  }

  .mobile-toggle {
    display: flex;
  }

  .site-sidebar {
    display: none;
  }

  .site-sidebar.open {
    display: flex;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: calc(100vh - var(--nav-height));
    background: rgba(9, 9, 11, 0.98);
    backdrop-filter: blur(12px);
    z-index: 40;
    padding: 2rem 1.25rem;
    border-right: none;
  }

  .site-main {
    margin-left: 0;
    padding-top: 1.5rem;
  }
}
