/* tomhellier.com - terminal style, no external assets.
 *
 * Dark by default, light when the browser asks for it. Colours are tokens,
 * so a change is one line. Do not add inline styles to the HTML: the
 * Content-Security-Policy for this host allows style-src 'self' only.
 */

:root {
  color-scheme: light dark;

  --bg: #0b0f0e;
  --panel: #101715;
  --rule: #1f2a26;
  --ink: #d6dbd8;
  --muted: #9aa39f;
  --accent: #4ade80;

  --font: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f7f5;
    --panel: #ffffff;
    --rule: #d7ddd9;
    --ink: #14181a;
    --muted: #4d5653;
    --accent: #166534;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: clamp(1rem, 6vw, 4rem) 1.25rem;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background-color: var(--bg);
  /* One radial glow, no image request. Ignored by browsers without
   * color-mix(), which only loses the glow. */
  background-image: radial-gradient(
    circle at 50% 0%,
    color-mix(in srgb, var(--accent) 8%, transparent),
    transparent 60%
  );
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
}

.session {
  width: 100%;
  max-width: 44rem;
  margin: 0;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background-color: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
}

/* A prompt line: the "tom@homelab:~$" part comes from CSS, so a screen
 * reader reads only the command. */
.line {
  margin: 0 0 0.25rem;
  color: var(--muted);
}

.prompt::before {
  content: "tom@homelab:~$ ";
  color: var(--accent);
}

/* The typed command, brighter than the prompt. */
.cmd {
  color: var(--ink);
}

.out {
  margin: 0 0 1.75rem;
  color: var(--ink);
}

.name {
  margin: 0.25rem 0 1.75rem;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.links li + li {
  margin-top: 0.5rem;
}

a {
  display: inline-flex;
  align-items: center;
  /* 44px target, even on a phone. */
  min-height: 44px;
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* The cursor block on the last line. */
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 0.5ch;
  vertical-align: -0.2em;
  background-color: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .cursor {
    animation: blink 1.2s steps(2, start) infinite;
  }
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

::selection {
  background-color: var(--accent);
  color: var(--bg);
}
