/* ============================================================
   Atari Legacy — Reader Resources (/r/)
   Extends styles.css. Same masthead red, same cosmic ground,
   plus a paper-white slab for anything the reader has to read
   character by character: code, hashes, commands.
   ============================================================ */

:root{
  --code-bg:   #0d1326;
  --code-line: rgba(244,241,234,.08);
  --amber:     #e8b04b;
  --green:     #7fc97f;
}

.crumbs{
  font-size:13px; letter-spacing:.06em; text-transform:uppercase;
  color:var(--muted); padding-block:22px 0;
}
.crumbs a{ color:var(--muted); text-decoration:none; border-bottom:1px solid var(--line); }
.crumbs a:hover{ color:var(--paper); }
.crumbs .sep{ opacity:.4; margin-inline:8px; }

.res-head{ padding-block:26px 34px; border-bottom:1px solid var(--line); }
.res-head .kicker{
  color:var(--red); font-weight:700; letter-spacing:.16em;
  text-transform:uppercase; font-size:12px; margin:0 0 10px;
}
.res-head h1{
  font-family:var(--serif); font-weight:700;
  font-size:clamp(30px,5vw,52px); line-height:1.08; margin:0 0 14px;
}
.res-head .meta{
  font-size:14px; color:var(--muted); margin:0 0 18px;
  display:flex; flex-wrap:wrap; gap:8px 16px; align-items:center;
}
.res-head .meta b{ color:var(--paper); font-weight:600; }
.res-head .lede{ font-size:clamp(16px,2vw,19px); max-width:62ch; margin:0; }

.badge{
  display:inline-block; border:1px solid var(--red); color:var(--red);
  border-radius:999px; padding:3px 11px; font-size:11px; font-weight:700;
  letter-spacing:.12em; text-transform:uppercase;
}
.badge.draft{ border-color:var(--amber); color:var(--amber); }

.warnbar{
  background:var(--amber); color:#1a1206; font-weight:700;
  text-align:center; padding:10px 16px; font-size:14px; letter-spacing:.04em;
}

section.block{ padding-block:38px; border-bottom:1px solid var(--line); }
section.block > .wrap > h2{
  font-family:var(--serif); font-size:clamp(21px,3vw,28px);
  margin:0 0 6px; font-weight:700;
}
section.block > .wrap > p.sub{ color:var(--muted); margin:0 0 22px; max-width:64ch; }

/* ---- downloads ---- */
.dl{ display:grid; gap:12px; }
.dl a.item{
  display:flex; align-items:flex-start; gap:16px; text-decoration:none;
  background:rgba(244,241,234,.035); border:1px solid var(--line);
  border-left:3px solid var(--red); border-radius:4px;
  padding:16px 18px; transition:background .15s, border-color .15s;
}
.dl a.item:hover{ background:rgba(244,241,234,.07); border-left-color:var(--paper); }
.dl .ico{
  font-family:var(--sans); font-weight:700; font-size:11px; letter-spacing:.08em;
  background:var(--red); color:#fff; border-radius:3px; padding:5px 8px;
  min-width:52px; text-align:center; flex:none; margin-top:2px;
}
.dl .txt{ min-width:0; }
.dl .name{ font-weight:600; margin:0 0 3px; }
.dl .note{ color:var(--muted); font-size:14px; margin:0 0 6px; }
.dl .facts{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:11.5px; color:var(--muted); word-break:break-all; margin:0;
}
.dl .facts b{ color:var(--paper); font-weight:600; }

/* ---- quickstart ---- */
.steps{ counter-reset:step; display:grid; gap:10px; margin:0; padding:0; list-style:none; }
.steps li{ counter-increment:step; display:flex; gap:14px; align-items:center; }
.steps li::before{
  content:counter(step); flex:none; width:26px; height:26px; border-radius:50%;
  background:var(--red); color:#fff; font-size:13px; font-weight:700;
  display:grid; place-items:center;
}
.steps code{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  background:var(--code-bg); border:1px solid var(--line); border-radius:3px;
  padding:7px 12px; font-size:13.5px; display:block; flex:1; overflow-x:auto;
}

/* ---- code listing ---- */
.listing{ border:1px solid var(--line); border-radius:4px; overflow:hidden; }
.listing .bar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:rgba(244,241,234,.05); border-bottom:1px solid var(--line);
  padding:9px 14px; font-size:13px;
}
.listing .bar .fn{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-weight:600;
}
.listing .bar .act{ display:flex; gap:8px; }
.listing button.copy, .listing a.raw{
  font:inherit; font-size:12px; cursor:pointer; text-decoration:none;
  background:transparent; color:var(--muted);
  border:1px solid var(--line); border-radius:3px; padding:4px 10px;
}
.listing button.copy:hover, .listing a.raw:hover{ color:var(--paper); border-color:var(--paper); }
.listing button.copy.done{ color:var(--green); border-color:var(--green); }
.listing pre{
  margin:0; background:var(--code-bg); overflow-x:auto;
  counter-reset:ln; padding:16px 0; max-height:70vh;
}
.listing code{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:13px; line-height:1.62; display:block;
}
.listing .ln{ display:block; padding:0 18px 0 0; white-space:pre; }
.listing .ln::before{
  counter-increment:ln; content:counter(ln);
  display:inline-block; width:3.2em; margin-right:1.1em; padding-right:.7em;
  text-align:right; color:rgba(244,241,234,.28); border-right:1px solid var(--code-line);
  user-select:none; -webkit-user-select:none;
}
.listing .ln:hover{ background:rgba(244,241,234,.04); }

/* ---- provenance: a file we transcribed rather than received ---- */
.dl .prov, .prov-bar{
  color:var(--amber); font-size:13px; margin:0 0 6px; line-height:1.5;
}
.prov-bar{
  background:rgba(232,176,75,.08); border-bottom:1px solid var(--line);
  padding:9px 14px; margin:0; font-size:12.5px;
}
.prov-bar a{ color:inherit; }

/* ---- figures / video ---- */
.figs{ display:grid; gap:22px; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); }
.figs figure{ margin:0; }
.figs img{ border:1px solid var(--line); border-radius:3px; background:#000; }
.figs figcaption{ color:var(--muted); font-size:13.5px; margin-top:8px; }

.vid{ display:grid; gap:16px; }
.vid .facade{
  position:relative; display:block; width:100%; aspect-ratio:16/9;
  border:1px solid var(--line); border-radius:4px; cursor:pointer;
  background:linear-gradient(160deg,#16203c,#0b1020); color:inherit;
  font:inherit; text-align:left; padding:0; overflow:hidden;
}
.vid .facade .play{
  position:absolute; inset:0; display:grid; place-items:center; gap:14px;
  align-content:center; text-align:center; padding:22px;
}
.vid .facade .tri{
  width:64px; height:64px; border-radius:50%; background:var(--red);
  display:grid; place-items:center; color:#fff; font-size:22px;
}
.vid .facade .lbl{ font-weight:600; }
.vid .facade .hint{ color:var(--muted); font-size:13px; max-width:44ch; }
.vid iframe{ width:100%; aspect-ratio:16/9; border:0; border-radius:4px; }

/* ---- links / errata / rights ---- */
ul.linklist{ list-style:none; margin:0; padding:0; display:grid; gap:9px; }
ul.linklist a{ text-decoration:none; border-bottom:1px solid var(--line); }
ul.linklist a:hover{ border-bottom-color:var(--red); }
ul.linklist .host{ color:var(--muted); font-size:13px; }

table.errata{ width:100%; border-collapse:collapse; font-size:14.5px; }
table.errata th, table.errata td{
  text-align:left; vertical-align:top; padding:10px 12px;
  border-bottom:1px solid var(--line);
}
table.errata th{ color:var(--muted); font-weight:600; font-size:12px;
  letter-spacing:.1em; text-transform:uppercase; }
table.errata code{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:13px; background:var(--code-bg); padding:2px 6px; border-radius:3px;
}
table.errata .was code{ color:#e88; }
table.errata .now code{ color:var(--green); }
.noerrata{ color:var(--muted); }

.rights{ color:var(--muted); font-size:14px; max-width:70ch; }
.rights b{ color:var(--paper); }

/* ---- series navigation ---- */
.pager{ display:flex; gap:14px; flex-wrap:wrap; justify-content:space-between; padding-block:30px; }
.pager a{
  text-decoration:none; border:1px solid var(--line); border-radius:4px;
  padding:13px 18px; min-width:220px; flex:1;
}
.pager a:hover{ border-color:var(--red); }
.pager .dir{ color:var(--red); font-size:11px; font-weight:700;
  letter-spacing:.14em; text-transform:uppercase; display:block; margin-bottom:4px; }
.pager .ttl{ font-weight:600; }
.pager a.next{ text-align:right; }

/* ---- hub / index listing ---- */
.reslist{ display:grid; gap:14px; }
.reslist a.row{
  display:grid; gap:4px; text-decoration:none; padding:16px 18px;
  border:1px solid var(--line); border-left:3px solid var(--red); border-radius:4px;
  background:rgba(244,241,234,.03);
}
.reslist a.row:hover{ background:rgba(244,241,234,.07); }
.reslist .tag{ color:var(--red); font-size:11px; font-weight:700;
  letter-spacing:.14em; text-transform:uppercase; margin:0; }
.reslist h3{ font-family:var(--serif); font-size:20px; margin:0; font-weight:600; }
.reslist p.sum{ color:var(--muted); font-size:14.5px; margin:0; max-width:72ch; }
.reslist .url{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:12px; color:var(--muted); margin:2px 0 0;
}
.issue-group{ margin-bottom:34px; }
.issue-group > h2{
  font-family:var(--serif); font-size:24px; margin:0 0 4px; font-weight:700;
}
.issue-group > p{ color:var(--muted); font-size:14px; margin:0 0 16px; }

@media (max-width:520px){
  .listing code{ font-size:12px; }
  .listing .ln::before{ width:2.2em; margin-right:.6em; padding-right:.5em; }
  .dl a.item{ gap:11px; padding:14px; }
  .steps li{ align-items:flex-start; }
}

@media print{
  body{ background:#fff; color:#000; }
  .masthead,.foot,.vid,.pager{ display:none; }
  .listing pre{ max-height:none; background:#fff; }
  .listing code{ color:#000; }
}
