:root {
  --background: #f8f8fb;
  --foreground: #111116;
  --card: #ffffff;
  --muted: #f1f1f5;
  --muted-foreground: #6b7280;
  --primary: #6366f1;
  --primary-foreground: #ffffff;
  --secondary: #f1f1f5;
  --secondary-foreground: #111116;
  --border: #e4e4ea;
  --ring: #6366f1;
  --radius: 0.625rem;
  --hero-glow: rgba(99, 102, 241, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0a0a0d;
    --foreground: #e6e6ea;
    --card: #131318;
    --muted: #1b1b22;
    --muted-foreground: #9a9aa5;
    --secondary: #1b1b22;
    --secondary-foreground: #e6e6ea;
    --border: #23232b;
    --hero-glow: rgba(99, 102, 241, 0.18);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.border-b {
  border-bottom: 1px solid var(--border);
}

.border-t {
  border-top: 1px solid var(--border);
}

header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--background) 80%, transparent);
  backdrop-filter: blur(12px);
}

header .bar {
  display: flex;
  height: 3.5rem;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand img {
  width: 28px;
  height: 28px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-lg {
  height: 2.75rem;
  padding: 0 1.35rem;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
}

.btn-ghost {
  background: transparent;
}

.btn-ghost:hover,
.btn-outline:hover,
.btn-secondary:hover {
  background: var(--muted);
}

main {
  flex: 1;
}

.hero-section {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: -20% 20% auto;
  height: 55%;
  background: radial-gradient(ellipse at center, var(--hero-glow), transparent 70%);
  pointer-events: none;
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: calc(100vh - 3.5rem);
  justify-content: center;
  padding-top: 3.5rem;
  padding-bottom: 4rem;
}

@media (min-width: 640px) {
  .hero {
    padding-top: 4rem;
    padding-bottom: 5rem;
  }
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  animation: rise 0.55s ease both;
}

.hero-brand img {
  width: 56px;
  height: 56px;
}

.hero-brand h1 {
  margin: 0;
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

@media (min-width: 640px) {
  .hero-brand h1 {
    font-size: 4rem;
  }
}

.hero-headline {
  margin: 0;
  max-width: 36rem;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.35;
  animation: rise 0.55s ease 0.08s both;
}

@media (min-width: 640px) {
  .hero-headline {
    font-size: 1.5rem;
  }
}

.hero-subtitle {
  margin: 0;
  max-width: 36rem;
  font-size: 1.05rem;
  color: var(--muted-foreground);
  animation: rise 0.55s ease 0.16s both;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  animation: rise 0.55s ease 0.24s both;
}

.stats {
  display: grid;
  gap: 1rem;
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

@media (min-width: 640px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.stat-card:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  transform: translateY(-2px);
}

.card-label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.card-value {
  margin: 0;
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.features {
  padding-top: 3.5rem;
  padding-bottom: 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.features > .intro h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.features > .intro p {
  margin: 0.5rem 0 0;
  max-width: 36rem;
  color: var(--muted-foreground);
}

.group {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.group h3 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.grid {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.module-card {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.module-card:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.module-title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.module-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.55;
}

footer .bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

@media (min-width: 640px) {
  footer .bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

footer nav {
  gap: 1rem;
}

footer a:hover {
  color: var(--foreground);
}

.legal-layout {
  display: grid;
  gap: 2rem;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

@media (min-width: 1024px) {
  .legal-layout {
    grid-template-columns: 220px 1fr;
  }
}

.legal-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.legal-nav-title {
  margin: 0 0 0.5rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.legal-nav a {
  border-radius: calc(var(--radius) - 2px);
  padding: 0.375rem 0.5rem;
}

.legal-nav a:hover,
.legal-nav a.active {
  background: var(--muted);
}

.legal-article h1 {
  margin: 0 0 0.5rem;
  font-size: 1.875rem;
  font-weight: 600;
}

.legal-updated {
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.legal-section {
  margin-bottom: 1.75rem;
}

.legal-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.legal-section p,
.legal-section li {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.legal-section ul {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
}

.legal-lines {
  margin-bottom: 0.75rem;
}

/* Docs + FAQ */
.doc-layout {
  display: grid;
  gap: 2rem;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

@media (min-width: 1024px) {
  .doc-layout {
    grid-template-columns: 240px 1fr;
    align-items: start;
  }
}

.doc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.875rem;
}

@media (min-width: 1024px) {
  .doc-nav {
    position: sticky;
    top: 4.5rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
  }
}

.doc-nav-title {
  margin: 1rem 0 0.35rem;
  padding: 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.doc-nav-title:first-child {
  margin-top: 0;
}

.doc-nav a {
  border-radius: calc(var(--radius) - 2px);
  padding: 0.35rem 0.5rem;
  color: var(--muted-foreground);
}

.doc-nav a:hover {
  background: var(--muted);
  color: var(--foreground);
}

.doc-article {
  min-width: 0;
}

.doc-article h1 {
  margin: 0 0 0.5rem;
  font-size: 1.875rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.doc-lead {
  margin: 0 0 2rem;
  font-size: 1.05rem;
  color: var(--muted-foreground);
  max-width: 46rem;
}

.doc-section {
  scroll-margin-top: 4.5rem;
  margin-bottom: 2.75rem;
}

.doc-section h2 {
  margin: 0 0 0.35rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.doc-section h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.doc-section p,
.doc-section li {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  line-height: 1.65;
}

.doc-section p {
  margin: 0 0 0.85rem;
  max-width: 46rem;
}

.doc-section ul {
  margin: 0 0 0.95rem;
  padding-left: 1.25rem;
  max-width: 46rem;
}

.doc-section li {
  margin-bottom: 0.4rem;
}

.doc-section strong {
  color: var(--foreground);
  font-weight: 600;
}

code,
.doc-section code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  padding: 0.1rem 0.35rem;
  color: var(--foreground);
  white-space: nowrap;
}

.doc-callout {
  margin: 0 0 1rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary) 5%, transparent);
  font-size: 0.9rem;
  color: var(--muted-foreground);
  max-width: 46rem;
}

.doc-callout strong {
  color: var(--foreground);
}

.cmd-table-wrap {
  max-width: 46rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 1rem;
}

.cmd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.cmd-table th,
.cmd-table td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.cmd-table th {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  background: var(--muted);
}

.cmd-table tr:last-child td {
  border-bottom: none;
}

.cmd-table td:first-child {
  white-space: nowrap;
}

.cmd-table td code {
  white-space: nowrap;
}

.cmd-table td.cmd-desc {
  color: var(--muted-foreground);
}

.faq {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 48rem;
}

.faq-group-title {
  margin: 1.75rem 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.faq-group-title:first-child {
  margin-top: 0;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.faq-item[open] {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 550;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--muted-foreground);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item .faq-body {
  padding: 0 1.15rem 1.1rem;
}

.faq-item .faq-body p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--muted-foreground);
  line-height: 1.65;
}

.faq-item .faq-body p:last-child {
  margin-bottom: 0;
}

.faq-item .faq-body a {
  color: var(--primary);
}

.faq-item .faq-body a:hover {
  text-decoration: underline;
}

.doc-cta {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-brand,
  .hero-headline,
  .hero-subtitle,
  .actions,
  .stat-card,
  .module-card,
  .btn {
    animation: none !important;
    transition: none !important;
  }
}
