:root {
  color-scheme: dark light;
  --page: #0b0f14;
  --glow: #17202b;
  --window: #11161d;
  --bar: #1a212b;
  --border: #2a3441;
  --text: #e6edf3;
  --muted: #8b98a8;
  --prompt: #7ee787;
  --link: #79c0ff;
  --error: #ff9a8f;
  --shadow: rgb(0 0 0 / 55%);
}

@media (prefers-color-scheme: light) {
  :root {
    --page: #eef0f3;
    --glow: #ffffff;
    --window: #fdfdfc;
    --bar: #e7eaee;
    --border: #cfd6de;
    --text: #1f2933;
    --muted: #5f6b7a;
    --prompt: #1a7f37;
    --link: #0a5fc2;
    --error: #b42318;
    --shadow: rgb(31 41 51 / 18%);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 35%, var(--glow), var(--page) 70%) var(--page);
  color: var(--text);
  font-family: ui-monospace, "JetBrains Mono", "Cascadia Code", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.1rem);
  line-height: 1.6;
}

.terminal {
  width: min(100%, 38rem);
  background: var(--window);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 1.5rem 3.5rem -1rem var(--shadow);
  overflow: hidden;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  background: var(--bar);
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.45;
}

.title {
  /* Balance the three dots so that the title stays centered */
  flex: 1;
  margin-right: 3.1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85em;
}

.screen {
  padding: 1.5rem 1.5rem 1.75rem;
}

.line {
  margin: 1.4rem 0 0.2rem;
  color: var(--muted);
}

.line:first-child {
  margin-top: 0;
}

.prompt {
  color: var(--prompt);
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 1.4rem + 3.5vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

h1.error {
  color: var(--error);
  font-size: clamp(1.5rem, 1.1rem + 2.2vw, 2.1rem);
}

.output {
  margin: 0;
}

.links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

a {
  color: var(--link);
  font-weight: 700;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.25em;
}

a::after {
  content: "/";
  /* inline-block keeps the underline of the link off the slash */
  display: inline-block;
  color: var(--muted);
  font-weight: 400;
}

a:hover {
  text-decoration-thickness: 0.16em;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 0.25em;
  border-radius: 0.2em;
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  vertical-align: text-bottom;
  background: var(--text);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
  }
}
