@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700 900;
  font-display: block;
  src: url('/fonts/montserrat-latin.woff2') format('woff2');
}

:root {
  --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --bg: #ffffff;
  --bg-subtle: #f6f5f9;
  --text: #262626;
  --text-muted: #5c5863;
  --heading: #28262a;
  --accent: #7b16ff;
  --accent-soft: rgba(123, 22, 255, 0.1);
  --border: rgba(40, 38, 42, 0.1);
  --code-bg: #f4f2f8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151418;
    --bg-subtle: #1e1c24;
    --text: #e6e4ec;
    --text-muted: #9c97a8;
    --heading: #f5f3fa;
    --accent: #a86bff;
    --accent-soft: rgba(168, 107, 255, 0.18);
    --border: rgba(240, 238, 248, 0.12);
    --code-bg: #1e1c24;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 44px 20px 64px 20px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.65;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  body {
    padding: 56px 48px 80px 48px;
  }
}

body.frame {
  min-height: 100vh;
  border-left: 14px solid var(--accent);
}

.wrapper {
  max-width: 660px;
  margin: 0 auto;
}

a {
  color: var(--accent);
  text-decoration: none;
  word-wrap: break-word;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-bottom: 52px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--heading);
}

.brand:hover {
  text-decoration: none;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.site-name {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.site-tagline {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
}

.site-nav a {
  color: var(--text-muted);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: none;
}

/* Meta row & pills */
.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
}

.post-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

/* Homepage Feed */
.feed-item {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.feed-item:first-child {
  padding-top: 8px;
  border-top: none;
}

.feed-title {
  margin: 0 0 8px 0;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

@media (min-width: 768px) {
  .feed-title {
    font-size: 40px;
  }
}

.feed-title a {
  color: var(--heading);
}

.feed-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.feed-excerpt {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
}

.feed-photo-body img {
  margin: 12px 0 0 0;
  border-radius: 6px;
}

/* Single Post */
.post-header {
  margin-bottom: 32px;
}

.post-title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 38px;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--heading);
}

@media (min-width: 768px) {
  .post-title {
    font-size: 48px;
  }
}

.page-intro {
  margin-bottom: 24px;
}

/* Prose Content */
.content h1,
.content h2,
.content h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--heading);
  letter-spacing: -0.02em;
}

.content h2 {
  font-size: 26px;
  line-height: 1.25;
  margin: 40px 0 16px 0;
}

.content h3 {
  font-size: 21px;
  line-height: 1.3;
  margin: 32px 0 12px 0;
}

.content p {
  margin: 0 0 20px 0;
}

.content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.content ul,
.content ol {
  margin: 0 0 22px 0;
  padding-left: 22px;
}

.content li {
  margin-bottom: 8px;
}

.content li::marker {
  color: var(--accent);
  font-weight: 700;
}

.content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 28px 0;
  border-radius: 6px;
}

.content figure {
  margin: 32px 0;
}

.content figure img {
  margin: 0;
}

.content figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-muted);
}

.content blockquote {
  margin: 28px 0;
  padding: 20px 24px;
  background: var(--bg-subtle);
  border-left: 6px solid var(--accent);
  border-radius: 0 6px 6px 0;
}

.content blockquote p:last-child {
  margin-bottom: 0;
}

.content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.content pre {
  margin: 28px 0;
  padding: 20px 24px;
  background: var(--code-bg);
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.5;
}

.content pre code {
  background: none;
  padding: 0;
  font-size: 15px;
}

/* Photo Album & Wide Image Support (preserved from existing posts) */
.photo-album {
  margin: 32px 0;
}

.photo-album > p {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.photo-album img {
  margin: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 960px) {
  .img-expander {
    margin: 36px -64px;
  }

  .img-expander img {
    width: 100%;
    max-height: 65vh;
    object-fit: cover;
    margin: 0;
  }
}

/* Footnotes (markdown-it-footnote) */
.footnotes-sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 40px 0 20px 0;
}

.footnotes {
  font-size: 14px;
  color: var(--text-muted);
}

.footnotes-list {
  padding-left: 20px;
}

.footnote-item p {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.post-back {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text);
}

.page-num:hover {
  background: var(--bg-subtle);
  text-decoration: none;
}

.page-num.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* Footer */
.site-footer {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 16px;
  font-family: var(--font-heading);
  font-weight: 700;
}

.footer-links a {
  color: var(--text-muted);
}

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

.footer-note {
  margin: 0;
}
