:root {
  /* Backgrounds */
  --background: #FFFFF0;
  --code-bg: #fff0d2;

  /* Borders */
  --border-color: #d4c5b9;
  --border: 1px solid var(--border-color);
  --border-thick: 2px solid var(--border-color);

  /* Interactive colors */
  --primary: #590000;
  --active: #6b5737;
  --secondary: #8b7355;

  /* Text colors */
  --text: #2d2a26;
  --muted: #666666;
  --light: #999999;

  /* Spacing */
  --xs: 0.25rem;
  --md: 0.5rem;
  --lg: 1rem;
  --xl: 2rem;
  --xxl: 4rem;
}

html {
  box-sizing: border-box;
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

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

body {
  background-color: var(--background);
  color: var(--text);
  display: flex;
  flex-direction: column;
  font-family: 'Courier New', Courier, monospace;
  line-height: 1.4;
  margin: 0 auto;
  min-height: 100vh;
  width: clamp(360px, 100% - var(--xl), 50rem);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  color: var(--primary);
}

h1 {
  border-bottom: 2px solid var(--primary);
  font-size: 1.5rem;
  margin: var(--xl) 0 var(--lg);
  text-transform: uppercase;
}
h2 {
  font-size: 1.25rem;
  margin: var(--lg) 0 0;
}
h3 {
  font-size: 1.125rem;
  margin: var(--lg) 0 0;
}
p {
  margin: var(--xs) 0 0;
  padding: 0;
}
p + p {
  margin: var(--md) 0 0;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  color: var(--active);
  text-decoration: underline;
}
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

main {
  flex: 1;
}

header {
  display: flex;
  padding: var(--md) 0;
  border-bottom: 1px solid var(--primary);

  .brand {
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  a {
    font-weight: bold;
  }

  nav {
    align-items: center;
    display: flex;
    font-size: 1.125rem;
    gap: var(--lg);
    margin-left: auto;
  }
}

main a:visited {
  color: var(--secondary);
}

.motto {
  color: var(--muted);
  font-size: 0.9em;
  font-style: italic;
  margin: var(--md) 0 0;
  text-align: right;
}

/* Blogpost Styles */
vf-meta {
  display: block;
  margin-top: var(--md);
}

vf-meta, vf-tags {
  font-size: 0.9rem;
  color: var(--muted);
}

vf-tags {
  display: block;
  margin-top: .125rem;
  border-bottom: var(--border);
  margin-bottom: var(--lg);
  padding-bottom: var(--md);
}

footer {
  border-top: var(--border);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.9em;
  padding: var(--md) 0;
  margin: var(--xl) 0 0;

  @media (min-width: 480px) {
    flex-direction: row;
    span {
      margin-left: auto;
    }
  }
}

table {
  border-collapse: collapse;
  font-size: 0.9em;
  margin: var(--lg) 0 var(--lg);
  width: 100%;
}

td {
  border-top: var(--border);
  color: var(--muted);
}

th {
  border-bottom: var(--border-thick);
}

th, td {
  padding: var(--md);
  text-align: left;
}

th {
  background-color: var(--code-bg);
  color: var(--text);
  font-weight: bold;
}

@media (max-width: 480px) {
  table {
    display: block;
    overflow-x: auto;
  }
}

code {
  background: var(--code-bg);
  padding: 0.1rem 0.3rem;
  font-family: 'Courier New', monospace;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

pre code {
  background: none;
  padding: 0;
}

section > h2 {
	margin-top: var(--xl);
	border-bottom: 2px solid var(--primary);
}

article + article {
  border-top: 1px solid var(--primary);
  margin-top: var(--lg);
}

article .teaser {
  margin: var(--lg) 0 var(--xl);
}

article img {
	max-width: 100%;
	height: auto;
	margin: var(--lg) 0;
	display: block;
}

.blog-list h1 {
  border-bottom: 2px solid var(--primary);
  font-size: 1.4rem;
	font-weight: 600;
	font-style: italic;
	margin-bottom: var(--xl);
}

/* About page */
.about-intro {
  display: flex;
  flex-direction: column;
  gap: var(--lg);
  margin-top: var(--lg);

  figure {
    border: 1px solid var(--border-color);
    border-radius: .375rem;
    margin: 0;
    padding: .375rem;

    img {
      border-radius: .375rem;
      display: block;
      max-width: 12rem;
      aspect-ratio: 296/402;
      width: 100%;
    }
  }

  @media (min-width: 600px) {
    flex-direction: row;
    align-items: flex-start;

    figure {
      flex-shrink: 0;
    }
  }
}

.landing {
  .hero {
    text-align: center;
    margin: var(--xxl) 0;

    h1 {
      font-size: 2rem;
      margin: 0;
    }

    .tagline {
      font-size: 1.125rem;
      color: var(--muted);
      margin: var(--md) 0 0;
    }
  }

  section + section {
    margin-top: var(--xl);
  }

  .cta {
    border-top: var(--border);
    padding-top: var(--xl);
    text-align: center;

    a {
      font-size: 1.125rem;
      font-weight: bold;
    }
  }
}
