:root {
  color-scheme: dark;
  --desk: #07111f;
  --case: #b8aa84;
  --case-hi: #e2d4aa;
  --screen: #02080d;
  --ink: #c8d8c1;
  --dim: #7e9885;
  --cyan: #54d6cf;
  --blue: #102f8f;
  --hot: #fff7c7;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--desk); }
body {
  min-height: 100vh;
  margin: 0;
  color: #d9d2ba;
  background:
    radial-gradient(circle at 15% 12%, rgba(51, 106, 122, .18), transparent 27rem),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(255,255,255,.012) 80px),
    var(--desk);
  font-family: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", monospace;
}

a { color: var(--cyan); }
.skip { position: fixed; left: 1rem; top: -5rem; z-index: 4; padding: .6rem; background: #fff; color: #000; }
.skip:focus { top: 1rem; }

.desk { width: min(92rem, 100%); margin: 0 auto; padding: clamp(.7rem, 2vw, 2rem); }
.outside { display: flex; gap: 1rem; align-items: center; margin: 0 auto .7rem; max-width: 86rem; color: #aca68f; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.outside a { margin-right: auto; text-decoration: none; }
.wire-light { width: .55rem; height: .55rem; border-radius: 50%; background: #77ef86; box-shadow: 0 0 10px #77ef86; }

.terminal {
  overflow: hidden;
  min-height: min(74vh, 58rem);
  border: clamp(.45rem, 1vw, .9rem) solid var(--case);
  border-top-color: var(--case-hi);
  border-left-color: var(--case-hi);
  border-radius: .45rem;
  background: var(--screen);
  box-shadow: 0 1.5rem 5rem rgba(0,0,0,.55), inset 0 0 2rem rgba(0,0,0,.7);
}

.terminal-bar, .keys {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .34rem .7rem;
  color: #fff;
  background: var(--blue);
  font-size: clamp(.68rem, 1.2vw, .9rem);
  line-height: 1.35;
}
.terminal-bar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }

.screen {
  position: relative;
  min-height: calc(min(74vh, 58rem) - 4.25rem);
  padding: clamp(.6rem, 1.5vw, 1rem);
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, #061018 0, var(--screen) 80%);
  text-shadow: 0 0 .35rem rgba(154, 246, 189, .22);
}
.screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 4rem #000; }
.boot { white-space: pre-wrap; line-height: 1.6; }
.crumb { min-height: 2rem; margin: 0 0 .45rem; color: var(--hot); border-bottom: 1px solid #315143; line-height: 1.5; }
.terminal-list { position: relative; z-index: 1; }

.row {
  display: grid;
  grid-template-columns: 2.3rem minmax(10rem, 2fr) minmax(8rem, 1fr) 5.5rem;
  width: 100%;
  padding: .18rem .25rem;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.row:hover, .row.selected { color: #06101a; background: var(--cyan); text-shadow: none; }
.row .mark { text-align: center; }
.row .subject, .row .author { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .count, .row .date { text-align: right; color: var(--dim); }
.row:hover .count, .row.selected .count, .row:hover .date, .row.selected .date { color: #18322d; }
.row.group-row { grid-template-columns: 2.3rem minmax(12rem, 1fr) 6rem; padding-block: .35rem; }
.group-description { margin: .2rem .5rem 1rem 2.55rem; color: var(--dim); font-size: .82rem; line-height: 1.45; }

.article { position: relative; z-index: 1; }
.headers { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .12rem .7rem; margin: 0 0 1rem; padding-bottom: .8rem; border-bottom: 1px solid #315143; font-size: .88rem; }
.headers div { display: contents; }
.headers dt { color: var(--cyan); }
.headers dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.article pre { margin: 0; color: var(--ink); font: inherit; line-height: 1.38; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.article .historical-contact { color: #e6bf7a; }

.keys { justify-content: flex-start; flex-wrap: wrap; background: #15203a; }
.keys span { white-space: nowrap; }
kbd { padding: 0 .2rem; color: #fff; font: inherit; background: #273760; border: 1px solid #6374a4; }
.search-line { position: sticky; z-index: 3; bottom: 0; display: flex; padding: .3rem; background: #102f8f; }
.search-line input { flex: 1; border: 0; outline: 0; color: #fff; background: transparent; font: inherit; }

.margin-note { max-width: 66rem; margin: 1.1rem auto 0; columns: 2 24rem; column-gap: 3rem; color: #aaa58f; font: .78rem/1.55 system-ui, sans-serif; }
.margin-note p { margin: 0 0 .7rem; break-inside: avoid; }
.noscript { margin: 1rem; color: #fff; }

@media (max-width: 680px) {
  .desk { padding: 0; }
  .outside { padding: .55rem .7rem 0; }
  .terminal { min-height: calc(100vh - 3rem); border-width: .28rem 0; border-radius: 0; }
  .screen { min-height: calc(100vh - 8rem); }
  .terminal-bar span:last-child { display: none; }
  .row { grid-template-columns: 1.8rem minmax(0, 1fr) 3.7rem; }
  .row .author { display: none; }
  .row.group-row { grid-template-columns: 1.8rem minmax(0, 1fr) 3.8rem; }
  .group-description { margin-left: 2rem; }
  .margin-note { padding: 0 .8rem 1rem; columns: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .wire-light { animation: breathe 3s ease-in-out infinite; }
  @keyframes breathe { 50% { opacity: .45; } }
}
