:root {
  color-scheme: light dark;

  --font-serif: 'Libre Baskerville', serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --font-size-75: 0.9rem;
  --font-size-100: 1rem;
  --font-size-150: 1.1rem;
  --font-size-200: 1.25rem;
  --font-size-300: 1.5rem;
  --font-size-400: 2rem;

  --line-height-100: 1.1;
  --line-height-200: 1.2;
  --line-height-300: 1.4;
  --line-height-400: 1.5;

  --color-text-body: #111;
  --color-text-support: #666;

  --color-bg: #fff;
  --color-bg-alt: #f5f5f5;

  --color-border: #ddd;

  --color-positive: green;
  --color-negative: red;

  --box-shadow-100: 0 2px 4px rgba(0,0,0,0.1);

  --border-radius-100: 2px;
  --border-radius-200: 4px;
  --border-radius-300: 8px;

  --space-100: 0.25rem;
  --space-200: 0.5rem;
  --space-300: 0.75rem;
  --space-400: 1rem;
  --space-500: 2rem;
  --space-600: 3rem;
  --space-700: 4rem;

  --container-width: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-text-body: #eee;
    --color-text-support: #999;

    --color-bg: #0a0a0a;
    --color-bg-alt: #1a1a1a;

    --color-border: #333;

    --color-positive: rgb(23, 176, 23);
    --color-negative: rgb(255, 43, 43);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  padding: var(--space-400);
  max-width: var(--container-width);
  font-family: var(--font-serif);
  line-height: var(--line-height-400);
  color: var(--color-text-body);
  background: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: var(--line-height-100);
}

a {
  color: currentColor;
}

a:hover {
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  max-height: 480px;
  border-radius: var(--border-radius-200);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-700) auto;
  width: 117px;
}

code, pre {
  font-family: var(--font-mono);
  font-size: var(--font-size-75);
  background: var(--color-bg-alt);
}

pre {
  display: inline-block;
  white-space: pre-wrap;
  padding: var(--space-300) var(--space-400);
  margin: var(--space-200) 0;
  border-radius: var(--border-radius-200);
}

code {
  white-space: nowrap;
  border-radius: var(--border-radius-100);
  border: 1px solid var(--color-border);
  padding: 1px 4px;
}

blockquote {
  border-left: 1px solid var(--color-border);
  padding: 0 var(--space-400);
  margin: var(--space-400) 0;
  font-size: var(--font-size-150);
  font-style: italic;
}

table {
  border: 1px solid var(--color-border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--border-radius-200);
  overflow: hidden;
  margin: var(--space-500) 0;
  width: 100%;
  font-family: var(--font-sans);
}

th, td {
  padding: var(--space-200) var(--space-300);
  border-bottom: 1px solid var(--color-border);
}

th {
  background: var(--color-bg-alt);
}

tr:last-child td {
  border-bottom: none;
}


/* Typography */

.header-link {
  font-family: var(--font-sans);
  text-decoration: none;
  color: var(--color-text-support);
}

.headline {
  font-family: var(--font-serif);
  font-size: var(--font-size-400);
  font-weight: 500;
  line-height: var(--line-height-200);
  margin: var(--space-500) 0 0;
}

.tagline {
  font-size: var(--font-size-200);
  color: var(--color-text-support);
  margin: var(--space-200) 0;
}

.kicker {
  font-family: var(--font-sans);
  text-transform: uppercase;
  font-size: var(--font-size-100);
  letter-spacing: 0.1em;
  margin: var(--space-600) 0 0;
  color: var(--color-text-support);
}

.muted {
  color: var(--color-text-support);
}

li {
  margin: var(--space-200) 0;
}

/* Inline status labels, e.g. <code class="positive"> */

code.positive { --tone: var(--color-positive); }
code.negative { --tone: var(--color-negative); }

code.positive,
code.negative {
  background: color-mix(in srgb, var(--tone) 20%, transparent);
  color: var(--tone);
  border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent);
}

/* Lists without bullets */

.articles,
.projects,
footer ul {
  list-style: none;
  padding: 0;
}

/* Footer */

footer {
  margin-top: var(--space-600);
}

/* List: Articles */

.articles a {
  text-decoration: none;
  font-size: var(--font-size-150);
}

.articles a:hover {
  text-decoration: underline;
}

/* List: Projects */

.projects {
  display: flex;
  flex-direction: column;
}

.card-project {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: var(--space-400);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-300);
  text-decoration: none;
  color: var(--color-text-body);
  transition: background-color 0.2s ease-in-out;
}

.card-project:hover {
  background: var(--color-bg-alt);
}

.card-project:focus-visible {
  outline: 2px solid var(--color-text-body);
  outline-offset: 2px;
}

.card-project h3,
.card-project p {
  grid-column: 1;
  margin: 0;
}

.card-project h3 {
  font-weight: 500;
  font-size: var(--font-size-200);
  margin-bottom: var(--space-100);
}

.card-project p {
  color: var(--color-text-support);
}

.card-project code {
  width: fit-content;
  margin-top: var(--space-300);
}

/* Chevron */
.card-project::after {
  content: "";
  grid-column: 2;
  grid-row: 1 / span 3;
  width: 0.6rem;
  height: 0.6rem;
  border-top: 2px solid var(--color-text-support);
  border-right: 2px solid var(--color-text-support);
  transform: rotate(45deg);
  margin-right: var(--space-200);
}

/* Articles */

article img {
  display: block;
  margin: var(--space-700) auto;
  box-shadow: var(--box-shadow-100);
}

article .date {
  margin: var(--space-500) 0;
}

article .date + p {
  font-size: var(--font-size-200);
}

article h2 {
  margin-top: var(--space-600);
  font-weight: 700;
}

article h3 {
  margin-top: var(--space-500);
  font-size: var(--font-size-200);
  font-weight: 600;
}

article h4 {
  margin-top: var(--space-500);
  font-family: var(--font-serif);
  font-size: var(--font-size-150);
  font-weight: 500;
  line-height: var(--line-height-400);
}
