/* dmitriiev.dev — hand-rolled theme. Edit freely; this is the whole look. */

:root {
  --fg: #1c1c1e;
  --bg: #ffffff;
  --muted: #6e6e73;
  --accent: #2b6cff;
  --rule: #ececec;
  --inline-code-bg: #f3f3f5;
  --inline-code-fg: #b5305f;
  --maxw: 42rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e7e7ea;
    --bg: #121214;
    --muted: #9a9aa2;
    --accent: #6ea0ff;
    --rule: #2a2a2e;
    --inline-code-bg: #26262b;
    --inline-code-fg: #ff9ec4;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 18px/1.7 ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4rem 1.4rem 6rem;
}

/* headings + ui use sans, body stays serif for readability */
h1, h2, h3, header, nav, .meta, .post-list {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.4rem; }
h2 { font-size: 1.35rem; letter-spacing: -0.01em; margin: 2.4rem 0 0.8rem; }
h3 { font-size: 1.1rem; margin: 1.8rem 0 0.6rem; }

p { margin: 0 0 1.15rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

.meta { color: var(--muted); font-size: 0.85rem; }

/* index */
header { margin-bottom: 2.5rem; }
header h1 { margin-bottom: 0.3rem; }
header p { color: var(--muted); margin: 0; }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li {
  margin: 0;
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
}
.post-list li:last-child { border-bottom: 1px solid var(--rule); }
.post-list a { font-size: 1.05rem; font-weight: 600; }
.post-meta { display: block; margin-top: 0.25rem; }

/* post chrome */
.draft-banner {
  display: inline-block;
  margin: 0.5rem 0 1rem;
  padding: 0.15rem 0.55rem;
  border: 1px dashed var(--muted);
  border-radius: 5px;
  color: var(--muted);
  font: 600 0.72rem/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* code: Shiki paints the <pre> background/colors, we own the box */
article pre {
  margin: 1.4rem 0;
  padding: 1rem 1.15rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.55;
  border: 1px solid var(--rule);
}
article pre code { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; }
article :not(pre) > code {
  font: 0.85em ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--inline-code-bg);
  color: var(--inline-code-fg);
  padding: 0.12rem 0.38rem;
  border-radius: 5px;
}

article blockquote {
  margin: 1.4rem 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

article ul, article ol { padding-left: 1.4rem; }
article li { margin: 0.3rem 0; }

article table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
  margin: 1.4rem 0;
}
article th, article td {
  border: 1px solid var(--rule);
  padding: 0.5rem 0.7rem;
  text-align: left;
}
article th { background: var(--inline-code-bg); }

article img { max-width: 100%; height: auto; border-radius: 8px; }

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

.post-footer {
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-family: ui-sans-serif, -apple-system, system-ui, sans-serif;
  font-size: 0.92rem;
  color: var(--muted);
}
.post-footer p { margin: 0; }

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
  font-family: ui-sans-serif, -apple-system, system-ui, sans-serif;
  font-size: 0.9rem;
}
.masthead .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  color: var(--fg);
}
.masthead .brand:hover { color: var(--accent); text-decoration: none; }
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1px solid var(--rule);
}
.masthead-links { display: flex; gap: 0.9rem; }
.masthead-links a { color: var(--muted); }
.masthead-links a:hover { color: var(--accent); }

::selection { background: var(--accent); color: #fff; }
