:root {
  /* Color Tokens */
  --bg-main: #000000;
  --bg-surface: #0A0A0C;
  --bg-card: #121215;
  --bg-card-hover: #1C1C22;
  --bg-glass: rgba(18, 18, 21, 0.75);
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.25);
  --border-focus: #FFFFFF;
  
  --text-primary: #FFFFFF;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  
  --accent: #FFFFFF;
  --accent-text: #000000;
  --accent-glow: rgba(255, 255, 255, 0.15);
  
  /* Radii & Layout */
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --radius-pill: 9999px;

  --max-width: 1040px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 0.25s;
}

/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--duration) var(--ease-out);
}

a:hover {
  opacity: 0.8;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

/* ── Layout ────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 60px 0;
}

.section-header {
  margin-bottom: 40px;
  text-align: center;
}

.section-header h2 {
  font-size: clamp(26px, 4vw, 36px);
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 580px;
  margin: 0 auto;
}

/* ── Navbar ────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: all var(--duration) var(--ease-out);
  background: transparent;
}

.navbar.scrolled {
  padding: 14px 0;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.navbar-logo {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.navbar-links a {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease-out);
}

.navbar-links a:hover,
.navbar-links a.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}

/* ── Hero ──────────────────────────────────────────────────────── */
.hero {
  padding: 160px 0 60px;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.hero h1 {
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.04em;
}

.hero p {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
}

/* Search */
.hero-search {
  max-width: 580px;
  margin: 0 auto 20px;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 20px 24px 20px 56px;
  font-size: 16px;
  font-family: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  outline: none;
  transition: all var(--duration) var(--ease-out);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

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

.hero-search input:focus {
  border-color: var(--border-focus);
  background: var(--bg-surface);
  box-shadow: 0 0 25px var(--accent-glow);
}

.hero-search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 22px;
}

.quick-tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 600px;
  margin: 0 auto;
}

.tag-btn {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
}

.tag-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* ── Topics Grid Cards ─────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  transition: all var(--duration) var(--ease-out);
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.card-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.card h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

.card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.card-arrow {
  position: absolute;
  top: 28px;
  right: 28px;
  color: var(--text-muted);
  transition: transform var(--duration) var(--ease-out), color var(--duration) var(--ease-out);
}

.card:hover .card-arrow {
  color: var(--text-primary);
  transform: translateX(4px);
}

/* ── Detailed Help Topics ──────────────────────────────────────── */
.topic-detail {
  padding: 40px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  margin-bottom: 28px;
  scroll-margin-top: 100px;
  transition: all var(--duration) var(--ease-out);
}

.topic-detail:hover {
  border-color: var(--border-hover);
}

.topic-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.topic-detail-header h2 {
  font-size: 24px;
}

.topic-content h3 {
  font-size: 18px;
  margin: 24px 0 12px;
  color: var(--text-primary);
}

.topic-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.7;
}

.topic-content ul {
  list-style: none;
  margin-bottom: 20px;
}

.topic-content li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.topic-content li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.callout {
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--text-primary);
  border-radius: var(--radius-md);
  margin: 24px 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.callout strong {
  color: var(--text-primary);
}

.callout.warning {
  border-left-color: #FF5252;
  background: rgba(255, 82, 82, 0.08);
}

.callout.warning strong {
  color: #FF5252;
}

/* ── FAQ Accordion ─────────────────────────────────────────────── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--duration) var(--ease-out);
}

.faq-item:hover {
  border-color: var(--border-hover);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  cursor: pointer;
  user-select: none;
  gap: 16px;
}

.faq-question h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.faq-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  transition: all var(--duration) var(--ease-out);
  flex-shrink: 0;
}

.faq-item.open .faq-toggle {
  transform: rotate(45deg);
  background: var(--accent);
  color: var(--accent-text);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-out);
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-answer-inner {
  padding: 0 28px 24px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

/* ── Form Controls (Contact / Report Bug) ──────────────────────── */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 640px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  transition: all var(--duration) var(--ease-out);
}

.form-control:focus {
  outline: none;
  background: var(--bg-main);
  border-color: var(--border-focus);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 140px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

/* ── Creator Profile Component ─────────────────────────────────── */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 48px;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.profile-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--border-color);
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.profile-avatar .material-icons-round {
  font-size: 54px;
  color: var(--text-secondary);
}

.profile-bio {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 32px;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 36px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration) var(--ease-out);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.3);
  opacity: 1;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
}

/* ── Footer ────────────────────────────────────────────────────── */
.footer {
  padding: 60px 0 40px;
  border-top: 1px solid var(--border-color);
  margin-top: 80px;
  background: var(--bg-surface);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 14px;
}

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

.footer-copy {
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Legal / Privacy Page ──────────────────────────────────────── */
.legal-meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.topic-detail-header:has(.legal-section-number) > div:last-child {
  position: relative;
}

.legal-section-number {
  position: absolute;
  bottom: 100%;
  left: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  white-space: nowrap;
}

.legal-toc {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
}

.legal-toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.legal-toc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease-out);
  text-decoration: none;
}

.legal-toc-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  opacity: 1;
}

.legal-toc-item .material-icons-round {
  font-size: 18px;
  color: var(--text-muted);
  transition: color var(--duration) var(--ease-out);
}

.legal-toc-item:hover .material-icons-round {
  color: var(--text-primary);
}

.legal-table-wrapper {
  overflow-x: auto;
  margin: 16px 0 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.legal-table thead th {
  background: rgba(255, 255, 255, 0.04);
  padding: 14px 18px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-color);
}

.legal-table tbody td {
  padding: 14px 18px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  line-height: 1.6;
}

.legal-table tbody tr:last-child td {
  border-bottom: none;
}

.legal-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.legal-security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.legal-security-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--duration) var(--ease-out);
}

.legal-security-item:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.05);
}

.legal-security-item > .material-icons-round {
  font-size: 24px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 2px;
}

.legal-security-item strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.legal-security-item p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.legal-code-block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ── Dependencies Page ─────────────────────────────────────────── */
.dep-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 560px;
  margin: 0 auto;
}

.dep-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all var(--duration) var(--ease-out);
}

.dep-stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.dep-stat-number {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.dep-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.dep-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin-bottom: 16px;
  transition: all var(--duration) var(--ease-out);
}

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

.dep-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.dep-card-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dep-card-title h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.dep-publisher {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.dep-version {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.dep-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.dep-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.dep-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  transition: all var(--duration) var(--ease-out);
  text-decoration: none;
}

.dep-links a:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.06);
  opacity: 1;
}

.dep-links a .material-icons-round {
  font-size: 16px;
}

/* License Badges */
.license-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.license-mit {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.license-bsd {
  background: rgba(168, 85, 247, 0.15);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.license-apache {
  background: rgba(249, 115, 22, 0.15);
  color: #FB923C;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

/* ── Animations ────────────────────────────────────────────────── */
.animate-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all var(--duration) var(--ease-out);
    z-index: 999;
  }

  .navbar-links.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .navbar-links a {
    font-size: 20px;
    padding: 12px 32px;
  }

  .mobile-toggle {
    display: block;
    position: relative;
    z-index: 1000;
  }

  .hero, .page-header {
    padding: 130px 0 40px !important;
  }

  .topic-detail {
    padding: 28px 20px;
  }

  .form-card, .profile-card {
    padding: 28px 20px;
  }

  .dep-stats-grid {
    grid-template-columns: 1fr;
  }
}
