:root {
    --bg: #0d1117;
    --panel: #161b22;
    --border: #30363d;
    --text: #c9d1d9;
    --muted: #8b949e;
    --accent: #58a6ff;
    --code-bg: #1f2630;
    --green: #3fb950;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.7;
}

code, pre, .logo, .synopsis {
    font-family: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

/* ---- top bar ---- */
.topbar {
    position: sticky;
    top: 0;
    background: rgba(13, 17, 23, 0.9);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}
.topbar__inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.logo {
    color: var(--green);
    font-weight: 700;
}
.topbar__nav {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 13px;
    letter-spacing: 0.04em;
}
.topbar__nav a {
    color: var(--muted);
    text-decoration: none;
}
.topbar__nav a:hover { color: var(--accent); }

/* ---- page ---- */
.page {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}
.title {
    font-size: 34px;
    letter-spacing: 0.05em;
    margin: 0 0 4px;
}
.subtitle {
    color: var(--muted);
    margin-top: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}

section { margin-top: 38px; }
h2 {
    color: var(--accent);
    font-size: 15px;
    letter-spacing: 0.12em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}

p { margin: 14px 0; }

code {
    background: var(--code-bg);
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 0.9em;
    color: #e6edf3;
}

pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 18px;
    overflow-x: auto;
    line-height: 1.6;
}
pre code { background: none; padding: 0; }
.synopsis { color: var(--green); }
.example { color: #d2dbe5; }

blockquote {
    margin: 22px 0;
    padding: 10px 18px;
    border-left: 3px solid var(--green);
    color: var(--muted);
    font-style: italic;
}

.opts dt {
    margin-top: 14px;
    color: #e6edf3;
}
.opts dd {
    margin: 4px 0 0 18px;
    color: var(--muted);
}

.page__footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
}
.hint {
    opacity: 0.35;
    font-style: italic;
}

/* ---- secret unlock overlay ---- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.overlay[hidden] { display: none; }

.modal {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 26px 26px 22px;
    width: min(380px, 92vw);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal h3 {
    margin: 0 0 6px;
    color: var(--green);
    font-family: "Cascadia Code", Consolas, monospace;
}
.modal p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 14px;
}
.modal input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
}
.modal input:focus {
    outline: none;
    border-color: var(--accent);
}
.modal__actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
.modal button {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--code-bg);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
}
.modal button.primary {
    background: var(--green);
    border-color: var(--green);
    color: #0d1117;
    font-weight: 700;
}
.modal button:hover { filter: brightness(1.1); }

.modal__error {
    color: #f85149;
    font-size: 13px;
    min-height: 18px;
    margin: 10px 0 0;
}

/* ---- view-only PDF viewer ---- */
.pdf-viewer {
    position: fixed;
    inset: 0;
    background: #0a0c10;
    z-index: 200;
    display: flex;
    flex-direction: column;
    /* discourage selecting / copying the rendered content */
    user-select: none;
    -webkit-user-select: none;
}
.pdf-viewer[hidden] { display: none; }

.pdf-viewer__bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}
.pdf-viewer__title {
    font-family: "Cascadia Code", Consolas, monospace;
    color: var(--green);
    font-size: 15px;
}
.pdf-viewer__tag {
    margin-left: 8px;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.05em;
}
.pdf-viewer__close {
    background: var(--code-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
}
.pdf-viewer__close:hover { filter: brightness(1.2); }

.pdf-viewer__pages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 24px 16px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.pdf-page {
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: center;
}
.pdf-page canvas {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    /* a canvas can't be dragged out, but make it explicit */
    pointer-events: none;
}
