/* itskonrad.com — solarized light, jetbrains mono, no frameworks */

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/JetBrainsMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/JetBrainsMono-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* solarized light */
  --base3:  #fdf6e3;  /* background */
  --base2:  #eee8d5;  /* background highlights */
  --base1:  #93a1a1;  /* comments, secondary */
  --base01: #586e75;  /* emphasized text */
  --base00: #657b83;  /* body text */
  --yellow: #b58900;
  --orange: #cb4b16;
  --red:    #dc322f;
  --blue:   #268bd2;
  --cyan:   #2aa198;
  --green:  #859900;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--base3);
  color: var(--base00);
  font-family: "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 1rem;
  line-height: 1.7;
}

::selection { background: var(--base2); color: var(--base01); }

/* centered single-screen pages (home, 404) */
body.center {
  min-height: 100svh;
  display: grid;
  place-items: center;
}
body.center main { max-width: 38rem; padding: 2rem 1.5rem 3rem; }

/* reading pages (blog) */
body.page main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* secondary text uses base00 rather than base1: base1 on the cream
   background is ~2.5:1 contrast, below the 4.5:1 AA floor for small text */
.crumb {
  margin: 0 0 2.5rem;
  font-size: 0.875rem;
  color: var(--base00);
}
.crumb a { color: inherit; text-decoration-color: var(--base1); text-underline-offset: 0.25em; }

h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.6rem, 6vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--base01);
}
h1.error { color: var(--red); }

h2 { margin: 2.5rem 0 1rem;   font-size: 1.25rem;   color: var(--base01); }
h3 { margin: 2rem 0 0.75rem;  font-size: 1.0625rem; color: var(--base01); }
h4 { margin: 1.75rem 0 0.75rem; font-size: 1rem;    color: var(--base01); }

p { margin: 0 0 1.25rem; }

a {
  color: var(--blue);
  text-decoration-color: var(--base1);
  text-underline-offset: 0.25em;
}
a:hover { background: var(--base2); }

.cursor {
  display: inline-block;
  margin-left: 0.15em;
  color: var(--orange);
  animation: blink 1.2s steps(2, start) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}
@keyframes blink { to { visibility: hidden; } }

.comment {
  margin: 2.5rem 0 0;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--base00);
}
.comment p { margin: 0 0 0.25rem; }

/* ---------- articles ---------- */

.post-meta {
  margin: -0.75rem 0 2rem;
  font-size: 0.875rem;
  color: var(--base00);
}

ul, ol { margin: 0 0 1.25rem; padding-left: 1.5rem; }
li { margin-bottom: 0.5rem; }
li::marker { color: var(--base1); }

strong { color: var(--base01); }

code {
  font-family: inherit;
  font-size: 0.875em;
  color: var(--base01);
  background: var(--base2);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

pre {
  margin: 0 0 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--base2);
  border-radius: 4px;
  overflow-x: auto;
  line-height: 1.6;
}
pre code {
  font-size: 0.8125rem;
  background: none;
  padding: 0;
  border-radius: 0;
}

.math {
  margin: 1.5rem 0;
  text-align: center;
  color: var(--base01);
}

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

/* ---------- post list (/blog/) ---------- */

.post-list { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.post-list li { margin-bottom: 1.75rem; }
.post-list time { display: block; font-size: 0.875rem; color: var(--base00); }
.post-list .desc { margin: 0.25rem 0 0; font-size: 0.875rem; color: var(--base00); }
