/* palette and type follow nekopurrin and bloops */

/* catppuccin latte */
:root {
  color-scheme: light;

  --ctp-base: #eff1f5;
  --ctp-mantle: #e6e9ef;
  --ctp-surface0: #ccd0da;
  --ctp-text: #4c4f69;
  --ctp-subtext1: #5c5f77;
  --ctp-subtext0: #6c6f85;
  --ctp-overlay1: #8c8fa1;
  --ctp-blue: #1e66f5;
  --ctp-sapphire: #209fb5;
  --ctp-mauve: #8839ef;
  --ctp-yellow: #df8e1d;
}

/* catppuccin mocha */
:root[data-theme="night"] {
  color-scheme: dark;

  --ctp-base: #1e1e2e;
  --ctp-mantle: #181825;
  --ctp-surface0: #313244;
  --ctp-text: #cdd6f4;
  --ctp-subtext1: #bac2de;
  --ctp-subtext0: #a6adc8;
  --ctp-overlay1: #7f849c;
  --ctp-blue: #89b4fa;
  --ctp-sapphire: #74c7ec;
  --ctp-mauve: #cba6f7;
  --ctp-yellow: #f9e2af;
}

* {
  box-sizing: border-box;
}

body {
  max-width: 660px;
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
  background: var(--ctp-base);
  color: var(--ctp-text);
  font:
    1.125rem/1.75 Literata,
    serif;
}

h1,
h2 {
  font-weight: normal;
  line-height: 1.2;
}

h1 {
  margin: 0 0 1rem;
  font-size: 2.6rem;
  font-style: italic;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.6rem;
}

a {
  color: var(--ctp-blue);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, currentcolor 35%, transparent);
}

a:hover {
  color: var(--ctp-sapphire);
}

code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--ctp-surface0);
  background: var(--ctp-mantle);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9em;
}

li::marker {
  color: var(--ctp-mauve);
}

/* header nav, in the mono label style */

header {
  margin-bottom: 3.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--ctp-surface0);
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav a {
  border: none;
  font:
    600 0.8rem "JetBrains Mono",
    monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ctp-subtext0);
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--ctp-mauve);
}

/* page content */

section + section {
  margin-top: 3rem;
}

main ol,
main ul {
  padding-left: 1.5rem;
}

main ol {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

main li li {
  margin-top: 0.5rem;
}

.li-left-bar,
.ul-left-bar {
  padding-left: 0;
  list-style: none;
}

.li-left-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.li-left-bar li,
.ul-left-bar {
  padding-left: 1.1rem;
  border-left: 2px solid var(--ctp-mauve);
}

mjx-container[display="true"] {
  overflow-x: auto;
}

/* theme toggle: moon in day mode, sun in night mode */

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--ctp-surface0);
  border-radius: 50%;
  background: var(--ctp-mantle);
  color: var(--ctp-subtext1);
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--ctp-yellow);
}

.theme-toggle svg {
  width: 1.2rem;
  fill: none;
  stroke: currentcolor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:root:not([data-theme="night"]) .icon-sun,
:root[data-theme="night"] .icon-moon {
  display: none;
}

/* credits footer, last on every page */

.credits {
  margin-top: 6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ctp-surface0);
  font:
    0.8rem/1.6 "JetBrains Mono",
    monospace;
  color: var(--ctp-subtext0);
}

@media (width <= 480px) {
  body {
    padding: 3rem 1.1rem 2.5rem;
    font-size: 1.05rem;
  }

  h1 {
    font-size: 2.1rem;
  }
}
