/* colour scheme: solarized (light/dark), https://ethanschoonover.com/solarized/
   light-dark() picks the right value for the user's color-scheme, so the two
   palettes live side by side instead of in a duplicated media query block. */
:root {
  color-scheme: light dark;

  --bg: light-dark(#fdf6e3, #002b36);          /* cream / near-black teal, page background */
  --bg-alt: light-dark(#eee8d5, #073642);      /* tan / dark teal, panel background */
  --fg: light-dark(#657b83, #839496);          /* slate / soft grey-blue, body text */
  --fg-emphasis: light-dark(#586e75, #93a1a1); /* dark slate / light grey, headings */
  --muted: light-dark(#93a1a1, #586e75);       /* grey-blue / slate, muted/secondary text */
  --border: var(--bg-alt);
  --accent: #268bd2;         /* blue, same in both themes */
  --accent-visited: #6c71c4; /* violet, same in both themes */
  --focus: #cb4b16;          /* orange, same in both themes */
  --prompt: #859900;         /* green, same in both themes */
  --flag-blue: light-dark(#0f6fa3, #5bcefa);   /* trans flag blue; light value deepened for contrast on cream bg */
  --flag-pink: light-dark(#c2185b, #f5a9b8);   /* trans flag pink; light value deepened for contrast on cream bg */
  --flag-white: light-dark(#586e75, #ffffff);  /* trans flag white stripe; light value deepened for contrast on cream bg */

  --max-width: 46rem;
  --max-width-wide: min(95vw, 100rem);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* base */

* {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  background: var(--bg-alt);
  color: var(--fg);
  font-family: var(--mono);
  line-height: 1.6;
  padding: 1rem;
}

.skip-link { position: absolute; left: -999px; top: auto; }
.skip-link:focus { position: static; display: inline-block; margin: 1rem; }

/* terminal window chrome */

.terminal {
  max-width: var(--max-width-wide);
  margin: 1rem auto;
  background: var(--bg);
  border: 1px solid var(--muted);
  border-radius: 6px;
  overflow: hidden;
  padding: 0 1.5rem 1.5rem;
}

.term-titlebar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 -1.5rem 1.5rem;
  padding: 0.5rem 1.5rem;
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.term-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-lang { display: flex; align-items: baseline; gap: 0.35rem; flex-shrink: 0; }

.term-lang-btn {
  background: none;
  border: none;
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
}

.term-lang-btn:hover,
.term-lang-btn:focus-visible {
  opacity: 1;
  text-decoration: underline;
}

.term-lang-btn[aria-pressed="true"] {
  opacity: 1;
  color: var(--fg-emphasis);
  font-weight: bold;
  cursor: default;
}

.term-lang-sep { opacity: 0.4; }

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  border-top: 1px solid var(--border);
  padding: 1.25rem 0 0.5rem;
  color: var(--fg);
  font-size: 0.85rem;
}

footer p { margin: 0; }

header { padding-top: 0.5rem; padding-bottom: 1.5rem; }

/* hyfetch-style banner: cat art + tagline */

.hyfetch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

/* cat art and tagline sit side by side once there's room for both */
@media (min-width: 45rem) {
  .hyfetch {
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
  }
}

.ascii-cat { flex: 0 0 auto; margin: 0; line-height: 1.15; }

.flag-blue { color: var(--flag-blue); }
.flag-pink { color: var(--flag-pink); }
.flag-white { color: var(--flag-white); }

.hyfetch-info { flex: 1 1 auto; min-width: 0; width: 100%; }

h1 { font-size: 2rem; margin: 0 0 0.5rem; }

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

/* blinking cursor after h1; empty pseudo-element adds no text, so it's safe for
   the accessible name */
h1::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 0.3em;
  background: var(--fg-emphasis);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

@media (prefers-reduced-motion: reduce) {
  h1::after { animation: none; }
}

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

.tagline { font-size: 1.1rem; margin: 0 0 1rem; color: var(--fg-emphasis); }

/* resource groups */

main { padding-bottom: 1rem; }

.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2.5rem;
  align-items: start;
}

section { margin-bottom: 2.5rem; }
section section { margin-bottom: 1.75rem; }

/* no trailing gap after the last item in a group */
.categories > section,
section section:last-child {
  margin-bottom: 0;
}

h2 {
  font-size: 1.4rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

h3 { font-size: 1.05rem; margin-bottom: 0.5rem; color: var(--fg-emphasis); }

ul { list-style: none; padding-left: 1.25rem; margin: 0; }
li { margin-bottom: 0.5rem; }
li::before { content: "> "; color: var(--prompt); }

/* links */

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s ease;
}

a:hover, a:focus { text-decoration-color: currentColor; }
a:visited { color: var(--accent-visited); }

/* shared focus ring for interactive elements */
a:focus-visible,
.term-lang-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

small { font-size: 0.85rem; margin-left: 0.4rem; }

/* tighten up terminal chrome once it no longer has room to breathe */
@media (max-width: 30rem) {
  .terminal { margin: 0.5rem auto; padding: 0 1rem 1rem; }
  .term-titlebar { margin: 0 -1rem 1.5rem; padding: 0.5rem 1rem; }
  h1 { font-size: 1.6rem; }
}

