/* echo.surf — dark essay aesthetic */

:root {
  --bg: #111114;
  --surface: #18181f;
  --card: #22222a;
  --accent: #c44b2f;
  --dim: #f1ece5;
  --text: #e8e4de;
  --muted: #a59d94;
  --border: #34343d;
}

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

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

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

/* ── nav ── */
nav {
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.8rem;
}
nav .logo {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
}
nav a { color: var(--muted); }
nav a:hover { color: var(--accent); }
nav a.active { color: var(--accent); }

/* hamburger toggle - hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--dim);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px 14px;
  font-family: inherit;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
}
.nav-toggle:hover { color: var(--accent); }
.nav-toggle:active { background: var(--surface); }

/* nav links wrapper */
.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

/* ── mobile nav ── */
@media (max-width: 768px) {
  nav {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    gap: 12px;
    padding: 12px 16px;
  }
  
  .nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  
  nav .logo {
    display: inline-block !important;
    color: #fff !important;
    font-size: 1rem;
    font-weight: 600;
  }
  
  .nav-links {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 20px;
    gap: 12px;
    align-items: flex-start;
    z-index: 100;
  }
  
  .nav-links.open {
    display: flex !important;
  }
  
  /* Fix for human mode */
  body.mode-human nav {
    background: #fff;
    border-bottom: 1px solid #ccc;
  }
  
  body.mode-human nav .logo {
    color: #000 !important;
  }
  
  body.mode-human .nav-links {
    background: #fff;
    border-bottom: 1px solid #999;
  }
  
  body.mode-human .nav-toggle {
    color: #000;
    border-color: #999;
  }
}

/* ── layout ── */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px;
}

.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dim);
  margin: 40px 0 16px;
}

h3 {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--dim);
  margin: 24px 0 12px;
}

p { margin-bottom: 16px; }

.subtitle {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.lede {
  font-size: 1.05rem;
  color: var(--dim);
  line-height: 1.8;
  margin-bottom: 32px;
}

ul, ol {
  margin: 16px 0;
  padding-left: 24px;
}

li { margin-bottom: 8px; }

em { color: var(--dim); }

blockquote {
  border-left: 2px solid var(--border);
  padding-left: 16px;
  margin: 24px 0;
  color: var(--muted);
  font-style: italic;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface);
  padding: 2px 6px;
  font-size: 0.9em;
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

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

/* ── essay/page specific ── */
.essay-content {
  max-width: 640px;
}

.essay-content p {
  margin-bottom: 20px;
  line-height: 1.8;
}

.essay-date {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ── footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  margin-top: 60px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

footer a { color: var(--muted); }
footer a:hover { color: var(--dim); }

/* ── cards/grid ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 16px;
}

.card h3 {
  margin: 0 0 8px;
  color: var(--accent);
}

.card p {
  margin: 0;
  font-size: 0.9rem;
}

/* ── tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--dim);
  font-weight: 500;
}

/* ── counter badge ── */
.counter {
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  padding: 2px 8px;
  margin-left: 8px;
}

/* ── essay list ── */
.essay-list {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.essay-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.essay-list a {
  flex: 1;
}

.essay-list .date {
  color: var(--muted);
  font-size: 0.85rem;
  margin-left: 16px;
  white-space: nowrap;
}

/* ── agent view (index only) ── */
.agent-view {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 24px;
  white-space: pre-wrap;
  font-size: 0.85rem;
  line-height: 1.6;
}
.agent-view a { color: var(--dim); }
.agent-view a:hover { color: var(--accent); }
.agent-header {
  color: var(--accent);
  font-weight: 600;
  display: block;
  margin-bottom: 16px;
}
.agent-section {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
  display: block;
  margin-top: 24px;
  padding-top: 8px;
}
.agent-divider { 
  color: var(--muted); 
  display: block;
  margin: 4px 0 8px;
}
.agent-label {
  color: var(--dim);
  display: inline-block;
  min-width: 22ch;
}
.agent-muted { color: var(--muted); }
.agent-trust-high { color: var(--dim); }
.agent-trust-medium { color: var(--text); }

/* ── mode toggle ── */
.mode-toggle {
  position: fixed;
  top: 12px;
  right: 20px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  background: var(--bg);
}
.mode-toggle button {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  padding: 5px 12px;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
  text-transform: uppercase;
}
.mode-toggle button:hover { color: var(--dim); }
.mode-toggle button.active {
  color: var(--accent);
  background: var(--surface);
}

/* ── view switching ── */
.agent-view, .human-view { display: none; }
body.mode-agent .agent-view { display: block; }
body.mode-human .human-view { display: block; }
body.mode-human { background: #fff; color: #000; }

/* ── web 1.0 human view ── */
.human-view {
  font-family: 'Times New Roman', Times, Georgia, serif;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px;
  font-size: 16px;
  line-height: 1.6;
  color: #000;
}
.human-view a { color: #0000EE; }
.human-view a:visited { color: #551A8B; }
.human-view a:hover { color: #FF0000; }
.human-view hr { border: none; border-top: 1px solid #999; margin: 20px 0; }
.human-view h1 { font-size: 24px; margin: 0 0 4px; }
.human-view h2 { font-size: 18px; margin: 20px 0 8px; border-bottom: none; color: #000; text-transform: none; letter-spacing: normal; }
.human-view h3 { font-size: 16px; font-weight: bold; margin: 12px 0 4px; color: #000; }
.human-view ul { margin: 4px 0 12px 24px; }
.human-view li { margin-bottom: 2px; }
.human-view p { margin: 0 0 10px; }
.human-view .counter { color: #666; font-size: 12px; background: none; }
.human-view blockquote {
  border-left: 2px solid #999;
  margin: 10px 0 10px 16px;
  padding-left: 12px;
  color: #333;
  font-style: italic;
}
.human-view code { font-family: 'Courier New', monospace; font-size: 14px; }
.human-view .web1-toggle {
  float: right;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  color: #666;
}
.human-view .web1-toggle button {
  background: none;
  border: 1px solid #999;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
  color: #000;
}
.human-view .web1-toggle button:hover { background: #eee; }
.human-view .web1-footer {
  margin-top: 30px;
  padding-top: 10px;
  border-top: 1px solid #999;
  font-size: 12px;
  color: #666;
  text-align: center;
}
.human-view .web1-updated { color: #666; font-size: 12px; }
body.mode-human .mode-toggle { display: none; }
