@font-face {
  font-family: "Lora";
  src: url("/fonts/Lora-Regular.ttf") format("ttf");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lora";
  src: url("/fonts/Lora-Italic.ttf") format("ttf");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Lora";
  src: url("/fonts/Lora-Bold.ttf") format("ttf");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lora";
  src: url("/fonts/Lora-BoldItalic.ttf") format("ttf");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #fffaf6;
  --surface: #fff3e8;
  --surface-2: #fff0e2;
  --text: #2f241f;
  --muted: #78675d;
  --accent: #dfa06e;
  --accent-strong: #c97b42;
  --border: #ead7c7;
  --quote-bg: #fff2e6;
  --inline-code-bg: #f8e4d5;
  --inline-code-text: #6a3c1f;
  --code-bg: #2b221f;
  --code-text: #f6ede7;
  --shadow: rgba(52, 36, 25, 0.08);
  --max-width: 760px;
  --radius: 10px;
}

html[data-theme="dark"] {
  --bg: #1b1613;
  --surface: #241d19;
  --surface-2: #2c231e;
  --text: #f2e7df;
  --muted: #bea89a;
  --accent: #efab75;
  --accent-strong: #ffbf8c;
  --border: #46372e;
  --quote-bg: #2b221d;
  --inline-code-bg: #332822;
  --inline-code-text: #ffd7b4;
  --code-bg: #140f0d;
  --code-text: #f5e8de;
  --shadow: rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Lora", Georgia, serif;
  line-height: 1.8;
  transition: background 0.2s ease, color 0.2s ease;
}

.site {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.site-nav {
  margin-top: 1rem;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 0.1rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
}


.site-header {
  margin-bottom: 3rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.site-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.site-title {
  margin: 0;
  font-size: 2.25rem;
  line-height: 1.15;
  font-weight: 700;
}

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

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

.site-description {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  cursor: pointer;
}

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

.content {
  min-height: 60vh;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

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

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

.post-item-title,
.post-title,
.page-title {
  margin: 0 0 0.35rem;
  line-height: 1.2;
}

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

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

.post-meta {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.meta-sep {
  margin: 0 0.4rem;
}

.post-summary {
  margin: 0 0 1rem;
}

.post-description {
  color: var(--muted);
  font-size: 1.05rem;
  margin-top: 0.75rem;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  line-height: 1.3;
  margin-top: 2.4rem;
  margin-bottom: 0.75rem;
}

.post-content p,
.post-content ul,
.post-content ol {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.post-content li + li {
  margin-top: 0.35rem;
}

.post-content a,
.terms-list a,
.pagination-link,
.site-footer a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent-strong) 35%, transparent);
}

.post-content a:hover,
.terms-list a:hover,
.pagination-link:hover,
.site-footer a:hover {
  text-decoration-color: var(--accent-strong);
}

.post-content blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--quote-bg);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  font-style: italic;
}

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

.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 10px 26px var(--shadow);
  background: var(--surface);
  padding: 0.25rem;
}

.post-content figure {
  margin: 2rem 0;
}

.post-content figcaption {
  margin-top: 0.7rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}

.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--inline-code-bg);
  color: var(--inline-code-text);
  padding: 0.14rem 0.34rem;
  border-radius: 4px;
}

.post-content pre {
  margin: 2rem 0;
  padding: 1.2rem;
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.6;
}

.post-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 0.94em;
}

.post-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}

.post-content th,
.post-content td {
  border: 1px solid var(--border);
  padding: 0.75rem;
  text-align: left;
}

.post-content th {
  background: var(--surface);
}

.tag-list {
  list-style: none;
  padding: 0;
  margin: 0.85rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-strong);
  text-decoration: none;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

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

.post {
  display: block;
}

.post-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-footer-label {
  color: var(--muted);
  margin-right: 0.5rem;
}

.page-header {
  margin-bottom: 2rem;
}

.terms-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.terms-list li + li {
  margin-top: 0.8rem;
}

.terms-count {
  color: var(--muted);
}

.pagination {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.pagination-info {
  color: var(--muted);
}

.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
}

::selection {
  background: #ffd7b8;
  color: #2f241f;
}

/* Chroma syntax highlighting */
.chroma {
  background-color: var(--code-bg);
  color: var(--code-text);
}

.chroma .k,
.chroma .kd,
.chroma .kn,
.chroma .kp,
.chroma .kr,
.chroma .nt {
  color: #f6b37f;
}

.chroma .s,
.chroma .sa,
.chroma .sb,
.chroma .sc,
.chroma .dl,
.chroma .sd,
.chroma .s2 {
  color: #ffd3ac;
}

.chroma .c,
.chroma .ch,
.chroma .cm,
.chroma .c1,
.chroma .cs {
  color: #b49786;
  font-style: italic;
}

.chroma .m,
.chroma .mb,
.chroma .mf,
.chroma .mh,
.chroma .mi,
.chroma .il {
  color: #ffbe88;
}

.chroma .na,
.chroma .nb,
.chroma .nc,
.chroma .nf,
.chroma .fm {
  color: #ffe2c7;
}

.chroma .o,
.chroma .p {
  color: #f2d4bb;
}

.chroma .err {
  color: #ff8f8f;
}

@media (max-width: 640px) {
  html {
    font-size: 17px;
  }

  .site {
    padding: 2rem 1rem 3rem;
  }

  .site-header-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-title {
    font-size: 1.9rem;
  }

  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }
}

