/* ==========================================================================
   BUMASS.STORE — content.css
   Content components: marquee, NFO, catalog cards, awards, counters,
   dialogs, banners. The warez layer that sits on top of the OS chrome.
   ========================================================================== */

/* ==========================================================================
   Marquee (CSS, not the tag — so reduced-motion can stop it)
   ========================================================================== */

.marquee {
  position: relative;
  overflow: hidden;
  background: var(--term-bg);
  box-shadow: var(--bevel-well);
  padding: 4px 0;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--warn);
  white-space: nowrap;
}
.marquee__track {
  display: inline-flex;
  gap: 3em;
  padding-left: 100%;
  animation: marquee 34s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee__track,
.marquee:focus-within .marquee__track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
  /* Stop the crawl, give it back as a normal scrollable strip. */
  .marquee { overflow-x: auto; }
  .marquee__track { padding-left: 8px; animation: none; }
}
html[data-fx="off"] .marquee { overflow-x: auto; }
html[data-fx="off"] .marquee__track { padding-left: 8px; animation: none; }

/* ==========================================================================
   NFO block
   ========================================================================== */

.nfo {
  margin: 0;
  padding: 10px 12px;
  background: var(--term-bg);
  color: #c8c8c8;
  font-family: var(--mono);
  font-size: clamp(9px, 2.1vw, 12px);
  line-height: 1.25;
  white-space: pre;
  overflow-x: auto;
  box-shadow: var(--bevel-well);
  -webkit-overflow-scrolling: touch;
}
.nfo b { color: var(--term-ink); font-weight: 400; }
.nfo i { color: var(--warn); font-style: normal; }

/* ==========================================================================
   Terminal readout
   ========================================================================== */

.term {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.term p { margin: 0; }
.term .ok   { color: var(--term-ink); }
.term .bad  { color: #ff5f5f; }
.term .warn { color: var(--warn); }
.term .dim  { color: var(--term-dim); }
.term .cursor {
  display: inline-block;
  width: .6em;
  height: 1em;
  background: var(--term-ink);
  vertical-align: -2px;
  animation: caret 1.05s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* ==========================================================================
   Readout rows (fake system stats)
   ========================================================================== */

.readout { display: grid; gap: 6px; }
.readout__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: var(--fs-xs);
}
.readout__row dt { color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.readout__row dd {
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
  padding: 1px 6px;
  background: var(--well);
  box-shadow: var(--bevel-thin-in);
  min-width: 8ch;
  text-align: right;
}

/* Readout with its own bar underneath (used on the Lab page). */
.labmeter + .labmeter { margin-top: 9px; }
.labmeter__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.labmeter__head .label { margin: 0; }
.labmeter__head b {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  padding: 1px 6px;
  background: var(--well);
  box-shadow: var(--bevel-thin-in);
}

/* ==========================================================================
   Catalog cards
   ========================================================================== */

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.card .win__body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; }

.card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #1a1a20;
  box-shadow: var(--bevel-well);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.card__thumb img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }

/* No screenshot? Dithered "missing preview" plate. */
.card__thumb--empty {
  background-color: #262631;
  background-image:
    repeating-conic-gradient(#2f2f3c 0 25%, #202029 0 50%);
  background-size: 6px 6px;
}
.card__thumb--empty span {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: #8b8ba0;
  background: rgba(0, 0, 0, .6);
  padding: 3px 8px;
  box-shadow: inset 0 0 0 1px #4a4a5e;
}

.card__title {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  font-weight: 700;
  word-break: break-word;
}
.card__blurb {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  flex: 1 1 auto;
}

.card__meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1px 8px;
  font-size: var(--fs-xs);
  font-family: var(--mono);
  padding: 6px 8px;
  background: var(--well-alt);
  box-shadow: var(--bevel-well);
}
.card__meta dt { color: var(--ink-mute); text-transform: uppercase; }
.card__meta dd { margin: 0; font-weight: 700; word-break: break-word; }

.card__tags { display: flex; flex-wrap: wrap; gap: 4px; }

.card__warn {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 5px 7px;
  background: #fff6c8;
  box-shadow: var(--bevel-thin-out);
  font-size: var(--fs-xs);
  font-family: var(--mono);
  color: #4a3a00;
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.card__actions .btn { flex: 1 1 auto; }

.card__scan {
  display: grid;
  gap: 3px;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--ink-mute);
}

/* Featured entries get an obnoxious ribbon. */
.card--featured { position: relative; }
.card--featured::after {
  content: "NEW!";
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 3;
  padding: 2px 8px;
  background: var(--danger);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  transform: rotate(9deg);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .5);
  animation: nudge 2.6s ease-in-out infinite;
}
@keyframes nudge {
  0%, 88%, 100% { transform: rotate(9deg) scale(1); }
  94%           { transform: rotate(9deg) scale(1.12); }
}

/* ==========================================================================
   File-index rows (archive / FTP listing style)
   ========================================================================== */

.index {
  width: 100%;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  background: var(--well);
  box-shadow: var(--bevel-well);
}
.index caption {
  padding: 4px 8px;
  text-align: left;
  font-size: var(--fs-xs);
  color: var(--ink-mute);
  background: var(--face);
}
.index th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 4px 8px;
  background: var(--face);
  box-shadow: var(--bevel-thin-out);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  white-space: nowrap;
}
.index td {
  padding: 4px 8px;
  border-bottom: 1px dotted #cfcfc4;
  vertical-align: top;
}
.index tbody tr:hover { background: #ffffcc; }
.index__name { display: flex; align-items: center; gap: 6px; }
.index__name a {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 4px;
  word-break: break-word;
}
.index__num { text-align: right; white-space: nowrap; color: var(--ink-soft); }

@media (pointer: coarse) {
  .index__name a { min-height: 38px; padding: 6px 8px; }
  .prose a { display: inline-block; padding: 4px 2px; }
}

.index__wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* On small screens the table becomes stacked records. */
@media (max-width: 619px) {
  .index thead { display: none; }
  .index, .index tbody, .index tr, .index td { display: block; width: 100%; }
  .index tr {
    padding: 6px 0;
    border-bottom: 2px solid #d8d8cc;
  }
  .index td { border: 0; padding: 2px 8px; }
  .index td[data-th]::before {
    content: attr(data-th) ": ";
    color: var(--ink-mute);
    text-transform: uppercase;
    font-size: 10px;
  }
  .index__num { text-align: left; }
}

/* ==========================================================================
   Awards, buttons-of-the-web, counters
   ========================================================================== */

.awards {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}

/* The classic 88x31 web button. */
.award {
  width: 88px;
  height: 31px;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.1;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #fff;
  background: #000;
  box-shadow: inset 0 0 0 1px #fff, 0 0 0 1px #000;
  padding: 2px;
  text-decoration: none;
  overflow: hidden;
}
.award:visited { color: #fff; }
.award:hover { text-decoration: none; background: #111; color: var(--warn); }
.award--a { background: linear-gradient(90deg, #000080, #5000a0); }
.award--b { background: linear-gradient(90deg, #7a0000, #a04800); color: #ffe; }
.award--c { background: #001a00; color: var(--term-ink); }
.award--d { background: linear-gradient(90deg, #202020, #505050); }
.award--e { background: var(--warn); color: #000; box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #000; }
.award--e:visited { color: #000; }

/* Odometer hit counter. */
.counter {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: #111;
  box-shadow: var(--bevel-well);
}
.counter span {
  display: grid;
  place-items: center;
  min-width: 15px;
  padding: 2px 0;
  background: linear-gradient(180deg, #333 0%, #111 45%, #000 55%, #222 100%);
  color: var(--warn);
  font-family: var(--mono);
  font-size: var(--fs-md);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #444;
}

/* ==========================================================================
   Ad-shaped nonsense banner (goes nowhere, sells nothing)
   ========================================================================== */

.adbar {
  display: block;
  width: 100%;
  max-width: 468px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: center;
  font: inherit;
}
.adbar__inner {
  padding: 8px 10px;
  background: linear-gradient(90deg, #ff00a0, #ffe400, #00e5ff, #ff00a0);
  background-size: 300% 100%;
  animation: ad-shift 9s linear infinite;
  box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #fff;
  color: #000;
  font-family: var(--display);
  font-size: clamp(13px, 3.4vw, 19px);
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1.15;
}
@keyframes ad-shift { to { background-position: 300% 0; } }
.adbar__sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  display: block;
  margin-top: 2px;
}

/* ==========================================================================
   Fake dialogs (spawned by js/dialogs.js)
   ========================================================================== */

.dialog-layer {
  position: fixed;
  inset: 0;
  z-index: 880;
  pointer-events: none;
}
.dialog {
  position: absolute;
  width: min(340px, calc(100vw - 20px));
  pointer-events: auto;
  animation: dialog-in .12s steps(3);
}
@keyframes dialog-in {
  from { transform: scale(.85); opacity: .4; }
  to   { transform: scale(1);   opacity: 1; }
}
.dialog__body {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 12px;
}
.dialog__text { font-size: var(--fs-md); }
.dialog__text strong { display: block; margin-bottom: 4px; }
.dialog__text .mono { font-size: var(--fs-xs); color: var(--ink-mute); word-break: break-all; }
.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 0 12px 12px;
}
.dialog__actions .btn { min-width: 82px; }

/* ==========================================================================
   Desktop icon field (homepage shortcuts)
   ========================================================================== */

.icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 4px;
}
.icons a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px;
  min-height: 78px;
  text-align: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--bevel-thin-out);
  background: var(--face);
}
.icons a:visited { color: var(--ink); }
.icons a:hover { background: var(--light); text-decoration: none; color: var(--ink); }
.icons a:active { box-shadow: var(--bevel-thin-in); }
.icons a small { display: block; font-weight: 400; color: var(--ink-mute); font-size: 10px; }

/* ==========================================================================
   Stories — reading view

   The one place on this site that is genuinely comfortable. Everything else
   can be a mess; prose people are here to read gets a proper measure, real
   leading and paper-coloured ink.
   ========================================================================== */

.reader {
  background: #f4f1e6;
  box-shadow: var(--bevel-well);
  padding: clamp(18px, 5vw, 52px) clamp(14px, 4vw, 40px);
}

.story {
  max-width: 66ch;
  margin: 0 auto;
  color: #1a1a17;
  font-family: Georgia, "Times New Roman", "Nimbus Roman", serif;
  font-size: clamp(15px, 1.05rem + .25vw, 18px);
  line-height: 1.72;
}
.story p { margin: 0; }
.story p + p { margin-top: 1.05em; }
.story h2,
.story h3 {
  font-family: var(--ui);
  letter-spacing: .01em;
  margin: 1.9em 0 .5em;
}
.story h2 { font-size: 1.28em; }
.story h3 { font-size: 1.08em; }
.story em { font-style: italic; }
.story blockquote {
  margin: 1.3em 0;
  padding-left: 1.1em;
  border-left: 3px solid #c9c2a8;
  color: #45423a;
  font-style: italic;
}
.story hr {
  width: 6ch;
  height: auto;
  margin: 2.2em auto;
  border: 0;
  box-shadow: none;
  text-align: center;
}
.story hr::before {
  content: "* * *";
  display: block;
  font-family: var(--mono);
  color: #8d8674;
  letter-spacing: .4em;
}
/* First line of the piece, set the old way. */
.story > p:first-of-type::first-line { font-variant: small-caps; letter-spacing: .04em; }

.story__head {
  max-width: 66ch;
  margin: 0 auto clamp(20px, 4vw, 36px);
  padding-bottom: 14px;
  border-bottom: 2px solid #d8d2bd;
}
.story__head h1 {
  font-family: var(--ui);
  font-size: clamp(1.5rem, 5vw, 2.3rem);
  line-height: 1.12;
  color: #16150f;
}
.story__byline {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: #5c574a;
}
.story__end {
  max-width: 66ch;
  margin: clamp(26px, 5vw, 44px) auto 0;
  padding-top: 14px;
  border-top: 2px solid #d8d2bd;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: #5c574a;
}

/* ==========================================================================
   Misc
   ========================================================================== */

.prose { font-size: var(--fs-md); max-width: 66ch; }
.prose h3 { margin: 1.1em 0 .35em; font-size: var(--fs-lg); }
.prose ul { list-style: square; padding-left: 1.3em; margin: .4em 0; }
.prose li { margin: .2em 0; }
.prose li::marker { color: var(--danger); }

/* Never blink something the reader must read in order to use the site.
   The global kill switch in base.css stops this when FX are off. */
.blink { animation: blink 1.15s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.rule-warn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: repeating-linear-gradient(45deg, #ffd400 0 10px, #1a1a1a 10px 20px);
  box-shadow: var(--bevel-thin-out);
}
.rule-warn span {
  background: var(--face);
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  box-shadow: var(--bevel-thin-out);
}

.filelist {
  display: grid;
  gap: 4px;
  /* minmax(0,…) — grid items default to min-width:auto and would otherwise
     refuse to shrink below the width of an unbreakable filename. */
  grid-template-columns: minmax(0, 1fr);
}
.filelist a {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  min-width: 0;
  padding: 6px 8px;
  min-height: 38px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--bevel-thin-out);
  background: var(--face);
}
.filelist a:visited { color: var(--ink); }
.filelist a:hover { background: var(--sel); color: var(--sel-ink); text-decoration: none; }
.filelist a:hover .badge { box-shadow: none; }
.filelist a span:first-of-type {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty {
  padding: 22px 14px;
  text-align: center;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--ink-mute);
}

.loading {
  padding: 18px 12px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--ink-mute);
  text-align: center;
}
