/* ============================================================
   secretmyth.blog — mono CRT theme (inspired by warez.sl0p.foo)
   grayscale phosphor · dark-only · Share Tech Mono
   ============================================================ */

:root {
    --accent-rgb: 228 233 237;      /* cold white/silver */
    --accent-dim-rgb: 124 132 137;
    --text: #d3d8dc;
    --bg: #17191d;
    --bg-core: #26292f;
    --bg-mid: #1d2025;
    --bg-edge: #15171b;
    --bg-corner: #2e3238;
    --panel: #22252b;
    --term-bg: #1d1f21;

    /* derived */
    --phos: rgb(var(--accent-rgb));
    --phos-dim: rgb(var(--accent-dim-rgb));
    --fg-bright: #eef1f4;
    --fg-1: #b8bfc6;
    --fg-2: #939aa1;
    --fg-3: #6d747c;
    --fg-4: #71787f;
    --border: #3c4249;
    --code-bg: rgba(255, 255, 255, 0.05);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Share Tech Mono", ui-monospace, Menlo, monospace,
                 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", emoji;
    background-color: var(--bg);
        radial-gradient(1100px 760px at 50% -14%, var(--bg-core) 0%, var(--bg-mid) 52%, var(--bg-edge) 100%),
        radial-gradient(900px 600px at 90% 110%, var(--bg-corner) 0%, transparent 60%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
}

a { color: var(--phos); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- generic page (info / about) ---- */
.page-wrap {
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
    padding: 1.5rem 1.25rem 2rem;
}

::selection { background: var(--phos); color: var(--term-bg); }

/* thin, theme-matched scrollbars everywhere (page + overflow boxes) */
html {
    scrollbar-width: thin;
    scrollbar-color: #4a4e55 #14161a;
}
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: #4a4e55; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #5a5e66; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- header ---- */
.site-header {
    padding: 1.5rem 0 0;
}
.wrap {
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1.25rem 2rem;
}
.site-header .wrap { padding-bottom: 0; max-width: none; }

h1.site-title {
    margin: 0 0 .3rem;
    font-size: 2rem;
    line-height: normal;
    letter-spacing: 1px;
    font-weight: normal;
    display: inline-block;
    background: linear-gradient(100deg,
        var(--fg-bright) 0%, var(--fg-bright) 42%,
        #ffffff 49%, #ffffff 53%,
        var(--fg-bright) 60%, var(--fg-bright) 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: title-sweep 4.5s linear infinite;
}
@keyframes title-sweep {
    from { background-position: 120% 0; }
    to   { background-position: -130% 0; }
}
.site-title a { color: inherit; text-decoration: none; }
.site-title a:hover { text-decoration: none; }

/* compact layered-glitter logo (home page only) */
.site-logo-link {
    display: inline-block;
    text-decoration: none;
}
.site-logo {
    display: block;
    margin: 0 0 .3rem;
    width: 290px;
    max-width: 100%;
    height: auto;
}

.tagline {
    color: var(--fg-3);
    font-size: 0.85rem;
    margin: 0 0 0.6rem 8px;
}

/* small corner wordmark — the only home button (non-home pages) */
.corner-brand {
    position: fixed;
    top: 1.1rem;
    right: 1rem;
    z-index: 40;
    font-size: 0.92rem;
    letter-spacing: 2px;
    color: var(--phos);
    text-decoration: none;
    text-shadow: 0 0 10px rgba(54, 255, 154, 0.4);
}
.corner-brand:hover {
    color: #ffffff;
    text-decoration: none;
    text-shadow: 0 0 14px rgba(54, 255, 154, 0.7);
}

/* matrix-cycling tagline (typewriter) */
.matrix-line {
    min-height: 1.4em;
    color: var(--phos);
    font-size: 0.95rem;
    margin: 0 0 1rem 8px;
}
.matrix-line .caret {
    display: inline-block;
    width: 0.55em;
    background: var(--phos);
    animation: blink 1s steps(1) infinite;
    margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

/* subtle rain canvas strip in header */
#rain {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 140px;
    opacity: 0.38;
    pointer-events: none;
    z-index: 0;
}
.site-header, .wrap { position: relative; }
.site-header .wrap > * { position: relative; z-index: 1; }

/* ---- post list (warez drops style) ---- */
.drops {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 820px;
}
.drops li {
    border-top: 1px solid var(--border);
    padding: 1.1rem 0;
}
.drops .date {
    color: var(--fg-3);
    font-size: 0.78rem;
    margin-right: 0.5rem;
}
.drops .title { font-size: 1.32rem; }
.drops .desc {
    color: var(--fg-2);
    font-size: 0.84rem;
    margin-top: 0.35rem;
    line-height: 1.55;
}
.drops .tags { margin-top: 0.45rem; }

/* ---- tags: lowercase, thin bordered, accent text ---- */
.tag {
    display: inline-block;
    font-size: 0.68rem;
    color: var(--phos);
    border: 1px solid var(--phos-dim);
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 0.32rem;
    text-transform: lowercase;
    letter-spacing: 0.3px;
}
a.tag { text-decoration: none; transition: all 0.15s ease; }
a.tag:hover {
    background: var(--phos);
    color: var(--term-bg);
    text-decoration: none;
}

/* landing-page tags slightly smaller than post-page tags */
.drops .tag { font-size: 0.6rem; }

/* ---- post page ---- */
article.post {
    max-width: 1180px;
    margin: 0 auto;
    width: 100%;
    padding: 0 0 2rem;
}
.post-title {
    font-size: 1.55rem;
    margin: 0 0 0.3rem;
    color: var(--phos);
    line-height: 1.3;
}
.post-header {
    padding-right: 7rem;   /* keep the title clear of the corner wordmark */
}
.post-meta {
    color: var(--fg-3);
    font-size: 0.78rem;
    margin-bottom: 1.5rem;
}
.post-meta .tags { margin-top: 0.4rem; }
.post-content h1, .post-content h2, .post-content h3 {
    color: var(--phos);
    line-height: 1.3;
}
.post-content h1 { font-size: 1.25rem; margin: 2rem 0 0.6rem; border-bottom: 1px solid var(--border); padding-bottom: 0.35rem; }
.post-content h2 { font-size: 1.08rem; margin: 1.8rem 0 0.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
.post-content h3 { font-size: 0.95rem; margin: 1.4rem 0 0.4rem; }
.post-content p, .post-content li {
    line-height: 1.65;
    font-size: 0.88rem;
    color: var(--text);
}
.post-content ul, .post-content ol { padding-left: 1.3rem; }

code {
    font-family: ui-monospace, "Fira Code", Menlo, monospace;
    font-size: 0.82rem;
    background: var(--code-bg);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--fg-bright);
}
pre {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.78rem;
    line-height: 1.5;
    font-family: ui-monospace, "Fira Code", Menlo, monospace;
}
pre code { background: none; padding: 0; color: var(--fg-1); }

blockquote {
    margin: 1.2rem 0;
    padding: 0.7rem 1.1rem;
    border-left: 3px solid var(--phos);
    background: rgba(255, 255, 255, 0.03);
    color: var(--fg-2);
    font-size: 0.86rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin: 0.6rem 0;
}
th, td {
    text-align: left;
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--border);
}
th { color: var(--phos); font-weight: normal; }

img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 4px; }
figure { margin: 1rem 0; }
figcaption { color: var(--fg-3); font-size: 0.75rem; margin-top: 0.4rem; text-align: center; }

hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ---- post credit footer ---- */
.post-credit {
    margin-top: 2.5rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
    color: var(--fg-4);
    font-size: 0.75rem;
}
.post-credit a { color: var(--fg-2); }
.post-credit a:hover { color: var(--phos); }

/* ---- left sidebar: toc ---- */
.side {
    position: fixed;
    top: 1.2rem;
    left: 1rem;
    width: 253px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: calc(100vh - 2.4rem);
    overflow-y: auto;
    z-index: 20;
}

.post-body {
    display: block;
    max-width: 820px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.post-content {
    min-width: 0;
}

/* Wide post: opt-in via `wide: true` in front matter.
   Drops the 820px body cap and hides the right-side TOC/brand sidebar
   so tables and code-heavy sections can breathe. */
.post-wide .post-body {
    max-width: 1200px;
}
.post-wide table {
    font-size: 0.84rem;     /* a touch larger than the 820px-wide default,
                               so wide tables don't feel anaemic */
}
.toc {
    max-height: calc(100vh - 16rem);
    overflow-y: auto;
    font-size: 0.78rem;
    border: 1px solid #373b41;
    border-radius: 4px;
    background: #1d1f21;
    padding: 0.35rem;
    scrollbar-width: thin;
    scrollbar-color: #4a4e55 transparent;
}
.toc::-webkit-scrollbar { width: 9px; }
.toc::-webkit-scrollbar-thumb { background: #4a4e55; border-radius: 3px; }
.toc::-webkit-scrollbar-track { background: transparent; }
@media (max-width: 1760px) {
    /* no room for a fixed left sidebar → stack the TOC inline above the post */
    .post-body { padding: 0 1.1rem; }
    .side {
        position: static;
        left: auto;
        width: 100%;
        max-height: none;
        margin: 0 0 1rem;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0.6rem 1rem;
    }
    .toc { max-height: none; width: 100%; }
}

.toc-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    color: #c5c8c6;
    font-family: inherit;
    font-size: 0.78rem;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
}
.toc-list {
    list-style: none;
    margin: 0;
    padding: 0.3rem 0.8rem 0.7rem;
}
.toc-list li { margin: 0.25rem 0; }
.toc-list a { color: #969896; }
.toc-list a:hover { color: #c5c8c6; }
.toc-list a.active { color: #b294bb; }
.toc-list ul { list-style: none; padding-left: 0.9rem; margin: 0.15rem 0; }

/* ---- footer ---- */
.site-footer {
    padding: 1.2rem 2rem;
    margin-top: auto;
    border-top: 1px solid var(--border);
    color: var(--fg-4);
    font-size: 0.72rem;
    text-align: center;
}
.site-footer a { color: var(--fg-2); }

/* ---- responsive ---- */
@media (max-width: 700px) {
    .site-header, .wrap, article.post { padding-left: 1.1rem; padding-right: 1.1rem; }
    h1.site-title { font-size: 1.5rem; }
}



/* Terminal window chrome */
.terminal {
    margin: 1rem 0 1.4rem 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--term-bg);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.04);
    overflow: hidden;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.7rem;
    background: #282a2e;
    border-bottom: 1px solid var(--border);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.12);
}
.terminal-dot.red { background: #cc6666; }
.terminal-dot.yellow { background: #f0c674; }
.terminal-dot.green { background: #b5bd68; }

.terminal-title {
    flex: 1;
    text-align: center;
    color: #969896;
    font-size: 0.74rem;
    letter-spacing: 0.4px;
    text-transform: lowercase;
}

.terminal-body {
    padding: 0.7rem 1rem 1rem 1rem;
    overflow-x: auto;
    font-size: 0.72rem;
    line-height: 1.5;
    color: #c5c8c6;
    font-family: ui-monospace, "Fira Code", Menlo, "Share Tech Mono", monospace;
    scrollbar-width: none;
    -ms-overflow-style: none;
    white-space: pre-wrap;
    word-break: break-word;
}

.terminal-body pre,
.terminal-body code {
    white-space: pre-wrap;
    word-break: break-word;
}

.terminal-body::-webkit-scrollbar {
    height: 0;
    display: none;
}

.terminal-body .prompt {
    color: var(--phos);
}

.terminal-body .prompt-path {
    color: #6a9fdd;
}

.terminal-body .prompt-dollar {
    color: var(--fg-2);
}

.terminal-body .cmd {
    color: var(--fg-bright);
}

.terminal-body .output {
    color: var(--fg-2);
}

.terminal-body .output-highlight {
    color: var(--phos);
}

.terminal-body .dim {
    color: var(--fg-4);
}

.terminal-body .green {
    color: #5ae08a;
}

.terminal-body .path {
    color: #dd9a6a;
}

/* markdown inside terminal body */
.terminal-body h2,
.terminal-body h3,
.terminal-body p,
.terminal-body ul,
.terminal-body ol,
.terminal-body blockquote,
.terminal-body code,
.terminal-body pre {
    margin: 0;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.terminal-body h2 {
    color: var(--phos);
    font-size: 1.05rem;
    margin: 1.4rem 0 0.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
    font-weight: normal;
}

.terminal-body h3 {
    color: var(--phos);
    font-size: 0.92rem;
    margin: 1.2rem 0 0.4rem;
    font-weight: normal;
}

.terminal-body p {
    color: var(--fg-2);
    margin: 0.5rem 0;
    line-height: 1.6;
}

.terminal-body ul,
.terminal-body ol {
    padding-left: 1.3rem;
    margin: 0.5rem 0;
}

.terminal-body li {
    color: var(--fg-2);
    margin: 0.25rem 0;
    line-height: 1.6;
}

.terminal-body blockquote {
    border-left: 3px solid var(--phos);
    padding: 0.3rem 0.8rem;
    margin: 0.6rem 0;
    color: var(--fg-3);
    background: rgba(255,255,255,0.02);
}

.terminal-body code {
    background: none;
    padding: 0;
    color: var(--fg-bright);
    font-size: inherit;
}

.terminal-body pre {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--fg-1);
    overflow-x: auto;
}

.terminal-body pre code {
    color: inherit;
    background: none;
    padding: 0;
}

.terminal-body a {
    color: #6a9fdd;
}

.terminal-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1rem 0;
}

.terminal {
    position: relative;
}

.terminal-body {
    position: relative;
}
