:root {
  color-scheme: light;
  --bg: #fff;
  --text: #282828;
  --muted: #767676;
  --faint: #a3a3a3;
  --rule: #e4e4e4;
  --wash: #f6f6f4;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --column: 700px;
  --panel: 400px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1c1c;
  --text: #e6e3dc;
  --muted: #9b9891;
  --faint: #6b6964;
  --rule: #333230;
  --wash: #262523;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1c1c1c;
    --text: #e6e3dc;
    --muted: #9b9891;
    --faint: #6b6964;
    --rule: #333230;
    --wash: #262523;
  }
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* top bar ------------------------------------------------------------- */

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 18px 24px;
  font-family: var(--sans);
  font-size: 13px;
}

.wordmark {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

.top-links a,
.top-links button { margin-left: 22px; }

.top-links button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.top-links button:hover { text-decoration: underline; text-underline-offset: 2px; }

/* page column --------------------------------------------------------- */

.page {
  max-width: var(--column);
  margin: 40px auto 96px;
  padding: 0 16px;
}

.intro {
  margin: 0 0 40px;
}

.intro .stale { color: var(--muted); }

/* filters ------------------------------------------------------------- */

.filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 32px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.filters label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  min-width: 0;
}


.filters select,
.filters input {
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 2px 0;
  flex: 1;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.filters select {
  padding-right: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M0 0h8L4 5z' fill='%23767676'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
}

.filters input { cursor: text; }
.filters input::placeholder { color: var(--faint); }

.filters select:focus,
.filters input:focus {
  outline: none;
  border-bottom-color: var(--text);
}

.count {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 6px;
  display: flex;
  justify-content: space-between;
}

.count button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* listings ------------------------------------------------------------ */

.listings {
  list-style: none;
  margin: 0;
  padding: 0;
}

.listings li {
  display: grid;
  grid-template-columns: 84px 1fr auto 16px;
  gap: 0 20px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}

.listings li:hover .title { text-decoration: underline; text-underline-offset: 3px; }

.listings li.selected {
  background: var(--wash);
  box-shadow: -12px 0 0 var(--wash), 12px 0 0 var(--wash);
}

.age {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.age.fresh { color: var(--text); }

.title { margin: 0; font-weight: normal; font-size: 17px; line-height: 1.4; }

.meta {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.meta .sep { margin: 0 6px; color: var(--faint); }

.source {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.empty {
  padding: 40px 0;
  color: var(--muted);
}

/* applied ticks ------------------------------------------------------- */

.tick {
  width: 16px;
  height: 16px;
  align-self: start;
  margin-top: 4px;
  padding: 0;
  border: 1px solid var(--faint);
  border-radius: 2px;
  background: none;
  cursor: pointer;
  position: relative;
}

.tick:hover { border-color: var(--text); }

.tick[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
}

.tick[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid var(--bg);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.listings li.applied .title { color: var(--muted); }
.listings li.applied .age.fresh { color: var(--muted); }

.detail .mark {
  font: 13px var(--sans);
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  margin-left: 16px;
  cursor: pointer;
}

.detail .mark:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

.top-links .current { color: var(--muted); }

/* applied page -------------------------------------------------------- */

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 48px;
  margin-bottom: 48px;
}

.fact-group.wide { grid-column: 1 / -1; }

.fact-group h2 {
  font-family: var(--sans);
  font-weight: normal;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
}

.fact {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
}

.fact-group.wide .fact { font-size: 14px; }
.fact b { font-weight: normal; color: var(--text); white-space: nowrap; }
.fact span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.listings .gone { color: var(--faint); font-style: italic; }
.applied-page .listings li { cursor: default; }
.applied-page .listings li:hover .title { text-decoration: none; }
.applied-page .listings li.applied .title { color: var(--text); }
.applied-page .listings .title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.applied-page .age .posted { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }

.tools .actions {
  font-family: var(--sans);
  font-size: 13px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.tools .actions button,
.tools .import {
  font: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tools .actions button:hover,
.tools .import:hover { color: var(--text); }
.tools .import input { display: none; }

/* about --------------------------------------------------------------- */

.about {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.about h2 {
  font-family: var(--sans);
  font-weight: normal;
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 12px;
}

.about p { margin: 0 0 18px; }
.about a { text-decoration: underline; text-underline-offset: 2px; }

.polled {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

/* Two hundred company names is a wall of text, so keep it folded away. */
.polled summary {
  cursor: pointer;
  width: fit-content;
}

.polled p { margin: 10px 0 0; }

/* detail panel -------------------------------------------------------- */

.detail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--panel);
  background: var(--bg);
  border-left: 1px solid var(--rule);
  overflow-y: auto;
  padding: 56px 32px 48px;
}

.close {
  position: absolute;
  top: 12px;
  right: 20px;
  font: 24px/1 var(--sans);
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 4px 8px;
}

.close:hover { color: var(--text); }

.detail .kicker {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}

.detail h2 {
  font-weight: normal;
  font-size: 22px;
  line-height: 1.3;
  margin: 0 0 6px;
}

.detail .company {
  margin: 0 0 24px;
  color: var(--muted);
}

.apply {
  display: inline-block;
  font: 14px var(--sans);
  color: var(--bg);
  background: var(--text);
  padding: 9px 18px;
  border-radius: 2px;
}

.apply:hover { text-decoration: none; opacity: 0.85; }

.detail .also {
  font-family: var(--sans);
  font-size: 13px;
  margin-left: 16px;
  color: var(--muted);
}

.detail .also:hover { color: var(--text); }

.detail dl {
  margin: 32px 0 0;
  font-size: 15px;
  border-top: 1px solid var(--rule);
}

.detail dt {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
}

.detail dd { margin: 2px 0 0; }
.detail dd + dd { margin-top: 0; }
.detail dd .when { color: var(--muted); }
.detail dd a { text-decoration: underline; text-underline-offset: 2px; }

.detail .more {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.detail .more h3 {
  font-family: var(--sans);
  font-weight: normal;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
}

.detail .more ul { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.detail .more li { padding: 4px 0; cursor: pointer; }
.detail .more li:hover { text-decoration: underline; text-underline-offset: 2px; }
.detail .more .where { color: var(--muted); font-family: var(--sans); font-size: 12px; margin-left: 6px; }

.detail .note {
  margin-top: 32px;
  font-size: 14px;
  color: var(--muted);
}

/* corner fire ---------------------------------------------------------- */

#fire {
  position: fixed;
  left: 36px;
  bottom: 28px;
  width: 80px;
  height: 96px;
  cursor: default;
}

#fire canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}

@media (max-width: 1000px) {
  #fire { display: none; }
  body.has-detail .to-top { display: none; }
}

/* back to top ---------------------------------------------------------- */

.to-top {
  position: fixed;
  right: 36px;
  bottom: 28px;
  font: 13px var(--sans);
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 6px 12px;
  cursor: pointer;
}

.to-top:hover { color: var(--text); border-color: var(--muted); }

body.has-detail .to-top { right: calc(var(--panel) + 36px); }

/* when the panel would cover the column, give it the right margin ------ */

@media (max-width: 1560px) {
  body.has-detail { padding-right: var(--panel); }
}

@media (max-width: 1000px) {
  body.has-detail { padding-right: 0; }
  .detail { width: min(var(--panel), 100%); }
}

@media (max-width: 640px) {
  .top { padding: 14px 16px; }
  .filters { grid-template-columns: repeat(2, 1fr); gap: 14px 24px; }
  .listings li { grid-template-columns: 1fr auto 16px; }
  .age { grid-column: 1 / -1; order: -1; }
  .applied-page .age .posted { display: inline; margin-left: 10px; }
  .facts { grid-template-columns: 1fr; }
  .detail { width: 100%; padding: 56px 20px 40px; }
}
