/* Fonts, all self-hosted under the SIL OFL (see fonts/*-LICENSE.txt).
   Newsreader Italic is cut to a single static instance (400, 18pt optical
   size) and subset to Latin, including Romanian diacritics. */
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Newsreader-Italic.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Inter-Regular.woff2") format("woff2");
}

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

@font-face {
  font-family: "Inter";
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/Inter-Medium.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --bg: #fff;
  --text: #172033;
  --body: #3e4a5f;
  --muted: #687082;
  --underline: #c4c9d4;
  --rule: #eef1f5;
  --code-bg: #f6f8fa;

  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;

  --measure: 36rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111;
    --text: #e6edf3;
    --body: #c9d1d9;
    --muted: #8b949e;
    --underline: #4a525e;
    --rule: #252b35;
    --code-bg: #1c2128;
  }
}

* {
  box-sizing: border-box;
}

/* One text size for the whole site. Hierarchy comes from color, weight,
   and the italic serif, not from size. */

html,
body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
}

h1,
h2,
h3 {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
}

/* Headings share one style: the italic serif. Newsreader runs smaller
   than Inter at the same size, so 1.1em makes them look equal. */
h1,
h2 {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  letter-spacing: 0;
  margin: 2.5rem 0 0.75rem;
}

h1 {
  margin-top: 0;
}

h3 {
  color: var(--text);
  font-weight: 500;
  margin: 2rem 0 0.5rem;
}

p,
ul,
ol,
blockquote,
pre,
table {
  margin: 0 0 1rem;
}

em {
  font-style: italic;
}

/* Links are always underlined; external ones carry an arrow. */

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.15s;
}

a:hover {
  text-decoration-color: currentColor;
}

a.external::after {
  color: var(--muted);
  content: "\2197";
  display: inline-block;
  margin-left: 0.15em;
  text-decoration: none;
}

code,
pre {
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: 0.9em;
  letter-spacing: 0;
}

code {
  border-radius: 0.2rem;
  padding: 0.1rem 0.25rem;
}

pre {
  overflow-x: auto;
  padding: 1rem;
}

blockquote {
  border-left: 2px solid var(--rule);
  color: var(--muted);
  font-style: italic;
  padding-left: 1rem;
}

/* Layout: one narrow column. */

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

.site-header {
  margin-bottom: 3rem;
}

.logo {
  background: var(--text);
  color: var(--bg);
  display: inline-flex;
  flex-direction: column;
  font-weight: 500;
  height: 5.25rem;
  justify-content: flex-end;
  letter-spacing: 0.08em;
  line-height: 1.35;
  padding: 0.75rem 0.8rem;
  text-decoration: none;
  text-transform: uppercase;
  width: 5.25rem;
}

.logo span {
  display: block;
}

nav {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
}

nav a.active {
  color: var(--text);
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Lists of articles and projects: name, then a muted line. */

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

.article-list li {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.article-list span,
.article-list time {
  color: var(--muted);
}

/* Articles */

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

.article-header h1 {
  margin-bottom: 0.25rem;
}

.article-header time,
.footnotes,
.site-footer {
  color: var(--muted);
}

.footnotes {
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  padding-top: 1rem;
}

.site-footer {
  margin-top: 4rem;
}

.site-footer a {
  color: var(--muted);
}

@media (max-width: 40rem) {
  .site {
    padding: 2.5rem 1.25rem 3rem;
  }

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