/* === Fable 5 Explained — Dark Theme Stylesheet === */

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2129;
  --bg-elevated: #21262d;
  --border: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #d2991d;
  --accent-hover: #e3b341;
  --accent-dim: rgba(210, 153, 29, 0.15);
  --link: #58a6ff;
  --link-hover: #79c0ff;
  --danger: #f85149;
  --success: #3fb950;
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 820px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

/* === Nav === */
nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

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

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.15s;
}

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

/* === Hero === */
.hero {
  padding: 80px 24px 60px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #e6edf3 0%, #d2991d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 32px;
}

.hero-meta {
  display: flex;
  gap: 20px;
  justify-content: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.hero-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* === Content === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* === Cards === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin: 40px 0;
}

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

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--accent);
}

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.card a {
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.card a:hover {
  color: var(--link-hover);
}

/* === Alert Banner === */
.alert-banner {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 32px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.alert-banner .alert-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.alert-banner p {
  color: var(--danger);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* === Stats === */
.stats-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin: 32px 0;
}

.stat {
  flex: 1;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* === Article Typography === */
article {
  margin-top: 32px;
}

article h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.02em;
}

article h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 36px 0 12px;
}

article p {
  margin-bottom: 18px;
  color: var(--text-primary);
  font-size: 1.02rem;
}

article strong {
  color: var(--accent);
}

article ul, article ol {
  margin: 12px 0 24px 24px;
}

article li {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

article blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
  font-style: italic;
}

article blockquote p {
  margin: 0;
}

/* === Table === */
.benchmark-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 36px;
  font-size: 0.94rem;
}

.benchmark-table th {
  background: var(--bg-elevated);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.benchmark-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

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

.benchmark-table .highlight {
  color: var(--accent);
  font-weight: 700;
}

.benchmark-table .best {
  background: var(--accent-dim);
}

/* === Timeline === */
.timeline {
  margin: 32px 0;
  padding-left: 24px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  margin-bottom: 28px;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -31px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
}

.timeline-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.timeline-content {
  color: var(--text-primary);
  font-size: 0.98rem;
}

/* === Footer === */
footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer a {
  color: var(--link);
  text-decoration: none;
}

/* === Article Header === */
.article-header {
  padding: 60px 0 20px;
}

.article-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.article-header .byline {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 12px;
}

/* === CTA Button === */
.cta-btn {
  display: inline-block;
  background: var(--accent);
  color: #0d1117;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.15s, transform 0.1s;
}

.cta-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* === Responsive === */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero {
    padding: 48px 20px 36px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .nav-inner {
    padding: 0 16px;
  }

  .nav-links {
    gap: 12px;
  }

  .benchmark-table {
    font-size: 0.82rem;
  }

  .benchmark-table th,
  .benchmark-table td {
    padding: 8px 10px;
  }

  .article-header h1 {
    font-size: 1.7rem;
  }

  .stats-row {
    flex-direction: column;
  }
}

/* === Back to top === */
.back-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.1rem;
  transition: border-color 0.15s, color 0.15s;
}

.back-top:hover {
  border-color: var(--accent);
  color: var(--accent);
}
