:root {
  --primary: #0D9BBF;
  --accent1: #83D0E0;
  --accent2: #3BE8B0;
  --accent3: #E82C2C;
  --bg: #121F2B;
  --surface: #1C2F3D;
  --text: #D0DFE6;
  --muted: #6699B3;
  --font-sans: "Montserrat", sans-serif;
  --font-serif: "Source Serif 4", serif;
}

html.light {
  --primary: #11778D;
  --accent1: #77C0D4;
  --accent2: #2DCCA3;
  --bg: #F2F8FA;
  --surface: #E8F1F5;
  --text: #445B66;
  --muted: #5492A8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

button, a { color: inherit; }

.shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header-spacer { height: 3.5rem; flex-shrink: 0; }

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg);
}

.header-line { display: none; height: 1px; background: var(--muted); }

.header-frame {
  max-width: 81.25rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.header-row {
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.logo {
  display: block;
  line-height: 0;
}

.logo img {
  height: 1.5rem;
  width: auto;
  max-width: 5.5rem;
}

.nav-desktop { display: none; }

.nav-desktop a,
.nav-panel a {
  text-decoration: none;
  font-size: 1rem;
}

.nav-panel {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  border-top: 1px solid var(--muted);
  padding: 1rem;
}

.nav-panel.open { display: flex; }

.nav-panel a { font-size: 1.125rem; padding: 0.25rem 0; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.menu-button {
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.menu-button span {
  display: block;
  height: 2px;
  width: 1.25rem;
  background: var(--text);
}

.menu-button .bars { display: flex; flex-direction: column; gap: 5px; }

.theme-button {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.theme-button img { width: 28px; height: 28px; }

main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

.watermark {
  position: absolute;
  top: 400px;
  left: 0;
  right: 0;
  margin: auto;
  width: 400px;
  height: 400px;
  opacity: 0.6;
  filter: blur(0.5px);
  pointer-events: none;
  z-index: 0;
}

.content {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
}

.page-title {
  min-height: 5rem;
  margin-top: 1.5rem;
  padding: 1.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 400;
}

.page-copy {
  max-width: 42rem;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
  text-align: center;
  color: var(--muted);
}

.page-copy code { white-space: nowrap; }

.catalog {
  list-style: none;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  max-width: 42rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.catalog li,
.empty {
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  border: 1px solid var(--accent1);
  border-radius: 6px;
  padding: 1.25rem;
}

.catalog a {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  text-decoration: none;
}

.catalog a:hover { color: var(--primary); }

.catalog p { margin: 0.5rem 0 0; }

footer { flex-shrink: 0; }

.footer-line {
  display: block;
  height: 1px;
  max-width: 81.25rem;
  margin: 0 auto;
  background: var(--muted);
}

.footer-row {
  max-width: 81.25rem;
  height: 3.125rem;
  margin: 0 auto;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-row a { line-height: 0; }

.footer-row img { width: 24px; height: 24px; }

.only-dark { display: inline; }
.only-light { display: none; }
html.light .only-dark { display: none; }
html.light .only-light { display: inline; }

@media (min-width: 640px) {
  .logo img { height: 1.75rem; max-width: 7.5rem; }
}

@media (min-width: 1280px) {
  .header-spacer { height: 8rem; }
  .header-frame { margin-top: 1.75rem; height: 6.25rem; padding: 0; }
  .header-line { display: block; height: 1px; background: var(--muted); }
  .header-row { height: calc(6.25rem - 2px); }
  .logo img { height: 4rem; max-width: none; }
  .nav-desktop {
    display: flex;
    width: 32rem;
    align-items: center;
    justify-content: space-between;
  }
  .menu-button { display: none; }
  .page-title {
    height: 7.625rem;
    margin-top: 50px;
    padding: 0;
    font-size: 2.25rem;
  }
}
