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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --border: #2a2a3a;
  --border-subtle: #1e1e2e;
  --text-primary: #e4e4ef;
  --text-secondary: #9898b0;
  --text-muted: #6868808;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --green: #10b981;
  --yellow: #f59e0b;
  --red: #ef4444;
  --orange: #f97316;
  --cyan: #06b6d4;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* === NAVIGATION === */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 2rem;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo .icon { font-size: 1.3rem; }

.nav-links { display: flex; gap: 0.25rem; }

.nav-links a {
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* === LAYOUT === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero {
  padding: 5rem 0 3rem;
  text-align: center;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #e4e4ef 0%, #6366f1 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 2rem;
}

.hero .meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* === SECTIONS === */
section { padding: 3rem 0; }

.section-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-header p {
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

/* === EXECUTIVE SUMMARY CARDS === */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.25s;
}

.summary-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.summary-card .card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.summary-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.summary-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* === TABLES === */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead { background: var(--bg-card); }

th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

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

tr:hover td { background: rgba(99, 102, 241, 0.04); }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
}

.rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #000; }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #000; }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #a0522d); color: #fff; }
.rank-n { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); }

.stars-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--yellow);
}

/* === FRAMEWORK CARDS === */
.framework-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.25rem;
}

.framework-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.25s;
}

.framework-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.framework-card .card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.framework-card .card-header .emoji { font-size: 1.5rem; }

.framework-card .card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.framework-card .card-header .stars {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--yellow);
  font-weight: 600;
}

.framework-card .desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--accent-hover);
}

.tag.green { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.2); color: var(--green); }
.tag.cyan { background: rgba(6, 182, 212, 0.1); border-color: rgba(6, 182, 212, 0.2); color: var(--cyan); }

/* === CODE BLOCKS === */
.code-block {
  background: #0d0d14;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin: 1.25rem 0;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.code-header .lang { font-weight: 600; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.05em; }

.code-block pre {
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: #c4c4d4;
}

.code-block .kw { color: #c678dd; }
.code-block .fn { color: #61afef; }
.code-block .str { color: #98c379; }
.code-block .cm { color: #5c6370; font-style: italic; }
.code-block .num { color: #d19a66; }
.code-block .type { color: #e5c07b; }

/* === PRINCIPLE CARDS === */
.principle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border-left: 3px solid var(--accent);
}

.principle-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.principle-card h3 .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.principle-card p, .principle-card ul {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.principle-card ul { padding-left: 1.25rem; margin-top: 0.5rem; }
.principle-card li { margin-bottom: 0.3rem; }

.impact-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--green);
  margin-top: 0.75rem;
}

/* === ANTI-PATTERN TABLE === */
.anti-pattern-row { display: flex; gap: 1rem; margin-bottom: 0.75rem; }

/* === CHECKLIST === */
.checklist {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.checklist h3 { font-size: 1.1rem; margin-bottom: 1rem; }

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}

.checklist-item:last-child { border-bottom: none; }

.check-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  margin-top: 2px;
}

.checklist-item strong { color: var(--text-primary); }
.checklist-item span { color: var(--text-secondary); }

/* === FOOTER === */
.footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
  }
  .nav-toggle { display: block; }
  .hero h1 { font-size: 2rem; }
  .hero .subtitle { font-size: 1rem; }
  .framework-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .container { padding: 0 1rem; }
}
