/* TEI - Tesla Educational Index */
/* Tesla-inspired dark theme, mobile-first, glanceable */

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

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --border: #222;
  --text: #e8e8e8;
  --text-dim: #888;
  --accent: #e82127;
  --accent-glow: rgba(232, 33, 39, 0.15);
  --link: #ccc;
  --radius: 12px;
}

html { font-size: 18px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Header */
.site-header {
  text-align: center;
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.site-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

.site-header .subtitle {
  color: var(--text-dim);
  font-size: 1rem;
  font-weight: 400;
}

.logo-mark {
  color: var(--accent);
  font-weight: 800;
}

/* Sections */
.section {
  margin-bottom: 3rem;
}

.section h2 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Card list */
.card-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-list a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}

.card-list a:hover,
.card-list a:focus {
  border-color: var(--accent);
  background: var(--accent-glow);
  outline: none;
}

.card-num {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 2rem;
  text-align: right;
  flex-shrink: 0;
}

.card-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.card-body p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Detail pages */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.page-header .breadcrumb {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.page-header .breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
}

.page-header .breadcrumb a:hover { color: var(--text); }

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header .tag {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.content {
  font-size: 1.1rem;
  line-height: 1.8;
}

.content h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}

.content ul, .content ol {
  margin: 0.75rem 0 0.75rem 1.5rem;
}

.content li {
  margin-bottom: 0.4rem;
}

.content p {
  margin-bottom: 1rem;
}

.content .instruction-block {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  font-size: 1.05rem;
  white-space: pre-wrap;
}

/* Run page combo header */
.combo-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.combo-header .tag { margin-top: 0; }

/* Back link */
.back-link {
  display: inline-block;
  margin-top: 2.5rem;
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  transition: border-color 0.2s, color 0.2s;
}

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

/* Responsive */
@media (max-width: 600px) {
  html { font-size: 16px; }
  .container { padding: 1.5rem 1rem 3rem; }
  .site-header { padding: 2rem 0 1.5rem; }
  .site-header h1 { font-size: 1.8rem; }
  .card-list a { padding: 0.85rem 1rem; }
}

/* Plain text block for AI parsing */
.ai-text {
  font-family: inherit;
  white-space: pre-wrap;
  line-height: 1.7;
}
