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

:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --bg-section: #111111;
  --red: #e11d48;
  --red-dim: #be123c;
  --red-glow: rgba(225, 29, 72, 0.15);
  --text: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #666;
  --border: #222;
  --border-light: #2a2a2a;
  --code-bg: #1a1a1a;
  --radius: 12px;
  --radius-sm: 8px;
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 2px 7px;
  border-radius: 4px;
  color: #e0e0e0;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  overflow-x: auto;
  margin: 16px 0;
  line-height: 1.55;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
  color: #d4d4d4;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.92em;
}

table td, table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

table tr:last-child td { border-bottom: none; }
table td:first-child { white-space: nowrap; }

ul, ol { padding-left: 24px; margin: 12px 0; }
li { margin: 6px 0; color: var(--text-secondary); }
li strong { color: var(--text); }

h4 {
  font-size: 1.05em;
  font-weight: 600;
  margin: 28px 0 10px;
  color: var(--text);
}

/* === NAV === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.3s, backdrop-filter 0.3s;
}

.nav-scrolled {
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo-img { height: 52px; }

.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--text-secondary); font-size: 0.9em; font-weight: 500; text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 4px; }

.hero-badge {
  display: inline-block;
  font-size: 0.85em;
  font-weight: 500;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 20px;
  padding: 5px 18px;
  margin-bottom: 20px;
  letter-spacing: 0.03em;
}

/* === HERO === */
.hero {
  padding: 160px 0 100px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, var(--red-glow) 0%, transparent 60%);
}

.hero-title {
  font-size: clamp(2.2em, 5vw, 3.6em);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: 1.15em;
  color: var(--text-secondary);
  margin: 20px auto 36px;
  max-width: 600px;
  line-height: 1.7;
}

.hero-actions { display: flex; gap: 14px; justify-content: center; margin-bottom: 50px; }

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95em;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary { background: var(--red); color: white; }
.btn-primary:hover { background: var(--red-dim); text-decoration: none; }

.btn-outline { border: 1px solid var(--border-light); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--text-muted); text-decoration: none; }

.hero-comparison {
  max-width: 700px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.comparison-row {
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.9em;
  color: var(--text-muted);
}

.comparison-row.highlight {
  background: var(--red-glow);
  color: var(--text);
  border-top: 1px solid var(--border);
}

.comparison-label { font-weight: 700; min-width: 120px; text-align: left; }
.comparison-flow { font-family: 'JetBrains Mono', monospace; font-size: 0.88em; }
.arrow { color: var(--red); margin: 0 4px; }

/* === SECTIONS === */
.section { padding: 100px 0; }
.section-dark { background: var(--bg-section); }

.section-title {
  font-size: clamp(1.6em, 3vw, 2.2em);
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 50px;
  font-size: 1.05em;
}

.subsection-title {
  font-size: 1.3em;
  font-weight: 600;
  text-align: center;
  margin: 60px 0 30px;
}

/* === FEATURES GRID === */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s, background 0.2s;
}

.feature-card:hover { border-color: var(--border-light); background: var(--bg-card-hover); }

.feature-icon { font-size: 1.8em; margin-bottom: 14px; }

.feature-card h3 { font-size: 1.05em; font-weight: 600; margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: 0.9em; line-height: 1.6; }

/* === PILLARS === */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.pillar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 22px;
}

.pillar-name { font-weight: 700; font-size: 1em; color: var(--red); margin-bottom: 6px; }
.pillar-desc { font-size: 0.9em; color: var(--text-secondary); margin-bottom: 8px; }
.pillar-who { font-size: 0.82em; color: var(--text-muted); font-style: italic; }

/* === LIFECYCLE === */
.lifecycle {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.lifecycle-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  min-width: 140px;
  flex: 1;
  max-width: 180px;
}

.step-num {
  width: 28px;
  height: 28px;
  background: var(--red);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85em;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-name { font-weight: 600; font-size: 0.95em; margin-bottom: 6px; }
.step-desc { font-size: 0.8em; color: var(--text-muted); line-height: 1.5; }

.lifecycle-arrow { color: var(--red); font-size: 1.4em; padding-top: 28px; }

/* === QUICK START STEPS === */
.steps { display: flex; flex-direction: column; gap: 20px; max-width: 750px; margin: 0 auto; }

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  position: relative;
}

.step-card-num {
  position: absolute;
  top: -14px;
  left: 24px;
  width: 28px;
  height: 28px;
  background: var(--red);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85em;
  font-weight: 700;
}

.step-card h3 { font-size: 1.05em; font-weight: 600; margin-bottom: 10px; }
.step-card p { color: var(--text-secondary); font-size: 0.9em; margin-top: 8px; }
.step-card pre { margin: 10px 0 0; }

/* === PLATFORMS === */
.platforms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.platform-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.platform-card h3 { font-size: 1.05em; font-weight: 600; margin-bottom: 10px; }
.platform-card p { color: var(--text-secondary); font-size: 0.88em; line-height: 1.6; }
.platform-card pre { margin: 8px 0 12px; }

.widget-section {
  margin-top: 50px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
}

.widget-section p { color: var(--text-secondary); font-size: 0.92em; margin: 8px 0; }

/* === WORKSPACE === */
.workspace-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

.workspace-tree {
  position: sticky;
  top: 100px;
}

.workspace-tree code { font-size: 0.82em; line-height: 1.7; }

.explain-item { margin-bottom: 20px; }
.explain-item strong { font-size: 0.95em; display: block; margin-bottom: 4px; }
.explain-item p { color: var(--text-secondary); font-size: 0.88em; line-height: 1.6; }

/* === DOCS GRID === */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.docs-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.docs-card:hover { border-color: var(--red); background: var(--bg-card-hover); text-decoration: none; transform: translateY(-2px); }

.docs-card h3 { font-size: 1.05em; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.docs-card p { color: var(--text-secondary); font-size: 0.88em; line-height: 1.6; margin: 0; }
.docs-card .docs-card-arrow { color: var(--red); font-size: 0.85em; margin-top: 12px; display: block; }

/* === DOC PAGE LAYOUT === */
.doc-page { padding: 120px 0 80px; min-height: 100vh; }
.doc-page .container { max-width: 820px; }

.doc-breadcrumb { margin-bottom: 30px; font-size: 0.88em; }
.doc-breadcrumb a { color: var(--text-muted); }
.doc-breadcrumb a:hover { color: var(--text); }
.doc-breadcrumb span { color: var(--text-muted); margin: 0 8px; }

.doc-content h1 { font-size: 2em; font-weight: 700; margin-bottom: 16px; }
.doc-content h2 { font-size: 1.4em; font-weight: 600; margin: 40px 0 14px; padding-top: 20px; border-top: 1px solid var(--border); }
.doc-content h2:first-of-type { border-top: none; padding-top: 0; }
.doc-content h3 { font-size: 1.1em; font-weight: 600; margin: 28px 0 10px; }
.doc-content h4 { font-size: 1em; margin: 24px 0 8px; }
.doc-content p { color: var(--text-secondary); font-size: 0.95em; margin: 10px 0; line-height: 1.75; }
.doc-content > p:first-of-type { font-size: 1.08em; color: var(--text); margin-bottom: 20px; }

.doc-nav-bottom {
  display: flex;
  justify-content: space-between;
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
  gap: 16px;
}

.doc-nav-link {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 24px;
  text-decoration: none;
  transition: border-color 0.2s;
  flex: 1;
  max-width: 48%;
}

.doc-nav-link:hover { border-color: var(--red); text-decoration: none; }
.doc-nav-link .doc-nav-label { font-size: 0.78em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.doc-nav-link .doc-nav-title { font-size: 0.95em; font-weight: 600; color: var(--text); margin-top: 4px; }
.doc-nav-link.next { text-align: right; margin-left: auto; }

/* === EXAMPLE === */
.example-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  margin-bottom: 24px;
}

.example-card h3 { font-size: 1.2em; font-weight: 600; margin-bottom: 14px; }
.example-card p { color: var(--text-secondary); font-size: 0.92em; margin-bottom: 12px; }
.example-card ol { margin: 14px 0; }
.example-card li { color: var(--text-secondary); font-size: 0.92em; }

.use-cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }

.use-case {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.use-case strong { font-size: 0.95em; display: block; margin-bottom: 6px; }
.use-case p { color: var(--text-muted); font-size: 0.85em; margin: 0; }

/* === PHILOSOPHY === */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.philosophy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.philosophy-card h3 { font-size: 1.05em; font-weight: 600; margin-bottom: 10px; color: var(--red); }
.philosophy-card p { color: var(--text-secondary); font-size: 0.9em; line-height: 1.65; }

/* === FOOTER === */
.footer {
  border-top: 1px solid var(--border);
  padding: 60px 0 0;
  background: var(--bg);
}

.footer-inner { display: flex; justify-content: space-between; gap: 40px; }
.footer-brand p { color: var(--text-muted); font-size: 0.88em; margin-top: 10px; }
.footer-logo { height: 56px; }
.footer-links { display: flex; gap: 60px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 { font-size: 0.85em; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.footer-col a { color: var(--text-secondary); font-size: 0.88em; text-decoration: none; }
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  font-size: 0.82em;
  color: var(--text-muted);
}

/* === MOBILE === */
@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 60px; right: 24px; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 24px; gap: 14px; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }

  .hero { padding: 120px 0 70px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .comparison-row { flex-direction: column; gap: 6px; padding: 12px 18px; }
  .comparison-label { min-width: auto; }

  .features-grid { grid-template-columns: 1fr; }
  .platforms-grid { grid-template-columns: 1fr; }
  .philosophy-grid { grid-template-columns: 1fr; }
  .workspace-layout { grid-template-columns: 1fr; }
  .workspace-tree { position: static; }

  .lifecycle { flex-direction: column; align-items: center; }
  .lifecycle-arrow { transform: rotate(90deg); padding: 0; }
  .lifecycle-step { max-width: 100%; width: 100%; }

  .docs-nav { gap: 4px; }
  .docs-tab { padding: 8px 14px; font-size: 0.82em; }
  .doc-panel { padding: 24px; }

  .footer-inner { flex-direction: column; }
  .footer-links { flex-direction: column; gap: 30px; }

  .section { padding: 60px 0; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.8em; }
  .comparison-flow { font-size: 0.78em; }
  .step-card { padding: 24px 20px; }
}
