* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --fg: #111111;
  --mut: #666666;
  --line: #d9d9d9;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.mono { font-family: var(--mono); }

a { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }
a:hover { background: var(--fg); color: var(--bg); text-decoration: none; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 18px; }

/* header */
header.site { border-bottom: 2px solid var(--fg); }
header.site .wrap { padding-top: 22px; padding-bottom: 14px; }
.brand { font-family: var(--mono); font-weight: 700; font-size: 20px; letter-spacing: -0.5px; }
.tagline { color: var(--mut); font-size: 13.5px; margin-top: 4px; max-width: 52ch; }
nav.main { display: flex; gap: 14px; margin-top: 12px; font-family: var(--mono); font-size: 13px; }
nav.main a.on { background: var(--fg); color: var(--bg); text-decoration: none; padding: 1px 6px; }

/* timeline */
#timeline {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--fg);
  overflow-x: auto;
  scrollbar-width: thin;
}
#timeline .strip { display: flex; min-width: max-content; }
#timeline a {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 8px 12px;
  text-decoration: none;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}
#timeline a:hover { background: var(--fg); color: var(--bg); }
#timeline a.on { background: var(--fg); color: var(--bg); }
#timeline a .dn { display: block; color: var(--mut); font-size: 10px; letter-spacing: 0; }
#timeline a.on .dn { color: #bbb; }

main { padding: 26px 0 60px; }

/* typography blocks */
h1.day {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.sub { color: var(--mut); font-family: var(--mono); font-size: 12.5px; margin-top: 6px; }
.statline {
  font-family: var(--mono);
  font-size: 13px;
  margin: 16px 0 4px;
  padding: 8px 10px;
  border-top: 1px solid var(--fg);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.statline b { font-weight: 700; }

.prose { margin-top: 20px; }
.prose p { margin-bottom: 14px; max-width: 64ch; }
.prose p:last-child { margin-bottom: 0; }

h2.sec {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 34px 0 10px;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 5px;
}

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--mut);
  border-bottom: 2px solid var(--fg);
  padding: 6px 8px 6px 0;
}
td { border-bottom: 1px solid var(--line); padding: 6px 8px 6px 0; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
td.n, th.n { text-align: right; font-family: var(--mono); white-space: nowrap; }
td.rk { font-family: var(--mono); color: var(--mut); width: 34px; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f2f2f2; }
.barcell { width: 34%; min-width: 90px; }
.bar { height: 9px; background: var(--fg); }
.bar.max { outline: 1px solid var(--fg); background: transparent; }

/* misc components */
.facts { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--fg); }
.facts div { flex: 1 1 120px; padding: 10px 12px; border-right: 1px solid var(--line); }
.facts div:last-child { border-right: none; }
.facts .k { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--mut); }
.facts .v { font-family: var(--mono); font-size: 18px; font-weight: 700; margin-top: 2px; }

button, input[type="text"], input[type="password"] {
  font: inherit;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--fg);
  border-radius: 0;
  padding: 8px 12px;
}
button { font-family: var(--mono); font-size: 13px; cursor: pointer; }
button:hover { background: var(--fg); color: var(--bg); }
input[type="text"], input[type="password"] { font-family: var(--mono); width: 100%; font-size: 16px; }
input:focus, button:focus { outline: 2px solid var(--fg); outline-offset: 1px; }

.linkbtn {
  background: none; border: none; padding: 0;
  font-family: inherit; font-size: inherit;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
  color: var(--fg);
}
.linkbtn:hover { background: var(--fg); color: var(--bg); }

/* hours chart */
.hours { display: flex; align-items: flex-end; gap: 2px; height: 70px; margin-top: 8px; }
.hours .col { flex: 1; position: relative; background: #f2f2f2; height: 100%; }
.hours .col i { position: absolute; bottom: 0; left: 0; right: 0; background: var(--fg); display: block; }
.hours .col:hover::after {
  content: attr(data-l);
  position: absolute; bottom: calc(100% + 4px); left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono); font-size: 10px; background: var(--fg); color: var(--bg);
  padding: 1px 5px; white-space: nowrap; z-index: 2;
}
.hourx { display: flex; gap: 2px; font-family: var(--mono); font-size: 9px; color: var(--mut); margin-top: 3px; }
.hourx span { flex: 1; text-align: center; overflow: hidden; }

/* messages list */
.msglist { list-style: none; font-size: 13.5px; }
.msglist li { border-bottom: 1px solid var(--line); padding: 7px 0; display: flex; gap: 10px; }
.msglist li:last-child { border-bottom: none; }
.msglist .mt { font-family: var(--mono); color: var(--mut); white-space: nowrap; font-size: 12px; padding-top: 1px; }
.msglist .mx { word-break: break-word; max-width: 58ch; white-space: pre-wrap; }

/* gate */
#gate { padding: 60px 0 40px; }
#gate form { max-width: 340px; }
#gate label { display: block; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; margin: 18px 0 5px; }
#gate .hint { font-family: var(--mono); font-size: 11px; color: var(--mut); margin-top: 4px; }
#gate button { margin-top: 20px; width: 100%; }
#gate .err { display: none; margin-top: 14px; font-size: 14px; border-left: 3px solid var(--fg); padding: 4px 10px; }
#gate .err.show { display: block; }

footer.site { border-top: 1px solid var(--fg); }
footer.site .wrap { padding: 14px 0 30px; color: var(--mut); font-size: 12.5px; font-family: var(--mono); }

.backlink { font-family: var(--mono); font-size: 12px; display: inline-block; margin-bottom: 14px; }
.hidden { display: none !important; }

@media (max-width: 640px) {
  body { font-size: 15px; }
  header.site .wrap { padding-top: 16px; padding-bottom: 10px; }
  .tagline { font-size: 12.5px; }
  h1.day { font-size: 18px; }
  main { padding-top: 20px; }
  nav.main { gap: 10px; }
  nav.main a { padding: 3px 8px; }
}

@media (max-width: 520px) {
  .facts div { flex-basis: 46%; border-bottom: 1px solid var(--line); }
  td.barcell, th.bh { display: none; }
  /* people table on phones: rank, who, msgs, days only */
  td:nth-child(5), th:nth-child(5), td:nth-child(6), th:nth-child(6) { display: none; }
  .msglist .mx { max-width: none; }
  #timeline a { padding: 8px 10px; }
}
