/* Shared by slopcommander.xyz and slopviewer.xyz: one layout, two palettes.
   The frames, titles set into their borders and the key bar come from FAR and Norton Commander. */

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

/* Slop Commander: Classic Blue. */
:root {
  --bg: #0a1446;
  --panel: #10206a;
  --panel-head: #0d1a5a;
  --line: #5cc8e4;
  --text: #e8edfb;
  --muted: #a3b2df;
  --name: #7fdcf0;
  --accent: #ffd84a;
  --bar: #4cbfd8;
  --bar-text: #031033;
  --cursor: rgba(92, 200, 228, 0.22);
  --dialog: #d5dae6;
  --dialog-text: #10173a;
  --dialog-line: #10173a;
  --code-bg: #0a1446;
  --code-text: #dfe7ff;
  --shot-line: rgba(92, 200, 228, 0.45);
  --shadow: rgba(0, 0, 0, 0.45);
  --body-font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* Slop Viewer: ink on paper, the indigo of mdv's icon. */
.viewer {
  --bg: #efe9dc;
  --panel: #f8f4eb;
  --panel-head: #efe9dc;
  --line: #262a63;
  --text: #1d2042;
  --muted: #5a5d7d;
  --name: #3f41c4;
  --accent: #b3471d;
  --bar: #262a63;
  --bar-text: #f3eee3;
  --cursor: rgba(84, 86, 214, 0.12);
  --dialog: #e4dccb;
  --dialog-text: #1d2042;
  --dialog-line: #262a63;
  --code-bg: #1d2042;
  --code-text: #f3eee3;
  --shot-line: rgba(38, 42, 99, 0.35);
  --shadow: rgba(38, 42, 99, 0.25);
  --body-font: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--body-font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--name); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

code, kbd, pre { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--cursor); padding: 0.08em 0.35em; border-radius: 3px; }

/* The menu bar along the top, as FAR's. */
.menubar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 24px;
  height: 40px;
  background: var(--bar);
  color: var(--bar-text);
  font: 500 14px/1 var(--mono);
}
.menubar a { color: inherit; text-decoration: none; }
.menubar a:hover { text-decoration: underline; }
.menubar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-right: auto; }
.menubar .brand img { width: 22px; height: 22px; }

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

/* A panel: a double frame with its title set into the top border. */
.frame {
  position: relative;
  margin-top: 56px;
  padding: 36px 36px 32px;
  background: var(--panel);
  border: 4px double var(--line);
}
.frame > .title {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -58%);
  padding: 2px 12px;
  background: var(--panel);
  font: 700 15px/1.4 var(--mono);
  white-space: nowrap;
}
.frame.active > .title { background: var(--bar); color: var(--bar-text); }

h1, h2, h3 { font-family: var(--mono); line-height: 1.2; margin: 0; }

/* The opening panel. */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5.4vw, 56px); letter-spacing: -0.02em; }
.hero h1 small { display: block; margin-top: 10px; font-size: 16px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.hero .lede { font-size: 21px; line-height: 1.5; max-width: 34em; margin: 20px 0 0; }
.hero .icon { width: 168px; height: 168px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 28px; }
.meta { font: 13px/1.5 var(--mono); color: var(--muted); }

/* Buttons are bars of the menu's colour, as a FAR dialog's focused button. */
.button {
  display: inline-block;
  padding: 11px 20px;
  background: var(--bar);
  color: var(--bar-text);
  font: 700 15px/1 var(--mono);
  text-decoration: none;
  border: 0;
}
.button::before { content: "[ "; }
.button::after { content: " ]"; }
.button:hover { background: var(--accent); color: var(--bar-text); }
.viewer .button:hover { color: #fff; }

/* Screenshots. */
figure { margin: 0; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--shot-line);
  border-radius: 10px;
  box-shadow: 0 20px 50px -18px var(--shadow);
}
/* A caption: the heading on the left, its text in two columns, the keys under the text. */
.caption {
  display: grid;
  grid-template-columns: 260px 1fr 1fr;
  gap: 10px 36px;
  align-items: start;
}
.caption h3 { font-size: 19px; grid-row: span 2; }
.caption p { margin: 0; }
.caption .keys { grid-column: 2 / span 2; margin-top: 4px; }
.lead-shot { margin-top: 40px; }
.lead-shot .caption { margin-top: 30px; }

.tour { display: grid; gap: 72px; }
.tour .caption { margin-bottom: 24px; }

/* Keys look like the key bar's cells: a number, then a label in the bar's colour. */
kbd {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel-head);
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  white-space: nowrap;
}

/* The features panel, laid out as the Details view. */
.listing { width: 100%; border-collapse: collapse; font-size: 16px; }
.listing th {
  text-align: left;
  padding: 0 12px 10px;
  font: 500 13px/1 var(--mono);
  color: var(--muted);
  border-bottom: 1px solid var(--shot-line);
}
.listing td { padding: 9px 12px; vertical-align: top; border-bottom: 1px solid transparent; }
.listing td:first-child { font: 500 15px/1.6 var(--mono); color: var(--name); white-space: nowrap; }
.listing td:last-child, .listing th:last-child { text-align: right; white-space: nowrap; }
.listing tbody tr:hover td { background: var(--cursor); }
.listing tbody tr:hover td:first-child { color: var(--accent); }

/* The download panel is a dialog, light on the page as FAR's are. */
.dialog { background: var(--dialog); color: var(--dialog-text); border-color: var(--dialog-line); }
.dialog > .title { background: var(--dialog); color: var(--dialog-text); }
.dialog a:not(.button) { color: inherit; }
.dialog .meta { color: inherit; opacity: 0.75; }
.dialog ol { margin: 26px 0 0; padding-left: 1.4em; }
.dialog li { margin-bottom: 14px; padding-left: 6px; }
.dialog li::marker { font-family: var(--mono); font-weight: 700; }
.dialog code { background: rgba(16, 23, 58, 0.09); }
pre {
  margin: 10px 0 6px;
  padding: 12px 16px;
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 6px;
  line-height: 1.5;
}
pre code { background: none; padding: 0; font-size: 14px; }

.download-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.download-head h2 { font-size: 24px; }

.note { margin-top: 22px; font-size: 15px; }

/* The sibling app. */
.sibling { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.sibling img { width: 96px; height: 96px; }
.sibling h2 { font-size: 22px; margin-bottom: 8px; }
.sibling { align-items: start; }
.sibling p { margin: 0 0 10px; }
.sibling ul { margin: 0 0 14px; padding-left: 1.2em; }
.sibling li { margin-bottom: 6px; }
.sibling li::marker { content: "▸ "; color: var(--line); }
.pair { margin: 18px 0 0; font-size: 15px; color: var(--muted); }

.limits { margin-top: 24px; font-size: 15px; color: var(--muted); }

/* The key bar along the bottom: 1 Help, 2, 3 View… */
.keybar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border-top: 1px solid var(--shot-line);
  font: 13px/1 var(--mono);
}
.keybar a, .keybar span.cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 7px 8px;
  text-decoration: none;
  color: var(--bar-text);
  background: var(--bar);
  opacity: 1;
}
.keybar span.cell { opacity: 0.35; }
.keybar .n { color: var(--text); background: var(--bg); padding: 2px 4px; margin: -2px 0 -2px -4px; }
.keybar a:hover { background: var(--accent); }
.keybar .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

footer {
  margin-top: 64px;
  font: 13px/1.7 var(--mono);
  color: var(--muted);
  text-align: center;
}
footer a { color: inherit; }

@media (max-width: 860px) {
  body { font-size: 16px; }
  .frame { padding: 30px 20px 24px; }
  .hero { grid-template-columns: 1fr; }
  .hero .icon { width: 96px; height: 96px; order: -1; }
  .caption { grid-template-columns: 1fr; gap: 12px; }
  .caption h3 { grid-row: auto; }
  .caption .keys { grid-column: auto; }
  .listing td:nth-child(2) { font-size: 15px; }
  .listing th:last-child, .listing td:last-child { display: none; }
  .keybar { position: static; grid-template-columns: repeat(5, 1fr); }
  .keybar span.cell { display: none; }
  main { padding-bottom: 40px; }
  .menubar { gap: 18px; padding: 0 16px; font-size: 13px; }
  .menubar .optional { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
