/* === Design Tokens === */
:root {
  --color-text: #1A1A1A;
  --color-secondary: #737373;
  --color-muted: #A3A3A3;
  --color-bg: #FFFFFF;
  --color-surface: #F6F6F6;
  --color-border: rgba(0, 0, 0, 0.1);
  --color-border-subtle: rgba(0, 0, 0, 0.03);
  --color-divider: rgba(0, 0, 0, 0.06);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

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

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Page Layout === */
.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 110px 80px;
}

.main-content {
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* === Header === */
.header {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.avatar {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: default;
  margin-left: -6px;
  margin-top:36px;
}

.avatar svg {
  width: 72px;
  height: 72px;
  color: var(--color-muted);
}

/* Eye tracking */
#rai-eye-l, #rai-eye-r {
  transition: ry 0.08s ease;
}

.title-text {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--color-text);
  padding-top: 32px;
  padding-left: 8px;
  padding-right: 8px;
}

.tagline {
  font-size: 16px;
  color: var(--color-secondary);
  line-height: 1.7;
  padding-left: 8px;
  padding-right: 8px;
}

.rai-letter {
  font-family: 'Georgia', 'Times New Roman', serif;
  color: var(--color-text);
}

/* === Section Divider === */
.section-divider {
  display: flex;
  align-items: center;
  gap: 16px;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-divider);
}

.divider-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.divider-arrow {
  font-size: 12px;
  color: var(--color-muted);
  flex-shrink: 0;
  margin-left: -10px;
}

/* === Install Widget === */
.install-widget {
  display: inline-flex;
  align-items: center;
  background: var(--color-surface);
  border-radius: 100px;
  padding: 4px;
  gap: 0;
  max-width: 100%;
}

.toggle-group {
  display: flex;
}

.toggle-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  padding: 8px 20px;
  border-radius: 100px;
  background: transparent;
  color: var(--color-secondary);
  transition: all 0.2s ease;
}

.toggle-btn.active {
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.widget-divider {
  width: 1px;
  height: 20px;
  background: var(--color-divider);
  margin: 0 4px;
}

.cmd-display {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px 8px 16px;
  min-width: 0;
  overflow: hidden;
}

.cmd-text {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  color: var(--color-muted);
  transition: color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.copy-btn:hover {
  color: var(--color-text);
}

.copy-btn.copied {
  color: rgba(34, 197, 94, 0.8);
  transform: scale(1.2);
}

.copy-btn svg {
  width: 16px;
  height: 16px;
  transition: opacity 0.15s ease;
}

/* === Feed List === */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.feed-item {
  display: flex;
  gap: 16px;
  width: 100%;
}

.feed-icon {
  width: 40px;
  height: 40px;
  background: var(--color-surface);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feed-icon svg {
  width: 20px;
  height: 20px;
  color: var(--color-text);
}

.item-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.item-body {
  font-size: 15px;
  color: var(--color-secondary);
  line-height: 1.5;
}

.code-block {
  background: var(--color-surface);
  border-radius: 16px;
  border: 1px solid var(--color-border-subtle);
  padding: 18px;
  margin-top: 8px;
  overflow-x: auto;
}

.code-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.code-group + .code-group {
  margin-top: 12px;
}

.code-line {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text);
  display: block;
  white-space: pre;
}

.code-output {
  color: var(--color-secondary);
}

.code-added {
  background: rgba(34, 197, 94, 0.1);
  color: var(--color-text);
  font-weight: 500;
  margin: 0 -20px;
  padding: 2px 20px;
  border-left: 3px solid rgba(34, 197, 94, 0.6);
}

.code-muted {
  color: var(--color-muted);
}

/* === Features === */
.features {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.feature-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: var(--color-surface);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-icon svg {
  width: 20px;
  height: 20px;
  color: var(--color-text);
}

.feature-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feature-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.feature-desc {
  font-size: 15px;
  color: var(--color-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Feature icon color variants */
.feature-icon-good svg {
  color: rgba(34, 197, 94, 0.7);
}

.feature-icon-not svg {
  color: rgba(239, 68, 68, 0.6);
}


/* === Quick Start === */
.quickstart {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.qs-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qs-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.qs-desc {
  font-size: 14px;
  color: var(--color-secondary);
  line-height: 1.5;
  margin: 0;
}

.qs-desc code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--color-surface);
  padding: 2px 6px;
  border-radius: 4px;
}

.qs-table {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}

.qs-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.qs-row:last-child {
  border-bottom: none;
}

.qs-flag {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  min-width: 160px;
}

.qs-flag-desc {
  font-size: 14px;
  color: var(--color-secondary);
}

/* === Footer === */
.footer-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: none;
  color: var(--color-secondary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.footer-btn:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

.footer-btn svg {
  width: 18px;
  height: 18px;
}

/* === Theme Switch === */
.theme-switch {
  display: inline-flex;
  align-items: center;
  background: var(--color-surface);
  border-radius: 8px;
  padding: 2px;
  gap: 0;
  margin-left: auto;
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-btn:hover {
  color: var(--color-text);
}

.theme-btn.active {
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.theme-btn svg {
  width: 14px;
  height: 14px;
}

/* === Dark Theme === */
[data-theme="dark"] {
  --color-text: #E5E5E5;
  --color-secondary: #A3A3A3;
  --color-muted: #737373;
  --color-bg: #171717;
  --color-surface: #262626;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-border-subtle: rgba(255, 255, 255, 0.05);
  --color-divider: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .toggle-btn.active {
  background: var(--color-surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .theme-btn.active {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .copy-btn.copied {
  color: rgba(34, 197, 94, 0.9);
}

.docs-theme-switch {
  margin-top: auto;
  padding-top: 24px;
}

/* === Responsive === */
@media (max-width: 768px) {
  .page {
    padding: 48px 32px;
  }
}

@media (max-width: 480px) {
  .page {
    padding: 32px 20px;
  }

  .title-text {
    font-size: 24px;
  }

  .install-widget {
    flex-direction: column;
    border-radius: 16px;
    align-items: stretch;
    width: 100%;
  }

  .toggle-group {
    justify-content: center;
  }

  .widget-divider {
    width: 100%;
    height: 1px;
    margin: 0;
  }

  .cmd-display {
    justify-content: center;
    padding: 12px 16px;
  }

  .feed-item {
    flex-direction: column;
    gap: 12px;
  }

  .footer-buttons {
    flex-direction: column;
  }

  .footer-btn {
    justify-content: center;
  }
}

/* === Docs Page === */
.docs-page {
  display: flex;
  min-height: 100vh;
}

.docs-sidebar {
  width: 260px;
  padding: 24px;
  border-right: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.docs-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
  transition: color 0.2s ease;
}

.docs-back:hover {
  color: var(--color-text);
}

.docs-back svg {
  width: 16px;
  height: 16px;
}

.docs-nav-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.docs-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.doc-link {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--color-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s ease;
}

.doc-link:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

.doc-link.active {
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 500;
}

.docs-content {
  flex: 1;
  padding: 48px;
  max-width: 720px;
  min-width: 0;
}

/* Markdown rendered content */
.docs-content h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--color-text);
}

.docs-content h2 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--color-text);
}

.docs-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--color-text);
}

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

.docs-content ul, .docs-content ol {
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-secondary);
  margin-bottom: 12px;
  padding-left: 24px;
}

.docs-content li {
  margin-bottom: 4px;
}

.docs-content code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--color-surface);
  padding: 2px 6px;
  border-radius: 4px;
}

.docs-content pre {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 16px;
  border: 1px solid var(--color-border-subtle);
}

.docs-content pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
}

.docs-content a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.docs-content a:hover {
  color: var(--color-secondary);
}

.docs-content blockquote {
  border-left: 3px solid var(--color-border);
  padding-left: 16px;
  margin-bottom: 12px;
  color: var(--color-secondary);
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 14px;
}

.docs-content th, .docs-content td {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  text-align: left;
}

.docs-content th {
  background: var(--color-surface);
  font-weight: 600;
}

.docs-loading {
  color: var(--color-muted);
  font-size: 15px;
  padding: 24px 0;
}

/* Docs responsive */
@media (max-width: 768px) {
  .docs-page {
    flex-direction: column;
  }

  .docs-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: 16px 20px;
  }

  .docs-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .doc-link {
    padding: 6px 10px;
    font-size: 13px;
  }

  .docs-content {
    padding: 24px 20px;
  }
}
