@font-face {
  font-family: 'Computer Modern Serif';
  src: url('https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/fonts/KaTeX_Main-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Computer Modern Serif';
  src: url('https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/fonts/KaTeX_Main-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Computer Modern Serif';
  src: url('https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/fonts/KaTeX_Main-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Computer Modern Serif';
  src: url('https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/fonts/KaTeX_Main-BoldItalic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #002746;
  --text: #ffffff;
  --muted: rgba(255,255,255,0.5);
  --accent: #7eb8e0;
  --divider: rgba(255,255,255,0.08);
  --serif: 'Computer Modern Serif', 'Libre Baskerville', Georgia, serif;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.8rem 4rem;
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  backdrop-filter: blur(12px);
}

.logo {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.3s;
}
.logo:hover { opacity: 0.7; }

.header-about {
  font-family: var(--serif);
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s;
  letter-spacing: 0.03em;
}
.header-about:hover { color: var(--accent); }

/* ── Index entries ── */
.index-view {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 4rem 6rem;
}

.entry {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 2rem;
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--divider);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s ease forwards;
  text-decoration: none;
}
.entry:nth-child(1) { animation-delay: 0.1s; }
.entry:nth-child(2) { animation-delay: 0.25s; }
.entry:nth-child(3) { animation-delay: 0.4s; }
.entry:last-child { border-bottom: none; }
.entry:hover .entry-title { color: var(--accent); }

@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}

.meta { padding-top: 0.35rem; }

.meta-author {
  font-size: 0.82rem;
  color: var(--text);
  opacity: 0.85;
  margin-bottom: 0.15rem;
}

.meta-date {
  font-size: 0.78rem;
  color: var(--accent);
  opacity: 0.9;
}

.entry-title {
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 0.8rem;
  transition: color 0.3s;
}

.entry-desc {
  font-size: 0.92rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.7);
  max-width: 680px;
}

/* ── Post page ── */
.post-view {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 4rem 6rem;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

.post-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 2.4rem;
  line-height: 1.25;
  color: var(--accent);
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--divider);
  max-width: 85%;
}

.post-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 3rem;
}

.post-sidebar { padding-top: 0.2rem; }

.post-sidebar .meta-author {
  font-size: 0.85rem;
  color: var(--text);
  opacity: 0.85;
  margin-bottom: 0.2rem;
}

.post-sidebar .meta-date {
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.5rem;
  font-size: 0.78rem;
}

.post-tags span {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(255,255,255,0.3);
}

.post-tags .sep {
  color: var(--muted);
  text-decoration: none;
}

.post-body {
  max-width: 720px;
}

.post-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.85);
  margin-bottom: 2rem;
}

.post-hero {
  width: 100%;
  margin-bottom: 2rem;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
}

.post-hero img {
  width: 100%;
  height: auto;
  display: block;
}

.post-body p {
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.82);
  margin-bottom: 1.4rem;
}

.post-body .lead-para::first-letter {
  font-size: 3.2rem;
  float: left;
  line-height: 1;
  margin-right: 0.12em;
  margin-top: 0.05em;
  color: var(--accent);
  font-family: var(--serif);
}

.post-body h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 1.3rem;
  margin: 2.5rem 0 1rem;
  color: var(--text);
}

.post-body blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.2rem;
  margin: 1.8rem 0;
  font-style: italic;
  color: rgba(255,255,255,0.65);
  font-size: 0.95rem;
  line-height: 1.75;
}

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }
.back-link::before { content: '\2190'; }

/* ── About ── */
.about-view {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 4rem 6rem;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

.about-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 2.4rem;
  line-height: 1.25;
  color: var(--accent);
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--divider);
}

.about-body {
  max-width: 620px;
}

.about-body p {
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.82);
  margin-bottom: 1.4rem;
}

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

/* ── Footer ── */
footer {
  text-align: center;
  padding: 2rem 4rem;
  border-top: 1px solid var(--divider);
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--serif);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  header { padding: 1.2rem 1.5rem; }
  .index-view, .post-view, .about-view { padding: 1.5rem 1.5rem 4rem; }
  .entry {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 2rem 0;
  }
  .entry-title { font-size: 1.35rem; }
  .post-title { font-size: 1.6rem; max-width: 100%; }
  .post-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
