/* Theme for the OSO download host's directory listings.
 *
 * nginx's fancyindex module generates the page: a <title>, this stylesheet, then
 * the header fragment, an <h1>Index of ...</h1>, a <table id="list">, and the
 * footer fragment. Setting fancyindex_css_href REPLACES the module's built-in
 * stylesheet entirely, so everything the listing needs has to be here.
 *
 * Matched to web/oldschoolops (ink-950 ground, one #46ff00 accent, Space Grotesk
 * headings) so a visitor who arrives from the main site does not feel like they
 * left it. The palette is duplicated rather than shared, because this file is
 * served by a different machine that has no access to the site's build.
 */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@400;500&family=JetBrains+Mono:wght@400&display=swap');

:root {
  --ink-950: #07090a;
  --ink-900: #0c1011;
  --ink-850: #111618;
  --ink-700: #222a2e;
  --ink-600: #313b40;
  --ink-400: #6b7a81;
  --ink-300: #97a5ab;
  --ink-200: #c4cdd1;
  --ink-100: #e6ebed;
  --brand-300: #8dff63;
  --brand-400: #46ff00;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 1.25rem 4rem;
  background: var(--ink-950);
  color: var(--ink-200);
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-400); text-decoration: none; }
a:hover { color: var(--brand-300); text-decoration: underline; }

/* --- the header/footer fragments ------------------------------------------ */

.oso-bar {
  max-width: 64rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--ink-700);
}

.oso-mark {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink-100);
}
.oso-mark span { color: var(--brand-400); }
.oso-mark:hover { text-decoration: none; color: var(--ink-100); }

.oso-bar nav { display: flex; gap: 1.25rem; font-size: 0.875rem; }
.oso-bar nav a { color: var(--ink-300); }
.oso-bar nav a:hover { color: var(--brand-400); text-decoration: none; }

.oso-note {
  max-width: 64rem;
  margin: 1.5rem auto 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ink-700);
  border-left: 2px solid var(--brand-400);
  border-radius: 0.375rem;
  background: var(--ink-900);
  color: var(--ink-300);
  font-size: 0.875rem;
  line-height: 1.6;
}

.oso-foot {
  max-width: 64rem;
  margin: 3rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ink-700);
  color: var(--ink-400);
  font-size: 0.8125rem;
  line-height: 1.7;
}

/* --- the listing fancyindex generates ------------------------------------- */

h1 {
  max-width: 64rem;
  margin: 2rem auto 1rem;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-100);
  /* fancyindex writes "Index of /rf/". Not renamed here: the path IS the useful
     part of that heading, and rewriting it in CSS would only be able to hide it. */
}

table {
  max-width: 64rem;
  width: 100%;
  margin: 0 auto;
  border-collapse: collapse;
  border: 1px solid var(--ink-700);
  border-radius: 0.5rem;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

thead th {
  padding: 0.6rem 1rem;
  background: var(--ink-850);
  border-bottom: 1px solid var(--ink-700);
  text-align: left;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-400);
  white-space: nowrap;
}
thead th a { color: inherit; }
thead th a:hover { color: var(--brand-400); text-decoration: none; }

tbody td {
  padding: 0.55rem 1rem;
  border-top: 1px solid var(--ink-800, #161c1f);
  color: var(--ink-400);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
  white-space: nowrap;
}
tbody td:first-child {
  width: 60%;
  white-space: normal;
  word-break: break-word;
}
tbody tr:hover td { background: var(--ink-900); }
tbody tr:first-child td { border-top: none; }

/* fancyindex renders the size and date columns right of the name; on a phone the
   name is the only one worth the width. */
@media (max-width: 40rem) {
  body { padding: 0 0.75rem 3rem; }
  tbody td:last-child, thead th:last-child { display: none; }
}

/* The module emits a horizontal rule and an nginx signature under the table when
   server_tokens is on. The signature is switched off in the site config; this
   catches the rule so the footer fragment is the last thing on the page. */
hr { display: none; }
address { display: none; }
