:root {
  font-size: 16px;

  --bg: #1a1a1a;
  --bg-darker: #161616;
  --accent: #35978a;
  --text: #bfc5cf;
  --text-bright: #fbfbfb;
  --text-muted: #848b98;
  --border: #333;
}

@view-transition {
  navigation: auto;
}

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

@font-face {
  font-family: 'Archivo';
  src: url('Archivo-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

::selection {
  background-color: var(--accent);
  color: var(--bg);
}

body {
  font-family:  'Archivo', system-ui, -apple-system, sans;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-wrapper {
  width: min(90%, 1400px);
  margin: 0 auto;
  padding: 0 1rem;
}

.header {
  display: flex;
  justify-content: space-between;
}

header {
  border-bottom: 1px solid var(--border);
  padding: 2rem 0;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }

nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  
  & a {
    color: var(--text);
    text-decoration: none;
    
    &:hover {
      color: var(--accent);
    }
  }
}

main {
  flex: 1;
  padding: 2rem 0;
}

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
}

.title {
  margin-bottom: 1.6rem;
}

ul.post-list {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;

  li {
    list-style: none;
    > a {
      color: inherit;
      
      &:visited,
      &:hover,
      &:active {
        color: inherit;
      }
    }
  }
}

.post, .about {
  > p + p {
    margin-top: 1rem;
  }

  h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
  }

  h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
  }

  pre {
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.9rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: var(--bg-darker);
  }

  table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;

    thead {
      font-weight: 700;
      background-color: var(--bg);
    }

    th,
    td {
      padding: 0.75rem 1rem;
      text-align: left;
      border-bottom: 1px solid var(--border);
    }

    tbody tr:hover {
      background-color: color-mix(in srgb, var(--text) 5%, transparent);
    }
  }

  a {
    color: var(--accent);
  }

  ul, ol {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
  }

  hr {
    border: none;
    height: 1px;
    margin: 2rem 0;
    background: linear-gradient(
      90deg,
      var(--border),
      var(--accent),
      var(--border)
    );
    background-size: 200% 100%;
    animation: beam 10s ease-in-out infinite;
  }

  blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-style: italic;
  }

  code:not(pre code) {
    background-color: var(--bg-darker);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
  }

  img {
    max-width: 600px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
  }
}

.projects {
  h2 {
    margin-bottom: 0.2rem;
  }

  p {
    margin-bottom: 1rem;
  }
}

.grayscale-img {
  max-width: 600px;
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(100%);
  transition: filter 0.3s ease;

  &:hover {
    filter: grayscale(0%)
  }
}

.cursor {
  cursor: pointer;
}

.rss {
  stroke: white;
  width: 16px;
  height: 16px;

  &:hover {
    stroke: var(--accent);
  }
}

@media (max-width: 640px) {
  header .rss {
    display: none;
  }
}

@keyframes beam {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}
