:root {
  --forest: #1B4332;
  --navy: #1E3A5F;
  --sage: #52B788;
  --sage-light: #74C69D;
  --bg: #FAF7F4;
  --bg2: #EDE7DC;
  --card-bg: #FFFFFF;
  --dark: #111A14;
  --text: #1C1C1C;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --light: #F5F0E8;
  --border: #E5DDD0;
  --shadow: 0 1px 3px rgba(27, 67, 50, 0.08);
  --shadow-hover: 0 4px 12px rgba(27, 67, 50, 0.12);
  --code-bg: #EDE7DC;
  --code-text: #1C1C1C;
  --tag-bg: #EDE7DC;
  --tag-text: #5B5B5B;
  --radius: 10px;
  --radius-sm: 6px;
  --max-width: 960px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

::selection {
  background: var(--forest);
  color: #fff;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: var(--forest);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover { color: var(--sage); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Header ─── */

header {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--forest);
}

.header-title a {
  color: var(--forest);
}

.header-title a:hover {
  color: var(--sage);
}

.header-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.header-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.header-linkedin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.header-linkedin:hover {
  background: var(--forest);
  color: #fff;
}

/* ─── Hero ─── */

.hero {
  background: linear-gradient(135deg, rgba(27,67,50,0.04), rgba(30,58,95,0.04));
  padding: 56px 0 48px;
}

.hero h1 {
  font-size: 2.4rem;
  color: var(--forest);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  max-width: 560px;
  line-height: 1.7;
}

/* ─── Controls ─── */

.controls {
  margin-bottom: 28px;
  padding-top: 40px;
}

.search-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.search-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(82,183,136,0.12);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-btn {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
  font-weight: 500;
  white-space: nowrap;
}

.tag-btn:hover {
  border-color: var(--sage);
  color: var(--forest);
  background: rgba(82,183,136,0.06);
}

.tag-btn.active {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}

.count-info {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ─── Entry list ─── */

.entry-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.entry {
  display: block;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text);
}

.entry:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.entry-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.entry-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.entry-type {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.entry-type.article {
  background: rgba(82,183,136,0.12);
  color: var(--sage);
}

.entry-type.post {
  background: rgba(74,144,217,0.1);
  color: #4a90d9;
}

.entry-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.entry-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.entry-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--tag-bg);
  color: var(--tag-text);
}

/* ─── Detail view ─── */

.detail {
  display: none;
  padding-top: 40px;
}

.detail.visible {
  display: block;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
  transition: color 0.2s;
}

.detail-back:hover {
  color: var(--forest);
}

.detail-header {
  margin-bottom: 28px;
}

.detail-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.2;
  color: var(--forest);
  letter-spacing: -0.01em;
}

.detail-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.detail-tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--tag-bg);
  color: var(--tag-text);
}

.detail-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.detail-section-title {
  font-family: var(--font-body);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 600;
}

.prompt-container {
  background: var(--code-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-family: var(--font-body);
}

.prompt-actions {
  display: flex;
  gap: 8px;
}

.prompt-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.73rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: var(--font-body);
  transition: all 0.2s;
}

.prompt-btn:hover {
  border-color: var(--sage);
  color: var(--forest);
  background: rgba(82,183,136,0.08);
}

.prompt-content {
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--code-text);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.materials-list {
  list-style: none;
  padding: 0;
}

.materials-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

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

.materials-list a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.material-icon {
  font-size: 0.95rem;
}

.detail-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sage);
}

/* ─── Empty state ─── */

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 0.9rem;
}

/* ─── Footer ─── */

footer {
  margin-top: 80px;
  padding: 28px 0;
  background: var(--dark);
  color: var(--light);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer p {
  font-size: 0.82rem;
}

footer nav {
  display: flex;
  gap: 16px;
}

footer nav a {
  color: var(--light);
  font-size: 0.82rem;
  transition: opacity 0.2s;
}

footer nav a:hover {
  opacity: 0.7;
}

footer nav a.inactive {
  opacity: 0.45;
  cursor: default;
}

footer nav a.inactive:hover {
  opacity: 0.45;
}

/* ─── Responsive ─── */

@media (max-width: 600px) {
  body {
    font-size: 0.95rem;
  }

  header {
    padding: 24px 0 16px;
  }

  .hero {
    padding: 36px 0 32px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .container {
    padding: 0 16px;
  }

  .detail-title {
    font-size: 1.5rem;
  }

  .entry-title {
    font-size: 0.95rem;
  }

  .search-row {
    flex-direction: column;
  }

  .prompt-content {
    font-size: 0.76rem;
    padding: 12px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

@media print {
  .controls, .search-row, .prompt-btn, .detail-back {
    display: none;
  }
}
