:root {
  color-scheme: light;

  --bg: #ffffff;
  --surface: #f6f8fa;
  --surface-2: #eaeef2;
  --border: #d0d7de;
  --border-soft: #e4e8ed;
  --text: #1f2328;
  --muted: #59636e;
  --dim: #8c959f;

  --green: #1a7f37;
  --blue: #0969da;
  --yellow: #9a6700;
  --brand: #34b06a;

  /* ANSI palette — Solarized Light, the standard light-background terminal theme.
     Which token gets which colour is captured from real `git` output, not chosen:
     log hashes and decoration punctuation are 33 (yellow), HEAD is 1;36 (bold
     cyan), branch names in a decoration are 1;32 (bold green), status short
     flags are 31/32, ls directories are 01;34. Typed commands and git's plain
     messages (Switched to…, warning:, error:) carry no colour at all. */
  --a-red: #dc322f;
  --a-green: #859900;
  --a-yellow: #b58900;
  --a-blue: #268bd2;
  --a-magenta: #d33682;
  --a-cyan: #2aa198;

  --mono: "Spline Sans Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 820px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #0969da22; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

code { color: var(--muted); }

/* ---------- chrome ---------- */

.topbar,
main,
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 28px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
}

.brand:hover { text-decoration: none; }

.mark { display: block; flex: none; }

.b-wrong { color: var(--text); }
.b-branch { color: var(--green); }
.tld { color: var(--dim); font-weight: 300; }

.topbar nav,
footer nav { display: flex; gap: 20px; }

.topbar nav a,
footer nav a {
  color: var(--muted);
  font-size: 13px;
  transition: color .15s;
}

.topbar nav a:hover,
footer nav a:hover { color: var(--text); text-decoration: none; }

main { padding-bottom: 96px; }

/* ---------- terminal window ---------- */

.win {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
  opacity: 0;
  animation: fade .5s var(--ease) .05s forwards;
}

.win-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.win-bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cdd4db;
}

.win-bar i:nth-child(1) { background: #ff5f57; }
.win-bar i:nth-child(2) { background: #febc2e; }
.win-bar i:nth-child(3) { background: #28c840; }

.win-bar span {
  margin-left: 8px;
  font-size: 12px;
  color: var(--dim);
}

.win-body {
  margin: 0;
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.95;
  white-space: pre-wrap;
  word-break: break-word;
}

.ln { display: block; }

/* the prompt itself is the one deliberate choice here — prompt colour is a
   shell-theme setting, and green is what most default themes ship. */
.pr { color: var(--a-green); font-weight: 600; user-select: none; }

.a-red     { color: var(--a-red); }
.a-green   { color: var(--a-green); }
.a-yellow  { color: var(--a-yellow); }
.a-blue    { color: var(--a-blue); }
.a-magenta { color: var(--a-magenta); }
.a-cyan    { color: var(--a-cyan); }
.a-bold    { font-weight: 700; }
.a-faint   { opacity: .62; }

.cur {
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--muted);
  animation: blink 1.1s steps(1) infinite;
}

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

.out { color: var(--muted); opacity: 0; }
.out.dim { color: var(--dim); }
.out.show { animation: fade .4s var(--ease) forwards; }

@keyframes fade { to { opacity: 1; } }

/* ---------- hero ---------- */

.hero { padding-top: 64px; }

.intro {
  margin-top: 34px;
  opacity: 0;
  animation: fade .5s var(--ease) .4s forwards;
}

.intro h1 {
  max-width: 42ch;
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -.015em;
  text-wrap: pretty;
}

.intro h1 s { color: var(--dim); }

.meta {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--dim);
}

.meta a { color: var(--muted); }
.meta a:hover { color: var(--blue); }

/* ---------- section head ---------- */

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 88px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.sec-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.sec-meta { font-size: 12px; color: var(--dim); }

/* ---------- grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.note { grid-column: 1 / -1; margin: 0; color: var(--dim); font-size: 13px; }

.card {
  display: flex;
  flex-direction: column;
  min-height: 132px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  opacity: 0;
  animation: fade .4s var(--ease) forwards;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

a.card:hover {
  border-color: #b6bfc9;
  background: #fbfcfd;
  box-shadow: 0 1px 3px #1f23280f;
  text-decoration: none;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 500;
}

a.card:hover h3 { color: var(--blue); }

.card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  font-size: 11.5px;
  color: var(--dim);
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  padding: 0 6px;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  color: var(--dim);
}

.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, var(--dim));
}

.hash { color: var(--dim); }

/* ---------- empty state ---------- */

.empty { grid-column: 1 / -1; }

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.slot {
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: #b8c0c8;
  font-size: 12px;
}

/* ---------- footer ---------- */

footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 20px 40px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--dim);
}

/* ---------- 404 ---------- */

.oops { padding-top: 96px; }
.oops h1 { margin: 0 0 8px; font-size: 15px; font-weight: 500; color: var(--muted); }
.oops .fatal { margin: 0 0 24px; color: var(--dim); }

/* ==========================================================
   app pages — /apps/<slug>/ fills the screen
   ========================================================== */

body.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app .app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: none;
  padding: 20px 28px;
  font-size: 13px;
}

.app .app-bar a { color: var(--muted); }
.app .app-bar a:hover { color: var(--text); text-decoration: none; }
.app .app-bar .crumb { color: var(--dim); }

.app .app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  max-width: none;
  padding: 0 28px 72px;
  text-align: center;
}

.app .app-main h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 500;
  letter-spacing: -.03em;
}

.app .hint {
  margin: 0 0 34px;
  max-width: 44ch;
  color: var(--muted);
  font-size: 14px;
  text-wrap: pretty;
}

.app .stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 720px;
  min-height: 240px;
}

/* ---------- responsive ---------- */

@media (max-width: 560px) {
  .topbar, main, footer { padding-inline: 18px; }
  .hero { padding-top: 44px; }
  .sec-head { margin-top: 64px; }
  .win-bar span { display: none; }
  .grid, .slots { grid-template-columns: 1fr; }
  .intro h1 { font-size: 18px; }
  .app .app-bar { padding: 16px 18px; }
  .app .app-main { padding: 0 18px 56px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
}
