/* Font faces */
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/IBMPlexMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Source Serif 4';
  src: url('/fonts/SourceSerif4-VariableFont_wght.ttf') format('truetype-variations');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Figtree';
  src: url('/fonts/Figtree-VariableFont_wght.ttf') format('truetype-variations');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Homemade Apple';
  src: url('/fonts/HomemadeApple-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Root variables */
:root {
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-sans: 'Figtree', system-ui, sans-serif;
  --font-decorative: "Homemade Apple", cursive;
  --font-mono: 'IBM Plex Mono', monospace;
  --color-bg: #F8F9FB;
  --color-fg: #1E1F21;
  --color-fg-50: rgba(30, 31, 33, 0.5);
  --color-highlight: #001CA7;
}

/* Base styles */
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  display: flex;
}

/* Layout */
.container {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 2fr;
  position: relative;
}

.container::before {
  content: '';
  position: fixed;
  left: 33.333%;
  top: 0;
  height: 100vh;
  width: 0.5pt;
  background-color: var(--color-fg);
}

main {
  grid-column: 2;
  padding: 2rem 4rem;
  max-width: 64ch;
}

header {
  grid-column: 2;
  padding: 2rem 4rem 0;
}

footer {
  grid-column: 2;
  padding: 2rem 4rem;
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: 0;
  right: 2rem;
  width: 20px;
  height: 64px;
  background-color: var(--color-fg);
  cursor: pointer;
}

/* Navigation */
nav {
  display: flex;
  gap: 2rem;
  margin-bottom: 0.5rem;
}

nav a {
  color: var(--color-fg-50);
  text-decoration: none;
  transition: color 0.2s;
}

nav a:hover, nav a.active {
  color: var(--color-fg);
}

nav a.active {
  text-decoration: underline;
  text-underline-offset: 0.25rem;
}

/* Headers */
.home main h1:first-child,
.archive main h1:first-child {
  font-family: var(--font-sans);
  font-weight: 700;
  font-style: normal;  
  font-size: clamp(3.3rem, 8vw, 4rem);
  text-align: left;
  color: var(--color-fg);
  line-height: 1.2;
  margin-bottom: 4rem;
}

body.regular-page main h1:first-child,
.single-post h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-style: normal;
  font-size: clamp(2rem, 5vw, 2.5rem);
  text-align: left;
  color: var(--color-fg);
  line-height: 1.2;
  margin-top: 1.5rem;
  margin-bottom: 3rem;
}

/* Responsive */
@media screen and (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
  }

  .container::before {
    display: none;
  }

  main, header, footer {
    grid-column: 1;
    padding: 1rem;
  }
}

/* Dark theme */
:root.dark-theme {
  --color-bg: #1E1F21;
  --color-fg: #F8F9FB;
  --color-fg-50: rgba(248, 249, 251, 0.6);
  --color-highlight: #ABB8FA;
}