/* -------------------------------------------------
   Base
------------------------------------------------- */

:root {
  color-scheme: light dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.55;
}

/* -------------------------------------------------
   Layout
------------------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* -------------------------------------------------
   Navigation (left bar)
------------------------------------------------- */

nav {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;

  padding: 1.2rem;
  border-right: 1px solid rgba(127,127,127,.35);
}

nav .site-title {
  display: block;
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

nav .site-desc {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-bottom: 1.2rem;
}

nav a {
  display: block;
  margin: 0.4rem 0;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

/* -------------------------------------------------
   Main content
------------------------------------------------- */

main {
  padding: 2rem;
  max-width: 900px;
}

h1, h2, h3 {
  line-height: 1.25;
}

h1 {
  margin-top: 0;
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* -------------------------------------------------
   Cards / blocks
------------------------------------------------- */

.card {
  border: 1px solid rgba(127,127,127,.35);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
}

/* -------------------------------------------------
   Code blocks
------------------------------------------------- */

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

pre {
  padding: 1rem;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(127,127,127,.35);
}

/* -------------------------------------------------
   Footer
------------------------------------------------- */

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(127,127,127,.35);
  font-size: 0.9rem;
  opacity: 0.75;
}

/* -------------------------------------------------
   Mobile layout
------------------------------------------------- */

@media (max-width: 800px) {

  .layout {
    grid-template-columns: 1fr;
  }

  nav {
    position: static;
    height: auto;
    overflow: visible;

    border-right: none;
    border-bottom: 1px solid rgba(127,127,127,.35);
  }

  nav a {
    display: inline-block;
    margin-right: 0.8rem;
  }

  main {
    padding: 1.5rem 1rem;
  }
}
.lang-switch {
  margin: 1rem 0;
  font-size: 0.85rem;
}

.lang-switch a {
  margin-right: 0.5rem;
  text-decoration: none;
  color: #666;
}

.lang-switch a:hover {
  text-decoration: underline;
  color: #000;
}
