/* The site's own look ("techy"). The same colours live as the Techy palette on design.jaeggisimon.ch;
   these values are the fallback for when that stylesheet can't load (and for the 404 page). */
:root {
  --bg: #F2F3F0;
  --bar: #FFFFFF;
  --line: #D9DCE1;
  --ink: #1C2230;
  --muted: #7F8693;
  --caret: #3B5BDB;
  --sel: #EEF1FB;
  --shadow: 0 1px 0 rgba(28,34,48,.04), 0 12px 32px -12px rgba(28,34,48,.18);
  color-scheme: light;
}
/* data-mode is set by the theme script; without it, follow the system */
:root[data-mode="dark"] {
  --bg: #15181E;
  --bar: #1E222A;
  --line: #2C313B;
  --ink: #E6E8EC;
  --muted: #737B88;
  --caret: #8DA4FF;
  --sel: #262C3A;
  --shadow: 0 1px 0 rgba(255,255,255,.03), 0 16px 40px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-mode]) {
    --bg: #15181E;
    --bar: #1E222A;
    --line: #2C313B;
    --ink: #E6E8EC;
    --muted: #737B88;
    --caret: #8DA4FF;
    --sel: #262C3A;
    --shadow: 0 1px 0 rgba(255,255,255,.03), 0 16px 40px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
/* A palette from design.jaeggisimon.ch/api/palettes.css sets --bg --ink --muted --line directly;
   the rest of this site's tokens map onto its field, purple (accent) and hover. */
:root[data-palette] {
  --bar: var(--field);
  --caret: var(--purple);
  --sel: var(--hover);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.4 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  display: grid;
  place-items: center;
  padding: 0 16px;
}
main {
  width: min(560px, 100%);
  margin-top: -12vh;
}
h1 {
  margin: 0 0 18px 17px;
  font: inherit;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 a { color: inherit; text-decoration: none; }
p { margin: 0 0 0 17px; color: var(--muted); }
p a { color: var(--caret); }

/* The bar grows into a results panel, like Spotlight */
.palette {
  position: relative;
}
form {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 16px;
  background: var(--bar);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: border-color .15s ease;
}
form:focus-within { border-color: var(--caret); }
form svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  caret-color: var(--caret);
  caret-shape: block;
}
input::placeholder { color: var(--muted); opacity: 1; }
kbd {
  flex: none;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
}
form:focus-within kbd { visibility: hidden; }
@media (hover: none) { kbd { display: none; } }

ul {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--bar);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  max-height: min(420px, 60vh);
  overflow-y: auto;
}
li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
}
li[aria-selected="true"] { background: var(--sel); }
li .name { flex: none; min-width: 9ch; }
li .hint {
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
li .hint b { font-weight: inherit; color: var(--caret); }
li.empty { color: var(--muted); cursor: default; }
li.output {
  flex-direction: column;
  gap: 4px;
  cursor: default;
}
li.output .cmd { color: var(--muted); font-size: 14px; }

/* ls portfolio: the app icons, like a launcher */
.apps {
  align-self: stretch;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 4px;
  margin: 6px -6px 0;
}
.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px 12px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  text-align: center;
  outline: 0;
}
.app:hover, .app:focus-visible { background: var(--sel); }
.app img {
  width: 64px;
  height: 64px;
  margin-bottom: 4px;
  transition: transform .15s ease;
}
.app:hover img, .app:focus-visible img { transform: translateY(-2px); }
.app .label { font-size: 15px; }
.app .desc { font-size: 12px; line-height: 1.35; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { form, .app img { transition: none; } }
