/* ============================================================
   The Curious Observer — Stylesheet
   Typography: Space Mono (titles, ALL CAPS) + Inter 300 (body)
   ============================================================ */

/* === TOKENS === */
:root {
  --ink:     #1c1917;
  --paper:   #faf9f7;
  --accent:  #3a6f8f;
  --rule:    #e2ddd8;
  --muted:   #78716c;
  --width:   680px;
  --mono:    'Space Mono', 'Courier New', monospace;
  --sans:    'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --ink:    #ede9e4;
  --paper:  #0d0c0b;
  --accent: #6aadca;
  --rule:   #272220;
  --muted:  #9e948e;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

/* === BASE === */
html { font-size: 18px; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* === LAYOUT === */
.container {
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === HEADER === */
.site-header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 3.5rem;
}

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

.site-title {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

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

.site-logo {
  height: 26px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

nav a {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  margin-left: 1.25rem;
  display: flex;
  align-items: center;
  line-height: 1;
  transition: color 0.2s ease;
}

.theme-toggle:hover { color: var(--accent); }

[data-theme="dark"] .site-logo { filter: invert(1); }

/* === HOME: LEDE === */
.site-lede {
  margin-bottom: 2.5rem;
}

.site-lede p {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1rem;
  font-style: italic;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* === DIVIDERS === */
hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

/* === LABELS === */
.label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 2rem;
}

/* === POST LIST (HOME) === */
.post-list { list-style: none; }

.post-item {
  padding-bottom: 2.25rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--rule);
}

.post-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.post-item h2 {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.post-item h2 a {
  color: var(--ink);
  text-decoration: none;
}

.post-item h2 a:hover { color: var(--accent); }

.post-excerpt {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.7;
  margin-bottom: 0.6rem;
}

.post-meta {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* === ARTICLE PAGE === */
.back-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 2.5rem;
}

.back-link::before { content: "← "; }
.back-link:hover { color: var(--accent); }

.article-header { margin-bottom: 2.5rem; }

.article-category {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 1rem;
  text-decoration: none;
}

.article-title {
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.article-meta {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* === ARTICLE BODY === */
.article-body p {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: 1.5rem;
}

.article-body h2 {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--ink);
}

/* === REFERENCES === */
.references {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.references h2 {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.references ol {
  padding-left: 1.25rem;
}

.references li {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 0.65rem;
}

/* === ABOUT / PAGE === */
.page-title {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.page-body p {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: 1.5rem;
}

/* === FOOTER === */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0;
  margin-top: 5rem;
}

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

.site-footer p {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover { color: var(--accent); }

.footer-social {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-social a {
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: color 0.2s ease;
}

.footer-social svg {
  width: 15px;
  height: 15px;
}

.site-footer a:hover { color: var(--accent); }

/* === RESPONSIVE === */
@media (max-width: 720px) {
  html { font-size: 16px; }
  .article-title { font-size: 1.35rem; }
  .site-header { margin-bottom: 2.5rem; }
}

/* === NAV LAYOUT === */
nav { display: flex; align-items: center; gap: 1.25rem; }
.theme-toggle { margin-left: 0; }
.nav-active { color: var(--ink) !important; }

/* === PAGE HEADER === */
.page-header { margin-bottom: 2.5rem; }
.page-header .label { margin-bottom: 0.5rem; }

.page-subtitle {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.35rem;
}

/* === TIMELINE === */
.timeline-track {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 1.5rem;
}

.timeline-line {
  position: absolute;
  top: calc(1.5rem + 7px);
  left: calc(100% / 12);
  right: calc(100% / 12);
  height: 1px;
  background: var(--rule);
  pointer-events: none;
}

.milestone {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  z-index: 1;
}

.milestone-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  background: var(--paper);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.milestone-dot:hover { border-color: var(--accent); }

.milestone-dot[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58, 111, 143, 0.18);
}

[data-theme="dark"] .milestone-dot[aria-expanded="true"] {
  box-shadow: 0 0 0 3px rgba(106, 173, 202, 0.18);
}

.milestone-dot.is-done {
  background: var(--accent);
  border-color: var(--accent);
}

.milestone-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.7rem;
  gap: 0.2rem;
  text-align: center;
}

.milestone-month {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.milestone-book {
  font-family: var(--sans);
  font-size: 0.67rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.3;
  max-width: 76px;
}

.milestone-drawer {
  margin-top: 1.5rem;
  border: 1px solid var(--rule);
  animation: drawer-in 0.18s ease;
}

.milestone-drawer[hidden] { display: none; }

@keyframes drawer-in {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.drawer-inner { padding: 1.5rem; }

.drawer-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.drawer-month-text {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.drawer-theme-text {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.drawer-rows { display: grid; gap: 0.9rem; }

.drawer-row {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 0.75rem;
}

.drawer-row-label {
  font-family: var(--mono);
  font-size: 0.57rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.1rem;
}

.drawer-row-value {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.875rem;
  color: var(--ink);
  line-height: 1.6;
}

.drawer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.drawer-list li {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.875rem;
  color: var(--ink);
  line-height: 1.5;
  padding-left: 1rem;
  position: relative;
}

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

.drawer-status {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.drawer-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  flex-shrink: 0;
}

.drawer-status.done { color: var(--accent); }
.drawer-status.done .drawer-status-dot { background: var(--accent); border-color: var(--accent); }

/* === CURRICULUM === */
.curriculum-month {
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.curriculum-month:last-child { border-bottom: none; margin-bottom: 0; }

.curriculum-month-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.55rem;
}

.curriculum-month-title {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  color: var(--ink);
}

.curriculum-month-book {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 1.25rem;
}

.curriculum-body p {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.9rem;
  line-height: 1.8;
  margin-bottom: 0.85rem;
  color: var(--ink);
}

.curriculum-body p:last-child { margin-bottom: 0; }

.curriculum-detail-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.3rem;
}

/* === CITATION LINKS === */
.cite-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  text-decoration-color: var(--muted);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.cite-link:hover {
  color: var(--accent);
  text-decoration-style: solid;
  text-decoration-color: var(--accent);
}

@media (max-width: 540px) {
  .milestone-book { display: none; }
}
