:root {
  font-family:
    Departure Mono,
    monospace;
  /* Departure Mono has no bold face, so allow weight synthesis */
  font-synthesis: weight;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: light dark;

  --amber: #ffa133;
  --pumpkin: #e47b1a;
  --periwinkle: #8f99fb;
  --enamel: #eeeeee;
  --ash: #8e8e8e;
  --mud: #8a8a6f;
  --clay: #6c6c58;
  --smoke: #666666;
  --dark: #444444;
  --carbon: #222222;

  --link: blue;
  --border: var(--smoke);
  --accent: var(--amber);
  --fg: var(--dark);
  --bg: var(--enamel);
  --muted: var(--clay);
  --hover: #e4e4e4;
  --add: #d9f2d0;
  --del: #f6d5d8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --border: var(--mud);
    --link: var(--periwinkle);
    --fg: var(--enamel);
    --bg: var(--carbon);
    --muted: #bccabb;
    --hover: #2c2c2c;
    --add: #173d1c;
    --del: #4a1f24;
  }
}

@font-face {
  font-family: DepartureMono;
  src:
    url("/fonts/DepartureMono-1.500/DepartureMono-Regular.woff2")
      format("woff2"),
    url("/fonts/DepartureMono-1.500/DepartureMono-Regular.woff") format("woff"),
    url("/fonts/DepartureMono-1.500/DepartureMono-Regular.otf")
      format("opentype");
}

* {
  box-sizing: border-box;
}

body {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
  color: var(--fg);
  background-color: var(--bg);
  font-size: 0.9rem;
  line-height: 1.5;
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: 1em;
  margin: 1rem 0 0.5rem;
}

h1 {
  color: var(--accent);
}

img,
h1,
h2 {
  vertical-align: middle;
}

img {
  border: 0;
}

hr {
  border: 0;
  border-top: 1px dashed var(--border);
  height: 1px;
  margin: 1rem 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

table thead td {
  font-weight: bold;
  border-bottom: 1px solid var(--border);
}

table td {
  padding: 0.15rem 0.4rem;
  vertical-align: top;
}

#branches tr:hover td,
#tags tr:hover td,
#index tr:hover td,
#log tr:hover td,
#files tr:hover td {
  background-color: var(--hover);
}

#content table td {
  white-space: nowrap;
}

#index tr td:nth-child(2),
#tags tr td:nth-child(3),
#branches tr td:nth-child(3),
#log tr td:nth-child(2) {
  white-space: normal;
}

td.num {
  text-align: right;
}

.desc {
  color: var(--muted);
}

.url a {
  overflow-wrap: anywhere;
}

#content pre {
  margin: 0;
  overflow-x: auto;
}

#blob a {
  color: var(--muted);
}

#blob a.line {
  display: inline-block;
  min-width: 4ch;
  margin-right: 1ch;
  text-align: right;
  user-select: none;
}

#blob a:target,
#blob a.line:hover {
  color: var(--accent);
}

a.d,
a.h,
a.i,
a.line {
  text-decoration: none;
}

a.i {
  background-color: var(--add);
}

a.d {
  background-color: var(--del);
}

a.h {
  color: var(--accent);
}

.A,
.M,
.D,
.R,
.C,
.T,
.U,
.X {
  font-weight: bold;
}

.A,
.i {
  color: #1d7a32;
}

.D,
.d {
  color: #b4232f;
}

@media (prefers-color-scheme: dark) {
  .A,
  .i {
    color: #7ddb91;
  }

  .D,
  .d {
    color: #ff8a95;
  }
}

@media screen and (max-width: 800px) {
  body {
    padding: 1rem;
  }

  #content {
    overflow-x: auto;
  }
}
