/* CSS Variables */
:root {
  --green: #368b2e;
  --green-light: #45a33b;
  --bg: #f5f5f0;
  --muted: #5a9953;
}

/* Dark mode */
body.dark-mode {
  --green: #4ade80;
  --green-light: #6ee7a0;
  --bg: #111;
  --muted: #6ee7a0;
}

/* Reset and base styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Mono', 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--green);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* Two-column layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

/* Header */
header {
  margin-bottom: 48px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.header-left {
  flex: 1;
}

.header-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--green);
  line-height: 1;
  background: transparent;
  cursor: pointer;
  transition: opacity 0.2s;
}

.header-icon:hover {
  opacity: 0.7;
}

body.dark-mode .header-icon {
  font-size: 14px;
}

.site-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

nav {
  display: flex;
  gap: 20px;
}

nav a {
  color: var(--green);
  text-decoration: underline;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.5px;
}

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

/* Sections */
section {
  margin-bottom: 48px;
}

h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--green);
}

/* Labels (//now//, //previously//, //lore//) */
.label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
  margin-top: 20px;
}

section > .label:first-of-type {
  margin-top: 0;
}

/* Content lists */
.about-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.about-list li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 6px;
  line-height: 1.5;
  font-size: 12px;
}

.about-list li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.about-list a {
  color: var(--green);
  text-decoration: underline;
}

.about-list a:hover {
  color: var(--green-light);
}

/* Writing list */
.writing-list {
  list-style: none;
  padding: 0;
}

.writing-list li {
  margin-bottom: 16px;
}

.writing-list a {
  color: var(--green);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.4;
}

.writing-list a:hover {
  text-decoration: underline;
}

.writing-list .date {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.writing-list .divider {
  border-bottom: 1px dashed var(--muted);
  margin: 16px 0;
}

/* Coming soon text */
.coming-soon {
  color: var(--muted);
}

/* Bookshelf */
.shelf-controls {
  margin-bottom: 24px;
}

.book-search {
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--green);
  color: var(--green);
  margin-bottom: 16px;
}

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

.book-search:focus {
  outline: none;
  border-color: var(--green-light);
}

.shelf-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-row {
  display: flex;
  gap: 8px;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--green);
  color: var(--green);
  padding: 6px 12px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-btn:hover {
  background: var(--green);
  color: var(--bg);
}

.filter-btn.active {
  background: var(--green);
  color: var(--bg);
}

.book-count {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Year groups */
.year-group {
  margin-bottom: 32px;
}

.year-group.hidden {
  display: none;
}

.year-header {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Book grid */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 16px;
}

.book-card {
  position: relative;
  cursor: pointer;
}

.book-card.hidden {
  display: none;
}

.book-cover {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border: 1px solid var(--green);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: var(--bg);
}

.book-card:hover .book-cover,
.book-card:hover .book-placeholder {
  transform: scale(1.05) translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

/* Book placeholder for missing covers */
.book-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--green);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1.3;
  border: 1px solid var(--green);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--bg);
  border: 1px solid var(--green);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--green);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--green);
  max-width: 500px;
  width: 100%;
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--green);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
}

.modal-close:hover {
  color: var(--green-light);
}

.modal-content {
  display: flex;
  gap: 20px;
}

.modal-cover {
  width: 120px;
  height: 180px;
  object-fit: cover;
  border: 1px solid var(--green);
  flex-shrink: 0;
}

.modal-info {
  flex: 1;
}

.modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  border: none;
  padding: 0;
}

.modal-author {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}

.modal-review {
  font-size: 12px;
  color: var(--green);
  line-height: 1.6;
}

/* Footer */
footer {
  padding-top: 32px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.footer-thanks {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.social-links {
  display: flex;
  gap: 20px;
}

.social-links a {
  color: var(--green);
  text-decoration: underline;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.social-links a:hover {
  color: var(--green-light);
}

/* Blog article styles */
.article-header {
  margin-bottom: 32px;
}

.article-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--green);
  line-height: 1.4;
  margin-bottom: 8px;
}

.article-date {
  font-size: 13px;
  color: var(--muted);
}

.article-content {
  margin-bottom: 40px;
}

.article-content p {
  margin-bottom: 16px;
}

.article-content ul {
  list-style: none;
  margin-bottom: 16px;
  padding: 0;
}

.article-content ul li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.article-content ul li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.back-link {
  display: inline-block;
  color: var(--green);
  text-decoration: underline;
  font-size: 13px;
  margin-bottom: 32px;
}

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

/* Responsive */
@media (max-width: 768px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 20px 16px 40px;
  }

  .site-title {
    font-size: 18px;
  }

  nav {
    gap: 14px;
  }

  nav a {
    font-size: 12px;
  }

  h2 {
    font-size: 14px;
  }

  body {
    font-size: 14px;
  }

  .article-title {
    font-size: 18px;
  }

  section {
    margin-bottom: 40px;
  }

  header {
    margin-bottom: 40px;
  }

  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
  }

  .modal-content {
    flex-direction: column;
  }

  .modal-cover {
    width: 100px;
    height: 150px;
  }

  .filter-row {
    flex-wrap: wrap;
  }

  .filter-btn {
    font-size: 10px;
    padding: 5px 8px;
  }

  .shelf-controls-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
