/* ============================================================
   resonance.css — terminal-UI story reader ("The Creator of Nothing")
   blended into the netrunner neon-noir site: uses the global
   --c-* palette, --f-mono font and the shared .neon-panel chrome,
   so it reads as part of the page rather than a box on top of it.
   ============================================================ */

/* let the page use the wide content surface like /friends */
.bin-container:has(.res-page) {
    max-width: none;
    padding: 14px 20px 26px;
}
.res-page {
    max-width: none;
    margin: 0;
}

/* the reader is a transparent shell — the site background shows through */
.res-app {
    font-family: var(--f-mono, 'Share Tech Mono', monospace);
    color: var(--c-text);
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: clamp(640px, 84vh, 1140px);
    min-height: 620px;
    position: relative;
}

/* panels inherit the site's neon-panel look; kill its block margin so the
   flex layout stays tight, and let them flex/scroll internally */
.res-app .neon-panel { margin-bottom: 0; }
.res-app .np-bar { font-size: 12.5px; }

/* state toggling between title screen and reader */
.res-app[data-state="title"] .res-reader { display: none; }
.res-app[data-state="reading"] .res-title { display: none; }

/* ===================================================================
   TITLE SCREEN
   =================================================================== */
.res-title {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
}
.res-tcard {
    max-width: 500px;
    width: 100%;
}
.res-tcard { max-width: 560px; }
.res-tinner {
    padding: 56px 44px 48px;
    text-align: center;
}
.res-tsigil {
    width: 104px;
    height: 104px;
    object-fit: contain;
    margin: 0 auto 22px;
    display: block;
    filter: drop-shadow(0 0 14px rgba(111, 230, 255, 0.55)) drop-shadow(0 0 30px rgba(var(--c-secondary-rgb), 0.3));
    animation: res-sigil-pulse 4.5s ease-in-out infinite;
}
@keyframes res-sigil-pulse {
    0%, 100% { transform: scale(1); opacity: 0.92; }
    50% { transform: scale(1.05); opacity: 1; }
}
.res-ttitle {
    font-family: var(--f-hero, 'Orbitron', sans-serif);
    font-size: clamp(24px, 4.2vw, 38px);
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin: 0 0 20px;
    color: var(--c-primary);
}
.res-tdiv {
    color: rgba(var(--c-secondary-rgb), 0.5);
    letter-spacing: 0.4em;
    margin-bottom: 20px;
    font-size: 15px;
}
.res-tinner .res-tmeta {
    color: var(--c-secondary);
    font-size: 15px;
    margin: 0 0 28px;
    opacity: 0.9;
}
.res-tstart .res-blink {
    color: var(--c-primary);
    font-size: 15px;
    letter-spacing: 0.08em;
    text-shadow: 0 0 8px rgba(var(--c-primary-rgb), 0.5);
    animation: res-blink 1.4s steps(2, start) infinite;
}
@keyframes res-blink { 50% { opacity: 0.3; } }

/* ===================================================================
   READER LAYOUT
   =================================================================== */
.res-reader {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
}

/* --- header --- */
.res-header { flex-shrink: 0; }
.res-header .np-bar { gap: 12px; }
.res-header-stat {
    margin-left: auto;
    color: var(--c-secondary);
    font-size: 12px;
    letter-spacing: 1px;
    white-space: nowrap;
    text-shadow: none;
}
.res-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--c-primary);
    font-size: 15px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

/* --- main row --- */
.res-main {
    flex: 1;
    display: flex;
    gap: 14px;
    min-height: 0;
    position: relative;
}

/* --- sidebar --- */
.res-side {
    width: 264px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.res-nav {
    flex: 1;
    overflow-y: auto;
    padding: 9px 6px;
}
.res-nav-item {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--c-text);
    opacity: 0.62;
    font-family: inherit;
    font-size: 13.5px;
    padding: 6px 11px;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: 8px;
    transition: color 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}
.res-nav-item:hover { opacity: 1; background: rgba(var(--c-primary-rgb), 0.06); }
.res-nav-item.active {
    color: var(--c-primary);
    opacity: 1;
    text-shadow: 0 0 7px rgba(var(--c-primary-rgb), 0.45);
}
.res-nav-mark { width: 8px; flex-shrink: 0; font-weight: 700; }
.res-nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.res-nav-time {
    font-size: 11px;
    opacity: 0.45;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.res-keys {
    border-top: 1px solid rgba(var(--c-primary-rgb), 0.18);
    padding: 10px 15px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: rgba(var(--c-text-rgb), 0.45);
}
.res-keys .res-key { color: var(--c-secondary); }

/* --- reading pane --- */
.res-read {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}
.res-read .np-bar {
    text-transform: lowercase;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.res-read .np-bar::before { display: none; }
.res-progress {
    height: 2px;
    width: 100%;
    background: rgba(var(--c-primary-rgb), 0.1);
    flex-shrink: 0;
}
.res-progress-fill {
    height: 2px;
    width: 0;
    background: var(--c-primary);
    box-shadow: 0 0 7px rgba(var(--c-primary-rgb), 0.6);
    transition: width 0.2s ease;
}
.res-content {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
}
/* the reading pane spans full width, but the prose stays in a
   comfortable centered column for readability */
.res-content-inner {
    max-width: 820px;
    margin: 0 auto;
    padding: 38px 40px 12px;
}

/* chapter heading */
.res-chhead {
    margin-bottom: 34px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(var(--c-primary-rgb), 0.16);
}
.res-chhead h3 {
    font-family: var(--f-hero, 'Orbitron', sans-serif);
    font-size: 26px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 0;
    color: var(--c-primary);
    text-shadow: 0 0 10px rgba(var(--c-primary-rgb), 0.35);
}
.res-chhead .res-chsub {
    color: var(--c-secondary);
    font-size: 17px;
    margin: 9px 0 0;
}
.res-chhead .res-chmeta {
    color: rgba(var(--c-text-rgb), 0.4);
    font-size: 12px;
    margin: 11px 0 0;
    font-variant-numeric: tabular-nums;
}

/* article typography
   NOTE: the reading pane carries .neon-panel, whose global rule
   `.neon-panel p { font-size:15px }` outranks plain .res-p — so these
   selectors are deliberately scoped under .res-content to win. */
.res-article { color: rgba(var(--c-text-rgb), 0.92); }
.res-content .res-p {
    font-size: 20px;
    line-height: 1.9;
    margin: 15px 0;
    color: rgba(var(--c-text-rgb), 0.92);
}
.res-strong { color: #fff; font-weight: 700; }
.res-em { font-style: italic; color: var(--c-secondary); }
.res-cyan { color: #6fe6ff; text-shadow: 0 0 8px rgba(111, 230, 255, 0.35); }
.res-red { color: var(--c-primary); text-shadow: 0 0 8px rgba(var(--c-primary-rgb), 0.35); }
.res-content .res-quote {
    color: rgba(var(--c-text-rgb), 0.62);
    font-style: italic;
    font-size: 20px;
    margin: 15px 0;
    border-left: 2px solid rgba(var(--c-secondary-rgb), 0.4);
    padding-left: 16px;
    line-height: 1.8;
}
.res-content .res-bold-line {
    color: var(--c-primary);
    font-size: 20px;
    font-weight: 700;
    margin: 20px 0;
    text-shadow: 0 0 10px rgba(var(--c-primary-rgb), 0.45);
}
.res-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 30px 0;
    user-select: none;
}
.res-divider span {
    flex: 1;
    border-top: 1px solid rgba(var(--c-primary-rgb), 0.16);
}
.res-divider b {
    color: rgba(var(--c-secondary-rgb), 0.55);
    font-size: 11px;
    letter-spacing: 0.5em;
    font-weight: 400;
}
.res-tobe {
    text-align: center;
    padding: 56px 0;
    color: var(--c-primary);
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    font-size: 14px;
    text-shadow: 0 0 14px rgba(var(--c-primary-rgb), 0.5);
}

/* end-of-chapter nav */
.res-chnav {
    margin-top: 56px;
    padding-top: 20px;
    border-top: 1px solid rgba(var(--c-primary-rgb), 0.16);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    color: var(--c-secondary);
}
.res-chnav-btn {
    background: none;
    border: none;
    color: var(--c-secondary);
    font-family: inherit;
    font-size: 13.5px;
    cursor: pointer;
    transition: color 0.12s ease, text-shadow 0.12s ease;
}
.res-chnav-btn:hover {
    color: var(--c-primary);
    text-shadow: 0 0 7px rgba(var(--c-primary-rgb), 0.5);
}

/* --- footer --- */
.res-footer { flex-shrink: 0; }
.res-footer-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    font-size: 13.5px;
}
.res-fbtn {
    background: none;
    border: none;
    color: var(--c-secondary);
    font-family: inherit;
    font-size: 13.5px;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.12s ease;
}
.res-fbtn:hover { color: var(--c-primary); }
.res-fbtn:disabled { opacity: 0.25; cursor: default; }
.res-fcur {
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.res-fcount {
    color: rgba(var(--c-text-rgb), 0.5);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.res-fbar {
    margin-left: auto;
    color: rgba(var(--c-primary-rgb), 1);
    opacity: 0.55;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* mobile drawer scrim */
.res-side-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 60;
    display: none;
}
.res-side-scrim.show { display: block; }

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 820px) {
    .res-app { height: clamp(480px, 78vh, 760px); }
    .res-menu-btn { display: inline-block; margin-left: auto; }
    .res-header-stat { display: none; }

    .res-side {
        position: absolute;
        z-index: 70;
        top: 0;
        left: 0;
        height: 100%;
        width: 270px;
        max-width: 82%;
        transform: translateX(-106%);
        transition: transform 0.22s ease;
        background: rgba(8, 8, 18, 0.96);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
    }
    .res-side.open { transform: translateX(0); }
    .res-content-inner { padding: 22px 16px 8px; }
    .res-fbar { display: none; }
}
