/* ==========================================================================
   RyuSim Design System
   A complete CSS stylesheet for the RyuSim landing page.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens
   -------------------------------------------------------------------------- */
:root {
  --ryu-primary: #27272a;
  --ryu-accent: #84cc16;
  --ryu-accent-hover: #65a30d;
  --ryu-bg: #fafafa;
  --ryu-surface: #ffffff;
  --ryu-text: #18181b;
  --ryu-muted: #71717a;
  --ryu-border: #e4e4e7;
  --ryu-code-bg: #f0f0f2;
  --ryu-code-text: #27272a;
  --ryu-radius: 15px;
  --ryu-radius-sm: 8px;
  --ryu-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --ryu-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --ryu-font-heading: "Inter", system-ui, -apple-system, sans-serif;
  --ryu-font-body: "Inter", system-ui, -apple-system, sans-serif;
  --ryu-font-code: "JetBrains Mono", "Fira Code", monospace;
  --ryu-max-width: 1120px;
  --ryu-nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--ryu-font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ryu-text);
  background-color: var(--ryu-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--ryu-accent-hover);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--ryu-accent);
}

img {
  max-width: 100%;
  display: block;
}

/* --------------------------------------------------------------------------
   3. Layout Utilities
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--ryu-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.section {
  padding-top: 80px;
  padding-bottom: 80px;
}

.section-sm {
  padding-top: 48px;
  padding-bottom: 48px;
}

/* --------------------------------------------------------------------------
   4. Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 250, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ryu-border);
  height: var(--ryu-nav-height);
  display: flex;
  align-items: center;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--ryu-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.nav-logo {
  display: flex;
  flex-direction: column;
  font-size: 20px;
  font-weight: 700;
  color: var(--ryu-text);
  text-decoration: none;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.nav-logo:hover {
  color: var(--ryu-text);
}

.nav-version {
  font-size: 11px;
  font-weight: 500;
  color: var(--ryu-accent);
  letter-spacing: 0;
}

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

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ryu-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover {
  color: var(--ryu-text);
}

.nav-links a.active {
  color: var(--ryu-text);
  border-bottom-color: var(--ryu-accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 32px;
  height: 32px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--ryu-text);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* --------------------------------------------------------------------------
   5. Mobile Navigation
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--ryu-nav-height);
    left: 0;
    right: 0;
    background: var(--ryu-surface);
    border-bottom: 1px solid var(--ryu-border);
    padding: 16px 24px;
    gap: 16px;
    box-shadow: var(--ryu-shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 16px;
    padding: 8px 0;
    border-bottom: none;
  }
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: var(--ryu-radius-sm);
  font-family: var(--ryu-font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-accent {
  background-color: var(--ryu-accent);
  color: var(--ryu-primary);
  border-color: var(--ryu-accent);
}

.btn-accent:hover {
  background-color: var(--ryu-accent-hover);
  border-color: var(--ryu-accent-hover);
  color: var(--ryu-primary);
  box-shadow: var(--ryu-shadow);
}

.btn-outline {
  background-color: transparent;
  color: var(--ryu-primary);
  border-color: var(--ryu-primary);
}

.btn-outline:hover {
  background-color: var(--ryu-primary);
  color: var(--ryu-surface);
}

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
.hero {
  text-align: center;
  padding-top: 100px;
  padding-bottom: 80px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ryu-accent-hover);
  background-color: rgba(132, 204, 22, 0.12);
  margin-bottom: 24px;
}

.hero h1 {
  font-family: var(--ryu-font-heading);
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  color: var(--ryu-text);
  margin-bottom: 20px;
}

.hero .subtitle {
  font-size: 18px;
  color: var(--ryu-muted);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 36px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   8. Hero Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .hero {
    padding-top: 64px;
    padding-bottom: 48px;
  }

  .hero h1 {
    font-size: 36px;
    letter-spacing: -1px;
  }

  .hero .subtitle {
    font-size: 16px;
  }
}

/* --------------------------------------------------------------------------
   9. Code Block
   -------------------------------------------------------------------------- */
.code-block {
  display: flex;
  align-items: center;
  background-color: var(--ryu-code-bg);
  color: var(--ryu-code-text);
  font-family: var(--ryu-font-code);
  font-size: 14px;
  line-height: 1.6;
  border-radius: var(--ryu-radius);
  padding: 16px 20px;
  gap: 12px;
  overflow-x: auto;
}

.code-block code {
  flex: 1;
  white-space: nowrap;
}

.code-block .copy-btn {
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.06);
  border: none;
  color: var(--ryu-code-text);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--ryu-radius-sm);
  cursor: pointer;
  font-family: var(--ryu-font-body);
  transition: background-color 0.15s ease;
}

.code-block .copy-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.install-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ryu-muted);
  text-align: center;
}

.code-block-multi {
  position: relative;
  background-color: var(--ryu-code-bg);
  color: var(--ryu-code-text);
  font-family: var(--ryu-font-code);
  font-size: 14px;
  line-height: 1.7;
  border-radius: var(--ryu-radius);
  padding: 20px 24px;
  overflow-x: auto;
}

.code-block-multi code {
  white-space: pre;
}

.code-block-multi .copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.06);
  border: none;
  color: var(--ryu-code-text);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--ryu-radius-sm);
  cursor: pointer;
  font-family: var(--ryu-font-body);
  transition: background-color 0.15s ease;
}

.code-block-multi .copy-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* --------------------------------------------------------------------------
   10. Feature Cards
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background-color: var(--ryu-surface);
  border-radius: var(--ryu-radius);
  box-shadow: var(--ryu-shadow);
  border: 1px solid var(--ryu-border);
  padding: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--ryu-shadow-lg);
}

.card h3 {
  font-family: var(--ryu-font-heading);
  font-size: 17px;
  font-weight: 700;
  color: var(--ryu-text);
  margin-bottom: 8px;
}

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

/* --------------------------------------------------------------------------
   11. Feature Matrix
   -------------------------------------------------------------------------- */
.matrix {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--ryu-radius);
  overflow: hidden;
  background-color: var(--ryu-surface);
  box-shadow: var(--ryu-shadow);
  border: 1px solid var(--ryu-border);
}

.matrix th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ryu-muted);
  padding: 14px 20px;
  text-align: left;
  background-color: var(--ryu-bg);
  border-bottom: 1px solid var(--ryu-border);
}

.matrix td {
  font-size: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--ryu-border);
  color: var(--ryu-text);
}

.matrix tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.badge-stable {
  background-color: rgba(132, 204, 22, 0.15);
  color: #4d7c0f;
}

.badge-early {
  background-color: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.badge-planned {
  background-color: rgba(113, 113, 122, 0.15);
  color: #52525b;
}

/* --------------------------------------------------------------------------
   12. Section Headings
   -------------------------------------------------------------------------- */
.section-heading {
  text-align: center;
  margin-bottom: 48px;
}

.section-heading h2 {
  font-family: var(--ryu-font-heading);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ryu-text);
  margin-bottom: 12px;
}

.section-heading p {
  font-size: 16px;
  color: var(--ryu-muted);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--ryu-border);
  text-align: center;
  padding: 32px 24px;
}

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

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  list-style: none;
  margin-bottom: 12px;
}

.footer-links a {
  font-size: 13px;
  color: var(--ryu-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* --------------------------------------------------------------------------
   14. Content Pages
   -------------------------------------------------------------------------- */
.content-page {
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
  padding: 48px 24px 80px;
}

.content-page h1,
.docs-content h1 {
  font-family: var(--ryu-font-heading);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--ryu-text);
  margin-bottom: 12px;
}

.content-page h2,
.docs-content h2 {
  font-family: var(--ryu-font-heading);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ryu-text);
  margin-top: 48px;
  margin-bottom: 16px;
}

.content-page h3,
.docs-content h3 {
  font-family: var(--ryu-font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--ryu-text);
  margin-top: 32px;
  margin-bottom: 12px;
}

.content-page p,
.docs-content p {
  margin-bottom: 16px;
  line-height: 1.7;
}

.content-page ul,
.content-page ol,
.docs-content ul,
.docs-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
  line-height: 1.7;
}

.content-page li,
.docs-content li {
  margin-bottom: 6px;
}

.content-page code,
.docs-content code {
  font-family: var(--ryu-font-code);
  font-size: 0.9em;
  background-color: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ryu-text);
}

.content-page .code-block code,
.content-page .code-block-multi code,
.docs-content .code-block code,
.docs-content .code-block-multi code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: var(--ryu-code-text);
  font-size: 14px;
}

.page-subtitle {
  font-size: 18px;
  color: var(--ryu-muted);
  margin-bottom: 0;
}

.callout {
  border-left: 4px solid var(--ryu-accent);
  background: var(--ryu-surface);
  padding: 20px 24px;
  border-radius: 0 var(--ryu-radius) var(--ryu-radius) 0;
  margin: 24px 0;
}

.content-page pre,
.docs-content pre {
  margin-bottom: 24px;
}

.content-page pre code,
.docs-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

/* --------------------------------------------------------------------------
   15. Grid Helpers
   -------------------------------------------------------------------------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   16. Platform Cards
   -------------------------------------------------------------------------- */
.platform-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  background-color: var(--ryu-surface);
  border-radius: var(--ryu-radius);
  border: 1px solid var(--ryu-border);
}

.platform-card .platform-icon,
.platform-card .card-icon {
  flex-shrink: 0;
  margin-bottom: 0;
  font-size: 28px;
}

.platform-card h3 {
  font-family: var(--ryu-font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--ryu-text);
  margin-bottom: 4px;
}

.platform-card p {
  font-size: 14px;
  color: var(--ryu-muted);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   17. Documentation Grid
   -------------------------------------------------------------------------- */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.docs-card {
  display: block;
  padding: 32px;
  background: var(--ryu-surface);
  border: 1px solid var(--ryu-border);
  border-radius: var(--ryu-radius);
  box-shadow: var(--ryu-shadow);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  color: var(--ryu-text);
}

.docs-card:hover {
  box-shadow: var(--ryu-shadow-lg);
  border-color: var(--ryu-accent);
  color: var(--ryu-text);
}

.docs-card h3 {
  margin-bottom: 8px;
  font-size: 1.25rem;
  font-weight: 700;
}

.docs-card p {
  color: var(--ryu-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   18. Documentation Sidebar Layout
   -------------------------------------------------------------------------- */
.docs-layout {
  display: flex;
  max-width: var(--ryu-max-width);
  margin: 0 auto;
  padding: 40px 24px;
  gap: 48px;
}

.docs-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--ryu-nav-height) + 24px);
  align-self: flex-start;
  max-height: calc(100vh - var(--ryu-nav-height) - 48px);
  overflow-y: auto;
}

.docs-sidebar h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ryu-muted);
  margin-bottom: 12px;
}

.docs-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

.docs-sidebar a {
  display: block;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ryu-muted);
  text-decoration: none;
  border-radius: var(--ryu-radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

.docs-sidebar a:hover {
  background: var(--ryu-code-bg);
  color: var(--ryu-text);
}

.docs-sidebar a.active {
  background: var(--ryu-code-bg);
  color: var(--ryu-text);
  font-weight: 600;
  border-left: 3px solid var(--ryu-accent);
}

.docs-content {
  flex: 1;
  min-width: 0;
}

/* Reuse content-page styles for docs-content */
.docs-content h1 { margin-bottom: 8px; }
.docs-content .page-subtitle { margin-bottom: 40px; color: var(--ryu-muted); font-size: 1.1rem; }
.docs-content h2 { margin-top: 48px; margin-bottom: 16px; }
.docs-content h3 { margin-top: 32px; margin-bottom: 12px; }

@media (max-width: 768px) {
  .docs-layout {
    flex-direction: column;
    gap: 24px;
  }
  .docs-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--ryu-border);
    padding-bottom: 16px;
  }
  .docs-sidebar ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
}
