/* H-Cell Chronicle — Delta Green dark theme */

:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-panel: #1c2128;
  --border: #30363d;
  --text: #c9d1d9;
  --text-dim: #8b949e;
  --heading: #e6edf3;
  --accent: #2ea043;
  --accent-hover: #3fb950;
  --accent-dim: #1a5c2a;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Navigation ── */

.site-nav {
  background-color: var(--bg-card);
  border-bottom: 2px solid var(--accent);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.nav-title {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: bold;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.1em;
  padding: 1rem 0;
  white-space: nowrap;
}

.site-nav ul {
  display: flex;
  list-style: none;
  gap: 0;
  flex-wrap: wrap;
}

.site-nav ul li a {
  display: block;
  padding: 1rem 0.75rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.15s;
}

.site-nav ul li a:hover,
.site-nav ul li a.active {
  color: var(--accent);
}

/* ── Main layout ── */

.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  color: var(--text-dim);
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

/* ── Typography ── */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Courier New', monospace;
  color: var(--heading);
  font-weight: bold;
  line-height: 1.3;
}

h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.4rem; margin: 1.5rem 0 0.5rem; }
h3 { font-size: 1.15rem; margin: 1.25rem 0 0.5rem; color: var(--accent); }
h4 { font-size: 1rem; margin: 1rem 0 0.25rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }

p { margin-bottom: 1rem; }

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

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.25rem; }

strong { color: var(--heading); }
em { color: var(--text-dim); font-style: italic; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

blockquote {
  border-left: 3px solid var(--accent-dim);
  padding-left: 1rem;
  color: var(--text-dim);
  font-style: italic;
  margin: 1rem 0;
}

/* ── Page header ── */

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

.page-header h1 {
  font-size: 2rem;
}

.aliases {
  color: var(--text-dim);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.module-name {
  color: var(--accent);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

.op-date {
  color: var(--text-dim);
  font-size: 0.875rem;
}

.breadcrumb {
  color: var(--text-dim);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.breadcrumb a {
  color: var(--text-dim);
}

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

/* ── Operation two-column layout ── */

.operation-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 720px) {
  .operation-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Entity sidebar ── */

.entity-sidebar {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  padding: 1rem;
  font-size: 0.875rem;
  position: sticky;
  top: 1rem;
}

.entity-sidebar h3 {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.75rem;
  margin-top: 0;
}

.sidebar-group {
  margin-bottom: 1rem;
}

.sidebar-group h4 {
  font-size: 0.7rem;
  color: var(--accent-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.sidebar-group ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.sidebar-group ul li {
  padding: 0.15rem 0;
  border-bottom: 1px solid var(--bg-panel);
}

/* ── Agent profile box ── */

.profile-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.profile-box p {
  margin-bottom: 0.4rem;
}

.profile-box .label {
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  margin-right: 0.5rem;
}

.profile-text {
  color: var(--text-dim);
  font-style: italic;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* ── Operations list ── */

.operations-list {
  margin: 1.5rem 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
}

.operations-list h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.operations-list ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.operations-list li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--bg-panel);
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

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

.module-tag {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: 'Courier New', monospace;
}

/* ── Child locations ── */

.child-locations {
  margin: 1.5rem 0;
}

.child-locations h3 {
  margin-top: 0;
}

/* ── Section list page ── */

.entry-list {
  list-style: none;
  padding-left: 0;
}

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

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

.entry-list li a {
  font-size: 1rem;
}

/* ── Home page dashboard ── */

.home-hero {
  border-left: 4px solid var(--accent);
  padding: 1.5rem 1.75rem;
  background-color: var(--bg-card);
  margin-bottom: 2rem;
}

.hero-title {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.hero-intro p {
  color: var(--text-dim);
  font-style: italic;
  font-size: 1.05rem;
  margin-bottom: 0;
  line-height: 1.7;
}

.home-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background-color: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.stat-box {
  flex: 1 1 auto;
  min-width: 80px;
  background-color: var(--bg-card);
  padding: 1rem 0.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-number {
  font-family: 'Courier New', monospace;
  font-size: 1.75rem;
  font-weight: bold;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.home-body {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.section-heading {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  margin-top: 0;
}

.latest-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  padding: 1.25rem 1.5rem;
}

.latest-meta {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.latest-date {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.latest-module {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'Courier New', monospace;
}

.latest-title {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
  color: var(--heading);
}

.latest-title a {
  color: var(--heading);
}

.latest-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.latest-excerpt {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.latest-link {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--accent);
}

.latest-link:hover {
  color: var(--accent-hover);
}

.recent-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.recent-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--bg-panel);
}

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

.recent-date {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.recent-module {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: 'Courier New', monospace;
  margin-left: auto;
  flex-shrink: 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1px;
  background-color: var(--border);
  border: 1px solid var(--border);
}

.category-card {
  background-color: var(--bg-card);
  padding: 1.25rem 1rem;
  text-align: center;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: background-color 0.15s;
}

.category-card:hover {
  background-color: var(--bg-panel);
  text-decoration: none;
}

.category-count {
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent);
  line-height: 1;
}

.category-name {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@media (max-width: 600px) {
  .home-stats {
    flex-wrap: wrap;
  }
  .stat-box {
    min-width: 70px;
  }
  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

/* ── Timeline ── */

.timeline-content h2 {
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
  margin-top: 2rem;
}

/* ── Page content general ── */

.page-content {
  line-height: 1.7;
}

.page-content h2 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}
