/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 22px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: background var(--duration) var(--ease),
              border-color var(--duration) var(--ease),
              color var(--duration) var(--ease),
              transform 0.15s var(--ease);
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--white);
  color: var(--gray-950);
  border-color: var(--white);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2), 0 4px 16px rgba(255,255,255,0.08);
}

.btn--primary:hover {
  background: var(--gray-100);
  border-color: var(--gray-100);
  box-shadow: 0 4px 24px rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

.btn--secondary {
  background: var(--gray-800);
  color: var(--gray-200);
  border-color: var(--border-strong);
}

.btn--secondary:hover {
  background: var(--gray-700);
  color: var(--white);
}

.btn--ghost {
  background: transparent;
  color: var(--gray-300);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  background: var(--gray-800);
  color: var(--white);
}

.btn--sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.btn--lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn--block { width: 100%; }

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-400);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}

/* Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--gray-800);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
  margin-bottom: var(--space-lg);
}

.card__icon svg {
  width: 22px;
  height: 22px;
}

.card h3 {
  color: var(--white);
  margin-bottom: var(--space-sm);
}

.card p {
  font-size: 0.9375rem;
  margin-bottom: var(--space-lg);
}

/* Feature card (large) */
.feature-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  height: 100%;
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.feature-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.04), transparent 70%);
  pointer-events: none;
}

.feature-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.feature-card h3 {
  color: var(--white);
  font-size: 1.375rem;
}

/* Plugin preview */
.plugin-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.plugin-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
}

.plugin-item--featured {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(255,255,255,0.04);
  animation: floatY 6s ease-in-out infinite;
}

.plugin-item--offset {
  opacity: 0.7;
  transform: scale(0.98);
  margin-left: var(--space-xl);
}

@media (min-width: 640px) {
  .plugin-item--offset { margin-left: var(--space-2xl); }
}

.plugin-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.plugin-item__head h4 {
  font-size: 0.9375rem;
  color: var(--white);
}

.plugin-item p {
  font-size: 0.8125rem;
}

/* Toggle */
.toggle {
  width: 40px;
  height: 22px;
  border-radius: 100px;
  background: var(--white);
  position: relative;
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gray-950);
  transition: transform var(--duration) var(--ease);
}

.toggle--off {
  background: var(--gray-800);
  border: 1px solid var(--border);
}

.toggle--off::after {
  right: auto;
  left: 3px;
  background: var(--gray-500);
}

/* Stats */
.stat {
  text-align: center;
  padding: var(--space-lg);
}

.stat__number {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat__label {
  margin-top: var(--space-sm);
  font-size: 0.875rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-strong);
  color: var(--gray-300);
  animation: fadeUp 0.7s 0.2s var(--ease-out) both;
}

.badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--white);
  animation: pulseDot 2s ease-in-out infinite;
}

/* Code block */
.code-block {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.code-line {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.code-line:last-child { border-bottom: none; }

.code-line__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-400);
  flex-shrink: 0;
}

.code-line__hash { color: var(--gray-400); }
.code-line__msg { color: var(--gray-200); }

/* Search */
.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--white);
  font-size: 0.9375rem;
  transition: border-color var(--duration) var(--ease);
}

.search-input::placeholder { color: var(--gray-500); }

.search-input:focus {
  outline: none;
  border-color: var(--gray-500);
}

.search-wrap {
  position: relative;
  max-width: 400px;
}

.search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--gray-500);
}

/* Plugin grid list */
.plugin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .plugin-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .plugin-grid { grid-template-columns: repeat(3, 1fr); }
}

.plugin-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}

.plugin-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.plugin-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.plugin-card__tags {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  margin-top: var(--space-sm);
}

.tag {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--gray-800);
  color: var(--gray-400);
}

/* Theme card */
.theme-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color var(--duration) var(--ease);
}

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

.theme-card__preview {
  height: 140px;
  background: linear-gradient(135deg, var(--gray-800), var(--gray-900));
}

.theme-card__body {
  padding: var(--space-lg);
}

.theme-card__body h4 {
  color: var(--white);
  margin-bottom: var(--space-xs);
}

/* Team member */
.team-card {
  text-align: center;
  padding: var(--space-xl);
}

.team-card__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gray-800);
  border: 2px solid var(--border-strong);
  margin: 0 auto var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-400);
}

.team-card h4 { color: var(--white); margin-bottom: var(--space-xs); }
.team-card p { font-size: 0.875rem; }

/* Download box */
.download-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl) var(--space-2xl);
  text-align: center;
}

.download-box h2 {
  color: var(--white);
  margin-bottom: var(--space-md);
}

.download-box p {
  margin-bottom: var(--space-xl);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.download-box__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
}

/* Cloud diagram */
.cloud-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xl);
  padding: var(--space-xl);
}

.cloud-node {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 18px;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--gray-300);
}

.cloud-node--main {
  background: var(--gray-800);
  border-color: var(--border-strong);
  color: var(--white);
  position: relative;
}

.cloud-node--main::before,
.cloud-node--main::after {
  content: '';
  position: absolute;
  top: 100%;
  width: 1px;
  height: 32px;
  background: var(--gray-700);
}

.cloud-node--main::before { right: 28%; transform: rotate(20deg); transform-origin: top; }
.cloud-node--main::after { left: 28%; transform: rotate(-20deg); transform-origin: top; }

.cloud-devices {
  display: flex;
  gap: var(--space-2xl);
}

/* Docs sidebar layout */
.docs-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
}

@media (min-width: 900px) {
  .docs-layout {
    grid-template-columns: 240px 1fr;
    align-items: start;
  }
}

.docs-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: sticky;
  top: calc(var(--header-h) + var(--space-lg));
}

.docs-sidebar a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}

.docs-sidebar a:hover,
.docs-sidebar a.is-active {
  background: var(--gray-800);
  color: var(--white);
}

.docs-content h2 {
  color: var(--white);
  margin: var(--space-2xl) 0 var(--space-md);
}

.docs-content h2:first-child { margin-top: 0; }

.docs-content p {
  margin-bottom: var(--space-md);
}

.docs-content ul {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
  list-style: disc;
  color: var(--text-muted);
}

.docs-content li { margin-bottom: var(--space-sm); }

/* Privacy prose */
.prose h2 {
  color: var(--white);
  margin: var(--space-2xl) 0 var(--space-md);
  font-size: 1.25rem;
}

.prose h2:first-child { margin-top: 0; }

.prose p {
  margin-bottom: var(--space-md);
  line-height: 1.8;
}

.prose ul {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
  list-style: disc;
  color: var(--text-muted);
}

.prose li { margin-bottom: var(--space-sm); }
