/*
 * HISYD // plain-text BBS skin
 * Goal: easy to edit, cheap to render, old-web first.
 * One stylesheet. System monospace only. No animation, gradients, shadows,
 * transitions, blend modes, filters, or web-font dependencies.
 */
:root {
  color-scheme: dark;
  --bg: #000000;
  --text: #c0c0c0;
  --dim: #707070;
  --line: #5a5a5a;
  --white: #ffffff;
  --green: #00ff00;
  --cyan: #00ffff;
  --yellow: #ffff00;
  --magenta: #ff00ff;
  --red: #ff5555;
  --blue: #55aaff;
  --rail: 184px;
  --page: 1180px;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: auto; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 14px/1.48 "Courier New", Courier, monospace;
}

[hidden] { display: none !important; }
::selection { color: #000; background: var(--cyan); }
a { color: var(--cyan); text-underline-offset: .14em; }
a:hover { color: var(--yellow); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 1px dashed var(--yellow);
  outline-offset: 2px;
}
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }

.skip-link {
  position: fixed;
  top: .25rem;
  left: .25rem;
  z-index: 20;
  padding: .25rem .45rem;
  color: #000;
  background: var(--yellow);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

/* Shared ASCII masthead injected by /script.js. */
.retro-head {
  width: min(calc(100% - 1rem), var(--page));
  margin: .7rem auto 0;
  overflow-x: auto;
}
.retro-rule {
  width: 100%;
  height: 0;
  margin: 0;
  border-top: 1px dashed var(--dim);
}
.retro-logo {
  margin: .2rem 0;
  color: var(--white);
  font: 700 clamp(.32rem, .62vw, .60rem)/1.05 "Courier New", Courier, monospace;
  white-space: pre;
  text-align: center;
}
.retro-logo .logo-cyan { color: var(--cyan); }
.retro-logo .logo-green { color: var(--green); }
.retro-logo .logo-magenta { color: var(--magenta); }
.retro-wordmark { display: none; }
.retro-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .55rem;
  justify-content: center;
  padding: .28rem 0;
  font-size: .83rem;
}
.retro-nav a { color: var(--cyan); text-decoration: none; }
.retro-nav a::before { content: "["; color: var(--dim); }
.retro-nav a::after { content: "]"; color: var(--dim); }
.retro-nav a[aria-current="page"] { color: var(--yellow); }
.retro-kicker {
  margin: .25rem 0;
  color: var(--green);
  font-size: .75rem;
  text-align: center;
}

/* Primary page and section rail inside the reading layout. */
.retro-shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 1rem;
  width: min(calc(100% - 1rem), var(--page));
  margin: .8rem auto 2rem;
  align-items: start;
}
.retro-shell > main { min-width: 0; margin: 0; }
.retro-rail {
  position: sticky;
  top: .5rem;
  max-height: calc(100vh - 1rem);
  overflow: auto;
  padding-right: .45rem;
  scrollbar-width: thin;
}
.rail-block { margin-bottom: .8rem; }
.rail-title {
  margin-bottom: .2rem;
  color: var(--yellow);
  font-weight: 700;
}
.rail-title::before { content: "/== "; color: var(--dim); }
.rail-title::after { content: " ==\\"; color: var(--dim); }
.rail-nav { display: grid; }
.rail-link {
  display: grid;
  grid-template-columns: 2.3rem minmax(0, 1fr);
  gap: .2rem;
  padding: .18rem 0;
  color: var(--text);
  text-decoration: none;
}
.rail-link:hover,
.rail-link[aria-current="page"] { color: var(--green); }
.rail-code { color: var(--dim); }
.rail-label { overflow-wrap: anywhere; }

/* Decorative art rails: wide screens only, inert, and outside reading space. */
.ascii-rail { display: none; }

@media (min-width: 1480px) {
  body { padding-right: 238px; }
  .ascii-rail {
    position: fixed;
    z-index: 0;
    top: .7rem;
    bottom: .8rem;
    width: 220px;
    flex-direction: column;
    justify-content: space-around;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    opacity: .58;
  }
  .ascii-rail-right {
    right: .5rem;
    display: flex;
    padding: .75rem 0 .75rem .75rem;
    border-left: 1px dashed #343434;
  }
  .ascii-rail pre {
    margin: 0;
    font: 700 .66rem/1.18 "Courier New", Courier, monospace;
    white-space: pre;
  }
  .ascii-cyan { color: var(--cyan); }
  .ascii-green { color: var(--green); }
  .ascii-magenta { color: var(--magenta); }
  .retro-head, .retro-shell, .site-footer { position: relative; z-index: 1; }
}

@media (min-width: 1680px) {
  body { padding-left: 238px; }
  .ascii-rail-left {
    left: .5rem;
    display: flex;
    padding: .75rem .75rem .75rem 0;
    border-right: 1px dashed #343434;
  }
}
/* Content: plain text first, border boxes only where they help scanning. */
h1, h2, h3 { font: inherit; font-weight: 700; }
h1 {
  margin: 0 0 .75rem;
  color: var(--white);
  font-size: 1.2rem;
  text-transform: uppercase;
}
h2 {
  margin: 1.1rem 0 .45rem;
  color: var(--green);
  font-size: 1rem;
  text-transform: uppercase;
}
h2::before { content: "/== "; color: var(--dim); }
h2::after { content: " ================================================="; color: var(--dim); }
h3 { margin: .65rem 0 .25rem; color: var(--cyan); }
p { margin: .35rem 0 .65rem; }
ul, ol { margin: .35rem 0 .75rem; padding-left: 1.25rem; }
li { margin-bottom: .22rem; }
code, pre { font-family: inherit; }
small, .muted { color: var(--dim); }

.eyebrow,
.intro-copy,
.resources-deck,
.random-deck,
.article-deck,
.tool-writeup-deck,
.oswa-deck,
.section-intro,
.reference-summary,
.random-note,
.legal-note {
  display: none !important;
}

.intro,
.resources-intro,
.random-intro,
.article-shell,
.tool-writeup-shell,
.not-found,
.oswa-intro,
.section-block,
.resources-section,
.random-section,
.article-body,
.tool-writeup-body,
.reference-section,
.resource-workbench {
  margin: 0 0 1rem;
  padding: 0;
  background: none;
  border: 0;
}

.section-heading,
.resource-section-heading,
.random-section-head,
.reference-section-head,
.method-card-head,
.reference-article-head,
.resource-card-top,
.random-card-top,
.card-meta,
.tool-facts,
.exam-facts,
.resource-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .75rem;
}
.resource-index,
.random-index,
.article-number,
.topic-chip,
.card-meta,
.tool-facts span,
.exam-facts span {
  color: var(--yellow);
  font-size: .72rem;
  text-transform: uppercase;
}

/* Home + articles. */
.post-grid { display: grid; gap: 0; }
.post-card {
  padding: .4rem 0;
  border-top: 1px dotted var(--line);
}
.post-card:last-child { border-bottom: 1px dotted var(--line); }
.post-card p { display: none; }
.post-card h3 { margin: .15rem 0; }
.text-link, .back-link, .section-download {
  display: inline-block;
  margin: .25rem 0;
  color: var(--cyan);
  font-size: .78rem;
}
.article-meta { display: flex; flex-wrap: wrap; gap: .3rem .8rem; color: var(--dim); font-size: .72rem; }
blockquote { margin: .65rem 0; padding-left: .7rem; color: var(--white); border-left: 1px solid var(--magenta); }

/* Resource library: terminal directory listing. */
.resource-workbench { margin-bottom: 1rem; }
.resource-workbench h2 { margin-top: 0; }
.resource-filter-row { display: flex; flex-wrap: wrap; gap: .2rem .45rem; margin-top: .4rem; }
.resource-filter-row button,
.resource-status-row button,
[data-copy-snippet] {
  padding: 0;
  color: var(--cyan);
  background: none;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: .14em;
}
.resource-filter-row button[aria-pressed="true"] { color: var(--yellow); }
.resource-status-row { justify-content: space-between; margin-top: .35rem; color: var(--dim); font-size: .72rem; }
.resource-empty { color: var(--red); }
.resource-grid { border-top: 1px dotted var(--line); }
.resource-card {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(0, 2.2fr) auto;
  gap: .25rem .75rem;
  align-items: baseline;
  padding: .34rem 0;
  color: var(--text);
  border-bottom: 1px dotted #343434;
  text-decoration: none;
  content-visibility: auto;
  contain-intrinsic-size: auto 64px;
}
.resource-card:hover { color: var(--white); }
.resource-card h3 { grid-column: 1; margin: 0; }
.resource-card p { grid-column: 2; margin: 0; font-size: .78rem; }
.resource-card-top { display: none; }
.resource-tags { grid-column: 3; display: flex; flex-wrap: wrap; gap: .25rem; justify-content: flex-end; }
.resource-tag { color: var(--magenta); font-size: .66rem; }
.resource-domain { display: none; }
.resources-section-intro { display: none; }

/* Random/archive lists. */
.random-grid { display: grid; gap: 0; border-top: 1px dotted var(--line); }
.random-card {
  display: grid;
  grid-template-columns: minmax(180px, .75fr) minmax(0, 2fr);
  gap: .5rem;
  padding: .38rem 0;
  color: var(--text);
  border-bottom: 1px dotted #343434;
  text-decoration: none;
}
.random-card h3 { margin: 0; }
.random-card p { margin: 0; font-size: .78rem; }
.random-card-top, .random-source { display: none; }
.random-card-static { cursor: default; }
.underground-manifesto {
  margin: .4rem 0 1rem;
  padding: .75rem 0 .8rem;
  color: var(--white);
  border-top: 1px solid var(--magenta);
  border-bottom: 1px solid var(--magenta);
}
.underground-manifesto p {
  max-width: 84ch;
  margin: 0 0 .75rem;
}
.underground-manifesto p:last-child { margin-bottom: 0; }
.manifesto-close {
  color: var(--yellow);
  font-weight: 700;
  letter-spacing: .04em;
}
.manifesto-close { color: var(--green); }
.manifesto-subhead {
  margin: 1rem 0 .55rem;
  color: var(--cyan);
}
.submission-note {
  margin-top: .65rem;
  padding-left: .65rem;
  color: var(--dim);
  border-left: 1px solid var(--yellow);
  font-size: .76rem;
}

/* Tool notes. */
.tool-facts { margin: .35rem 0 .75rem; padding: .25rem 0; border-top: 1px dotted var(--line); border-bottom: 1px dotted var(--line); }
.tool-writeup-body section + section { margin-top: 1rem; }
.tool-command,
.snippet-card pre {
  max-width: 100%;
  margin: .35rem 0;
  padding: .45rem;
  overflow: auto;
  color: var(--green);
  background: #000;
  border: 1px solid #3a3a3a;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* OSWA: plain manual / directory tree. */
.exam-facts { margin: .25rem 0 .75rem; }
.exam-facts span { padding-right: .5rem; }
.verified-note { display: block; margin-bottom: .8rem; color: var(--dim); }
.download-grid,
.method-grid,
.chain-grid,
.study-grid,
.internet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem 1rem; }
.download-card,
.method-card,
.chain-card,
.study-grid article,
.internet-card {
  padding: .35rem 0;
  color: var(--text);
  border-bottom: 1px dotted #343434;
  text-decoration: none;
}
.download-card p, .internet-card p { display: none; }
.download-card > span, .internet-card > span, .study-grid article > span { color: var(--magenta); font-size: .68rem; }
.download-card strong, .internet-card strong { color: var(--cyan); font-size: .72rem; }
.playbook-stack { display: grid; gap: .8rem; }
.reference-article {
  padding: .5rem 0 .8rem;
  border-top: 1px solid var(--line);
  content-visibility: auto;
  contain-intrinsic-size: auto 760px;
}
.reference-article-head { justify-content: space-between; }
.reference-article > h2 { margin-top: .55rem; }
.reference-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem 1.25rem; }
.reference-columns section { padding: 0; }
.reference-columns h3 { color: var(--yellow); }
.reference-columns ul, .reference-columns ol { font-size: .78rem; }
.online-links { display: flex; flex-wrap: wrap; gap: .25rem .8rem; margin-top: .45rem; font-size: .74rem; }
.snippet-group { margin-bottom: .35rem; border-bottom: 1px dotted var(--line); }
.snippet-group summary { cursor: pointer; padding: .35rem 0; color: var(--cyan); }
.snippet-group summary small { float: right; color: var(--dim); }
.snippet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem 1rem; padding: .25rem 0 .65rem; }
.snippet-card { min-width: 0; padding: .25rem 0; }
.snippet-card > div { display: flex; flex-wrap: wrap; gap: .25rem; color: var(--magenta); font-size: .66rem; }
.snippet-card small { color: var(--dim); }
.submission-list { columns: 2; column-gap: 1.5rem; }

/* Minimal footer. */
.site-footer {
  width: min(calc(100% - 1rem), var(--page));
  margin: 0 auto .8rem;
  padding-top: .3rem;
  color: var(--dim);
  border-top: 1px dashed var(--line);
}
.footer-shell { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; }
.footer-shell p { margin: 0; color: var(--dim); font-size: .7rem; }
.footer-shell strong { color: var(--green); font-size: .72rem; }

@media (max-width: 780px) {
  body { font-size: 13px; }
  .retro-head, .retro-shell, .site-footer { width: calc(100% - .5rem); }
  .retro-head { overflow: hidden; }
  .retro-logo { display: none; }
  .retro-wordmark {
    display: block;
    padding: .45rem .2rem;
    color: var(--cyan);
    font-weight: 700;
    font-size: clamp(1.1rem, 6.6vw, 1.65rem);
    letter-spacing: .05em;
    text-align: center;
  }
  h2::after { content: " ========"; }
  .retro-shell { display: block; }
  .retro-rail { position: static; max-height: none; margin-bottom: .9rem; padding-right: 0; }
  .rail-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: .75rem; }
  .resource-card, .random-card { grid-template-columns: 1fr; }
  .resource-card h3, .resource-card p, .resource-tags { grid-column: 1; justify-content: flex-start; }
  .download-grid, .method-grid, .chain-grid, .study-grid, .internet-grid, .reference-columns, .snippet-grid { grid-template-columns: 1fr; }
  .submission-list { columns: 1; }
}
