/* ==========================================================================
   Bylazora - 3270 screen stylesheet (style-v6)

   The site is a 3270 session. Not a dark theme with a monospace font: an
   actual screen. Black field, IBM Plex Mono throughout, the 3270 extended
   colour set used as FIELDS rather than decoration, ASCII rules and bordered
   panels rather than cards.

   Field colours, as a 3270 session assigned them:
     green      default text, values, pass
     turquoise  hyperlinks, field labels, keys
     yellow     headings and screen titles (high intensity)
     white      long-form body copy (the papers and the evidence annex)
     red        failure

   Deliberately absent: scanline overlays, CRT flicker, glow blur on body
   text, fake boot sequences. That is costume, not a screen.

   One weight only (Plex Mono 400). A real 3270 had no bold: intensity was
   colour. Emphasis is therefore colour, not weight.
   ========================================================================== */

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

:root {
  --screen: #08090a;
  --panel: #0e1012;
  --inset: #0a0c0d;

  /* Structure carries NO colour. On a real screen the rules, the field
     boundaries and the panel edges were not a hue at all: only characters
     were coloured. Painting the chrome green too is what turned the first
     pass into a wall of green. */
  --rule: #232a2c;
  --rule-bright: #38423f;

  /* Text intensity, not hue, is the primary hierarchy - as it was on a
     monochrome 3270, where "high intensity" was the same phosphor driven
     harder. */
  --text: #5aab5a;        /* normal intensity: body copy. ~6.6:1 on --screen,
                             against ~13:1 for the neon green this replaced,
                             which is glare rather than phosphor. */
  --text-dim: #79817d;    /* notes, metadata, secondary chrome */
  --text-hi: #dfe3dd;     /* high intensity: long-form reading, emphasis */

  --green: #5aab5a;       /* the phosphor itself */
  --green-hi: #7cc47c;    /* intensified field */
  --turquoise: #5fb6b6;   /* links, field labels */
  --yellow: #c9a227;      /* headings: gold, not lemon */
  --red: #cf5a51;         /* failures: brick, not fire-engine */

  --mono: "IBM Plex Mono", "Consolas", "Courier New", monospace;
  --measure: 74ch;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--screen); scrollbar-color: var(--rule-bright) var(--screen); scrollbar-width: thin; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--screen); border-left: 1px solid var(--rule); }
::-webkit-scrollbar-thumb { background: var(--rule-bright); border: 2px solid var(--screen); }
::-webkit-scrollbar-thumb:hover { background: var(--green-dim); }

body {
  background: var(--screen);
  color: var(--green);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  padding: 10px;
  -webkit-font-smoothing: antialiased;
}

/* The screen frame: a fixed 1px rule around the viewport, drawn inside the
   body padding so it never crosses text. */
body::after {
  content: "";
  position: fixed;
  inset: 4px;
  border: 1px solid var(--rule);
  pointer-events: none;
  z-index: 60;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 26px; }

/* Field labels and dot leaders, the way a panel laid out KEY . . . : VALUE */
.field { color: var(--turquoise); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.86rem; }
.dots { color: var(--rule-bright); }

a { color: var(--turquoise); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover, a:focus-visible { color: var(--green-hi); border-bottom-color: var(--green-hi); }

/* High intensity: 3270 emphasis was brighter, not bolder. */
strong, b { font-weight: 400; color: var(--text-hi); }
em, i { font-style: normal; color: var(--yellow); }

/* ---------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--screen);
  border-bottom: 1px solid var(--rule-bright);
  box-shadow: 0 0 0 1px var(--screen);
}
.site-header .wrap { padding-top: 12px; padding-bottom: 0; }

.screen-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 10px;
}
.brand {
  color: var(--yellow);
  letter-spacing: 0.08em;
  font-size: 0.98rem;
  border-bottom: none;
}
.brand:hover { color: var(--yellow); border-bottom-color: var(--yellow); }
.screen-sub { color: var(--text-dim); letter-spacing: 0.14em; font-size: 0.8rem; text-transform: uppercase; }
.screen-right { margin-left: auto; color: var(--turquoise); letter-spacing: 0.14em; font-size: 0.8rem; text-transform: uppercase; }

.pf-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  padding: 9px 0;
  border-top: 1px solid var(--rule);
  font-size: 0.84rem;
  letter-spacing: 0.06em;
}
.pf-row a { color: var(--turquoise); border-bottom: none; text-transform: uppercase; }
.pf-row a:hover { color: var(--green-hi); border-bottom: none; }
.pf-row a .pf-key { color: var(--green); margin-right: 1px; }
.pf-row a:hover .pf-key { color: var(--yellow); }
.pf-row a.is-cta { color: var(--screen); background: var(--green); padding: 2px 8px; }
.pf-row a.is-cta .pf-key { color: var(--screen); }
.pf-row a.is-cta:hover { background: var(--green-hi); color: var(--screen); }

/* ------------------------------------------------------------------ hero -- */

.hero { padding: 72px 0 44px; }
.kicker {
  color: var(--turquoise);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.78rem;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(1.7rem, 4.4vw, 3rem);
  line-height: 1.2;
  color: var(--yellow);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  max-width: 26ch;
}
.hero h1 .accent { color: var(--green); }
.cursor {
  display: inline-block;
  width: 0.62em;
  height: 1em;
  margin-left: 0.12em;
  background: var(--green);
  vertical-align: -0.08em;
  animation: blink 1.05s step-end infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.lede { max-width: var(--measure); margin-top: 24px; color: var(--green); }
.lede + .lede { margin-top: 14px; }
.hero-ctas { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }

/* --------------------------------------------------------------- buttons -- */

.btn {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--green);
  color: var(--green);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.82rem;
  background: transparent;
}
.btn::before { content: "[ "; color: var(--text-dim); }
.btn::after { content: " ]"; color: var(--text-dim); }
.btn:hover { background: var(--green); color: var(--screen); border-bottom-color: var(--green); }
.btn:hover::before, .btn:hover::after { color: var(--screen); }
.btn-primary { background: var(--green); color: var(--screen); }
.btn-primary::before, .btn-primary::after { color: var(--screen); }
.btn-primary:hover { background: var(--green-hi); border-color: var(--green-hi); }
.btn-ghost { border-color: var(--rule-bright); color: var(--turquoise); }
.btn-ghost::before, .btn-ghost::after { color: var(--rule-bright); }
.btn-ghost:hover { background: var(--turquoise); color: var(--screen); border-color: var(--turquoise); }
.btn-ghost:hover::before, .btn-ghost:hover::after { color: var(--screen); }

/* -------------------------------------------------------------- sections -- */

.section { padding: 52px 0; border-top: 1px solid var(--rule); }
.section.alt { background: var(--inset); }
.section h2 {
  color: var(--yellow);
  font-size: 1.28rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 20px;
  border-bottom: 1px dashed var(--rule-bright);
  padding-bottom: 10px;
}
.section h2::before { content: "== "; color: var(--rule-bright); }
.section h3 { color: var(--green); font-size: 1rem; letter-spacing: 0.04em; margin-bottom: 8px; text-transform: uppercase; }
.section-lede { color: var(--green); max-width: var(--measure); margin-bottom: 28px; }
.note {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-top: 26px;
  border-top: 1px dashed var(--rule-bright);
  padding-top: 14px;
  max-width: 96ch;
}
.note::before { content: "NOTE  "; color: var(--turquoise); }

/* Narrative groups: bordered fields, never rounded cards. */
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule-bright); border: 1px solid var(--rule-bright); margin-bottom: 28px; }
.card { background: var(--panel); padding: 20px; }
.card p { color: var(--green); font-size: 0.92rem; }
.card p + p { margin-top: 10px; }
.card h3 { color: var(--yellow); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.88rem; margin-bottom: 12px; border-bottom: 1px solid var(--rule); padding-bottom: 8px; }
.card .tier { color: var(--turquoise); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }
.card code { color: var(--yellow); background: transparent; }
.card .sig { font-size: 0.78rem; color: var(--text-dim); margin-top: 12px; }
.card .btn { margin-top: 12px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
/* Four field panels: 2x2 keeps the measure readable, where a 4-wide row would not. */
.grid-2x2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--rule-bright); border: 1px solid var(--rule-bright); margin-bottom: 28px; }
.pullquote {
  margin-top: 22px;
  color: var(--yellow);
  border-left: 2px solid var(--rule-bright);
  padding-left: 16px;
  font-size: 1.02rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* The governed cycle: numbered steps, the way a panel listed options. */
ol.cycle { list-style: none; counter-reset: step; margin-top: 8px; border-top: 1px solid var(--rule); }
ol.cycle li {
  counter-increment: step;
  padding: 14px 0 14px 62px;
  position: relative;
  border-bottom: 1px solid var(--rule);
  max-width: 100ch;
}
ol.cycle li::before {
  content: "0" counter(step) ".";
  position: absolute;
  left: 0;
  top: 14px;
  color: var(--turquoise);
  letter-spacing: 0.06em;
}
ol.cycle li strong { color: var(--yellow); }

/* ------------------------------------------------- exhibits and tables --- */

.codeblock {
  background: var(--panel);
  border: 1px solid var(--rule-bright);
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.62;
}
.codeblock pre { margin: 0; }
.codeblock code { color: var(--green); }
.codeblock .ok { color: var(--green); }
.codeblock .bad { color: var(--red); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  background: var(--panel);
  border: 1px solid var(--rule-bright);
}
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--rule); font-size: 0.9rem; color: var(--green); vertical-align: top; }
/* Column separators: without these a table reads as a modern grid, not a screen. */
th + th, td + td { border-left: 1px solid var(--rule); }
table tr:first-child th { border-bottom: 2px solid var(--rule-bright); }
th {
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  background: var(--inset);
  border-bottom: 1px solid var(--rule-bright);
}
tr:last-child td { border-bottom: none; }
td strong { color: var(--green-hi); }
.ok, .pass { color: var(--green-hi); }
.bad, .fail { color: var(--red); }

/* The benchmark chart, as a terminal table. */
.ascii-table {
  overflow-x: auto;
  margin: 24px 0;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--rule-bright);
  color: var(--green);
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre;
  tab-size: 4;
}
.ascii-table .hdr { color: var(--yellow); }

/* ------------------------------------------------------------------ docs -- */

.doc main, main.doc { padding-bottom: 20px; }
.doc h1 { color: var(--yellow); font-size: 1.4rem; text-transform: uppercase; letter-spacing: 0.1em; margin: 30px 0 10px; }
.doc h2 { color: var(--yellow); font-size: 1.14rem; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 36px; border-bottom: 1px dashed var(--rule-bright); padding-bottom: 7px; }
.doc h2::before { content: "== "; color: var(--rule-bright); }
.doc h3 { color: var(--green-hi); font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 24px; }
.doc h4 { color: var(--turquoise); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9rem; margin-top: 18px; }
.doc h1 + p, .doc h2 + p, .doc h3 + p { margin-top: 10px; }

/* Long-form reading: white on black at a comfortable measure, never 14px
   green. This is the one place the extended palette earns its keep. */
.doc p, .doc li { color: var(--text-hi); font-size: 16px; line-height: 1.78; max-width: var(--measure); }
.doc p { margin: 14px 0; }
.doc ul { margin: 14px 0 14px 4px; list-style: none; }
.doc ul li { padding-left: 24px; position: relative; margin: 7px 0; }
.doc ul li::before { content: "-"; position: absolute; left: 6px; color: var(--turquoise); }
.doc ul ul { margin: 6px 0 6px 18px; }
.doc hr { border: none; border-top: 1px solid var(--rule); margin: 30px 0; }
.doc a { color: var(--turquoise); }
.doc a:hover { color: var(--green-hi); border-bottom-color: var(--green-hi); }
.doc code { color: var(--yellow); font-size: 0.92em; }
.doc pre {
  background: var(--panel);
  border: 1px solid var(--rule-bright);
  padding: 16px;
  overflow-x: auto;
  margin: 18px 0;
  color: var(--green);
}
.doc pre code { color: var(--green); }
.doc table, .doc th, .doc td { font-size: 0.88rem; }
.doc th { color: var(--yellow); }
.doc td { color: var(--text-hi); }
.doc strong { color: var(--text-hi); }
.doc > p:first-of-type { margin-top: 18px; }

/* ------------------------------------------------------- cta and footer --- */

.cta { text-align: left; }
.contact-line { margin-top: 14px; }
.eos { text-align: center; color: var(--rule-bright); letter-spacing: 0.3em; font-size: 0.78rem; padding: 22px 0 4px; }

.site-footer { border-top: 1px solid var(--rule-bright); margin-top: 8px; padding: 18px 0 22px; }
.pf-legend { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; }
.pf-legend a { color: var(--turquoise); border-bottom: none; }
.pf-legend a:hover { color: var(--green-hi); border-bottom: none; }
.pf-legend .pf-key { color: var(--text-dim); }
.pf-legend a:hover .pf-key { color: var(--green-hi); }
.copyright { margin-top: 12px; color: var(--text-dim); font-size: 0.8rem; letter-spacing: 0.06em; }

/* Responsive: the screen reflows to one field per row. */
@media (max-width: 900px) {
  .three-col, .two-col, .grid-2x2 { grid-template-columns: 1fr; }
  .hero { padding: 46px 0 32px; }
  .wrap { padding: 0 16px; }
  .hero h1 { max-width: none; }
  .screen-right { display: none; }
  .doc p, .doc li { font-size: 15px; }
}
@media (max-width: 560px) {
  .pf-row { gap: 4px 14px; font-size: 0.78rem; }
  .screen-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; opacity: 1; }
}

@media print {
  body { background: #fff; color: #000; }
  body::after { display: none; }
}
