/* ---------- Reset & base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: #1e1e1e;
  color: #f2f2f0;
  font-family: "Funnel Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover { opacity: 0.75; }
a:focus-visible, button:focus-visible {
  outline: 2px solid #f2f2f0;
  outline-offset: 3px;
}

hr {
  border: none;
  border-top: 1px solid rgba(242, 242, 240, 0.15);
  margin: 24px 0;
}

/* ---------- Layout ---------- */
.layout {
  display: flex;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 48px 32px;
  display: flex;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.wordmark {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 40px;
}

.nav-list {
  list-style: none;
  margin: 0 0 auto 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nav-list a {
  font-size: 16px;
  color: rgba(242, 242, 240, 0.7);
  transition: color 0.15s ease;
}
.nav-list a:hover { opacity: 1; color: #f2f2f0; }
.nav-list a.active { color: #f2f2f0; }

.sidebar-footer {
  font-size: 13px;
  color: rgba(242, 242, 240, 0.45);
  line-height: 1.7;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 64px 48px 96px;
}

/* ---------- Entries / essay content ---------- */
.entry-full {
  max-width: 640px;
}

.entry-meta {
  font-size: 13px;
  color: rgba(242, 242, 240, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.entry-title {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0 0 32px;
}

.entry-body {
  font-size: 17px;
  color: rgba(242, 242, 240, 0.92);
}
.entry-body p { margin: 0 0 22px; }
.entry-body p:last-child { margin-bottom: 0; }

/* ---------- Writing index ---------- */
.page-hero { margin-bottom: 40px; }
.page-hero h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 0;
}

.entries-list {
  display: flex;
  flex-direction: column;
  max-width: 640px;
}

.entry-row {
  display: block;
  padding: 22px 0;
  border-bottom: 1px solid rgba(242, 242, 240, 0.1);
}
.entry-row:first-child { padding-top: 0; }
.entry-row:hover { opacity: 1; }
.entry-row:hover .entry-row-title { opacity: 0.75; }

.entry-row-title {
  font-size: 18px;
  font-weight: 500;
  transition: opacity 0.15s ease;
}

.entry-row-date {
  font-size: 13px;
  color: rgba(242, 242, 240, 0.45);
}

.entry-excerpt {
  margin-top: 6px;
  font-size: 14px;
  color: rgba(242, 242, 240, 0.6);
}

.empty-state {
  color: rgba(242, 242, 240, 0.5);
  font-size: 15px;
}

/* ---------- Currently: shared content + standalone page ---------- */
.now-list { max-width: 560px; }
.now-list p {
  font-size: 16px;
  margin: 0 0 18px;
}
.now-list .label {
  font-weight: 600;
  color: #f2f2f0;
}
.now-list .updated {
  margin-top: 28px;
  font-size: 13px;
  color: rgba(242, 242, 240, 0.45);
}

/* ---------- Currently: slide-in panel ---------- */
.panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(420px, 90vw);
  background: #242424;
  border-left: 1px solid rgba(242, 242, 240, 0.1);
  padding: 48px 36px;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  z-index: 50;
  overflow-y: auto;
}
.panel.is-open { transform: translateX(0); }

.panel h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 28px;
}

.panel-close {
  position: absolute;
  top: 28px;
  right: 28px;
  background: none;
  border: none;
  color: #f2f2f0;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 40;
}
.panel-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 32px 24px 8px;
  }
  .nav-list { flex-direction: row; gap: 20px; margin-bottom: 24px; }
  .main { padding: 8px 24px 64px; }
  .panel { width: 100vw; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .panel, .panel-overlay, .entry-row-title, a { transition: none; }
}
