:root {
  color-scheme: light dark;
  --page-bg: #fafafa;
  --terminal-bg: #fafafa;
  --fg: #101010;
  --muted: #686868;
  --prompt: #00c200;
  --host: #328eef;
  --accent: #c3512d;
  --switch-bg: #ffffff;
  --switch-border: #d7d7d7;
  --switch-active: #b3d7ff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page-bg: #2d2a2e;
    --terminal-bg: #2d2a2e;
    --fg: #fcfcfa;
    --muted: #c7c7c7;
    --prompt: #a9dc76;
    --host: #78dce8;
    --accent: #fc9867;
    --switch-bg: #403e41;
    --switch-border: #565557;
    --switch-active: #565557;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --page-bg: #fafafa;
  --terminal-bg: #fafafa;
  --fg: #101010;
  --muted: #686868;
  --prompt: #00c200;
  --host: #328eef;
  --accent: #c3512d;
  --switch-bg: #ffffff;
  --switch-border: #d7d7d7;
  --switch-active: #b3d7ff;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #2d2a2e;
  --terminal-bg: #2d2a2e;
  --fg: #fcfcfa;
  --muted: #c7c7c7;
  --prompt: #a9dc76;
  --host: #78dce8;
  --accent: #fc9867;
  --switch-bg: #403e41;
  --switch-border: #565557;
  --switch-active: #565557;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "JetBrains Mono", "JetBrainsMono Nerd Font", "SFMono-Regular", Consolas, monospace;
  background: var(--page-bg);
  color: var(--fg);
}

body::after {
  content: "";
  position: fixed;
  right: clamp(20px, 5vw, 56px);
  bottom: clamp(20px, 5vw, 56px);
  width: min(42vw, 360px);
  aspect-ratio: 1;
  background: url("/logo.svg") center / contain no-repeat;
  opacity: 0.08;
  pointer-events: none;
}

.page {
  min-height: 100vh;
  padding: clamp(20px, 5vw, 56px);
}

.terminal {
  position: relative;
  width: 100%;
  min-height: calc(100vh - (clamp(20px, 5vw, 56px) * 2));
  padding: 0;
  background: var(--terminal-bg);
}

.entry + .entry {
  margin-top: 28px;
}

p {
  margin: 0;
}

.command,
.output {
  font-size: clamp(22px, 5vw, 42px);
  line-height: 1.28;
  letter-spacing: 0;
}

.command {
  display: flex;
  align-items: baseline;
  gap: 0.42em;
  color: var(--fg);
  white-space: nowrap;
}

.command::before {
  content: "➜";
  color: var(--prompt);
  font-weight: 700;
}

.command .verb::before {
  content: "cnonim.name";
  color: var(--host);
  font-weight: 700;
  margin-right: 0.42em;
}

.verb {
  color: var(--fg);
}

.output {
  padding-left: 1.8em;
  color: var(--fg);
}

.output + .output {
  margin-top: 4px;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

a:hover {
  text-decoration-thickness: 2px;
}

.theme-switcher {
  position: fixed;
  top: 0;
  right: 0;
  margin: clamp(20px, 5vw, 56px);
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--switch-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--switch-bg) 88%, transparent);
}

.theme-switcher button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.theme-switcher button[aria-pressed="true"] {
  background: var(--switch-active);
  color: #101010;
}

.theme-switcher button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 560px) {
  .terminal {
    padding-top: 48px;
  }

  .theme-switcher {
    margin: 20px;
  }

  .command,
  .output {
    font-size: clamp(18px, 7vw, 30px);
  }
}
