/* Fonts (self-hosted, no third-party requests) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
/* Noto Serif italic: Latin + polytonic Greek, used for the homepage epigraph only */
@font-face { font-family: "Noto Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/noto-serif-latin-400-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Noto Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/noto-serif-greek-400-italic.woff2") format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Noto Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/noto-serif-greek-ext-400-italic.woff2") format("woff2"); unicode-range: U+1F00-1FFF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/poppins-latin-700-normal.woff2") format("woff2"); }

/* Theme tokens */
:root {
  --fill: rgb(250 252 252);
  --text: rgb(40 39 40);
  --muted: rgb(40 39 40 / 0.65);
  --faint: rgb(40 39 40 / 0.45);
  --accent: rgb(0 108 172);
  --accent-hover: rgb(0 73 116);
  --card: rgb(241 245 245);
  --border: rgb(227 230 230);
  --header-bg: rgb(255 255 255 / 0.8);
  color-scheme: light;
}
.dark {
  --fill: rgb(33 39 55);
  --text: rgb(234 237 243);
  --muted: rgb(234 237 243 / 0.7);
  --faint: rgb(234 237 243 / 0.45);
  --accent: rgb(100 168 234);
  --accent-hover: rgb(143 195 247);
  --card: rgb(48 53 68);
  --border: rgb(59 70 95);
  --header-bg: rgb(33 39 55 / 0.8);
  color-scheme: dark;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-y: scroll; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fill);
  color: var(--text);
  font: 400 1rem/1.6 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  transition: background-color .3s, color .3s;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px dashed var(--accent); outline-offset: 2px; }
img { max-width: 100%; height: auto; }

.container { width: 100%; max-width: 48rem; margin: 0 auto; padding: 0 1rem; }
main.container { padding-bottom: 4rem; }

/* Headings */
.heading, .section-title { font-family: "Poppins", system-ui, sans-serif; font-weight: 700; }
.heading-1 { font-size: 1.875rem; line-height: 1.25; margin: 0 0 .75rem; }
.section-title {
  font-size: .75rem; letter-spacing: .1em; text-transform: uppercase;
  opacity: .8; margin: 0 0 1rem;
}
.dark .heading, .dark .section-title { filter: brightness(1.6) saturate(.9); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .75rem; padding-bottom: .75rem; }
.brand { display: flex; flex-direction: column; line-height: 1.3; }
.brand:hover { color: var(--accent); }
.brand-name { font-size: 1.125rem; font-weight: 600; white-space: nowrap; }
.brand-name .light { font-weight: 400; }
.brand-domain { font-size: .75rem; color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: .25rem; }
.nav-links a { padding: .375rem .625rem; border-radius: .25rem; color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--accent); font-weight: 500; }
.theme-btn {
  display: inline-flex; margin-left: .25rem; padding: .375rem; border: 0; border-radius: .25rem;
  background: none; cursor: pointer; color: #eab308;
}
.theme-btn:hover { background: var(--card); }
.theme-btn svg { width: 1.25rem; height: 1.25rem; }
.icon-moon { display: none; }
.dark .theme-btn { color: #60a5fa; }
.dark .icon-sun { display: none; }
.dark .icon-moon { display: block; }

/* Home */
.hero { margin: 3.5rem 0 3rem; }
.hero p { color: var(--muted); max-width: 36rem; margin: 0 0 1rem; }
.hero p a, .prose a, .meta a, .post-footer a {
  color: var(--accent); text-decoration: underline; text-decoration-style: dashed; text-underline-offset: 4px;
}
.hero p a { font-weight: 600; }
.hero p a:hover, .prose a:hover, .meta a:hover, .post-footer a:hover { color: var(--accent-hover); }
.socials { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; font-size: .875rem; font-weight: 500; }
.socials a { color: var(--c); }
.dark .socials a { color: var(--c-dark, var(--c)); }
.socials a:hover { text-decoration: underline; text-underline-offset: 4px; }
section { margin-bottom: 3rem; }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li > a, .link-list li > div {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: .75rem 0; border-bottom: 1px solid var(--border); transition: border-color .2s;
}
.link-list li > a:hover { border-color: var(--accent); }
.link-list .title { margin: 0; font-size: .875rem; font-weight: 500; }
.link-list li > a:hover .title { color: var(--accent); }
.link-list .sub { margin: .125rem 0 0; font-size: .75rem; color: var(--muted); }
.link-list .arrow { font-size: .75rem; color: var(--faint); }

.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.read-more { font-size: .875rem; color: var(--accent); }
.read-more:hover { color: var(--accent-hover); }

/* Epigraph */
.epigraph { margin: 4rem auto 0; max-width: 34rem; text-align: center; }
.epigraph::before {
  content: ""; display: block; width: 2.5rem; height: 2px; margin: 0 auto 1.75rem;
  background: var(--accent); opacity: .6; border-radius: 1px;
}
.epigraph blockquote { margin: 0; }
.epigraph .verse {
  margin: 0; font-family: "Noto Serif", Georgia, "Times New Roman", serif; font-style: italic;
  font-size: .9375rem; line-height: 1.75; color: var(--text);
}
.epigraph .verse span { display: block; }
.epigraph .translation { margin: .625rem 0 0; font-size: .8125rem; line-height: 1.6; color: var(--muted); }
.epigraph figcaption {
  margin-top: .625rem; font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint);
}
@media (max-width: 30rem) { .epigraph .verse { font-size: .875rem; } }

/* Post lists */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { border-bottom: 1px solid var(--border); }
.post-item:last-child { border-bottom: 0; }
.post-item a { display: block; padding: 1.25rem 0; }
.post-item h3 { margin: 0 0 .5rem; font-size: 1.125rem; font-weight: 600; line-height: 1.35; transition: color .2s; }
.post-item a:hover h3 { color: var(--accent); }
.post-item .excerpt {
  margin: 0 0 .75rem; font-size: .875rem; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-item time { font-size: .75rem; color: var(--muted); }
.year { margin: 2.5rem 0 .25rem; font-size: .875rem; font-weight: 600; color: var(--faint); }
.page-intro { color: var(--muted); margin: 0 0 1rem; }

/* Pages & posts */
.page, .post { margin-top: 2.5rem; }
.back-link { display: inline-block; margin-bottom: 1.5rem; font-size: .875rem; color: var(--accent); }
.back-link:hover { color: var(--accent-hover); }
.post-header { margin-bottom: 2rem; }
.post-description { margin: 0 0 .75rem; font-size: 1.125rem; color: var(--muted); font-style: italic; }
.meta { margin: 0; font-size: .875rem; color: var(--muted); }
.post-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: .875rem; }

.prose { font-size: 1.0625rem; line-height: 1.85; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose figure, .prose pre, .prose table { margin: 0 0 1.25rem; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  font-family: "Poppins", system-ui, sans-serif; font-weight: 700; line-height: 1.3; margin: 2.25rem 0 1rem;
}
.prose h2 { font-size: 1.5rem; color: #1e40af; }
.prose h3 { font-size: 1.25rem; color: #7c3aed; }
.prose h4 { font-size: 1.1rem; color: #0f766e; }
.prose h5 { font-size: 1rem; color: #ea580c; }
.prose h6 { font-size: 1rem; color: #15803d; }
.dark .prose h2, .dark .prose h3, .dark .prose h4, .dark .prose h5, .dark .prose h6 { filter: brightness(1.6) saturate(.9); }
.prose a { overflow-wrap: anywhere; }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li { margin: .35rem 0; }
.prose strong { font-weight: 600; }
.prose blockquote { border-left: 4px solid var(--accent); padding-left: 1rem; font-style: italic; opacity: .85; margin-left: 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.prose img { display: block; margin: 0 auto; border-radius: .5rem; }
.prose figure { margin-left: 0; margin-right: 0; }
.prose figcaption { margin-top: .5rem; text-align: center; font-size: .875rem; color: var(--muted); }
.prose code { font-family: ui-monospace, "JetBrains Mono", Menlo, monospace; font-size: .875em; background: var(--card); color: var(--accent); padding: .1rem .3rem; border-radius: .25rem; }
.prose pre { background: var(--card); border: 1px solid var(--border); border-radius: .5rem; padding: 1rem; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: inherit; white-space: pre; }
.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--border); padding: .4rem .6rem; }
.prose .footnote-content, .prose .footnotes { font-size: .9rem; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 2rem; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding-top: 1.5rem; padding-bottom: 1.5rem; font-size: .875rem; color: var(--muted); }
.footer-inner p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.footer-links a:hover, .footer-privacy:hover { color: var(--accent); }

@media (max-width: 30rem) {
  .nav-links a { padding: .375rem .4rem; }
  .brand-domain { display: none; }
}
