/* Colony Library Shared Styles */
:root {
  --bg: #0a0a0f;
  --card: rgba(20, 15, 30, 0.9);
  --border: rgba(139, 92, 246, 0.2);
  --text: #e8e4f0;
  --muted: #8b8598;
  --purple: #a78bfa;
  --pink: #f472b6;
  --cyan: #00E1E6;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f97316;
  --colony-color: var(--purple); /* Override per colony */
}

/* Colony-specific colors */
.colony-alpha { --colony-color: #8b5cf6; --border: rgba(139, 92, 246, 0.2); }
.colony-beta { --colony-color: #22c55e; --border: rgba(34, 197, 94, 0.2); }
.colony-gamma { --colony-color: #f59e0b; --border: rgba(245, 158, 11, 0.2); }
.colony-delta { --colony-color: #ef4444; --border: rgba(239, 68, 68, 0.2); }
.colony-epsilon { --colony-color: #ec4899; --border: rgba(236, 72, 153, 0.2); }
.colony-eta { --colony-color: #a78bfa; --border: rgba(139, 92, 246, 0.2); }
.colony-supernova { --colony-color: #fbbf24; --border: rgba(251, 191, 36, 0.2); }

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

body {
  font-family: 'Crimson Pro', Georgia, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.9;
  min-height: 100vh;
}

.bg-pattern {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: 
    radial-gradient(ellipse at 20% 30%, color-mix(in srgb, var(--colony-color) 10%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, color-mix(in srgb, var(--colony-color) 6%, transparent) 0%, transparent 50%);
  z-index: -1;
}

.container {
  max-width: 750px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.library-nav {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
}

.library-nav .back-link {
  font-size: 0.9rem;
}

/* Navigation */
.back-link {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.3s;
}

.back-link:hover { color: var(--colony-color); }

.breadcrumb {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s;
}

.breadcrumb a:hover { color: var(--cyan); }

.breadcrumb span { margin: 0 0.5rem; }

/* Header */
header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

header.centered { text-align: center; }

.colony-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.2rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--colony-color), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

h1.large { font-size: 2.5rem; }

.subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  font-style: italic;
}

/* Story Content */
.story {
  margin-bottom: 3rem;
}

.story p {
  margin-bottom: 1.5rem;
  font-size: 1.15rem;
}

.story p:first-of-type::first-letter {
  font-size: 3.5rem;
  float: left;
  line-height: 1;
  padding-right: 0.5rem;
  color: var(--colony-color);
  font-weight: 600;
}

.highlight {
  color: var(--colony-color);
  font-style: italic;
}

.fact { color: var(--cyan); }

.question {
  color: var(--colony-color);
  filter: brightness(1.2);
}

.pheromone {
  display: block;
  font-family: 'Inter', monospace;
  font-size: 0.85rem;
  color: var(--cyan);
  background: rgba(0, 225, 230, 0.1);
  border-left: 3px solid var(--cyan);
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

/* Colony Voice Section */
.colony-voice {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--colony-color);
  border-radius: 0 12px 12px 0;
  padding: 2rem;
  margin-bottom: 2rem;
}

.colony-voice h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--colony-color);
  margin-bottom: 1.5rem;
}

.voice-text p {
  margin-bottom: 1rem;
  font-size: 1.05rem;
  line-height: 1.9;
  color: rgba(232, 228, 240, 0.9);
}

.voice-text p:first-child {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.voice-text p:last-child {
  margin-bottom: 0;
  font-style: italic;
  color: var(--colony-color);
}

.voice-text em {
  color: var(--cyan);
  font-style: italic;
}

/* Index/TOC Styles */
.toc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.toc h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 1rem;
}

.entry-list {
  list-style: none;
}

.entry-list li {
  border-bottom: 1px solid var(--border);
}

.entry-list li:last-child { border-bottom: none; }

.entry-list a {
  display: block;
  padding: 1rem 0;
  text-decoration: none;
  transition: all 0.3s;
}

.entry-list a:hover {
  padding-left: 0.5rem;
}

.entry-title {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  transition: color 0.3s;
}

.entry-list a:hover .entry-title { color: var(--cyan); }

.entry-desc {
  color: var(--muted);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
}

.entry-date {
  color: var(--colony-color);
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  margin-top: 0.5rem;
  opacity: 0.7;
}

/* Navigation between entries */
.entry-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
}

.entry-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s;
}

.entry-nav a:hover { color: var(--cyan); }

.entry-nav .next { text-align: right; }

/* Footer */
footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
}

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

footer a:hover { text-decoration: underline; }

.author {
  margin-top: 0.5rem;
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 600px) {
  .container { padding: 2rem 1.25rem; }
  h1 { font-size: 1.8rem; }
  h1.large { font-size: 2rem; }
  .story p { font-size: 1.05rem; }
  .story p:first-of-type::first-letter { font-size: 2.8rem; }
  .entry-nav { flex-direction: column; gap: 1rem; }
  .entry-nav .next { text-align: left; }
}
