/* NetHack+ post (nethack-plus.html), in the homepage style.
   Loaded after css/style.css and css/pages.css, which give the sidebar,
   fonts and link colors. Light only, like the rest of the site.
   The --chart-* and --tl-* tokens are read by nethack-plus/js/*.js. */
:root {
    color-scheme: light;
    --text: #666666;
    --ink: #444444;
    --muted: #999999;
    --rule: #eeeeee;
    --peri: #A5BAE0;
    --peri-soft: rgba(165, 186, 224, 0.5);
    --peri-wash: rgba(165, 186, 224, 0.18);
    --purple: #9C76C8;
    --panel: #f5f5f5;
    --head: 'Open Sans', sans-serif;
    --sans: 'Source Sans Pro', 'Open Sans', sans-serif;
    --mono: 'Consolas', 'Menlo', 'Monaco', 'Courier New', monospace;

    --chart-bg: #ffffff;
    --chart-ink: #4a4a4a;
    --chart-muted: #8d93a3;
    --chart-rule: #eeeeee;
    --human: #b07d0b;
    --chart-tip-bg: #555555;
    --chart-tip-ink: #ffffff;

    --tl-font: 'Source Sans Pro', sans-serif;
    --tl-grid: #eeeeee;
    --tl-lane: #d5dcea;
    --tl-year: #999999;
    --tl-name: #888888;
    --tl-dot-stroke: #ffffff;
    --tl-ring: #666666;
    --tl-tag: #444444;
    --tl-ours: #9C76C8;
}

/* ── Sidebar: section links under the homepage's Home link ── */
.sidenav { overflow-y: auto; }
.sidenav .side-rule {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.45);
    margin: 14px 30px 10px;
}
.sidenav .side-label {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--head);
    font-size: 13px;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.sidenav #toc a {
    font-size: 14px;
    padding: 5px 16px;
    margin: 1px 18px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}
.sidenav #toc a.on { background-color: rgba(255, 255, 255, 0.22); }
.sidenav #toc a.on:hover { color: #ffffff; }
.sidenav #toc a.sub {
    font-size: 12.5px;
    text-transform: none;
    line-height: 1.35;
    padding: 3px 12px;
    color: rgba(255, 255, 255, 0.9);
}

/* ── Reading column ── */
.post { font-size: 17px; line-height: 1.65; }
.post .col { max-width: 720px; }
.post .wide { max-width: 980px; }
.post p { margin: 0 0 1.05em; }
.post strong { color: #555555; font-weight: 600; }
.post ul, .post ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.post li { margin: 0.4em 0; }
.post sub { font-size: 0.72em; }
.post .muted { color: var(--muted); }

/* Section titles follow the homepage: Open Sans, grey, a rule above each section. */
.post section + section { margin-top: 0; padding-top: 0; border-top: 0; }
.post h2, .post h3, .post h4 { font-family: var(--head); color: var(--text); line-height: 1.3; }
.post h2 {
    font-size: 24px;
    margin: 56px 0 18px;
    padding-top: 26px;
    border-top: 1px solid var(--rule);
}
.post h3 { font-size: 19px; margin: 36px 0 12px; }
.post h4 { font-size: 16.5px; margin: 28px 0 8px; color: #555555; }

/* ── Title block ── */
.post-head { padding-top: 6px; }
.post .series { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.post .series > * + *::before { content: "·"; margin: 0 8px; color: #cccccc; }
.post-title {
    font-family: var(--head);
    font-size: 30px;
    font-weight: 600;
    line-height: 1.3;
    color: #555555;
    margin: 0 0 14px;
}
.post-title .plus, .series .plus { color: var(--purple); }
.post .byline { margin: 0 0 26px; font-size: 16px; }
.post .byline .authors { color: var(--text); }
.post .byline .pub { color: var(--text); font-style: italic; }
.post .dek p { font-size: 18px; line-height: 1.6; color: #5a5a5a; }

/* Inline contents: only where the sidebar is hidden. */
.post .contents { display: none; }

/* ── Code, keys, traces ── */
.post code, .post kbd {
    font-family: var(--mono);
    font-size: 0.86em;
    background: var(--panel);
    color: #555555;
    padding: 0.1em 0.35em;
    border-radius: 4px;
}
.post pre {
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.6;
    background: var(--panel);
    color: #555555;
    padding: 14px 18px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1.2em 0;
}
.post pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.tok-c { color: #8d93a3; font-style: italic; }
.tok-s { color: #2f8a63; }
.tok-k { color: #7a5bb5; }
.tok-n { color: #b07d0b; }
.post pre.trace { font-size: 12.5px; border-left: 4px solid var(--peri-soft); }
.post blockquote.trace {
    margin: 0.8em 0 1.2em;
    padding: 6px 0 6px 20px;
    border-left: 4px solid var(--peri-soft);
    color: var(--text);
    font-style: italic;
}

/* ── Figures ── */
.post figure { margin: 30px 0 36px; }
.post .window {
    position: relative;
    background: #ffffff;
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 18px;
    overflow: hidden;
}
.post figcaption {
    font-size: 15px;
    line-height: 1.55;
    color: #777777;
    margin-top: 10px;
    max-width: 720px;
}
.post figcaption b { font-family: var(--head); font-size: 14px; font-weight: 600; color: #555555; margin-right: 4px; }
.post figcaption .muted { color: #888888; }

/* SVG charts drawn by nethack-plus/js/page.js */
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text, .chart .lbl { font-family: var(--sans); font-size: 13px; fill: var(--chart-muted); }
.chart .grid line { stroke: var(--chart-rule); stroke-width: 1; }
.chart .dl { font-family: var(--sans); font-size: 13px; fill: var(--chart-ink); }
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-family: var(--sans);
    font-size: 13px;
    color: #888888;
    margin-bottom: 10px;
}
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-tip {
    position: absolute;
    pointer-events: none;
    z-index: 5;
    font-family: var(--sans);
    font-size: 13px;
    line-height: 1.45;
    background: var(--chart-tip-bg);
    color: var(--chart-tip-ink);
    padding: 6px 10px;
    border-radius: 5px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.1s;
    white-space: nowrap;
}

/* Terminal map (Figure 3), on a light screen */
.post .window.tty-window { container-type: inline-size; }
.tty {
    font-family: 'Menlo', 'Consolas', 'SFMono-Regular', 'Liberation Mono', monospace;
    font-size: clamp(5px, 1.95cqi, 15px);
    line-height: 1.2;
    white-space: pre;
    color: #555555;
    overflow: hidden;
    letter-spacing: 0;
}
.tty .g-wall { color: #7c8294; }
.tty .g-floor { color: #c4c8d2; }
.tty .g-door { color: #b07d0b; }
.tty .g-corr { color: #a3a8b6; }
.tty .g-hero { color: #ffffff; background: #3987e5; border-radius: 2px; }
.tty .g-mon { color: #d0453f; font-weight: 700; }
.tty .g-obj { color: #1f9e70; font-weight: 700; }
.tty .g-stair { color: var(--purple); font-weight: 700; }
.tty-status { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 8px 0 0; white-space: pre-wrap; }
.post pre.tty-call { margin: 14px 0 0; white-space: pre-wrap; }

/* ── Tables (like the homepage's updates table, with rules) ── */
.tablewrap { overflow-x: auto; margin: 1.4em 0; }
.post table { border-collapse: collapse; width: 100%; font-size: 15px; color: #555555; }
.post th, .post td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.post th { color: var(--muted); font-weight: normal; font-size: 13px; border-bottom-color: #dddddd; }
.post td.num, .post th.num { text-align: right; font-variant-numeric: tabular-nums; }
.post tr.hl td { background: var(--peri-wash); }
.post tr.ref td { color: var(--muted); }
.post th.grp { text-align: center; }
.post thead th[rowspan] { vertical-align: bottom; }
.post thead tr:first-child th[colspan] { border-bottom-color: var(--rule); padding-bottom: 4px; }
.post .window.orch-window { padding: 0; }
.orch-label { font-family: var(--head); font-size: 13px; color: var(--muted); margin: 0 !important; padding: 12px 18px 0; }
.orch-label.orch-split { border-top: 1px solid var(--rule); }
.post pre.orch { margin: 0; background: none; border-radius: 0; font-size: 12.5px; line-height: 1.5; padding: 8px 18px 14px; }
.post pre.orch-reply { white-space: pre-wrap; }
.post pre.orch .el { color: var(--muted); }
.post pre.orch .pick { background: var(--peri-wash); }

/* ── Related-work timeline (hover, focus or tap a point; nethack-plus/js/timeline-hover.js) ── */
.post .window.tl-window { overflow: visible; padding: 12px 14px 8px; }
#history-hover svg { display: block; width: 100%; height: auto; overflow: visible; }
#history-hover .tl-dot { cursor: pointer; outline: none; }
#history-hover .tl-dot:focus-visible .tl-ring { opacity: 1; }
.tl-card {
    position: absolute;
    z-index: 6;
    width: 340px;
    max-width: calc(100% - 16px);
    background: #ffffff;
    border: 1px solid var(--rule);
    border-left: 4px solid var(--peri);
    border-radius: 5px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    padding: 10px 14px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s;
}
.tl-card.show { opacity: 1; visibility: visible; }
.tl-card .when { display: block; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.tl-list { margin-top: 12px; font-size: 15px; }
.tl-list summary { cursor: pointer; color: #888888; }
.tl-list ol { margin: 8px 0 0; padding-left: 1.3em; }
.tl-list li { margin: 6px 0; line-height: 1.5; }
.tl-list .when { color: var(--muted); font-size: 13px; margin-right: 4px; }
#fig-history:not(.tl-ready) .tl-window { display: none; }

/* ── Best@k against tree search (idealized diagram) ── */
.tree-svg text { font-family: var(--sans); }

/* ── Gameplay videos ── */
.video-block + .video-block { margin-top: 18px; }
.video-block video { display: block; width: 100%; height: auto; border-radius: 4px; background: #15171d; }
.video-label { font-size: 14px; color: #777777; margin: 6px 0 0; }
.video-label b { font-family: var(--head); font-weight: 600; color: #555555; }

/* ── Footnotes and footer ── */
sup.fn { font-size: 0.7em; line-height: 0; }
sup.fn a { padding: 0 1px; }
.post .footnotes { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 15px; color: #888888; }
.post .footnotes ol { padding-left: 1.4em; margin: 0; }
.post .footnotes li { margin: 0 0 0.5em; }
.post .foot { font-size: 15px; color: #888888; padding: 26px 0 10px; }
.post .cite {
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    background: var(--panel);
    color: #555555;
    padding: 12px 16px;
    border-radius: 5px;
}

/* ── Phones and short screens (same breakpoint as css/style.css) ── */
@media screen and (max-width: 768px), screen and (max-height: 500px) {
    /* Narrow screens: no photo, name or menu, just a translucent bar of section titles,
       left-aligned, with the current section in bold (page.js sets .on). */
    .sidenav {
        background-color: rgba(165, 186, 224, 0.22);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        padding: 8px 16px;
        justify-content: flex-start;
    }
    .sidenav .propic, .sidenav .name-group, .sidenav > a,
    .sidenav .side-rule, .sidenav .side-label,
    .hamburger, .mobile-nav-dropdown { display: none !important; }
    .sidenav #toc { display: flex; flex-wrap: wrap; gap: 2px 14px; }
    .sidenav #toc a {
        display: inline-block;
        margin: 0;
        padding: 2px 0;
        font-size: 14px;
        text-transform: none;
        text-align: left;
        color: var(--text);
        background: none;
    }
    .sidenav #toc a.on { background: none; color: var(--ink); font-weight: 700; }
    .sidenav #toc a.sub { display: none; }
    .sidenav #toc a:hover, .sidenav #toc a.on:hover { color: var(--purple); }
    .main { margin-top: 56px; }
    html { scroll-padding-top: 64px; }
    .post { font-size: 16.5px; }
    .post-title { font-size: 25px; }
    .post .dek p { font-size: 17px; }
    .post h2 { font-size: 21px; margin-top: 44px; }
    .post .window { padding: 12px; }
    .window.chart { overflow-x: auto; }
    .window.chart svg { min-width: 640px; }
    .post .contents {
        display: block;
        font-size: 15px;
        margin: 1.4em 0 0;
        padding: 10px 16px;
        border-left: 4px solid var(--peri-soft);
    }
    .post .contents ol { margin: 0; }
}

/* ── Display equations (KaTeX) ── */
.post .eq { margin: 1em 0; overflow-x: auto; overflow-y: hidden; }

/* ── Settings gallery (Figure 2; nethack-plus/js/knobs.js + nethack-plus/knobs.css) ──
   knobs.css draws it on Part 1's dark panel; everything here re-themes it for the light page.
   The #knob-gallery prefix outranks knobs.css, which loads after this file. */
#knob-gallery {
    --dungeon: #ffffff;
    --dungeon-2: #f2f4f9;
    --dungeon-ink: #4a4a4a;
    --dungeon-muted: #8a8f9c;
    --dungeon-rule: #e6e8ee;
    --gold: #9C76C8;
    --serif: 'Source Sans Pro', 'Open Sans', sans-serif;
    --kn-cur: #e2a13b;
    --kn-van: #3987e5;
    --kn-oth: #b8bdca;
    --kn-closed: #3987e5;
    --kn-way: #9aa0b0;
    font-family: var(--sans);
    font-size: 13.5px;
}
body .kn-tip { --mono: 'Source Sans Pro', sans-serif; font-size: 13px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); }
/* NetHack's 16 colours on a white map */
#knob-gallery .kc0 { color: #444444; } #knob-gallery .kc1 { color: #d0453f; } #knob-gallery .kc2 { color: #2f8a4f; }
#knob-gallery .kc3 { color: #a86a00; } #knob-gallery .kc4 { color: #2f6fd6; } #knob-gallery .kc5 { color: #a64ac9; }
#knob-gallery .kc6 { color: #1d8fa3; } #knob-gallery .kc7 { color: #7c8294; } #knob-gallery .kc8 { color: #aab0bd; }
#knob-gallery .kc9 { color: #d0602a; } #knob-gallery .kc10 { color: #2f9e4f; } #knob-gallery .kc11 { color: #b07d0b; }
#knob-gallery .kc12 { color: #2f6fd6; } #knob-gallery .kc13 { color: #b04cc4; } #knob-gallery .kc14 { color: #1f9fb3; }
#knob-gallery .kc15 { color: #222222; }
#knob-gallery .kn-grid { color: #555555; }
#knob-gallery .kn-me { background: #3987e5; color: #ffffff !important; }
#knob-gallery .kn-f-room { background: rgba(57, 135, 229, 0.14); color: #2f5fa8 !important; }
#knob-gallery .kn-f-wall { color: #5d6478 !important; }
#knob-gallery .kn-f-corr { color: #1d8fa3 !important; background: rgba(47, 181, 201, 0.14); }
#knob-gallery .kn-f-pet { color: #222222 !important; box-shadow: 0 0 0 2px rgba(226, 161, 59, 0.45); }
#knob-gallery .kn-f-mon.sel { color: #222222 !important; }
#knob-gallery .kn-d-closed { color: #2f6fd6 !important; }
#knob-gallery .kn-d-open { color: #198a5e !important; background: rgba(25, 158, 112, 0.16); }
#knob-gallery .kn-d-doorway, #knob-gallery .kn-d-broken { color: #888888 !important; }
/* controls: the homepage's grey buttons, periwinkle when chosen */
#knob-gallery .kn-glabel { font-family: var(--head); font-size: 13px; color: #888888; }
#knob-gallery .kn-pills button, #knob-gallery .kn-play { color: #555555; background: #f5f5f5; border-color: transparent; border-radius: 5px; }
#knob-gallery .kn-pills button:hover, #knob-gallery .kn-play:hover { color: #ffffff; background: rgba(165, 186, 224, 0.75); border-color: transparent; }
#knob-gallery .kn-pills button[aria-pressed="true"] { background: var(--peri); border-color: var(--peri); color: #ffffff; }
#knob-gallery .kn-seg { border-color: var(--rule); border-radius: 5px; }
#knob-gallery .kn-seg button:hover { color: #333333; background: #f2f4f9; }
#knob-gallery .kn-seg button[aria-pressed="true"] { color: #222222; }
#knob-gallery .kn-mhead { font-family: var(--mono); }
#knob-gallery .kn-mhead code { color: #333333; }
#knob-gallery .kn-status { color: #999999; }
#knob-gallery .kn-mcap { font-size: 15px; color: #555555; }
#knob-gallery .kn-phead h4 { font-family: var(--head); font-size: 14px; font-weight: 600; color: #555555; }
#knob-gallery .kn-phead p { font-size: 14px; }
#knob-gallery .kn-h5, #knob-gallery .kn-kinds h5 { font-family: var(--head); font-size: 13px; font-weight: 600; color: #666666; }
#knob-gallery .kn-bar.cur .kn-bar-l, #knob-gallery .kn-bar.cur .kn-bar-v,
#knob-gallery .kn-hrow.cur .kn-bar-l,
#knob-gallery .kn-vs td.cur, #knob-gallery .kn-vs th.cur, #knob-gallery .kn-vs tr.main td.cur,
#knob-gallery button.kn-chip[aria-pressed="true"],
#knob-gallery .kn-card-h b { color: #333333; }
#knob-gallery .kn-chart .kn-ax { font-family: var(--sans); font-size: 12px; }
#knob-gallery .kn-chart .kn-ax.b { fill: #333333; }
#knob-gallery .kn-chart .kn-dl { font-family: var(--sans); font-size: 12px; }
#knob-gallery .kn-hcur { stroke: #666666; }
#knob-gallery .kn-bcur { fill: rgba(226, 161, 59, 0.16); }
