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

:root {
  --bg: #121110;
  --surface: #1c1a18;
  --text: #e6e2dd;
  --text-muted: #8a8682;
  --text-dim: #5e5b58;
  --accent: #d4a76a;
  --accent-dim: #8a6e4a;
  --border: #2a2825;
  --font-title: 'Georgia', 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ─── Navigation ─── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  pointer-events: none;
}

nav a {
  pointer-events: auto;
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.2s;
  font-family: var(--font-mono);
}

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

.nav-left {
  font-weight: 600;
  font-size: 0.85rem !important;
  letter-spacing: 0.12em !important;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  pointer-events: auto;
}

.nav-right a {
  pointer-events: auto;
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.2s;
  font-family: var(--font-mono);
}

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

.nav-sep {
  color: var(--border);
  font-size: 0.6rem;
  pointer-events: none;
}

/* ─── Main Content ─── */
main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
}

.thought {
  max-width: 580px;
  width: 100%;
  position: relative;
}

/* subtle decorative line */
.thought::before {
  content: '';
  position: absolute;
  top: -2rem;
  left: 0;
  width: 3rem;
  height: 2px;
  background: var(--accent-dim);
}

.thought-title {
  font-family: var(--font-title);
  font-size: 2.4rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 1.8rem;
  letter-spacing: -0.01em;
}

.thought-body {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.thought-body p {
  margin-bottom: 1rem;
}

.thought-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.thought-meta .sep {
  color: var(--border);
}

/* ─── Loading / Empty State ─── */
.state-message {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-family: var(--font-mono);
}

.state-message a {
  color: var(--accent-dim);
  text-decoration: none;
}

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

/* ─── Loading Spinner ─── */
.loading {
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.loading::after {
  content: '...';
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* ─── Admin Page ─── */
.admin-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
}

.admin-card {
  max-width: 560px;
  width: 100%;
}

.admin-card h1 {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.admin-card .sub {
  color: var(--text-dim);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  margin-bottom: 2.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 0.8rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-dim);
}

.form-group textarea {
  min-height: 160px;
  resize: vertical;
}

.btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.7rem 1.8rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.btn-primary {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.admin-msg {
  margin-top: 1rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  min-height: 1.2em;
}

.admin-msg.success {
  color: #6bcb77;
}

.admin-msg.error {
  color: #ff6b6b;
}

/* ─── Back link on admin ─── */
.back-link {
  display: inline-block;
  margin-top: 2rem;
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  transition: color 0.2s;
}

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

/* ─── Responsive ─── */
@media (max-width: 640px) {
  nav {
    padding: 1rem 1.2rem;
  }
  main {
    padding: 4rem 1.5rem;
  }
  .thought-title {
    font-size: 1.8rem;
  }
  .admin-wrapper {
    padding: 4rem 1.5rem;
  }
  .list-page {
    padding: 3rem 0;
  }
}

/* ─── List Page ─── */
.list-page {
  max-width: 580px;
  width: 100%;
  padding: 2rem 0;
}

.list-header {
  margin-bottom: 2.5rem;
  position: relative;
}

.list-header::before {
  content: '';
  position: absolute;
  top: -2rem;
  left: 0;
  width: 3rem;
  height: 2px;
  background: var(--accent-dim);
}

.list-header h1 {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.list-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ─── List Items ─── */
.list-item {
  display: block;
  text-decoration: none;
  padding: 1.4rem 0;
  position: relative;
  transition: opacity 0.2s;
  cursor: pointer;
}

/* elegant dot divider instead of full border */
.list-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    var(--border),
    var(--border) 2rem,
    transparent 60%
  );
}

.list-item:last-of-type::after {
  display: none;
}

.list-item:hover {
  opacity: 0.8;
}

.list-item-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  margin-bottom: 0.3rem;
}

.list-item-title {
  display: block;
  font-family: var(--font-title);
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 0.4rem;
  transition: color 0.2s;
}

.list-item:hover .list-item-title {
  color: var(--accent);
}

.list-item-preview {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}
