/*
 * NRG Terminal site template - main stylesheet
 * (C) 2026 NEON Retro Group - GNU General Public License version 2 or later
 *
 * Put your own changes in user.css (same folder). It loads after this file and
 * survives template updates.
 *
 * The look is driven by attributes on <html>:
 *   data-phosphor  green | amber | white | ega
 *   data-fx        off | low | high       data-flicker  on | off
 *   data-plain     on | off               data-body     plex | vt
 *   data-art       ansi | ascii           data-blockfont jetbrains | vga
 */

/* ------------------------------------------------------------------ fonts */
@font-face { font-family: "NRG VT323"; src: url("../fonts/vt323-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "NRG Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "NRG Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "NRG JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
/* Optional: upload Web437_IBM_VGA_8x16.woff (Ultimate Oldschool PC Font Pack, CC BY-SA 4.0) to ../fonts/ */
@font-face { font-family: "NRG IBM VGA"; src: url("../fonts/Web437_IBM_VGA_8x16.woff") format("woff"); font-weight: 400; font-display: swap; }

/* ----------------------------------------------------------------- tokens */
:root {
  color-scheme: dark;
  /* P1 green phosphor (default) */
  --bg: #040a05;
  --bg-raise: #081309;
  --phos: #39ff6a;
  --phos-dim: #23a84a;
  --phos-faint: #0f3f1c;
  --phos-bright: #c4ffd2;
  --alert: #ff5f56;
  --accent-head: var(--phos-bright);
  --accent-link: var(--phos-bright);
  --accent-key: var(--phos-bright);

  --font-display: "NRG VT323", "VT323", "Courier New", monospace;
  --font-body: "NRG Plex Mono", "IBM Plex Mono", Consolas, "Courier New", monospace;
  --font-art: "NRG Plex Mono", "IBM Plex Mono", Consolas, "Courier New", monospace;
  --font-block: "NRG JetBrains Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;

  --glow: .6;
  --scan: .12;
  --vignette: .35;

  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.75rem;
  --step-3: 2.5rem;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));

  /* 16 colour slots used by ANSI block art. Phosphor modes map them to brightness levels. */
  --c-k: transparent; --c-b: transparent;
  --c-K: var(--phos-faint);
  --c-g: color-mix(in srgb, var(--phos-dim) 70%, var(--bg));
  --c-c: var(--c-g); --c-r: var(--c-g); --c-m: var(--c-g); --c-y: var(--c-g);
  --c-B: var(--phos-dim);
  --c-w: var(--phos); --c-G: var(--phos); --c-C: var(--phos); --c-R: var(--phos);
  --c-M: var(--phos-bright); --c-Y: var(--phos-bright);
  --c-W: color-mix(in srgb, var(--phos-bright) 60%, #fff);
}
:root[data-phosphor="amber"] {
  --bg: #0b0702; --bg-raise: #140d03;
  --phos: #ffb000; --phos-dim: #b67c00; --phos-faint: #4a3200; --phos-bright: #ffe3a3;
}
:root[data-phosphor="white"] {
  --bg: #06070a; --bg-raise: #0d0f14;
  --phos: #dfe8ff; --phos-dim: #8e98ad; --phos-faint: #2a303c; --phos-bright: #ffffff;
}
:root[data-phosphor="ega"] {
  --bg: #000000; --bg-raise: #00002a;
  --phos: #aaaaaa; --phos-dim: #8a8a8a; --phos-faint: #0000aa; --phos-bright: #ffffff;
  --accent-head: #55ffff; --accent-link: #ffff55; --accent-key: #ffff55;
  --glow: .35;
  --c-k: #000000; --c-b: #0000aa; --c-g: #00aa00; --c-c: #00aaaa; --c-r: #aa0000; --c-m: #aa00aa; --c-y: #aa5500; --c-w: #aaaaaa;
  --c-K: #555555; --c-B: #5555ff; --c-G: #55ff55; --c-C: #55ffff; --c-R: #ff5555; --c-M: #ff55ff; --c-Y: #ffff55; --c-W: #ffffff;
}
:root[data-fx="off"]  { --glow: 0;   --scan: 0;   --vignette: 0; }
:root[data-fx="high"] { --glow: 1.5; --scan: .32; --vignette: .7; }
:root[data-phosphor="ega"][data-fx="high"] { --glow: .8; }
:root[data-body="vt"] { --font-body: var(--font-display); }
:root[data-blockfont="vga"] { --font-block: "NRG IBM VGA", "NRG JetBrains Mono", "JetBrains Mono", monospace; }
:root[data-plain="on"] { --glow: 0; --scan: 0; --vignette: 0; --font-body: "NRG Plex Mono", "IBM Plex Mono", Consolas, monospace; }

/* ------------------------------------------------------------------- base */
html, body { background: #000; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--phos); }
*, *::before, *::after { box-sizing: border-box; }
img, video, iframe { max-width: 100%; height: auto; }
.visually-hidden, .visually-hidden-focusable:not(:focus):not(:focus-within), .element-invisible {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
[hidden] { display: none !important; }

.nrg-screen {
  position: relative;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--phos) 7%, var(--bg)) 0%, var(--bg) 70%);
  color: var(--phos);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  text-shadow: 0 0 calc(var(--glow) * 2px) color-mix(in srgb, var(--phos) 70%, transparent),
               0 0 calc(var(--glow) * 9px) color-mix(in srgb, var(--phos) 35%, transparent);
  overflow-x: clip;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
:root[data-body="vt"] .nrg-screen { font-size: 1.35rem; line-height: 1.35; }
:root[data-plain="on"] .nrg-screen { font-size: 1.0625rem; line-height: 1.7; text-shadow: none; background: var(--bg); }

/* Scanlines and vignette */
.nrg-screen::before, .nrg-screen::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.nrg-screen::before {
  background: repeating-linear-gradient(to bottom, rgb(0 0 0 / var(--scan)) 0, rgb(0 0 0 / var(--scan)) 1px, transparent 1px, transparent 3px);
}
.nrg-screen::after {
  background: radial-gradient(ellipse at center, transparent 55%, rgb(0 0 0 / var(--vignette)) 100%);
  box-shadow: inset 0 0 120px rgb(0 0 0 / calc(var(--vignette) * .9));
}
.nrg-rollbar {
  position: fixed; left: 0; right: 0; top: -20vh; height: 18vh; display: none; pointer-events: none; z-index: 49;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--phos) 6%, transparent), transparent);
}
:root[data-fx="high"]:not([data-plain="on"]) .nrg-rollbar { display: block; animation: nrg-roll 9s linear infinite; }
@keyframes nrg-roll { to { transform: translateY(140vh); } }
:root[data-flicker="on"]:not([data-plain="on"]) .nrg-frame { animation: nrg-flicker 4s steps(1) infinite; }
@keyframes nrg-flicker { 0%, 100% { opacity: 1; } 47% { opacity: .96; } 48% { opacity: 1; } 83% { opacity: .975; } 84% { opacity: 1; } }
@keyframes nrg-blink { 50% { opacity: 0; } }

a { color: var(--accent-link); text-decoration: underline; text-decoration-color: var(--phos-dim); text-underline-offset: 3px; }
a:hover { background: var(--phos); color: var(--bg); text-shadow: none; text-decoration: none; }
:root[data-phosphor="ega"] a:hover { background: var(--accent-link); }
:focus-visible { outline: 2px solid var(--phos-bright); outline-offset: 3px; }
::selection { background: var(--phos); color: var(--bg); text-shadow: none; }

.nrg-skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--phos); color: var(--bg); padding: .25rem .75rem; }
.nrg-skip:focus { left: 16px; }

/* ----------------------------------------------------------------- layout */
.nrg-frame {
  max-width: 76rem; margin: 0 auto;
  padding-left: var(--gutter-l); padding-right: var(--gutter-r); padding-block: 0 2rem;
  display: grid; gap: 1.25rem;
  transform-origin: 50% 40vh;
}
.nrg-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; align-items: start; }
.has-sidebar-right .nrg-layout { grid-template-columns: minmax(0, 1fr) 20rem; }
.has-sidebar-left .nrg-layout { grid-template-columns: 16rem minmax(0, 1fr); }
.has-sidebar-left.has-sidebar-right .nrg-layout { grid-template-columns: 14rem minmax(0, 1fr) 18rem; }
@media (max-width: 1000px) { .has-sidebar-left.has-sidebar-right .nrg-layout { grid-template-columns: minmax(0, 1fr) 18rem; } .has-sidebar-left.has-sidebar-right .nrg-sidebar--left { grid-column: 1 / -1; order: 3; } }
@media (max-width: 860px) { .has-sidebar-right .nrg-layout, .has-sidebar-left .nrg-layout, .has-sidebar-left.has-sidebar-right .nrg-layout { grid-template-columns: minmax(0, 1fr); } .nrg-sidebar--left { order: 3; } }
.nrg-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1.25rem; }
.nrg-main { min-width: 0; outline: none; }
.nrg-component { min-width: 0; }
.nrg-sidebar, .nrg-main-top, .nrg-main-bottom { display: grid; gap: 1.25rem; min-width: 0; }
.nrg-main-top { margin-bottom: 1.25rem; }
.nrg-main-bottom { margin-top: 1.5rem; }

/* Status bar */
.nrg-statusbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .1rem 1.5rem;
  background: var(--phos); color: var(--bg); text-shadow: none;
  font-family: var(--font-display); font-size: 1.25rem; line-height: 1.6;
  padding: .1rem .75rem; font-variant-numeric: tabular-nums;
}
:root[data-phosphor="ega"] .nrg-statusbar { background: #00aaaa; color: #000; }
.nrg-statusbar > * { white-space: nowrap; }
.nrg-statusbar a { color: inherit; }
.nrg-statusbar__modules { display: flex; gap: 1rem; white-space: normal; }
.nrg-statusbar__modules p { margin: 0; }
.nrg-timeleft.low { animation: nrg-blink 1s steps(1) infinite; }
.nrg-page-sysop { text-decoration: none; padding: 0 .35rem; border: 1px solid currentColor; }
.nrg-page-sysop:hover { background: var(--bg); color: var(--phos); }
.nrg-page-sysop.is-paging { animation: nrg-blink .5s steps(1) infinite; }

/* Banner */
.nrg-banner { display: grid; gap: .5rem; padding-top: 1rem; }
.nrg-scene-link { display: block; text-decoration: none; color: inherit; }
.nrg-scene-link:hover { background: none; color: inherit; }
.nrg-scene { display: block; overflow: hidden; }
.nrg-art {
  display: none; margin: 0 auto; width: fit-content; max-width: 100%; overflow: hidden;
  font-family: var(--font-art); white-space: pre; line-height: 1.15; color: var(--phos-bright);
}
.nrg-art--full { display: block; font-size: clamp(4px, calc((100vw - 40px) / 60.5), 17px); }
.nrg-art--crop { font-size: clamp(4px, calc((100vw - 48px) / 45), 14px); }
@media (max-width: 760px) { .nrg-art--full { display: none; } .nrg-art--crop { display: block; } }
.nrg-art.is-fit { font-size: var(--fit-size); }
.nrg-art.is-module { display: block; }
.nrg-banner-custom { overflow: hidden; }
.nrg-tagline {
  font-family: var(--font-display); font-size: var(--step-1); color: var(--phos-dim);
  display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; margin: 0;
}
.nrg-tagline__text { color: var(--phos); }
:root[data-phosphor="ega"] .nrg-tagline__text { color: var(--accent-key); }
.nrg-badge { background: var(--phos); color: var(--bg); text-shadow: none; padding: 0 .4rem; }
:root[data-phosphor="ega"] .nrg-badge { background: #ff55ff; color: #000; }
.nrg-scene-caption { color: var(--phos-dim); }

/* Menu bar */
.nrg-menubar {
  border-block: 1px dashed var(--phos-dim); padding-block: .4rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1.5rem;
}
.nrg-menubar__right { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.nrg-menu-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.nrg-menu .nrg-menu-list > li { position: relative; }
.nrg-menu .nrg-menu-list a, .nrg-menu .nrg-menu-list .nav-header {
  font-family: var(--font-display); font-size: var(--step-1); text-decoration: none; color: var(--phos);
  padding: 0 .3rem; display: inline-block;
}
.nrg-menu-list .key { color: var(--accent-key); }
.nrg-menu-list a[aria-current="page"], .nrg-menu-list .active > a, .nrg-menu-list a.hot {
  background: var(--phos); color: var(--bg); text-shadow: none;
}
:root[data-phosphor="ega"] .nrg-menu-list a[aria-current="page"], :root[data-phosphor="ega"] .nrg-menu-list .active > a, :root[data-phosphor="ega"] .nrg-menu-list a.hot { background: #00aaaa; color: #000; }
.nrg-menu-list a[aria-current="page"] .key, .nrg-menu-list .active > a .key, .nrg-menu-list a.hot .key { color: inherit; }
.nrg-menu .mod-menu__sub {
  display: none; position: absolute; z-index: 30; top: 100%; left: 0; min-width: 14rem;
  list-style: none; margin: 0; padding: .35rem 0; background: var(--bg-raise); border: 1px solid var(--phos-dim);
}
.nrg-menu li:hover > .mod-menu__sub, .nrg-menu li:focus-within > .mod-menu__sub { display: block; }
.nrg-menu .mod-menu__sub a { display: block; padding: .1rem .75rem; }
.nrg-footer .nrg-menu-list, .nrg-sidebar .nrg-menu-list { gap: .25rem 1.25rem; }
.nrg-sidebar .nrg-menu-list { flex-direction: column; }
.nrg-sidebar .nrg-menu-list .mod-menu__sub { list-style: none; padding-left: 1.25rem; }

/* Phosphor switch */
.nrg-switch { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-family: var(--font-display); font-size: 1.15rem; }
.nrg-switch__label { color: var(--phos-dim); margin-right: .2rem; }
.nrg-switch button {
  font: inherit; cursor: pointer; padding: 0 .45rem; line-height: 1.4; display: inline-flex; align-items: center; gap: .35rem;
  background: transparent; border: 1px solid var(--phos-dim); color: var(--phos); text-shadow: inherit;
}
.nrg-switch button:hover { border-color: var(--phos-bright); }
.nrg-switch button[aria-pressed="true"] { background: var(--phos); border-color: var(--phos); color: var(--bg); text-shadow: none; }
:root[data-phosphor="ega"] .nrg-switch button[aria-pressed="true"] { background: #00aaaa; border-color: #00aaaa; color: #000; }
.nrg-switch .dot { width: .7em; height: .7em; display: inline-block; border-radius: 50%; }
.nrg-switch [data-ph="green"] .dot { background: #39ff6a; box-shadow: 0 0 6px #39ff6a; }
.nrg-switch [data-ph="amber"] .dot { background: #ffb000; box-shadow: 0 0 6px #ffb000; }
.nrg-switch [data-ph="white"] .dot { background: #dfe8ff; box-shadow: 0 0 6px #dfe8ff; }
.nrg-switch [data-ph="ega"] .dot { background: conic-gradient(#ff55ff 0 25%, #55ffff 0 50%, #ffff55 0 75%, #55ff55 0); }
.nrg-switch .sep { width: 1px; align-self: stretch; background: var(--phos-faint); margin-inline: .2rem; }

/* Search module in the menu bar */
.nrg-search form { display: flex; gap: .4rem; align-items: center; margin: 0; }
.nrg-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nrg-search input[type="search"], .nrg-search input[type="text"] { width: 12rem; }

/* Breadcrumbs */
.nrg-breadcrumbs ol, .nrg-breadcrumbs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 .25rem; font-family: var(--font-display); font-size: var(--step-1); color: var(--phos-dim); }
.nrg-breadcrumbs li + li::before { content: "\\"; margin-right: .25rem; color: var(--phos-dim); }
.nrg-breadcrumbs li:first-child::before { content: "C:\\"; }
.nrg-breadcrumbs .float-start, .nrg-breadcrumbs .divider { display: none; }

/* --------------------------------------------------------------- content */
.nrg-component h1, .nrg-component h2, .nrg-component h3, .nrg-component h4,
.nrg-module__title, .nrg-error h1, .nrg-offline__box h1 {
  font-family: var(--font-display); font-weight: 400; line-height: 1.05; text-wrap: balance; color: var(--accent-head); margin: 0 0 .5rem;
}
.nrg-component h1 { font-size: var(--step-3); }
.nrg-component h2 { font-size: var(--step-2); margin-top: 1.75rem; }
.nrg-component h3 { font-size: var(--step-1); text-transform: uppercase; letter-spacing: .06em; margin-top: 1.5rem; }
.nrg-component h4 { font-size: var(--step-1); margin-top: 1.25rem; }
.nrg-component .page-header h1::after, .com-content-article .page-header h2:only-child::after {
  content: ""; display: inline-block; width: .5em; height: .8em; margin-left: .15em; background: var(--phos-bright);
  box-shadow: 0 0 calc(var(--glow) * 8px) var(--phos); animation: nrg-blink 1.05s steps(1) infinite;
}
.nrg-component h2 a, .nrg-component h3 a { text-decoration: none; }
.nrg-component p, .nrg-component ul, .nrg-component ol, .nrg-component dl, .nrg-component table, .nrg-component figure { margin: 0 0 1rem; }
.nrg-component ul:not([class]) { list-style: none; padding-left: 1.5rem; }
.nrg-component ul:not([class]) > li::before { content: ">"; margin-left: -1.5rem; width: 1.5rem; display: inline-block; color: var(--phos-bright); }
.nrg-component ol:not([class]) { padding-left: 2rem; }
.nrg-component hr { border: 0; border-top: 1px dashed var(--phos-dim); margin: 1.5rem 0; }
.nrg-component blockquote { margin: 1.5rem 0; padding: .25rem 0 .25rem 1.25rem; border-left: 3px double var(--phos-dim); color: var(--phos-bright); }
.nrg-component blockquote p:last-child { margin: 0; }
.nrg-component figcaption, .nrg-component .caption { color: var(--phos-dim); font-size: .9em; }
.nrg-component img { border: 1px solid var(--phos-faint); }
:root:not([data-phosphor="ega"]):not([data-plain="on"]) .nrg-component img { filter: grayscale(1) sepia(.3) contrast(1.05); }
.nrg-component pre, .nrg-component code { font-family: var(--font-art); }
.nrg-component pre { background: var(--bg-raise); border: 1px solid var(--phos-faint); padding: .75rem 1rem; overflow-x: auto; font-size: .85em; line-height: 1.45; }
.nrg-component code { color: var(--phos-bright); }
.nrg-component pre code { color: inherit; }
.com-content-article, .com-content-article__body, .blog-item, .item-page { max-width: 46rem; }
.com-content-article__body { min-width: 0; }
.com-content-article.is-revealing .com-content-article__body { animation: nrg-reveal var(--reveal-time, 6s) steps(48) both; }
@keyframes nrg-reveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

/* Article info (author, date, category) */
.article-info, dl.article-info { display: flex; flex-wrap: wrap; gap: .15rem 1.25rem; color: var(--phos-dim); font-size: .9em; margin: .25rem 0 1.25rem; }
.article-info dt, .article-info .article-info-term { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.article-info dd { margin: 0; }
.article-info [class^="icon-"], .article-info [class*=" icon-"], .icon-fw { display: none; }
.article-info dd::before { color: var(--phos-dim); }
.article-info .createdby::before { content: "From: "; }
.article-info .published::before { content: "Date: "; }
.article-info .modified::before { content: "Updated: "; }
.article-info .category-name::before, .article-info .parent-category-name::before { content: "Area: "; }
.article-info .hits::before { content: "Read: "; }
.article-info time, .article-info a { color: var(--phos); }

/* Blog and category lists */
.blog-items, .com-content-category-blog__items { display: grid; gap: 0; }
.blog-item, .com-content-category-blog__item {
  padding: 1rem 0; border-bottom: 1px dashed var(--phos-faint);
}
.blog-item .page-header h2, .blog-item h2 { font-size: var(--step-2); margin-top: 0; }
.items-leading .blog-item h2 { font-size: var(--step-3); }
.nrg-new {
  font-family: var(--font-display); font-size: .7em; vertical-align: .25em; margin-left: .5rem; padding: 0 .3rem;
  background: var(--phos); color: var(--bg); text-shadow: none; letter-spacing: .05em;
}
:root[data-phosphor="ega"] .nrg-new { background: #ff55ff; color: #000; }
.readmore { margin: .5rem 0 0; }
.com-content-category__table, .category.table { width: 100%; }
.items-more ol, .items-more ul { list-style: none; padding: 0; }

/* Buttons */
.nrg-btn, .btn, button.button, input[type="submit"], input[type="button"], .readmore a, .pagenavigation a {
  font: inherit; font-family: var(--font-display); font-size: 1.3rem; line-height: 1.2; cursor: pointer;
  display: inline-block; padding: .2rem .8rem; text-decoration: none; border-radius: 0;
  background: transparent; color: var(--phos-bright); border: 1px solid var(--phos); text-shadow: inherit;
}
.nrg-btn:hover, .btn:hover, button.button:hover, input[type="submit"]:hover, .readmore a:hover, .pagenavigation a:hover,
.nrg-btn:focus-visible, .btn:focus-visible { background: var(--phos); color: var(--bg); text-shadow: none; }
:root[data-phosphor="ega"] :is(.nrg-btn, .btn, button.button, input[type="submit"], .readmore a, .pagenavigation a) { border-color: #55ffff; color: #55ffff; }
:root[data-phosphor="ega"] :is(.nrg-btn, .btn, button.button, input[type="submit"], .readmore a, .pagenavigation a):hover { background: #55ffff; color: #000; }
.btn-primary { border-width: 2px; }
.readmore a::before { content: "[ "; } .readmore a::after { content: " ]"; }
.readmore .icon-chevron-right, .readmore [class^="icon-"] { display: none; }

/* Forms */
input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="url"], input[type="tel"],
input[type="number"], input[type="date"], select, textarea, .form-control, .form-select {
  font: inherit; color: var(--phos-bright); background: var(--bg-raise); border: 1px solid var(--phos-dim); border-radius: 0;
  padding: .35rem .5rem; max-width: 100%; caret-color: var(--phos-bright); text-shadow: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--phos-bright); outline-offset: 1px; }
textarea { width: 100%; min-height: 8rem; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--phos); }
label, .control-label { color: var(--phos); }
.control-group, .mb-3, .form-group { margin-bottom: 1rem; display: grid; gap: .3rem; }
.form-text, .form-control-feedback, small { color: var(--phos-dim); }
.star, .required::after { color: var(--alert); }
fieldset { border: 1px solid var(--phos-faint); margin: 0 0 1rem; padding: .75rem 1rem; }
legend { font-family: var(--font-display); font-size: var(--step-1); color: var(--phos-bright); padding: 0 .4rem; }
.invalid { border-color: var(--alert) !important; }

/* Tables */
.table-wrap, .nrg-component .table-responsive { overflow-x: auto; }
.nrg-component table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: .92em; border: 1px solid var(--phos-dim); display: block; overflow-x: auto; }
@supports (display: table) { .nrg-component table { display: table; } }
.nrg-component th, .nrg-component td { padding: .35rem .75rem; text-align: left; border-bottom: 1px dashed var(--phos-faint); vertical-align: top; }
.nrg-component th { font-family: var(--font-display); font-weight: 400; font-size: 1.2em; background: var(--phos-faint); color: var(--phos-bright); }
:root[data-phosphor="ega"] .nrg-component th { background: #0000aa; color: #fff; }

/* Pagination */
.pagination__wrapper, .com-content-category-blog__navigation { margin: 1.5rem 0; }
.pagination { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; font-family: var(--font-display); font-size: 1.2rem; }
.pagination .page-link { display: inline-block; padding: 0 .6rem; border: 1px solid var(--phos-dim); text-decoration: none; color: var(--phos); }
.pagination .active .page-link, .pagination [aria-current] { background: var(--phos); color: var(--bg); text-shadow: none; }
.pagination .disabled .page-link { opacity: .4; }
.pagination [class^="icon-"]::before { content: none; }
.pagination .icon-angle-double-left::after { content: "<<"; } .pagination .icon-angle-left::after { content: "<"; }
.pagination .icon-angle-right::after { content: ">"; } .pagination .icon-angle-double-right::after { content: ">>"; }
.counter, .com-content-category-blog__counter { color: var(--phos-dim); }
.pagenavigation { margin: 2rem 0; }
.pagenavigation .pagination { justify-content: space-between; }

/* System messages and alerts */
#system-message-container { margin-bottom: 1rem; }
joomla-alert, .alert {
  display: block; border: 1px solid var(--phos); background: var(--bg-raise); color: var(--phos-bright);
  padding: .6rem 2.5rem .6rem .9rem; margin-bottom: .75rem; position: relative; font-family: var(--font-body);
}
joomla-alert .alert-heading, .alert-heading { font-family: var(--font-display); font-size: 1.25rem; text-transform: uppercase; }
joomla-alert[type="danger"], joomla-alert[type="error"], .alert-danger, .alert-error { border-color: var(--alert); color: var(--alert); }
joomla-alert .joomla-alert--close, .alert .btn-close { position: absolute; top: .3rem; right: .5rem; background: none; border: 0; color: inherit; font: inherit; font-size: 1.4rem; cursor: pointer; }

/* Tags, labels, badges */
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.tags a, .badge, .label { display: inline-block; padding: 0 .4rem; border: 1px solid var(--phos-dim); font-size: .85em; text-decoration: none; }
.icon-star::before, .icon-featured::before { content: "*"; }

/* ------------------------------------------------------- modules (nrgbox) */
.nrg-module { border: 1px solid var(--phos-dim); background: color-mix(in srgb, var(--bg-raise) 80%, transparent); min-width: 0; }
:root[data-phosphor="ega"] .nrg-module { border-color: #5555ff; }
.nrg-module__title {
  background: var(--phos-faint); padding: .3rem .75rem; margin: 0; border-bottom: 1px solid var(--phos-dim);
  font-size: var(--step-1); text-transform: uppercase; letter-spacing: .06em; color: var(--phos-bright);
}
:root[data-phosphor="ega"] .nrg-module__title { background: #0000aa; color: #fff; }
.nrg-module__body { padding: .75rem; font-size: .92em; display: grid; gap: .6rem; min-width: 0; }
.nrg-module__body > :last-child { margin-bottom: 0; }
.nrg-module__body ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.nrg-module__body p { margin: 0; }
.mod-articles-category-title, .mod-articleslatest a, .mod-articlespopular a { text-decoration: none; }

/* Who's online as nodes */
.nrg-nodes__summary { color: var(--phos-dim); }
.nrg-nodes__list { display: grid; gap: .35rem; margin: 0; font-variant-numeric: tabular-nums; }
.nrg-nodes__list > div { display: flex; justify-content: space-between; gap: .75rem; }
.nrg-nodes__list dt { margin: 0; display: flex; gap: .6rem; min-width: 0; }
.nrg-nodes__list dd { margin: 0; text-align: right; }
.nrg-nodes__n { color: var(--phos-dim); }
.nrg-nodes__who { color: var(--phos-bright); overflow-wrap: anywhere; }
.nrg-nodes .is-idle dd, .nrg-nodes .is-idle .nrg-nodes__who { color: var(--phos-dim); }

/* Custom module with the "ASCII art" layout */
.nrg-ascii {
  margin: 0; white-space: pre; overflow-x: auto; font-family: var(--font-art); line-height: 1.15; color: var(--phos-bright);
  font-size: clamp(6px, 1.6vw, 15px);
}
.ansi-art .nrg-ascii, .nrg-ascii.ansi-art { font-family: var(--font-block); line-height: 1; }

/* ---------------------------------------------------------- command line */
.nrg-cli { border: 1px solid var(--phos-dim); background: var(--bg-raise); display: grid; }
.nrg-cli__out {
  margin: 0; padding: .75rem 1rem .25rem; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 16rem; overflow-y: auto;
  font-family: var(--font-body); font-size: .92em; line-height: 1.5;
}
.nrg-cli__out .echo { color: var(--phos-dim); }
.nrg-cli__out .err { color: var(--alert); }
.nrg-cli__form { display: flex; align-items: center; gap: .5rem; padding: .25rem 1rem .75rem; margin: 0; }
.nrg-cli__form label { color: var(--phos-bright); font-family: var(--font-display); font-size: 1.3rem; white-space: nowrap; cursor: text; }
.nrg-cli__form input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; padding: .2rem 0;
  color: var(--phos-bright); caret-color: var(--phos-bright); font: inherit; text-transform: uppercase; text-shadow: inherit;
}
.nrg-cli__form:focus-within { box-shadow: inset 0 -1px 0 var(--phos-dim); }
:root[data-phosphor="ega"] .nrg-cli__form label, :root[data-phosphor="ega"] .nrg-cli__form input { color: #ffff55; caret-color: #ffff55; }

/* ---------------------------------------------------------------- footer */
.nrg-footer { display: grid; gap: .75rem; padding-top: 1rem; color: var(--phos-dim); font-size: .9em; }
.nrg-rule { font-family: var(--font-art); overflow: hidden; white-space: nowrap; color: var(--phos-dim); }
.nrg-footer p { margin: 0; }
.nrg-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.nrg-signoff { font-family: var(--font-display); font-size: var(--step-1); color: var(--phos); white-space: pre; }

/* ------------------------------------------------- display settings panel */
.nrg-setup-btn {
  position: fixed; z-index: 60; background: var(--bg); box-shadow: 0 0 0 4px var(--bg);
  right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.nrg-dialog {
  background: var(--bg-raise); color: var(--phos); border: 2px double var(--phos);
  max-width: min(34rem, calc(100vw - 32px)); width: 100%; padding: 0; font-family: var(--font-body); text-shadow: inherit;
}
:root[data-phosphor="ega"] .nrg-dialog { border-color: #55ffff; }
.nrg-dialog::backdrop { background: rgb(0 0 0 / .7); }
.nrg-dialog__head { background: var(--phos); color: var(--bg); text-shadow: none; font-family: var(--font-display); font-size: 1.4rem; padding: .2rem .9rem; }
:root[data-phosphor="ega"] .nrg-dialog__head { background: #00aaaa; color: #000; }
.nrg-dialog__body { padding: 1rem; display: grid; gap: .9rem; max-height: 70vh; overflow-y: auto; margin: 0; }
.nrg-dialog__body p { margin: 0; color: var(--phos-dim); font-size: .85em; }
.nrg-dialog fieldset { margin: 0; padding: .5rem .75rem .75rem; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.nrg-dialog label { display: inline-flex; gap: .45rem; align-items: center; cursor: pointer; }
.nrg-dialog__actions { display: flex; flex-wrap: wrap; gap: .75rem; padding: 0 1rem 1rem; }

/* ------------------------------------------------- boot screen / hang up */
.nrg-boot, .nrg-hangup {
  position: fixed; inset: 0; z-index: 80; background: var(--bg); cursor: pointer; overflow: hidden;
  padding: calc(2rem + env(safe-area-inset-top, 0px)) var(--gutter-r) 2rem var(--gutter-l);
  font-family: var(--font-display); font-size: 1.4rem; line-height: 1.3; color: var(--phos); white-space: pre-wrap;
}
.nrg-boot__hint { position: absolute; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); right: 16px; color: var(--phos-dim); }
.nrg-hangup { display: grid; place-content: center; text-align: center; font-size: 2.5rem; background: #000; }
.nrg-hangup .nrg-boot__hint { position: static; margin-top: 1rem; font-size: 1.3rem; }
.nrg-screen.is-off .nrg-frame { animation: nrg-crt-off .55s ease-in forwards; }
@keyframes nrg-crt-off {
  0% { transform: scale(1, 1); filter: brightness(1); }
  40% { transform: scale(1, .006); filter: brightness(4); }
  75% { transform: scale(.25, .006); filter: brightness(6); }
  100% { transform: scale(0, 0); filter: brightness(8); opacity: 0; }
}

/* ------------------------------------------------------- error / offline */
.nrg-error, .nrg-offline__box { padding-block: 2rem; max-width: 46rem; }
.nrg-prompt { font-family: var(--font-display); font-size: var(--step-1); color: var(--phos-dim); margin: 0 0 .5rem; overflow-wrap: anywhere; }
.nrg-error__title { font-size: var(--step-3); }
.nrg-error__code { color: var(--alert); }
.nrg-error__debug { overflow-x: auto; font-size: .8em; }
.nrg-offline__status { color: var(--phos-bright); font-family: var(--font-display); font-size: var(--step-1); }
.nrg-login fieldset { display: grid; gap: .5rem; max-width: 22rem; }

/* ------------------------------------------------- banner scene artwork */
/* Classic ASCII scenes */
.nrg-art .sg-frame, .nrg-art .sg-wire { color: var(--phos-dim); }
.nrg-art .sg-rg { color: var(--phos); font-weight: 600; }
.nrg-art .tube {
  color: var(--phos-bright); font-weight: 600;
  text-shadow: 0 0 calc(var(--glow) * 3px + 1px) var(--phos), 0 0 calc(var(--glow) * 10px) var(--phos), 0 0 calc(var(--glow) * 22px) color-mix(in srgb, var(--phos) 60%, transparent);
}
:root[data-plain="on"] .nrg-art .tube { text-shadow: none; }
.nrg-art .tube.dark { color: var(--phos-faint); text-shadow: none; }
.nrg-art .tube.buzz, .nrg-art .ntube.buzz { animation: nrg-buzz .8s steps(1); }
@keyframes nrg-buzz { 0% { opacity: 1; } 8% { opacity: .2; } 16% { opacity: 1; } 30% { opacity: .35; } 38% { opacity: 1; } 62% { opacity: .55; } 70% { opacity: 1; } }
.nrg-art .sun, .nrg-art .moon { color: var(--phos-bright); font-weight: 600; text-shadow: 0 0 calc(var(--glow) * 6px) var(--phos), 0 0 calc(var(--glow) * 16px) var(--phos); }
.nrg-art .sunref, .nrg-art .moonref, .nrg-art .twrname, .nrg-art .refname { color: var(--phos-bright); }
.nrg-art .ray, .nrg-art .cloud, .nrg-art .tow, .nrg-art .plane, .nrg-art .flamingo, .nrg-art .palm, .nrg-art .crab, .nrg-art .umbrella, .nrg-art .bldg { color: var(--phos); }
.nrg-art .water, .nrg-art .bird, .nrg-art .sand, .nrg-art .post, .nrg-art .trunk, .nrg-art .flamleg { color: var(--phos-dim); }
.nrg-art .win { color: var(--phos-bright); text-shadow: 0 0 calc(var(--glow) * 5px) var(--phos); }
.nrg-art .win.off { color: var(--phos-faint); text-shadow: none; }
.nrg-art .star { color: var(--phos-bright); }
.nrg-art .star.s1 { animation: nrg-twinkle 3.1s steps(1) infinite; }
.nrg-art .star.s2 { animation: nrg-twinkle 4.7s steps(1) infinite 1.3s; }
.nrg-art .star.s3 { color: var(--phos-dim); }
@keyframes nrg-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
.nrg-art .beacon { color: var(--alert); text-shadow: 0 0 calc(var(--glow) * 6px) var(--alert); animation: nrg-beacon 2.4s steps(1) infinite; }
@keyframes nrg-beacon { 0%, 100% { opacity: 1; } 15% { opacity: .1; } }

/* EGA colours for the classic ASCII scenes */
:root[data-phosphor="ega"] .ascii-art span { text-shadow: 0 0 calc(var(--glow) * 5px) currentColor; }
:root[data-phosphor="ega"] .ascii-art .tube { color: #ff55ff; text-shadow: 0 0 3px #ff55ff, 0 0 10px #ff55ff, 0 0 20px #aa00aa; }
:root[data-phosphor="ega"] .ascii-art .tube.dark { color: #550055; text-shadow: none; }
:root[data-phosphor="ega"] .ascii-art .sg-rg, :root[data-phosphor="ega"] .ascii-art .twrname { color: #55ffff; }
:root[data-phosphor="ega"] .ascii-art .refname, :root[data-phosphor="ega"] .ascii-art .flamingo, :root[data-phosphor="ega"] .ascii-art .cloud { color: #ff55ff; }
:root[data-phosphor="ega"] .ascii-art .sun { color: #ffff55; }
:root[data-phosphor="ega"] .ascii-art .sun.sb1 { color: #ff5555; }
:root[data-phosphor="ega"] .ascii-art .sun.sb2 { color: #ff55ff; }
:root[data-phosphor="ega"] .nrg-scene[data-scene="sunrise"] .ascii-art .sun.sb2 { color: #aa5500; }
:root[data-phosphor="ega"] .ascii-art .ray, :root[data-phosphor="ega"] .ascii-art .sand, :root[data-phosphor="ega"] .ascii-art .moon, :root[data-phosphor="ega"] .ascii-art .win { color: #ffff55; }
:root[data-phosphor="ega"] .ascii-art .sunref, :root[data-phosphor="ega"] .ascii-art .trunk, :root[data-phosphor="ega"] .ascii-art .post { color: #aa5500; }
:root[data-phosphor="ega"] .ascii-art .water, :root[data-phosphor="ega"] .ascii-art .bldg { color: #5555ff; }
:root[data-phosphor="ega"] .ascii-art .moonref, :root[data-phosphor="ega"] .ascii-art .tow, :root[data-phosphor="ega"] .ascii-art .star { color: #ffffff; }
:root[data-phosphor="ega"] .ascii-art .palm { color: #55ff55; }
:root[data-phosphor="ega"] .ascii-art .crab, :root[data-phosphor="ega"] .ascii-art .umbrella { color: #ff5555; }
:root[data-phosphor="ega"] .ascii-art .plane { color: #aaaaaa; }
:root[data-phosphor="ega"] .ascii-art .bird { color: #555555; }
:root[data-phosphor="ega"] .ascii-art .flamleg { color: #aa00aa; }
:root[data-phosphor="ega"] .ascii-art .win.off { color: #0000aa; text-shadow: none; }
:root[data-phosphor="ega"] .ascii-art .star.s3 { color: #55ffff; }

/* ANSI block-art scenes: 16 colour slots */
.nrg-art.ansi-art { font-family: var(--font-block); line-height: 1; font-weight: 400; text-shadow: none; }
.nrg-art.ansi-art span { text-shadow: none; }
.nrg-art.ansi-art .ntube { text-shadow: 0 0 calc(var(--glow) * 8px) var(--c-M); }
:root[data-plain="on"] .nrg-art.ansi-art .ntube { text-shadow: none; }
.nrg-art .ntube.dark { filter: brightness(.3); }
.ansi-art .f-k { color: var(--c-k); } .ansi-art .b-k { background: var(--c-k); }
.ansi-art .f-b { color: var(--c-b); } .ansi-art .b-b { background: var(--c-b); }
.ansi-art .f-g { color: var(--c-g); } .ansi-art .b-g { background: var(--c-g); }
.ansi-art .f-c { color: var(--c-c); } .ansi-art .b-c { background: var(--c-c); }
.ansi-art .f-r { color: var(--c-r); } .ansi-art .b-r { background: var(--c-r); }
.ansi-art .f-m { color: var(--c-m); } .ansi-art .b-m { background: var(--c-m); }
.ansi-art .f-y { color: var(--c-y); } .ansi-art .b-y { background: var(--c-y); }
.ansi-art .f-w { color: var(--c-w); } .ansi-art .b-w { background: var(--c-w); }
.ansi-art .f-K { color: var(--c-K); } .ansi-art .b-K { background: var(--c-K); }
.ansi-art .f-B { color: var(--c-B); } .ansi-art .b-B { background: var(--c-B); }
.ansi-art .f-G { color: var(--c-G); } .ansi-art .b-G { background: var(--c-G); }
.ansi-art .f-C { color: var(--c-C); } .ansi-art .b-C { background: var(--c-C); }
.ansi-art .f-R { color: var(--c-R); } .ansi-art .b-R { background: var(--c-R); }
.ansi-art .f-M { color: var(--c-M); } .ansi-art .b-M { background: var(--c-M); }
.ansi-art .f-Y { color: var(--c-Y); } .ansi-art .b-Y { background: var(--c-Y); }
.ansi-art .f-W { color: var(--c-W); } .ansi-art .b-W { background: var(--c-W); }
.nrg-art.ansi-art .win { color: var(--c-Y); }
.nrg-art.ansi-art .win.off { color: var(--c-k); text-shadow: none; }
.nrg-art.ansi-art .star { color: var(--c-W); }
:root:not([data-phosphor="ega"]) .nrg-art.ansi-art .win.off { color: var(--bg); }

/* ------------------------------------------------- plain mode & motion */
:root[data-plain="on"] .nrg-art .star, :root[data-plain="on"] .nrg-art .beacon,
:root[data-plain="on"] .nrg-component .page-header h1::after { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .nrg-frame, .nrg-rollbar, .nrg-timeleft.low, .nrg-art .tube, .nrg-art .ntube, .nrg-art .star, .nrg-art .beacon,
  .nrg-component .page-header h1::after, .nrg-page-sysop.is-paging { animation: none !important; }
  .nrg-rollbar { display: none !important; }
}

/* ----------------------------------------------------------------- print */
@media print {
  html, body, .nrg-screen { background: #fff !important; color: #000 !important; text-shadow: none !important; }
  .nrg-screen::before, .nrg-screen::after, .nrg-rollbar, .nrg-statusbar, .nrg-banner, .nrg-menubar, .nrg-cli,
  .nrg-setup-btn, .nrg-sidebar, .nrg-footer .nrg-rule { display: none !important; }
  .nrg-component * { color: #000 !important; text-shadow: none !important; }
  .has-sidebar-right .nrg-layout { grid-template-columns: 1fr; }
}

/* ------------------------------------------- modules carried over from Cassiopeia */
/* Modules still set to Cassiopeia's "card" / "noCard" styles get the same boxed look. */
.nrg-frame .card { border: 1px solid var(--phos-dim); background: color-mix(in srgb, var(--bg-raise) 80%, transparent); min-width: 0; }
:root[data-phosphor="ega"] .nrg-frame .card { border-color: #5555ff; }
.nrg-frame .card-header {
  font-family: var(--font-display); font-weight: 400; font-size: var(--step-1); text-transform: uppercase; letter-spacing: .06em;
  background: var(--phos-faint); color: var(--phos-bright); padding: .3rem .75rem; margin: 0; border-bottom: 1px solid var(--phos-dim);
}
:root[data-phosphor="ega"] .nrg-frame .card-header { background: #0000aa; color: #fff; }
.nrg-frame .card-body { padding: .75rem; font-size: .92em; }
.nrg-frame .card-body > :last-child { margin-bottom: 0; }
/* Article list modules */
.mod-articles-items, .mod-articles, .mod-articleslatest, .mod-articlespopular, .mod-articlescategory, .latestnews, .mostread { list-style: none; margin: 0; padding: 0; }
.mod-articles-items { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.mod-articles-items h3, .mod-articles-items h4 { font-family: var(--font-display); font-weight: 400; font-size: var(--step-1); margin: 0 0 .4rem; color: var(--accent-head); }
.mod-articles-items a { text-decoration: none; }
.mod-articles-items img { border: 1px solid var(--phos-faint); }
:root:not([data-phosphor="ega"]):not([data-plain="on"]) .nrg-frame .mod-articles-items img,
:root:not([data-phosphor="ega"]):not([data-plain="on"]) .nrg-frame .banner-overlay { filter: grayscale(1) sepia(.3) contrast(1.05); }
.mod-tagspopular ul, .tagspopular ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.mod-login fieldset, .mod-login .mod-login__userdata { display: grid; gap: .5rem; border: 0; padding: 0; margin: 0; }
.mod-login ul { list-style: none; padding: 0; }
/* Joomla's show/hide password button */
.input-password-toggle { font-family: var(--font-display); font-size: 1.1rem; padding: 0 .5rem; }
.input-password-toggle [class^="icon-"]::before { content: "SHOW"; }
.input-password-toggle .icon-eye-slash::before { content: "HIDE"; }
.input-group { display: flex; gap: .35rem; align-items: stretch; }
.input-group > input { flex: 1; min-width: 0; }

/* =====================================================================
 * NRG Blocks (mod_nrgblocks)
 * ===================================================================== */
.nrg-blocks { display: flex; flex-wrap: wrap; gap: 2rem 2rem; align-items: flex-start; min-width: 0; }
.nrg-blocks__title { font-family: var(--font-display); font-weight: 400; font-size: var(--step-2); color: var(--accent-head); margin: 0 0 .75rem; }
.nrg-block { flex: 1 1 100%; min-width: 0; display: grid; gap: .6rem; align-content: start; }
.nrg-block--w-narrow { max-width: 46rem; }
.nrg-block--w-half { flex: 1 1 calc(50% - 1rem); }
@media (max-width: 760px) { .nrg-block--w-half { flex-basis: 100%; } }
.nrg-block.is-boxed { border: 1px solid var(--phos-dim); background: color-mix(in srgb, var(--bg-raise) 80%, transparent); padding: 1rem 1.1rem; }
:root[data-phosphor="ega"] .nrg-block.is-boxed { border-color: #5555ff; }
.nrg-block > * { margin: 0; }
.nrg-block__prompt { font-family: var(--font-display); font-size: var(--step-1); color: var(--phos-dim); overflow-wrap: anywhere; }
.nrg-block__heading { font-family: var(--font-display); font-weight: 400; line-height: 1.05; text-wrap: balance; color: var(--accent-head); }
h2.nrg-block__heading { font-size: var(--step-3); }
h3.nrg-block__heading { font-size: var(--step-2); }
h4.nrg-block__heading { font-size: var(--step-1); text-transform: uppercase; letter-spacing: .06em; }
.nrg-block__heading.has-cursor::after {
  content: ""; display: inline-block; width: .5em; height: .8em; margin-left: .15em; background: var(--phos-bright);
  box-shadow: 0 0 calc(var(--glow) * 8px) var(--phos); animation: nrg-blink 1.05s steps(1) infinite;
}
.nrg-block__body > :first-child { margin-top: 0; }
.nrg-block__body > :last-child { margin-bottom: 0; }
.nrg-block__body p, .nrg-block__body ul, .nrg-block__body ol { margin: 0 0 1rem; }
.nrg-block__body ul { list-style: none; padding-left: 1.5rem; }
.nrg-block__body ul > li::before { content: ">"; margin-left: -1.5rem; width: 1.5rem; display: inline-block; color: var(--phos-bright); }
.nrg-block__body h2, .nrg-block__body h3, .nrg-block__body h4 { font-family: var(--font-display); font-weight: 400; color: var(--accent-head); margin: 1.25rem 0 .5rem; }
.nrg-block__body blockquote { margin: 1rem 0; padding-left: 1.25rem; border-left: 3px double var(--phos-dim); color: var(--phos-bright); }

/* Columns for gallery and cards */
.nrg-gallery, .nrg-cards { display: grid; gap: 1.25rem; list-style: none; margin: 0; padding: 0; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.nrg-cols-2 { --cols: 2; } .nrg-cols-3 { --cols: 3; } .nrg-cols-4 { --cols: 4; }
@media (max-width: 900px) { .nrg-cols-3, .nrg-cols-4 { --cols: 2; } }
@media (max-width: 560px) { .nrg-gallery, .nrg-cards { --cols: 1; } }
.nrg-gallery li::before { content: none; }

/* Images: CRT monitor frame, simple box, none */
.nrg-figure { margin: 0; display: grid; gap: .4rem; max-width: 100%; }
.nrg-figure img { display: block; width: 100%; height: auto; border: 0; }
.nrg-figure a:hover { background: none; }
.nrg-figure figcaption { color: var(--phos-dim); font-size: .9em; }
.nrg-figure--box .nrg-figure__screen { border: 1px solid var(--phos-dim); padding: 4px; background: var(--bg-raise); }
.nrg-figure--crt { max-width: 44rem; }
.nrg-figure--crt .nrg-figure__screen {
  position: relative; padding: clamp(10px, 3vw, 26px); border-radius: 18px;
  background: linear-gradient(145deg, #3a3a36, #1b1b19 60%, #121210); box-shadow: inset 0 0 0 2px #4b4b45, 0 6px 0 #0c0c0b, 0 10px 18px rgb(0 0 0 / .6);
}
.nrg-figure--crt .nrg-figure__screen img { border-radius: 14px / 18px; box-shadow: 0 0 0 3px #0a0a0a; }
.nrg-figure--crt .nrg-figure__screen::after {
  content: ""; position: absolute; inset: clamp(10px, 3vw, 26px); border-radius: 14px / 18px; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgb(0 0 0 / .18) 0 1px, transparent 1px 3px),
              radial-gradient(ellipse at center, transparent 60%, rgb(0 0 0 / .45) 100%);
  box-shadow: inset 0 0 30px rgb(0 0 0 / .6);
}
.nrg-figure--crt figcaption { text-align: center; }
:root:not([data-phosphor="ega"]):not([data-plain="on"]) .nrg-block.is-tinted img { filter: grayscale(1) sepia(1) hue-rotate(var(--tint-hue, 70deg)) saturate(2.2) brightness(.95) contrast(1.05); }
:root[data-phosphor="amber"] { --tint-hue: 0deg; }
:root[data-phosphor="white"] .nrg-block.is-tinted img { filter: grayscale(1) contrast(1.08) !important; }
.nrg-block:not(.is-tinted) img { filter: none !important; }

/* Cards */
.nrg-card { border: 1px solid var(--phos-dim); background: color-mix(in srgb, var(--bg-raise) 80%, transparent); display: flex; flex-direction: column; gap: .6rem; padding: 0 0 1rem; min-width: 0; }
:root[data-phosphor="ega"] .nrg-card { border-color: #5555ff; }
.nrg-card > * { margin: 0 1rem; }
.nrg-card__image { margin: 0; border-bottom: 1px solid var(--phos-dim); }
.nrg-card__image img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border: 0; }
.nrg-card__title { font-family: var(--font-display); font-weight: 400; font-size: var(--step-2); line-height: 1.05; color: var(--accent-head); margin-top: .9rem; }
.nrg-card__image + .nrg-card__title { margin-top: .2rem; }
.nrg-card > :first-child:not(.nrg-card__image) { margin-top: 1rem; }
.nrg-card__text { color: var(--phos); font-size: .95em; }
.nrg-card__link { margin-top: auto; padding-top: .25rem; }

/* Buttons */
.nrg-buttons { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }
.nrg-buttons--center { justify-content: center; }
.nrg-btn--primary { border-width: 2px; background: color-mix(in srgb, var(--phos) 14%, transparent); }

/* Alert box */
.nrg-alert { border: 2px double var(--phos); padding: .75rem 1rem; display: grid; gap: .35rem; background: color-mix(in srgb, var(--bg-raise) 85%, transparent); }
.nrg-alert__tag { font-family: var(--font-display); font-size: var(--step-1); color: var(--phos-bright); letter-spacing: .05em; }
.nrg-alert__body > :last-child { margin-bottom: 0; }
.nrg-alert--warning { border-color: var(--alert); }
.nrg-alert--warning .nrg-alert__tag { color: var(--alert); }
.nrg-alert--sysop .nrg-alert__tag { animation: nrg-blink 1.6s steps(1) infinite; }
:root[data-phosphor="ega"] .nrg-alert--info { border-color: #55ffff; } :root[data-phosphor="ega"] .nrg-alert--info .nrg-alert__tag { color: #55ffff; }
:root[data-phosphor="ega"] .nrg-alert--sysop { border-color: #ffff55; background: #0000aa; } :root[data-phosphor="ega"] .nrg-alert--sysop .nrg-alert__tag { color: #ffff55; }

/* Divider */
.nrg-divider { overflow: hidden; white-space: nowrap; color: var(--phos-dim); font-family: var(--font-block); line-height: 1; padding-block: .5rem; }
.nrg-divider--double { color: var(--phos); }
:root[data-phosphor="ega"] .nrg-divider--blocks { color: #ff55ff; }
:root[data-phosphor="ega"] .nrg-divider--wave { color: #5555ff; }

/* ASCII / ANSI art block */
.nrg-ascii-block { margin: 0; white-space: pre; overflow-x: auto; font-family: var(--font-art); line-height: 1.15; color: var(--phos-bright); max-width: 100%; }
.nrg-ascii-block.is-ansi { font-family: var(--font-block); line-height: 1; }
.nrg-ascii-block.is-glow { text-shadow: 0 0 calc(var(--glow) * 3px + 1px) var(--phos), 0 0 calc(var(--glow) * 12px) var(--phos); }
:root[data-phosphor="ega"] .nrg-ascii-block.is-glow { color: #ff55ff; text-shadow: 0 0 3px #ff55ff, 0 0 12px #aa00aa; }
:root[data-plain="on"] .nrg-ascii-block { text-shadow: none; }
.nrg-ascii-block.is-small { font-size: 9px; } .nrg-ascii-block.is-medium { font-size: 13px; } .nrg-ascii-block.is-large { font-size: 18px; }
.nrg-ascii-block.is-fit { font-size: clamp(4px, 1.4vw, 16px); overflow: hidden; }
.nrg-ascii-block.is-fitted { font-size: var(--fit-size); }

/* File listing */
.nrg-listing-wrap { overflow-x: auto; border: 1px solid var(--phos-dim); }
.nrg-listing { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: .92em; }
.nrg-listing th, .nrg-listing td { padding: .35rem .75rem; text-align: left; border-bottom: 1px dashed var(--phos-faint); white-space: nowrap; }
.nrg-listing thead th { font-family: var(--font-display); font-weight: 400; font-size: 1.2em; background: var(--phos-faint); color: var(--phos-bright); }
:root[data-phosphor="ega"] .nrg-listing thead th { background: #0000aa; color: #fff; }
.nrg-listing tbody th { font-weight: 400; color: var(--phos-dim); }
.nrg-listing tr.is-ok td, .nrg-listing tr.is-ok th { color: var(--phos-bright); }
.nrg-listing tr.is-bad td { color: var(--alert); }
.nrg-listing__flag { font-family: var(--font-display); padding: 0 .3rem; border: 1px solid currentColor; font-size: .9em; }
.nrg-listing tr.is-new .nrg-listing__flag { background: var(--phos); color: var(--bg); text-shadow: none; border-color: var(--phos); }
:root[data-phosphor="ega"] .nrg-listing tr.is-new .nrg-listing__flag { background: #ff55ff; border-color: #ff55ff; color: #000; }
.nrg-listing tbody tr:hover { background: color-mix(in srgb, var(--phos) 8%, transparent); }
.nrg-listing__count { margin: 0; padding: .3rem .75rem; color: var(--phos-dim); font-size: .85em; text-align: right; }

/* Progress meter */
.nrg-meter { display: grid; gap: .4rem; }
.nrg-meter p { margin: 0; }
.nrg-meter__bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .75rem; font-family: var(--font-block); font-size: clamp(.8rem, 2.6vw, 1.15rem); color: var(--phos-bright); white-space: pre; }
:root[data-phosphor="ega"] .nrg-meter__track { color: #55ff55; }
.nrg-meter__pct { font-family: var(--font-display); font-size: 1.4em; }
.nrg-meter__figures { font-family: var(--font-display); font-size: var(--step-1); color: var(--phos); }

/* A page built only from blocks: add "nrg-blocks-only" as the menu item's Page Class */
.nrg-blocks-only .nrg-component { display: none; }

@media (prefers-reduced-motion: reduce) { .nrg-block__heading.has-cursor::after, .nrg-alert--sysop .nrg-alert__tag { animation: none !important; } }
