/* ==========================================================
   ro0t.com — terminal theme
   Two phosphor colours: green (default) and amber.
   Change the colours in the two [data-theme] blocks below.
   ========================================================== */

:root,
[data-theme="green"] {
    --fg:     #33ff66;   /* main text */
    --bright: #b6ffc8;   /* headings / highlights */
    --dim:    #1f9d45;   /* secondary text */
    --faint:  #0f3d1c;   /* borders, selection */
    --bg:     #050a06;   /* screen background */
    --page:   #000000;   /* outside the window */
    --glow:   rgba(51, 255, 102, 0.45);
    --err:    #ff5f56;
}

[data-theme="amber"] {
    --fg:     #ffb000;
    --bright: #ffe0a3;
    --dim:    #b37800;
    --faint:  #4a3200;
    --bg:     #0d0800;
    --page:   #000000;
    --glow:   rgba(255, 176, 0, 0.45);
    --err:    #ff6b4a;
}

* { box-sizing: border-box; }

html { background: var(--page); }

body {
    margin: 0;
    min-height: 100vh;
    padding: 24px 16px;
    background: var(--page);
    color: var(--fg);
    font-family: "JetBrains Mono", "Fira Code", "IBM Plex Mono", "Cascadia Mono",
                 Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
    font-size: 15px;
    line-height: 1.65;
    text-shadow: 0 0 4px var(--glow);   /* soft phosphor glow */
}

::selection { background: var(--fg); color: var(--bg); text-shadow: none; }

/* ---------- the terminal window ---------- */

.window {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid var(--faint);
    border-radius: 8px;
    background: var(--bg);
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6), 0 0 0 1px #000;
}

/* CRT scanlines over the whole window */
.window::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0px,
        rgba(0, 0, 0, 0) 2px,
        rgba(0, 0, 0, 0.22) 3px
    );
}

.titlebar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: #111;
    border-bottom: 1px solid var(--faint);
    font-size: 13px;
    color: var(--dim);
    text-shadow: none;
}
.dots { display: flex; gap: 6px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: #333; display: block; }
.dots i:nth-child(1) { background: #ff5f56; }
.dots i:nth-child(2) { background: #ffbd2e; }
.dots i:nth-child(3) { background: #27c93f; }
.wintitle { flex: 1; text-align: center; }
.theme-switch a { color: var(--dim); text-decoration: none; }
.theme-switch a.on,
.theme-switch a:hover { color: var(--fg); }

.screen { padding: 20px 28px 28px; }

/* ---------- text ---------- */

a { color: var(--bright); text-decoration: none; }
a:hover, a:focus-visible { background: var(--fg); color: var(--bg); text-shadow: none; outline: none; }

h1, h2, h3, h4 { color: var(--bright); font-weight: 700; line-height: 1.3; margin: 1.4em 0 0.4em; }
h1 { font-size: 1.6em; }
h2 { font-size: 1.25em; }
h3 { font-size: 1.1em; }
h4 { font-size: 1em; }
h2 a, h1 a { color: inherit; }

p { margin: 0.5em 0; }
.dim  { color: var(--dim); }
.hl   { color: var(--bright); }
.err  { color: var(--err); text-shadow: 0 0 4px rgba(255, 80, 80, 0.4); }
.flash { color: var(--bright); border-left: 2px solid var(--fg); padding-left: 10px; }

code {
    color: var(--bright);
    background: var(--faint);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: inherit;
}
pre.code {
    background: #000;
    border: 1px dashed var(--faint);
    padding: 12px 14px;
    overflow-x: auto;
}
pre.code code { background: none; padding: 0; color: var(--fg); }

blockquote {
    margin: 1em 0;
    padding-left: 14px;
    border-left: 2px solid var(--dim);
    color: var(--dim);
}
ul { padding-left: 0; list-style: none; }
ul li::before { content: "* "; color: var(--dim); }

/* ---------- header ---------- */

.banner-link:hover { background: none; }
.banner {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.15;
    color: var(--fg);
}
.prompt { margin: 0.9em 0 0.2em; }
.ps1-user { color: var(--bright); }
.ps1-path { color: var(--dim); }
.cmd { color: var(--fg); }
.motd { color: var(--dim); margin-top: 0; }

.menu {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 14px 0 6px;
    padding: 8px 0;
    border-top: 1px dashed var(--faint);
    border-bottom: 1px dashed var(--faint);
}

/* ---------- post list ---------- */

.entry { margin: 18px 0 28px; }
.entry h2 { margin: 2px 0 4px; }
.ls-line { margin: 0; white-space: pre-wrap; font-size: 13px; }
.excerpt { color: var(--fg); opacity: 0.9; }
.pager { display: flex; gap: 16px; align-items: center; margin-top: 20px; }

.post .meta { margin-top: 0; }
.post .body { margin-top: 18px; }

/* ---------- forms ---------- */

input, textarea, select, button {
    font: inherit;
    color: var(--fg);
    background: transparent;
    text-shadow: inherit;
}
input[type="text"], input[type="password"], textarea, select {
    border: none;
    border-bottom: 1px solid var(--faint);
    padding: 4px 2px;
    outline: none;
    caret-color: var(--fg);
}
input:focus, textarea:focus, select:focus { border-color: var(--fg); }
select option { background: var(--bg); color: var(--fg); }

button {
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--bright);
}
button:hover, button:focus-visible { background: var(--fg); color: var(--bg); text-shadow: none; outline: none; }
button.danger { color: var(--err); }
button.danger:hover { background: var(--err); color: var(--bg); }

.grep { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.grep label .prompt { margin: 0; }
.grep input { flex: 1; min-width: 140px; }

.login input { width: 240px; max-width: 100%; }
.login label { display: inline-block; min-width: 110px; }

.editor { display: flex; flex-direction: column; gap: 4px; }
.editor label { margin-top: 12px; }
.editor input, .editor select { width: 100%; }
.editor select { width: auto; }
.editor textarea {
    width: 100%;
    min-height: 360px;
    resize: vertical;
    border: 1px solid var(--faint);
    padding: 10px;
    background: #000;
    line-height: 1.55;
}
.vim-bar {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    padding: 6px 10px;
    background: var(--fg);
    color: var(--bg);
    text-shadow: none;
}
.vim-bar a, .vim-bar button { color: var(--bg); }
.vim-bar a:hover, .vim-bar button:hover { background: var(--bg); color: var(--fg); }

/* ---------- admin table ---------- */

.table-wrap { overflow-x: auto; }
table.posts { width: 100%; border-collapse: collapse; font-size: 14px; }
table.posts th { text-align: left; color: var(--dim); font-weight: 400; border-bottom: 1px dashed var(--faint); padding: 4px 10px 4px 0; }
table.posts td { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--faint); vertical-align: top; }
.actions { white-space: nowrap; }
form.inline { display: inline; }

/* ---------- folders, tags, CVE severity ---------- */

.dir-list { display: flex; flex-wrap: wrap; gap: 4px 26px; }
.dir-list a { color: var(--bright); }

.tags { font-size: 13px; margin: 4px 0; }
.tag { color: var(--dim); margin-right: 6px; }
.tag-home { color: var(--bright); }
td.tags { font-size: 12px; }

.sev { font-size: 0.75em; margin-right: 8px; vertical-align: middle; white-space: nowrap; text-shadow: none; }
.sev-critical { color: var(--bg); background: var(--err); padding: 1px 4px; }
.sev-high     { color: var(--err); }
.sev-medium   { color: var(--bright); }
.sev-low,
.sev-none     { color: var(--dim); }

.folders input { width: 100%; min-width: 60px; }

/* ---------- footer + cursor ---------- */

.site-foot { margin-top: 36px; padding-top: 10px; border-top: 1px dashed var(--faint); font-size: 13px; }

.cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.1em;
    vertical-align: text-bottom;
    background: var(--fg);
    box-shadow: 0 0 6px var(--glow);
    animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* typing effect (added by terminal.js) */
.typing::after { content: "\2588"; animation: blink 1s steps(1) infinite; }

/* ---------- small screens ---------- */

@media (max-width: 600px) {
    body { padding: 0; font-size: 14px; }
    .window { border-radius: 0; border-left: none; border-right: none; }
    .screen { padding: 14px 14px 20px; }
    .banner { font-size: 9px; }
    .wintitle { display: none; }
    .theme-switch { margin-left: auto; }
}

/* respect people who turn off animations */
@media (prefers-reduced-motion: reduce) {
    .cursor, .typing::after { animation: none; }
}
