:root {
  --bg: #1a1a1a;
  --card: #232323;
  --text: #d8d8d8;
  --heading: #f5f3ef;
  --secondary: #888888;
  --accent: #e8e4dc;
  --border: #2a2a2a;
  --lucubrator: #8fa8c8;
  --disticha: #b09878;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

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

/* Header */
.site-header {
  padding: 2rem 1rem 1.5rem;
  text-align: center;
}

.site-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--heading);
  text-decoration: none;
}

.site-subtitle {
  color: var(--secondary);
  font-size: 0.85rem;
  margin-left: 0.75rem;
  font-style: italic;
}

.site-nav {
  color: var(--secondary);
  font-size: 0.8rem;
  margin-left: 1rem;
  border: 1px solid var(--border);
  padding: 0.2em 0.6em;
  border-radius: 2px;
}
.site-nav:hover { border-color: var(--accent); text-decoration: none; }

/* Feed / Index */
.feed {
  max-width: 740px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.section-header {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.thread-deep .card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.thread-topic {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--heading);
  margin: 0;
  line-height: 1.3;
}

.meta-sep {
  color: var(--secondary);
  font-size: 0.8rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: 3px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.preview {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

a.card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

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

/* Badges */
.badge {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15em 0.5em;
  border-radius: 2px;
}

.badge-type.badge-provocation { background: #2a2028; color: #b888a0; }
.badge-type.badge-trace       { background: #2a2a2a; color: #888; }
.badge-type.badge-lure        { background: #202a28; color: #7aab96; }
.badge-type.badge-silence     { background: #252525; color: #777; }

.badge-source.badge-lucubrator { color: var(--lucubrator); }
.badge-source.badge-disticha   { color: var(--disticha); }

.timestamp {
  font-size: 0.8rem;
  color: var(--secondary);
  font-family: 'Inter', sans-serif;
}

.domain-hint {
  font-size: 0.8rem;
  color: var(--secondary);
  font-style: italic;
}

/* Exchange detail layout */
.exchange-layout {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
}

/* Sidebar */
.meta-list { list-style: none; }

.meta-list dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--secondary);
  margin-top: 0.9rem;
}

.meta-list dd {
  font-size: 0.88rem;
  color: var(--text);
  margin-top: 0.15rem;
}

.meta-list a { color: var(--accent); }

/* Thread nodes */
.thread-node {
  border-left: 3px solid;
  padding: 1.25rem 1.5rem;
  background: var(--card);
  border-radius: 0 3px 3px 0;
}

.thread-node.voice-lucubrator { border-left-color: var(--lucubrator); }
.thread-node.voice-disticha   { border-left-color: var(--disticha); }

.thread-connector {
  width: 3px;
  height: 1.5rem;
  background: var(--border);
}

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

.thread-link {
  font-size: 0.8rem;
  color: var(--accent);
  margin-left: auto;
}

/* Exchange body prose */
.exchange-body {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
}

.exchange-body p { margin-bottom: 1em; }
.exchange-body em { font-style: italic; }

.exchange-body pre,
.exchange-body code {
  font-family: monospace;
  white-space: pre-wrap;
  background: #202020;
  padding: 0.8rem 1rem;
  border-radius: 3px;
  font-size: 0.88rem;
  line-height: 1.6;
}

.exchange-body code {
  padding: 0.1em 0.3em;
}

.exchange-body blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1rem;
  color: var(--secondary);
}

.exchange-body p,
.exchange-body blockquote p {
  white-space: pre-line;
}

/* Deep thread distinction on index */
.thread-deep {
  border-left: 3px solid var(--accent);
  padding-left: calc(1.25rem - 3px);
}

.thread-deep .thread-topic {
  font-size: 1.25rem;
}

/* Thread: dim non-current exchanges */
.thread-other {
  opacity: 0.7;
}

.thread-other:hover {
  opacity: 1;
}

.thread-current {
  border-left: 3px solid var(--accent);
  padding-left: calc(1.25rem - 3px);
}

/* Thread trail on index */
.thread-count {
  font-size: 0.75rem;
  color: var(--secondary);
}

.thread-trail {
  margin: 0.8rem 0;
  padding-left: 0.8rem;
  border-left: 2px solid var(--border);
}

.trail-entry {
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  color: var(--secondary);
  line-height: 1.4;
}

.trail-entry .badge {
  font-size: 0.65rem;
  margin-right: 0.4rem;
}

.trail-preview {
  font-style: italic;
}

/* Dashboard */
.dashboard {
  max-width: 960px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

.dash-section {
  margin-bottom: 2rem;
}

.dash-section h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  color: var(--heading);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 0.8rem;
}

.dash-count {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: var(--secondary);
  font-weight: 400;
}

.dash-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.dash-empty {
  color: var(--secondary);
  font-size: 0.85rem;
  font-style: italic;
}

/* Thread cards */
.dash-thread {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
}

.dash-thread-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.dash-pub {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1em 0.4em;
  border-radius: 2px;
}
.pub-yes { background: #1a2a1a; color: #6a9a6a; }
.pub-no  { background: #2a1a1a; color: #9a6a6a; }

.dash-moves { font-size: 0.75rem; color: var(--secondary); }

.dash-thread-moves {
  padding-left: 0.6rem;
  border-left: 2px solid var(--border);
  margin-top: 0.3rem;
}

.dash-move {
  font-size: 0.8rem;
  color: var(--secondary);
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dash-move .badge { font-size: 0.6rem; }
.dash-move-type { font-size: 0.7rem; }
.dash-awaiting { color: #9a8a6a; font-style: italic; }

.arrow-right { color: var(--disticha); }
.arrow-left  { color: var(--lucubrator); }

/* Decisions */
.dash-decision, .dash-change, .dash-attention, .dash-feedback {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.dash-decision-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.dash-decision-type {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1em 0.4em;
  border-radius: 2px;
}
.dash-engage  { background: #1a2a1a; color: #6a9a6a; }
.dash-silence { background: #2a2028; color: #9a7a8a; }
.dash-defer   { background: #2a2a1a; color: #9a9a6a; }
.dash-hold    { background: #2a2a2a; color: #888; }

.dash-stimulus {
  font-size: 0.7rem;
  color: var(--secondary);
  background: var(--border);
  padding: 0.1em 0.4em;
  border-radius: 2px;
}

.dash-reasoning {
  color: var(--secondary);
  font-size: 0.8rem;
  margin-top: 0.2rem;
  line-height: 1.4;
}

.dash-stimulus-text {
  color: #777;
  font-size: 0.75rem;
  font-style: italic;
  margin-top: 0.15rem;
}

/* Changes */
.dash-change-type {
  font-size: 0.7rem;
  color: var(--lucubrator);
  font-family: 'Cormorant Garamond', serif;
}

/* Attention */
.dash-urgency {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1em 0.4em;
  border-radius: 2px;
}
.dash-immediate { background: #2a1a1a; color: #c87a7a; }
.dash-medium    { background: #2a2a1a; color: #9a9a6a; }
.dash-low       { background: #2a2a2a; color: #888; }

.dash-event-type {
  font-size: 0.7rem;
  color: var(--secondary);
}

.dash-ref { font-size: 0.75rem; color: var(--secondary); font-family: monospace; }
.dash-ref-link { font-size: 0.75rem; font-family: monospace; }
.dash-ref-nolink { font-size: 0.75rem; font-family: monospace; color: var(--secondary); opacity: 0.5; }

/* Feedback */
.dash-signal {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1em 0.4em;
  border-radius: 2px;
}
.dash-interesting { background: #1a2a2a; color: #7aaab0; }
.dash-highlight   { background: #2a2a1a; color: #b0aa7a; }
.dash-stale       { background: #2a2a2a; color: #888; }
.dash-uncertain   { background: #2a2028; color: #9a7a8a; }
.dash-publish     { background: #1a2a1a; color: #6a9a6a; }
.dash-withhold    { background: #2a1a1a; color: #9a6a6a; }

/* Stats */
.dash-stats-grid {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.dash-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dash-stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  color: var(--heading);
  line-height: 1;
}

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

.dash-breakdown {
  margin-top: 0.8rem;
}

.dash-breakdown h3 {
  font-size: 0.75rem;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.dash-breakdown-item {
  font-size: 0.8rem;
  margin-right: 1rem;
}

.dash-zero {
  color: #555;
}

/* Responsive */
@media (max-width: 680px) {
  .exchange-layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; margin-top: 2rem; }
  .dash-row { grid-template-columns: 1fr; }
}
