/* ============================================================
   Dario-inspired theme — clean, minimal, long-form reading
   ============================================================ */

/* --- Variables (light mode default) --- */
:root {
  --bg:           #ffffff;
  --text:         #1a1a1a;
  --muted:        #6b6b6b;
  --accent:       #0055cc;
  --border:       #e0e0e0;
  --hover-bg:     #f5f5f5;
  --code-bg:      #f3f3f3;
  --selection-bg: rgba(0, 85, 204, 0.18);

  --font:         "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono:    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --content-width: 680px;
  --header-height: 56px;
  --transition:    0.2s ease;
}

/* --- Dark mode --- */
html.dark {
  --bg:        #0f0f0f;
  --text:      #e8e8e8;
  --muted:     #888888;
  --accent:    #5b9cf6;
  --border:    #2a2a2a;
  --hover-bg:  #1a1a1a;
  --code-bg:   #1e1e1e;
  --selection-bg: rgba(91, 156, 246, 0.25);
}

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

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 0;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--selection-bg); }

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition);
}
a:hover { text-decoration: underline; opacity: 0.8; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  transition: background var(--transition), border-color var(--transition);
}

.header-inner {
  max-width: calc(var(--content-width) + 4rem);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-name {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.site-name:hover { text-decoration: none; opacity: 0.7; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-nav a {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
  text-decoration: none;
  opacity: 1;
}

.mode-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  transition: color var(--transition), background var(--transition);
}
.mode-toggle:hover { background: var(--hover-bg); color: var(--text); }

/* ---- Main content ---- */
.site-main {
  flex: 1;
  width: 100%;
  max-width: calc(var(--content-width) + 4rem);
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ---- Home page ---- */
.bio {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.bio-text {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  max-width: 60ch;
}

.post-section { margin-bottom: 2.5rem; }

.section-heading {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.post-list {
  list-style: none;
}

.post-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.post-item:first-child { border-top: 1px solid var(--border); }

.post-title {
  font-family: var(--font);
  font-size: 17px;
  color: var(--text);
  font-weight: 400;
  line-height: 1.4;
  flex: 1;
}
.post-title:hover { color: var(--accent); text-decoration: none; }

.post-meta {
  font-family: var(--font);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- List page ---- */
.list-page { }
.section-title {
  font-family: var(--font);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 28px;
  color: var(--text);
  letter-spacing: 0;
}

/* ---- Images ---- */
img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  margin: 1.5rem 0;
}

/* ---- Single post ---- */
.post {
  max-width: var(--content-width);
}

.post-header { margin-bottom: 2.5rem; }

.post-heading {
  font-family: var(--font);
  font-size: 42px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--text);
  margin-bottom: 36px;
}

.post-header .post-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.sep { margin: 0 0.25rem; }

/* ---- Post body typography ---- */
.post-body { font-size: 17px; }

.post-body p { margin-bottom: 1.5em; }

.post-body h1 {
  font-family: var(--font);
  font-size: 42px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  margin-top: 2.5rem;
  margin-bottom: 36px;
}
.post-body h2 {
  font-family: var(--font);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
  margin-top: 2.5rem;
  margin-bottom: 28px;
}
.post-body h3 {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  margin-top: 2rem;
  margin-bottom: 22px;
}

.post-body ul, .post-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5em;
}
.post-body li { margin-bottom: 0.4rem; }

.post-body blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}
.post-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5em;
}
.post-body pre code {
  background: none;
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
}

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

.post-body .dinkus {
  text-align: center;
  color: var(--muted);
  margin: 2.5rem 0;
  font-size: 17px;
  letter-spacing: 0.5em;
}

.post-body a { color: var(--accent); }

/* ---- Buttons ---- */
button, .button {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
}

/* ---- Post footer ---- */
.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.back-link {
  font-family: var(--font);
  font-size: 14px;
  color: var(--muted);
}
.back-link:hover { color: var(--text); text-decoration: none; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.post-nav-link {
  font-family: var(--font);
  font-size: 14px;
  color: var(--muted);
  max-width: 48%;
}
.post-nav-link:hover { color: var(--text); text-decoration: none; }
.post-nav-next { margin-left: auto; text-align: right; }

/* ---- Footer nav ---- */
.footer-nav {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}
.footer-nav a {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  line-height: 2;
  color: var(--muted);
}
.footer-nav a:hover { color: var(--text); text-decoration: none; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  transition: border-color var(--transition);
}
.footer-inner {
  max-width: calc(var(--content-width) + 4rem);
  margin: 0 auto;
}
.site-footer p {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  line-height: 2;
  letter-spacing: 0;
  color: var(--muted);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .site-main { padding: 2rem 1.25rem; }
  .header-inner { padding: 0 1.25rem; }
  .post-heading { font-size: 32px; }
  .post-item {
    flex-direction: column;
    gap: 0.15rem;
  }
}
