/*!
 * eXeLearning Hacker Style
 * -----------------------
 * Author: Área de Tecnología Educativa · Consejería de Educación, FP y
 *         Actividad Física y Deportes del Gobierno de Canarias
 * Project: eXeLearning.net
 * License: Creative Commons CC0 1.0 Universal
 *
 * Matrix digital rain + Tron border draw-in + Fallout PipBoy rail.
 * Fonts: JetBrains Mono + VT323 (both SIL OFL 1.1).
 */

@charset "UTF-8";

/* =========================================================
   Fonts (self-hosted)
   ========================================================= */
@font-face {
    font-family: "JetBrains Mono";
    src: url(fonts/JetBrainsMono-Regular.woff2) format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "VT323";
    src: url(fonts/VT323-Regular.woff2) format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* =========================================================
   Palette & tokens
   ========================================================= */
:root {
    /* accent — green by default, swappable via html[data-accent] */
    --hk-accent:        #00ff9c;
    --hk-accent-dim:    #0b7a4b;
    --hk-accent-ink:    #9effcd;
    --hk-accent-soft:   rgba(0, 255, 156, 0.08);
    --hk-accent-line:   rgba(0, 255, 156, 0.35);
    --hk-accent-glow:   0 0 6px rgba(0, 255, 156, 0.55), 0 0 18px rgba(0, 255, 156, 0.22);

    --hk-bg:            #000000;
    --hk-bg-soft:       #030604;
    --hk-panel:         rgba(0, 20, 10, 0.55);
    --hk-panel-solid:   #020604;
    --hk-ink-muted:     #4a7d64;
    --hk-ink-dim:       #2d5040;

    --hk-warn:          #ffb000;
    --hk-err:           #ff5070;

    --rail-w:           300px;
    --rail-w-lg:        336px;
    --content-max:      1100px;

    --mono:  "JetBrains Mono", "IBM Plex Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --pixel: "VT323", "Press Start 2P", var(--mono);

    --border-draw:      900ms cubic-bezier(0.22, 0.61, 0.36, 1);
    --type-speed:       22ms;
}

html[data-accent="amber"] {
    --hk-accent:      #ffb000;
    --hk-accent-dim:  #7a5100;
    --hk-accent-ink:  #ffd780;
    --hk-accent-soft: rgba(255, 176, 0, 0.08);
    --hk-accent-line: rgba(255, 176, 0, 0.35);
    --hk-accent-glow: 0 0 6px rgba(255, 176, 0, 0.55), 0 0 18px rgba(255, 176, 0, 0.22);
}
html[data-accent="cyan"] {
    --hk-accent:      #5ef2ff;
    --hk-accent-dim:  #0b5a7a;
    --hk-accent-ink:  #b5f5ff;
    --hk-accent-soft: rgba(94, 242, 255, 0.08);
    --hk-accent-line: rgba(94, 242, 255, 0.35);
    --hk-accent-glow: 0 0 6px rgba(94, 242, 255, 0.55), 0 0 18px rgba(94, 242, 255, 0.22);
}

/* Light mode (opt-in via #darkModeToggler). Default is dark. */
html.exe-light-mode {
    --hk-bg:        #ffffff;
    --hk-bg-soft:   #f2f7f4;
    --hk-panel:     rgba(255, 255, 255, 0.8);
    --hk-accent:    #0b7a4b;
    --hk-accent-dim:#6fb090;
    --hk-accent-ink:#0a3924;
    --hk-ink-muted: #447058;
    --hk-ink-dim:   #8abba5;
    --hk-accent-soft: rgba(11, 122, 75, 0.08);
    --hk-accent-line: rgba(11, 122, 75, 0.35);
    --hk-accent-glow: none;
}
html.exe-light-mode[data-accent="amber"] {
    --hk-accent:    #8a5a00;
    --hk-accent-dim:#c8a254;
    --hk-accent-ink:#3d2a00;
    --hk-accent-soft: rgba(138, 90, 0, 0.08);
    --hk-accent-line: rgba(138, 90, 0, 0.35);
}
html.exe-light-mode[data-accent="cyan"] {
    --hk-accent:    #0b5a7a;
    --hk-accent-dim:#6ea8bf;
    --hk-accent-ink:#063048;
    --hk-accent-soft: rgba(11, 90, 122, 0.08);
    --hk-accent-line: rgba(11, 90, 122, 0.35);
}
html.exe-light-mode { color-scheme: light; }
html.exe-light-mode body,
html.exe-light-mode .exe-content { background: var(--hk-bg); color: var(--hk-accent-ink); }
html.exe-light-mode #hkRain { opacity: 0.3; mix-blend-mode: multiply; }
html.exe-light-mode body::after { background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,0.08) 3px, rgba(0,0,0,0.08) 3px); }
html.exe-light-mode body::before {
    background:
        radial-gradient(1200px 700px at 20% 0%, var(--hk-accent-soft), transparent 60%),
        linear-gradient(180deg, #fafffc 0%, #eef6f1 100%);
}

/* Light-mode rail: white background instead of the dark CRT gradient. */
html.exe-light-mode #siteNav {
    background:
        linear-gradient(180deg, #ffffff, #f2f7f4),
        var(--hk-bg);
    border-right: 1px solid var(--hk-accent-dim);
    color: var(--hk-accent-ink);
}
html.exe-light-mode #siteNav::before {
    background: repeating-linear-gradient(
        to bottom,
        transparent 0, transparent 2px,
        rgba(0, 0, 0, 0.05) 3px, rgba(0, 0, 0, 0.05) 3px
    );
    opacity: 0.5;
}
html.exe-light-mode #siteNav::after {
    background: radial-gradient(80% 40% at 50% -10%, var(--hk-accent-soft), transparent 70%);
}
html.exe-light-mode #siteNav a { color: var(--hk-accent-ink); }
html.exe-light-mode #siteNav a:hover { background: var(--hk-accent-soft); }
html.exe-light-mode #siteNav a.active,
html.exe-light-mode #siteNav a[aria-current="page"] {
    background: var(--hk-accent);
    color: #fff;
}
html.exe-light-mode .pip-head .pip-logo { text-shadow: none; }
html.exe-light-mode .pip-tab.active { color: #fff; }
html.exe-light-mode .pip-stat .val { text-shadow: none; }

/* =========================================================
   Reset / base
   ========================================================= */
* { box-sizing: border-box; }
html, body { height: 100%; }
html {
    background: var(--hk-bg);
    color-scheme: dark;
}
body {
    margin: 0;
    color: var(--hk-accent-ink);
    background: var(--hk-bg);
    font-family: var(--mono);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--hk-accent);
    text-decoration: none;
    border-bottom: 1px solid var(--hk-accent-line);
}
a:hover,
a:focus {
    text-shadow: var(--hk-accent-glow);
    border-bottom-color: var(--hk-accent);
}

::selection { background: var(--hk-accent); color: #000; }

body::-webkit-scrollbar,
#siteNav::-webkit-scrollbar { width: 10px; height: 10px; }
body::-webkit-scrollbar-track,
#siteNav::-webkit-scrollbar-track { background: #020604; }
body::-webkit-scrollbar-thumb,
#siteNav::-webkit-scrollbar-thumb { background: var(--hk-accent-dim); }

/* =========================================================
   Matrix rain + ambience + scanlines
   ========================================================= */
#hkRain {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.55;
    mix-blend-mode: screen;
    transition: opacity 0.4s ease;
}
body[data-rain="off"] #hkRain { opacity: 0; }

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(1200px 700px at 20% 0%, var(--hk-accent-soft), transparent 60%),
        radial-gradient(900px 500px at 90% 110%, var(--hk-accent-soft), transparent 60%),
        linear-gradient(180deg, #000 0%, #010402 100%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9990;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0,
        rgba(0, 0, 0, 0) 2px,
        rgba(0, 0, 0, 0.22) 3px,
        rgba(0, 0, 0, 0.22) 3px
    );
    mix-blend-mode: multiply;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}
body[data-scanlines="off"]::after { opacity: 0; }

@keyframes hk-flicker {
    0%, 100% { opacity: 0.7; }
    42%      { opacity: 0.62; }
    43%      { opacity: 0.78; }
    58%      { opacity: 0.64; }
    59%      { opacity: 0.74; }
}
body[data-flicker="on"]::after {
    animation: hk-flicker 5s infinite steps(8, end);
}

body[data-curve="on"] .exe-content {
    border-radius: 16px;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8), inset 0 0 180px rgba(0, 0, 0, 0.6);
}

@media (prefers-reduced-motion: reduce) {
    body::after,
    body[data-flicker="on"]::after { animation: none; }
}

/* =========================================================
   Main layout — wraps around #siteNav + main
   ========================================================= */
body.exe-export.exe-web-site {
    padding: 0;
}

/* Override content/css/base.css default (.exe-content { background: #fff }) */
.exe-content,
.exe-content.exe-export {
    background: var(--hk-bg);
    color: var(--hk-accent-ink);
}

.exe-content.exe-export {
    position: relative;
    z-index: 2;
    display: block;
    padding-left: var(--rail-w);
    min-height: 100vh;
    isolation: isolate;
}
body.siteNav-off .exe-content.exe-export {
    padding-left: 0;
    transition: padding-left 0.2s ease;
}
@media (min-width: 1400px) {
    .exe-content.exe-export { padding-left: var(--rail-w-lg); }
}
@media (max-width: 880px) {
    .exe-content.exe-export { padding-left: 0; }
}

#skipNav {
    position: absolute;
    left: -9999px;
    top: -9999px;
}
#skipNav:focus {
    left: 16px;
    top: 16px;
    z-index: 99;
    background: var(--hk-bg);
    color: var(--hk-accent);
    padding: 6px 10px;
    border: 1px solid var(--hk-accent);
}

/* =========================================================
   PipBoy rail (around #siteNav)
   ========================================================= */
#siteNav {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--rail-w);
    height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    background:
        linear-gradient(180deg, rgba(0, 20, 10, 0.92), rgba(0, 12, 6, 0.98)),
        var(--hk-bg);
    border-right: 1px solid var(--hk-accent-dim);
    color: var(--hk-accent-ink);
    font-family: var(--mono);
    font-size: 13px;
    overflow: hidden;
    z-index: 3;
}
#siteNav::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0, transparent 2px,
        rgba(0, 0, 0, 0.35) 3px, rgba(0, 0, 0, 0.35) 3px
    );
    pointer-events: none;
    mix-blend-mode: multiply;
    opacity: 0.6;
}
#siteNav::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(80% 40% at 50% -10%, var(--hk-accent-soft), transparent 70%);
    pointer-events: none;
}

/* eXe ships the .pre-js / .siteNav-hidden flags to avoid FOUC while the
   export script boots. Our rail is always part of the layout; override the
   default "hide" so it stays visible unless the user collapses it via
   #menuToggler (which sets body.siteNav-off). */
.siteNav-hidden #siteNav { display: flex; }

/* Collapse via #menuToggler: slide the rail off-screen and give the content
   its full width back. Kept off the layout even on desktop. */
#siteNav { transition: transform 0.25s ease; }
body.siteNav-off #siteNav {
    transform: translateX(-101%);
    pointer-events: none;
}

@media (min-width: 1400px) {
    #siteNav { width: var(--rail-w-lg); }
}
@media (max-width: 880px) {
    #siteNav {
        width: min(85vw, 360px);
        transform: translateX(-101%);
        z-index: 99;
    }
    body.siteNav-open #siteNav { transform: translateX(0); }
}

/* PipBoy chrome — injected by style.js */
.pip-head {
    position: relative;
    z-index: 1;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--hk-accent-dim);
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}
.pip-head .pip-logo {
    font-family: var(--pixel);
    font-size: 28px;
    letter-spacing: 0.08em;
    color: var(--hk-accent);
    text-shadow: var(--hk-accent-glow);
    line-height: 1;
}
.pip-head .pip-sub {
    font-size: 10px;
    opacity: 0.75;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-top: 4px;
}
.pip-head .pip-pwr {
    margin-left: auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hk-accent);
    box-shadow: var(--hk-accent-glow);
    animation: pip-pulse 1.6s infinite;
}
@keyframes pip-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

.pip-stats {
    position: relative;
    z-index: 1;
    padding: 10px 18px;
    border-bottom: 1px solid var(--hk-accent-dim);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    font-size: 11px;
    letter-spacing: 0.06em;
    flex: 0 0 auto;
}
.pip-stat { display: flex; gap: 8px; align-items: center; min-width: 0; }
.pip-stat .lbl { opacity: 0.65; text-transform: uppercase; min-width: 40px; }
.pip-stat .val {
    color: var(--hk-accent);
    text-shadow: var(--hk-accent-glow);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pip-bar {
    flex: 1;
    height: 6px;
    border: 1px solid var(--hk-accent-dim);
    position: relative;
}
.pip-bar > i {
    display: block;
    height: 100%;
    background: var(--hk-accent);
    box-shadow: var(--hk-accent-glow);
}

.pip-tabs {
    position: relative;
    z-index: 1;
    display: flex;
    border-bottom: 1px solid var(--hk-accent-dim);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    flex: 0 0 auto;
}
.pip-tab {
    flex: 1;
    padding: 9px 8px;
    text-align: center;
    background: transparent;
    color: var(--hk-ink-muted);
    border: 0;
    border-right: 1px solid var(--hk-accent-dim);
    font-family: var(--mono);
    font-size: inherit;
    letter-spacing: inherit;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}
.pip-tab:last-child { border-right: 0; }
.pip-tab:hover { color: var(--hk-accent-ink); background: var(--hk-accent-soft); }
.pip-tab.active {
    color: #000;
    background: var(--hk-accent);
    text-shadow: none;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.4);
}

.pip-section-hd {
    padding: 12px 18px 6px;
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--hk-ink-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}
.pip-section-hd::before { content: ">"; color: var(--hk-accent); }
.pip-section-hd::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--hk-accent-dim);
    margin-left: 6px;
}

/* Existing #siteNav <ul> acts as the nav list */
#siteNav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 1;
}
#siteNav > ul {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 0 20px;
}
#siteNav li { margin: 0; }
#siteNav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 18px 7px 28px;
    color: var(--hk-accent-ink);
    border: 0;
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 0.02em;
    position: relative;
    line-height: 1.25;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, padding 0.15s ease;
}
#siteNav a::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--hk-accent-dim);
}
#siteNav a:hover {
    background: var(--hk-accent-soft);
    padding-left: 32px;
    text-shadow: none;
}
#siteNav a:hover::before { background: var(--hk-accent); }
#siteNav a.active,
#siteNav a[aria-current="page"] {
    color: #000;
    background: var(--hk-accent);
    text-shadow: none;
}
#siteNav a.active::before,
#siteNav a[aria-current="page"]::before {
    background: #000;
    left: 14px;
    width: 8px;
    height: 2px;
    animation: pip-blink 0.9s steps(2, end) infinite;
}
@keyframes pip-blink { 50% { opacity: 0; } }

/* nested lists */
#siteNav ul ul a { padding-left: 42px; font-size: 12px; opacity: 0.9; }
#siteNav ul ul a::before { left: 26px; }
#siteNav ul ul a:hover { padding-left: 46px; }
#siteNav ul ul ul a { padding-left: 56px; }
#siteNav ul ul ul a::before { left: 40px; }

.pip-foot {
    position: relative;
    z-index: 1;
    padding: 10px 18px;
    border-top: 1px solid var(--hk-accent-dim);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    color: var(--hk-ink-muted);
    flex: 0 0 auto;
}
.pip-foot .blink {
    color: var(--hk-accent);
    animation: pip-blink 0.9s steps(2, end) infinite;
}

/* =========================================================
   Main page content
   ========================================================= */
main.page {
    position: relative;
    z-index: 1;
    padding: 46px clamp(20px, 4vw, 64px) 120px;
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

/* Client search — hidden by default, shown when body.search-open is set by
   #searchToggler. Mounts at the top of the main column like a slide-down drawer. */
#exe-client-search {
    position: fixed;
    top: 56px;
    right: 18px;
    left: auto;
    z-index: 48;
    min-width: 260px;
    max-width: calc(100vw - 36px);
    padding: 10px;
    background: var(--hk-bg);
    border: 1px solid var(--hk-accent);
    box-shadow: var(--hk-accent-glow);
    display: none;
}
body.search-open #exe-client-search { display: block; }
#exe-client-search input,
#exe-client-search [type="search"],
#exe-client-search [type="text"] {
    background: var(--hk-bg);
    color: var(--hk-accent);
    border: 1px solid var(--hk-accent-dim);
    padding: 6px 10px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    width: 100%;
}
#exe-client-search input:focus,
#exe-client-search [type="search"]:focus {
    outline: none;
    border-color: var(--hk-accent);
    box-shadow: var(--hk-accent-glow);
}
@media (max-width: 880px) {
    #exe-client-search { top: 50px; right: 12px; left: 12px; }
}

/* Header — page counter + package title + page title */
.main-header {
    margin-bottom: 36px;
    position: relative;
}
.page-counter {
    font-size: 10px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--hk-ink-muted);
    margin: 0 0 10px;
}
.page-counter-label { opacity: 0.7; }
.page-counter-content strong { color: var(--hk-accent); text-shadow: var(--hk-accent-glow); }
.page-counter-sep { margin: 0 2px; opacity: 0.5; }

.package-header {
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--hk-ink-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.package-header::before {
    content: "user@exe:~$";
    color: var(--hk-accent);
}
.package-header .package-title {
    margin: 0;
    font-weight: normal;
    color: var(--hk-accent-ink);
    letter-spacing: inherit;
}

.page-header {
    margin-top: 6px;
}
.page-title {
    font-family: var(--mono);
    font-weight: 500;
    font-size: clamp(24px, 3vw, 38px);
    color: var(--hk-accent);
    text-shadow: var(--hk-accent-glow);
    letter-spacing: 0.01em;
    line-height: 1.15;
    margin: 0;
}
.page-title::after {
    content: "";
    display: inline-block;
    width: 0.55em;
    height: 1em;
    background: var(--hk-accent);
    vertical-align: -0.12em;
    margin-left: 6px;
    box-shadow: var(--hk-accent-glow);
    animation: hk-caret 1.05s steps(2, end) infinite;
}
@keyframes hk-caret { 50% { opacity: 0; } }

/* =========================================================
   Boxes (iDevices) with Tron border draw-in
   ========================================================= */
article.box,
.exe-content .box {
    position: relative;
    margin: 0 0 42px;
    padding: 22px 26px 24px;
    background: var(--hk-panel);
    color: var(--hk-accent-ink);
    border: 0;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.box > .b-top,
.box > .b-right,
.box > .b-bot,
.box > .b-left {
    position: absolute;
    background: var(--hk-accent);
    box-shadow: var(--hk-accent-glow);
    pointer-events: none;
    transform-origin: 0 0;
}
.box > .b-top   { top: 0;    left: 0;  height: 1px; width: 100%;  transform: scaleX(0); transform-origin: left   center; }
.box > .b-right { top: 0;    right: 0; width: 1px;  height: 100%; transform: scaleY(0); transform-origin: top    center; }
.box > .b-bot   { bottom: 0; right: 0; height: 1px; width: 100%;  transform: scaleX(0); transform-origin: right  center; }
.box > .b-left  { bottom: 0; left: 0;  width: 1px;  height: 100%; transform: scaleY(0); transform-origin: bottom center; }

.box > .corner {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 1px solid var(--hk-accent);
    box-shadow: var(--hk-accent-glow);
    opacity: 0;
    transition: opacity 0.25s ease 0.7s;
    pointer-events: none;
}
.box > .corner.tl { top: -4px;    left: -4px;  border-right: 0; border-bottom: 0; }
.box > .corner.tr { top: -4px;    right: -4px; border-left: 0;  border-bottom: 0; }
.box > .corner.bl { bottom: -4px; left: -4px;  border-right: 0; border-top: 0; }
.box > .corner.br { bottom: -4px; right: -4px; border-left: 0;  border-top: 0; }

.box.drawn > .b-top   { transform: scaleX(1); transition: transform 260ms ease-out; }
.box.drawn > .b-right { transform: scaleY(1); transition: transform 220ms ease-out 260ms; }
.box.drawn > .b-bot   { transform: scaleX(1); transition: transform 260ms ease-out 480ms; }
.box.drawn > .b-left  { transform: scaleY(1); transition: transform 220ms ease-out 740ms; }
.box.drawn > .corner  { opacity: 1; transition-delay: 960ms; }

@media (prefers-reduced-motion: reduce) {
    .box > .b-top,
    .box > .b-right,
    .box > .b-bot,
    .box > .b-left { transform: none; }
    .box > .corner { opacity: 1; transition: none; }
}

/* Box header */
.box-head {
    margin: 0 0 14px;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--hk-ink-muted);
    background: transparent;
    border: 0;
}
.box-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 6px var(--hk-accent-soft)) brightness(1.1) hue-rotate(90deg) saturate(1.4);
}
html[data-accent="amber"] .box-icon { filter: drop-shadow(0 0 6px var(--hk-accent-soft)) sepia(1) saturate(4) hue-rotate(-10deg); }
html[data-accent="cyan"]  .box-icon { filter: drop-shadow(0 0 6px var(--hk-accent-soft)) hue-rotate(170deg) saturate(1.6) brightness(1.05); }
.box-icon img {
    width: 100%;
    height: auto;
    image-rendering: pixelated;
}
.box-title {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 18px;
    margin: 0;
    color: var(--hk-accent);
    text-shadow: var(--hk-accent-glow);
    letter-spacing: 0.02em;
    flex: 1;
    text-transform: none;
}
.box-title::before {
    content: "> ";
    color: var(--hk-accent-dim);
}

.box-toggle {
    background: transparent;
    border: 1px solid var(--hk-accent-dim);
    color: var(--hk-accent);
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.box-toggle > span {
    position: absolute;
    left: -9999px;
}
.box-toggle::before {
    content: "−";
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1;
}
.box-toggle.box-toggle-off::before { content: "+"; }
.box-toggle:hover {
    border-color: var(--hk-accent);
    background: var(--hk-accent-soft);
}

.box-content {
    font-size: 15px;
    line-height: 1.65;
    padding: 0;
}
.box-content > .idevice_node:not(:last-child) { margin-bottom: 18px; }
.box-content p { margin: 0 0 12px; }
.box-content p:last-child { margin-bottom: 0; }
.box-content strong { color: var(--hk-accent); }
.box-content em { color: var(--hk-accent-ink); font-style: italic; }
.box-content ul,
.box-content ol { padding-left: 22px; margin: 8px 0 12px; }
.box-content li { margin-bottom: 4px; }
.box-content li::marker { color: var(--hk-accent); }

.box-content figure {
    margin: 16px auto 8px;
    position: relative;
    border: 1px solid var(--hk-accent-dim);
    padding: 6px;
    background: rgba(0, 0, 0, 0.5);
    max-width: 100%;
}
.box-content figure img {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    filter: grayscale(0.7) contrast(1.1) brightness(0.85) hue-rotate(60deg);
    mix-blend-mode: screen;
    opacity: 0.9;
}
html[data-accent="amber"] .box-content figure img {
    filter: grayscale(0.7) contrast(1.1) brightness(0.9) sepia(0.7) hue-rotate(-25deg) saturate(1.6);
}
html[data-accent="cyan"] .box-content figure img {
    filter: grayscale(0.5) contrast(1.1) brightness(0.9) hue-rotate(180deg);
}
.box-content figure figcaption {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--hk-ink-muted);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 8px 4px 0;
    text-align: left;
}

/* =========================================================
   Typewriter
   ========================================================= */
.typer {
    display: inline;
    white-space: pre-wrap;
}
.typer-cursor {
    display: inline-block;
    width: 9px;
    height: 1.05em;
    background: var(--hk-accent);
    vertical-align: -0.15em;
    margin-left: 2px;
    box-shadow: var(--hk-accent-glow);
    animation: hk-caret 1.05s steps(2, end) infinite;
}
.typer.done .typer-cursor { display: none; }
.typer-pending { visibility: hidden; }

body[data-typewriter="off"] .typer-pending { visibility: visible; }
body[data-typewriter="off"] .typer-cursor  { display: none; }

@media (prefers-reduced-motion: reduce) {
    .typer-pending { visibility: visible; }
    .typer-cursor { animation: none; display: none; }
}

/* =========================================================
   iDevice-specific: True/False + Scrambled list + Download source
   ========================================================= */
/* trueorfalse */
.trueorfalse-idevice li,
.trueorfalse-idevice .question-list li {
    border: 1px solid var(--hk-accent-dim);
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 12px;
    margin-bottom: 10px;
    list-style: none;
}
.trueorfalse-idevice label,
.trueorfalse-idevice .trueorfalse-question {
    font-family: var(--mono);
    color: var(--hk-accent-ink);
}
.trueorfalse-idevice button,
.trueorfalse-idevice .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--hk-accent);
    color: var(--hk-accent);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-shadow: var(--hk-accent-glow);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.trueorfalse-idevice button:hover,
.trueorfalse-idevice .btn:hover {
    background: var(--hk-accent);
    color: #000;
    text-shadow: none;
}
.trueorfalse-idevice .correct { border-color: var(--hk-accent); }
.trueorfalse-idevice .correct::after { content: " ✔"; color: var(--hk-accent); }
.trueorfalse-idevice .incorrect { border-color: var(--hk-err); }
.trueorfalse-idevice .incorrect::after { content: " ✘"; color: var(--hk-err); }

/* scrambled-list */
.scrambled-list-idevice ol,
.scrambled-list-idevice ul {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
}
.scrambled-list-idevice li {
    border: 1px solid var(--hk-accent-dim);
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 12px;
    margin-bottom: 8px;
    font-family: var(--mono);
    color: var(--hk-accent-ink);
    cursor: grab;
    position: relative;
}
.scrambled-list-idevice li::before {
    content: "::";
    color: var(--hk-accent-dim);
    margin-right: 10px;
    letter-spacing: 0.1em;
}
.scrambled-list-idevice li:hover {
    border-color: var(--hk-accent);
    background: var(--hk-accent-soft);
}
.scrambled-list-idevice .correct { border-left: 2px solid var(--hk-accent); }
.scrambled-list-idevice .incorrect { border-left: 2px solid var(--hk-err); }

/* download-source-file */
.download-source-file-idevice a,
.download-source-file-idevice button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--hk-accent);
    color: var(--hk-accent);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-shadow: var(--hk-accent-glow);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.download-source-file-idevice a:hover,
.download-source-file-idevice button:hover {
    background: var(--hk-accent);
    color: #000;
    text-shadow: none;
    border-bottom-color: var(--hk-accent);
}

/* =========================================================
   Nav buttons (prev / next)
   ========================================================= */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 0 auto;
    padding: 20px clamp(20px, 4vw, 64px) 0;
    max-width: var(--content-max);
    border-top: 1px dashed var(--hk-accent-dim);
}
.nav-button,
a.nav-button {
    flex: 1;
    max-width: 48%;
    border: 1px solid var(--hk-accent-dim);
    padding: 14px 18px;
    color: var(--hk-accent-ink);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.2s ease, background 0.2s ease;
    background: rgba(0, 0, 0, 0.35);
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.3;
    text-align: left;
}
.nav-button:hover,
a.nav-button:hover {
    border-color: var(--hk-accent);
    background: var(--hk-accent-soft);
    border-bottom-color: var(--hk-accent);
    text-shadow: none;
}
.nav-button::before {
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--hk-ink-muted);
    text-transform: uppercase;
}
.nav-button-left::before  { content: "◄ prev"; }
.nav-button-right::before { content: "next ►"; }
.nav-button-right {
    text-align: right;
    align-items: flex-end;
}
.nav-button > span {
    font-size: 14px;
    color: var(--hk-accent);
    text-shadow: var(--hk-accent-glow);
}
span.nav-button { opacity: 0.3; cursor: default; }
span.nav-button:hover { border-color: var(--hk-accent-dim); background: rgba(0, 0, 0, 0.35); }

/* =========================================================
   Footer
   ========================================================= */
#siteFooter {
    margin: 60px auto 0;
    padding: 18px clamp(20px, 4vw, 64px) 20px;
    max-width: var(--content-max);
    border-top: 1px dashed var(--hk-accent-dim);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--hk-ink-muted);
    background: transparent;
}
#siteFooter #siteFooterContent p { margin: 0; }
#siteFooter a {
    color: var(--hk-accent-ink);
    border-bottom-color: var(--hk-accent-dim);
}
#siteFooter a:hover {
    color: var(--hk-accent);
    border-bottom-color: var(--hk-accent);
}

#made-with-eXe {
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: right;
    padding: 8px clamp(20px, 4vw, 64px) 16px;
    margin: 0;
    color: var(--hk-ink-muted);
    position: relative;
    z-index: 1;
}
#made-with-eXe a { color: inherit; border-bottom-color: var(--hk-ink-dim); }
#made-with-eXe a:hover { color: var(--hk-accent); }

/* =========================================================
   Top-bar togglers (dark mode, search, tweaks)
   ========================================================= */
.toggler-wrap {
    position: fixed;
    top: 16px;
    right: 18px;
    z-index: 50;
    display: flex;
    gap: 8px;
}
.toggler {
    background: var(--hk-bg);
    border: 1px solid var(--hk-accent);
    color: var(--hk-accent);
    padding: 6px 10px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-shadow: var(--hk-accent-glow);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 36px;
    height: 30px;
    line-height: 1;
}
.toggler:hover { background: var(--hk-accent-soft); }
.toggler > span {
    position: absolute;
    left: -9999px;
}
.toggler::before {
    font-size: 12px;
    letter-spacing: 0;
}
#darkModeToggler::before     { content: "☼"; }
html.exe-dark-mode #darkModeToggler::before { content: "☾"; }
#searchToggler::before       { content: "⌕"; }
#hackerTweaksToggler::before { content: "⚙"; }
#menuToggler::before         { content: "≡"; }

html.exe-dark-mode { --hk-bg: #000; }

/* Toggle icon flips when the rail is collapsed */
body.siteNav-off #menuToggler::before { content: "›"; }
/* Active search button reads as pressed while the panel is open */
body.search-open #searchToggler {
    background: var(--hk-accent);
    color: #000;
    text-shadow: none;
}
body.search-open #searchToggler::before { color: #000; }

/* =========================================================
   Tweaks panel
   ========================================================= */
#hackerTweaks {
    position: fixed;
    top: 56px;
    right: 18px;
    z-index: 51;
    width: 320px;
    max-width: calc(100vw - 36px);
    background: #000;
    border: 1px solid var(--hk-accent);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9), var(--hk-accent-glow);
    color: var(--hk-accent-ink);
    font-family: var(--mono);
    font-size: 12px;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
#hackerTweaks.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.tw-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--hk-accent-dim);
    color: var(--hk-accent);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 11px;
    text-shadow: var(--hk-accent-glow);
}
.tw-head .tw-close {
    background: transparent;
    border: 0;
    color: var(--hk-accent-dim);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
}
.tw-head .tw-close:hover { color: var(--hk-accent); }

.tw-body { padding: 10px 14px 14px; }
.tw-row { padding: 10px 0; border-bottom: 1px dashed var(--hk-ink-dim); }
.tw-row:last-child { border-bottom: 0; }
.tw-label {
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--hk-ink-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.tw-segs {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
}
.tw-seg {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--hk-accent-dim);
    background: transparent;
    color: var(--hk-ink-muted);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 7px 4px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    margin-right: -1px;
}
.tw-seg:hover {
    color: var(--hk-accent);
    border-color: var(--hk-accent);
    z-index: 1;
    position: relative;
}
.tw-seg.on {
    background: var(--hk-accent);
    color: #000;
    border-color: var(--hk-accent);
    text-shadow: none;
    z-index: 2;
    position: relative;
}
.tw-seg .sw {
    display: inline-block;
    width: 10px;
    height: 10px;
    vertical-align: -1px;
    margin-right: 6px;
    border: 1px solid currentColor;
}
.tw-seg[data-value="green"] .sw { background: #00ff9c; }
.tw-seg[data-value="amber"] .sw { background: #ffb000; }
.tw-seg[data-value="cyan"]  .sw { background: #5ef2ff; }

/* =========================================================
   Boot overlay
   ========================================================= */
#hkBoot {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    color: var(--hk-accent);
    font-family: var(--mono);
    font-size: 13px;
    padding: 40px clamp(20px, 4vw, 48px);
    overflow: hidden;
    text-shadow: var(--hk-accent-glow);
}
#hkBoot .bl {
    display: block;
    white-space: pre;
    line-height: 1.4;
}
#hkBoot .hb-caret {
    display: inline-block;
    width: 9px;
    height: 1em;
    background: var(--hk-accent);
    vertical-align: -0.12em;
    animation: hk-caret 1s steps(2, end) infinite;
    box-shadow: var(--hk-accent-glow);
}
#hkBoot.fade {
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
#hkBoot::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0, transparent 2px,
        rgba(0, 0, 0, 0.4) 3px, rgba(0, 0, 0, 0.4) 3px
    );
    mix-blend-mode: multiply;
}

/* =========================================================
   Pixel-font tweak
   ========================================================= */
body[data-pixel="all"] {
    font-family: var(--pixel);
    font-size: 19px;
    line-height: 1.45;
}
body[data-pixel="all"] #siteNav a,
body[data-pixel="all"] .pip-tabs,
body[data-pixel="all"] .page-title,
body[data-pixel="all"] .box-title { font-family: var(--pixel); }
body[data-pixel="chrome"] .pip-head .pip-logo,
body[data-pixel="chrome"] .page-title {
    font-family: var(--pixel);
    letter-spacing: 0.04em;
}
body[data-pixel="none"] .page-title,
body[data-pixel="none"] .box-title,
body[data-pixel="none"] .pip-head .pip-logo { font-family: var(--mono); }

/* =========================================================
   Misc / utility
   ========================================================= */
.clearfix::after { content: ""; display: block; clear: both; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

/* print: disable chrome */
@media print {
    #siteNav,
    #hkRain,
    #hkBoot,
    .toggler-wrap,
    #hackerTweaks,
    body::after,
    body::before { display: none !important; }
    body, .exe-content.exe-export { background: #fff !important; color: #000 !important; grid-template-columns: 1fr !important; }
    .box, .box-content, .box-title { color: #000 !important; text-shadow: none !important; }
    .box > .b-top, .box > .b-right, .box > .b-bot, .box > .b-left { display: none !important; }
    .box { border: 1px solid #000 !important; }
}

/* narrow viewport tweaks */
@media (max-width: 880px) {
    main.page { padding: 100px clamp(16px, 4vw, 28px) 80px; }
    .toggler-wrap { top: 12px; right: 12px; }
    #hackerTweaks { top: 50px; right: 12px; }
    .package-header { flex-wrap: wrap; }
}
