/* ─── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:        #1a1814;
  --ink-mid:    #4a4540;
  --ink-light:  #8a847c;
  --ink-faint:  #c8c2b8;
  --paper:      #f7f4ef;
  --paper-warm: #ede9e2;
  --accent:     #2d5a3d;
  --accent-mid: #4a8560;
  --accent-faint: #d4e8da;
  --line:       rgba(26,24,20,0.10);

  --sidebar-w:  17rem;
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-sans:  'DM Sans', system-ui, sans-serif;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
}

/* ─── Layout ─────────────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--ink);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-inner {
  padding: 2.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  min-height: 100%;
}

/* Avatar */
.avatar-ring {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: 1.5px solid var(--accent-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.avatar-placeholder {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--accent-mid);
  line-height: 1;
  letter-spacing: 0.05em;
}

/* Identity */
.identity { display: flex; flex-direction: column; }

.site-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  color: #f0ece4;
  line-height: 1.25;
  margin-bottom: 0.35rem;
}

.site-title {
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-mid);
  margin-bottom: 0.75rem;
}

.site-tagline {
  font-size: 0.82rem;
  color: var(--ink-faint);
  line-height: 1.55;
}

/* Nav */
.main-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  color: rgba(240,236,228,0.6);
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: all 0.18s ease;
  position: relative;
}

.nav-link:hover {
  color: #f0ece4;
  background: rgba(255,255,255,0.06);
}

.nav-link.active {
  color: #f0ece4;
  background: rgba(255,255,255,0.08);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5px;
  height: 60%;
  background: var(--accent-mid);
  border-radius: 2px;
}

/* External links */
.external-links {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.ext-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.75rem;
  border-radius: 5px;
  text-decoration: none;
  color: rgba(240,236,228,0.45);
  font-size: 0.82rem;
  transition: all 0.18s ease;
}

.ext-link:hover {
  color: rgba(240,236,228,0.85);
  background: rgba(255,255,255,0.05);
}

.ext-link svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* ─── Main Content ───────────────────────────────────────────────── */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 4rem 5rem 6rem;
  max-width: 74rem;
}

/* ─── Prose Typography ───────────────────────────────────────────── */
.prose {
  max-width: 680px;
}

.prose h1 {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.prose h2 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 400;
  color: var(--ink);
  margin-top: 3rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.prose h3 {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  margin-top: 2rem;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

/* Conference / event label after h3 */
.prose h3 + p strong:first-child {
  color: var(--accent);
}

.prose p {
  font-size: 0.97rem;
  color: var(--ink-mid);
  margin-bottom: 1rem;
  line-height: 1.75;
}

.prose strong {
  font-weight: 500;
  color: var(--ink);
}

.prose em {
  font-style: italic;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent-faint);
  transition: text-decoration-color 0.15s;
}

.prose a:hover {
  text-decoration-color: var(--accent);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

.prose ul, .prose ol {
  margin: 0.75rem 0 1rem 1.25rem;
}

.prose li {
  font-size: 0.97rem;
  color: var(--ink-mid);
  margin-bottom: 0.35rem;
  line-height: 1.7;
}

.prose li strong {
  color: var(--ink);
}

/* Code */
.prose code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: var(--paper-warm);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--ink);
}

.prose pre {
  background: var(--ink);
  color: var(--paper);
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.25rem 0;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  color: inherit;
}

/* ─── Page Load Animation ────────────────────────────────────────── */
.prose {
  animation: fadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }

  .sidebar-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
  }

  .identity { flex: 1; min-width: 180px; }
  .avatar-ring { display: none; }
  .site-tagline { display: none; }

  .main-nav {
    flex-direction: row;
    border-top: none;
    padding-top: 0;
    gap: 0.25rem;
  }

  .external-links {
    flex-direction: row;
    border-top: none;
    padding-top: 0;
    margin-top: 0;
    gap: 0.25rem;
    flex-wrap: wrap;
  }

  .ext-link span { display: none; }

  .layout { flex-direction: column; }

  .content {
    margin-left: 0;
    padding: 2rem 1.5rem 4rem;
  }

  .prose h1 { font-size: 2rem; }
}

@media (max-width: 480px) {
  .content { padding: 1.5rem 1.25rem 3rem; }
}
