/* parcel.rockorager.dev: siv's palette and parcel's face, so the page
   looks like the app. */

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --window-bg: #fafafa;
  --view-bg: #ffffff;
  --view-fg: #18181b;
  --muted-fg: #71717a;
  --border: #c4c4cc;
  --separator: #e4e4e7;
  --control-bg: #f4f4f5;
  --control-hover: #e4e4e7;
  --accent: #2563eb;
  --accent-fg: #ffffff;
  --selection-bg: #bfdbfe;
  --chip-bg: #c7d2fe;
  --status-bg: #ececef;
  --shadow: 0 12px 40px rgb(24 24 27 / 0.12);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --window-bg: #18181b;
    --view-bg: #09090b;
    --view-fg: #f4f4f5;
    --muted-fg: #a1a1aa;
    --border: #52525b;
    --separator: #3f3f46;
    --control-bg: #27272a;
    --control-hover: #3f3f46;
    --accent: #3b82f6;
    --selection-bg: #1e3a8a;
    --chip-bg: #312e81;
    --status-bg: #1f1f23;
    --shadow: 0 12px 40px rgb(0 0 0 / 0.5);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--view-bg);
  color: var(--view-fg);
  font: 15px/1.6 var(--mono);
  padding-bottom: 48px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* The header: the view's title in the accent, its filters as chips, the
   counts on the right. */
.header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  background: var(--view-bg);
  border-bottom: 1px solid var(--separator);
}

.title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
}

.title img {
  width: 28px;
  height: 28px;
}

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

.chip {
  display: inline-block;
  padding: 1px 12px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--view-fg);
  font-size: 14px;
  white-space: nowrap;
}

.counts {
  margin-left: auto;
  color: var(--muted-fg);
  font-size: 14px;
  white-space: nowrap;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* The hero: what it is, then the app itself. */
.hero {
  padding: 56px 0 32px;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 em {
  color: var(--accent);
  font-style: normal;
}

.lede {
  max-width: 62ch;
  margin: 0 0 24px;
  color: var(--muted-fg);
  font-size: 16px;
}

.shot {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--separator);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

/* Keycaps and hints, as the app's hint bars draw them. */
.hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hint {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--muted-fg);
  font-size: 14px;
}

a.hint:hover {
  text-decoration: none;
  color: var(--view-fg);
}

kbd {
  color: var(--accent);
  font: 700 14px var(--mono);
}

/* A section heads as the reader heads a thread. */
section {
  padding: 40px 0 8px;
}

h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.meta {
  margin: 0 0 20px;
  color: var(--muted-fg);
  font-size: 14px;
}

/* What parcel does, as rows of its list: who, tags, subject, snippet. */
.list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--separator);
}

.row {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  gap: 4px 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--separator);
  cursor: default;
}

.row:hover {
  background: var(--control-bg);
}

.row.selected {
  background: var(--selection-bg);
}

.who {
  color: var(--muted-fg);
  white-space: nowrap;
}

.row.unread .who {
  color: var(--view-fg);
  font-weight: 700;
}

.row.unread .who::before {
  content: "•";
  margin-left: -14px;
  margin-right: 6px;
  color: var(--accent);
}

.subject {
  font-weight: 700;
}

.tag {
  display: inline-block;
  margin-right: 8px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--control-bg);
  font-size: 13px;
  font-weight: 400;
  vertical-align: 1px;
}

.snippet {
  color: var(--muted-fg);
}

.snippet kbd {
  font-size: 15px;
}

/* The screenshots, two to a row where there is room. */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 32px;
}

figure {
  margin: 0;
}

figcaption {
  margin-top: 10px;
  color: var(--muted-fg);
  font-size: 14px;
}

/* A card, as compose's: the accent's edge on the view's background. */
.card {
  padding: 20px 24px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--view-bg);
  box-shadow: var(--shadow);
}

pre {
  margin: 0;
  overflow-x: auto;
  font: 14px/1.7 var(--mono);
}

pre .c {
  color: var(--muted-fg);
}

pre .p {
  color: var(--accent);
  user-select: none;
}

code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--control-bg);
  font: 14px var(--mono);
}

.prose {
  max-width: 76ch;
}

.prose h2 {
  margin-top: 36px;
  font-size: 18px;
}

.prose ul {
  padding-left: 1.4em;
}

.prose li {
  margin: 6px 0;
}

/* A release's changes: each commit's area as a tag, as the list tags
   threads. */
.prose section {
  padding-top: 24px;
}

.prose .changes {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--separator);
}

.changes li {
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--separator);
}

.sha {
  color: var(--muted-fg);
  font-size: 13px;
}

/* The status line: the mode in the accent, hints, and ^K on the right. */
.status {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 40px;
  padding-right: 20px;
  background: var(--status-bg);
  font-size: 14px;
}

.mode {
  display: flex;
  align-items: center;
  align-self: stretch;
  padding: 0 14px;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status .end {
  margin-left: auto;
}

@media (max-width: 640px) {
  .header {
    padding: 10px 16px;
  }

  .header .chip:not(:first-of-type),
  .counts {
    display: none;
  }

  main {
    padding: 0 16px;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .row.unread .who::before {
    margin-left: 0;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .status .hint:nth-of-type(n + 3),
  .status .end {
    display: none;
  }
}
