:root {
  --bg-base: #090a0c;
  --bg-surface: #111318;
  --bg-card: #161920;
  --bg-hover: #1c2028;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-focus: rgba(0, 230, 118, 0.4);
  --text-primary: #f0f2f5;
  --text-secondary: #a1a5ad;
  --text-muted: #6b7280;
  --accent: #00e676;
  --accent-hover: #00c853;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --font-mono: "SF Mono", "Fira Code", Consolas, monospace;
  --container-max: 1200px;
  --spacing-section: clamp(3rem, 6vw, 6rem);
  --spacing-block: clamp(2rem, 4vw, 3.5rem);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 2rem);
}

/* Typography */
h1, h2, h3, h4 {
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Layout Helpers */
.grid-2 { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }
.grid-3 { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-4 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

.section {
  padding-block: var(--spacing-section);
}

.section-header {
  margin-bottom: var(--spacing-block);
  max-width: 800px;
}

.section-header p {
  font-size: 1.1rem;
  max-width: 600px;
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(9, 10, 12, 0.85);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.nav-list {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  font-size: 0.95rem;
}

.nav-list a {
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.nav-list a:hover, .nav-list a[aria-current="page"] {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-list a[aria-current="page"] {
  color: var(--accent);
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--accent);
  color: #000;
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--text-secondary);
  background: var(--bg-hover);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: rgba(255, 255, 255, 0.1);
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: block;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  font-size: 0.95rem;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
}

td {
  color: var(--text-secondary);
}

tr:last-child td {
  border-bottom: none;
}

/* FAQ Details/Summary */
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 0;
  background: var(--bg-surface);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

/* SVG Animation Classes */
@keyframes drawSegment {
  0%, 100% { stroke-dashoffset: 0; }
  50% { stroke-dashoffset: 0.15; }
}

@keyframes floatNode {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.seg-line {
  stroke-dasharray: 0.08 0.2;
  stroke-dashoffset: 0;
  animation: drawSegment 6s ease-in-out infinite;
}

.node-dot {
  animation: floatNode 4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.node-dot:nth-child(odd) {
  animation-duration: 5s;
  animation-delay: 1s;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}
