/*
Theme Name: abow Terminal
Theme URI: https://abow.info/
Author: Andreas Bowitz (Andi Bow)
Author URI: https://abow.info/
Description: Terminal/CRT-Theme für den IT-Blog abow.info — "how do you do IT". Monospace-Typografie, CRT-Scanlines, dezente Thumbnails, Dark/Light-Umschalter und eigens gestaltete PowerShell-/Shell-Codeblöcke mit Syntax-Highlighting und Copy-Button. Optimiert für PowerShell-, Exchange- & Microsoft-Snippets.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* Selbst gehostet statt Google Fonts (DSGVO) */
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/jetbrains-mono-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-latin-400-italic.woff2) format("woff2"); }


/* =========================================================================
   abow Terminal — Design tokens
   ========================================================================= */
:root {
  --bg: oklch(0.165 0.012 222);
  --bg2: oklch(0.205 0.014 222);
  --panel: oklch(0.225 0.015 222);
  --fg: oklch(0.91 0.012 220);
  --dim: oklch(0.62 0.012 220);
  --faint: oklch(0.46 0.012 220);
  --line: oklch(0.32 0.012 222);
  --accent: oklch(0.82 0.13 195);
  --accent-dim: oklch(0.55 0.09 195);
  --green: oklch(0.84 0.15 152);
  --amber: oklch(0.83 0.12 78);
  --magenta: oklch(0.78 0.13 350);
  --red: oklch(0.7 0.17 25);
  --glow: oklch(0.82 0.13 195 / 0.35);
  --maxw: 940px;
  --pad: 22px;
}
[data-theme="light"] {
  --bg: oklch(0.96 0.006 220);
  --bg2: oklch(0.93 0.008 220);
  --panel: oklch(0.985 0.004 220);
  --fg: oklch(0.26 0.014 222);
  --dim: oklch(0.46 0.014 220);
  --faint: oklch(0.62 0.012 220);
  --line: oklch(0.84 0.01 220);
  --accent: oklch(0.55 0.12 205);
  --accent-dim: oklch(0.62 0.1 205);
  --green: oklch(0.55 0.13 152);
  --amber: oklch(0.6 0.12 70);
  --magenta: oklch(0.55 0.15 350);
  --red: oklch(0.55 0.2 25);
  --glow: oklch(0.55 0.12 205 / 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  word-wrap: break-word;
}

/* CRT scanline + vignette overlay */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 2px, oklch(0 0 0 / 0.04) 2px 3px);
  mix-blend-mode: multiply; opacity: .6;
}
[data-theme="light"] body::before { opacity: .25; }
body::after {
  content: ""; position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, transparent 55%, oklch(0 0 0 / 0.35) 100%);
}
[data-theme="light"] body::after { background: radial-gradient(120% 90% at 50% 0%, transparent 60%, oklch(0.5 0.02 220 / 0.12) 100%); }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
::selection { background: var(--accent); color: var(--bg); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100000; background: var(--accent); color: var(--bg); padding: 10px 16px; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* =========================================================================
   Window chrome top bar
   ========================================================================= */
.chrome {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.chrome-in { max-width: var(--maxw); margin: 0 auto; padding: 9px var(--pad); display: flex; align-items: center; gap: 14px; }
.dots { display: flex; gap: 7px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); display: block; }
.dots i:nth-child(1) { background: var(--red); }
.dots i:nth-child(2) { background: var(--amber); }
.dots i:nth-child(3) { background: var(--green); }
.chrome .path { color: var(--dim); font-size: 12.5px; letter-spacing: .02em; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chrome .path b { color: var(--accent); font-weight: 500; }
.chrome-actions { display: flex; align-items: center; gap: 8px; }
.toggle {
  border: 1px solid var(--line); background: transparent; color: var(--dim);
  font-family: inherit; font-size: 11.5px; padding: 5px 10px; border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: .15s;
}
.toggle:hover { color: var(--accent); border-color: var(--accent-dim); }

/* =========================================================================
   Masthead / wordmark
   ========================================================================= */
header.masthead { padding: 46px 0 30px; }
.brand { display: flex; align-items: baseline; gap: 4px; font-size: clamp(40px, 9vw, 76px); font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.brand .caret { color: var(--accent); font-weight: 400; }
.brand .name { color: var(--fg); }
.brand .cursor { width: .55ch; height: .86em; background: var(--accent); display: inline-block; transform: translateY(.06em); animation: blink 1.15s steps(1) infinite; box-shadow: 0 0 14px var(--glow); }
@keyframes blink { 50% { opacity: 0; } }
.tagline { margin: 16px 0 0; color: var(--dim); font-size: 15px; }
.tagline .k { color: var(--green); }
.tagline .it { color: var(--accent); }
.blurb { margin: 26px 0 0; color: var(--faint); font-size: 13px; max-width: 60ch; }

/* Command nav */
nav.cmds { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; border-top: 1px dashed var(--line); padding-top: 22px; align-items: center; }
nav.cmds a {
  font-size: 12.5px; color: var(--dim); padding: 7px 12px; border: 1px solid var(--line);
  border-radius: 7px; transition: .15s; white-space: nowrap;
}
nav.cmds a .p { color: var(--green); }
nav.cmds a:hover { color: var(--accent); border-color: var(--accent-dim); background: var(--bg2); }
nav.cmds a.active { color: var(--accent); border-color: var(--accent-dim); background: var(--bg2); box-shadow: inset 0 0 0 1px var(--accent-dim); }

/* terminal search field */

main { padding: 12px 0 40px; min-height: 40vh; }

.prompt-line { color: var(--faint); font-size: 12.5px; margin: 30px 0 18px; }
.prompt-line .u { color: var(--green); }
.prompt-line .a { color: var(--accent); }

/* =========================================================================
   Post list rows
   ========================================================================= */
.rows { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 18px; align-items: center;
  padding: 18px 14px; border: 1px solid transparent; border-radius: 10px; transition: .15s;
}
.row:hover { background: var(--bg2); border-color: var(--line); }
.row + .row { border-top: 1px solid var(--line); border-radius: 0; }
.row:hover { border-radius: 10px; }
.thumb {
  width: 64px; height: 64px; border-radius: 8px; border: 1px solid var(--line); overflow: hidden;
  background:
    repeating-linear-gradient(135deg, var(--bg2) 0 6px, transparent 6px 12px),
    var(--panel);
  display: grid; place-items: center; position: relative; flex-shrink: 0;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb span { font-size: 7.5px; color: var(--faint); text-align: center; padding: 4px; line-height: 1.3; }
.row .meta { color: var(--faint); font-size: 11px; display: flex; gap: 10px; align-items: center; margin-bottom: 5px; flex-wrap: wrap; }
.row .meta .cat { color: var(--accent); }
.row .meta .dot { color: var(--line); }
.row h2, .row h3 { margin: 0; font-size: 16px; font-weight: 500; letter-spacing: -.01em; }
.row:hover h2, .row:hover h3 { color: var(--accent); }
.row .ex { margin: 7px 0 0; color: var(--dim); font-size: 12.5px; line-height: 1.55; }
.row .go { color: var(--faint); font-size: 12px; white-space: nowrap; }
.row:hover .go { color: var(--accent); }
.row .go::after { content: " →"; }

/* Featured */
.feat {
  display: block;
  border: 1px solid var(--line); border-radius: 14px; padding: 26px; background:
    radial-gradient(120% 140% at 100% 0%, var(--bg2) 0%, transparent 60%), var(--panel);
  position: relative; overflow: hidden; margin-bottom: 8px;
}
.feat::before { content: "NEU"; position: absolute; top: 18px; right: 22px; z-index: 2; font-size: 10px; letter-spacing: .25em; color: var(--accent); border: 1px solid var(--accent-dim); padding: 3px 8px; border-radius: 5px; background: color-mix(in oklch, var(--panel) 80%, transparent); backdrop-filter: blur(4px); }
.feat .meta { color: var(--faint); font-size: 11.5px; margin-bottom: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.feat .meta .cat { color: var(--accent); }
.feat h2 { margin: 0; font-size: clamp(22px, 4vw, 30px); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; max-width: 22ch; }
.feat:hover h2 { color: var(--accent); }
.feat p { color: var(--dim); font-size: 14px; max-width: 62ch; margin: 14px 0 20px; }
/* featured with image: text + image side by side, stacking on small screens */
.feat.has-thumb { display: grid; grid-template-columns: 1fr minmax(38%, 420px); gap: 26px; align-items: center; }
.feat.has-thumb .feat-body { min-width: 0; }
.feat-thumb { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; line-height: 0; }
.feat-thumb img { display: block; width: 100%; height: 100%; max-height: 280px; object-fit: cover; }
@media (max-width: 680px) {
  .feat.has-thumb { grid-template-columns: 1fr; }
  .feat.has-thumb .feat-thumb { order: -1; }
  .feat-thumb img { max-height: 200px; }
}
.btn { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--accent); border: 1px solid var(--accent-dim); padding: 9px 16px; border-radius: 8px; transition: .15s; cursor: pointer; background: transparent; font-family: inherit; }
.btn:hover { background: var(--accent); color: var(--bg); box-shadow: 0 0 24px var(--glow); }

.section-title { font-size: 12px; letter-spacing: .22em; color: var(--faint); text-transform: uppercase; margin: 40px 0 6px; display: flex; align-items: center; gap: 12px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* =========================================================================
   Single post
   ========================================================================= */
article.post { padding-top: 8px; }
.back { font-size: 12px; color: var(--dim); display: inline-flex; gap: 7px; margin: 8px 0 22px; }
.back:hover { color: var(--accent); }
.post-head h1 { font-size: clamp(26px, 5vw, 40px); font-weight: 700; letter-spacing: -.025em; line-height: 1.15; margin: 0 0 16px; max-width: 26ch; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--faint); font-size: 12px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.post-meta .by { color: var(--green); }
.post-meta .cat { color: var(--accent); }
.post-meta a:hover { color: var(--accent); }
.feat-image { margin: 24px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.feat-image img { display: block; width: 100%; }

/* Generic post content (works with WP block/classic output) */
.entry-content { font-size: 15px; line-height: 1.75; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 38px 0 10px; color: var(--fg); }
.entry-content h2::before { content: "## "; color: var(--accent); }
.entry-content h3 { font-size: 17px; font-weight: 700; margin: 30px 0 8px; color: var(--fg); }
.entry-content h3::before { content: "### "; color: var(--accent); }
.entry-content h4 { font-size: 15px; font-weight: 700; margin: 24px 0 8px; color: var(--fg); }
.entry-content p { color: var(--dim); margin: 14px 0; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-dim); }
.entry-content a:hover { text-decoration-color: var(--accent); }
.entry-content strong, .entry-content b { color: var(--fg); font-weight: 700; }
.entry-content ul, .entry-content ol { color: var(--dim); margin: 14px 0; padding-left: 1.6em; }
.entry-content li { margin: 6px 0; }
.entry-content ul { list-style: none; padding-left: 1.2em; }
.entry-content ul > li { position: relative; }
.entry-content ul > li::before { content: "›"; color: var(--accent); position: absolute; left: -1.2em; }
.entry-content ol { list-style: decimal; }
.entry-content ol::marker { color: var(--accent); }
.entry-content :not(pre) > code { background: var(--bg2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: 13px; color: var(--accent); }
.entry-content img { border-radius: 10px; border: 1px solid var(--line); }
.entry-content figure { margin: 22px 0; }
.entry-content figcaption { color: var(--faint); font-size: 12px; text-align: center; margin-top: 8px; }
.entry-content hr { border: 0; border-top: 1px dashed var(--line); margin: 32px 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 13px; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; color: var(--dim); }
.entry-content th { color: var(--fg); background: var(--bg2); }

/* Blockquote / callout */
.entry-content blockquote {
  border-left: 2px solid var(--accent); background: var(--bg2); padding: 14px 18px;
  border-radius: 0 10px 10px 0; color: var(--dim); font-size: 13.5px; margin: 22px 0;
}
.entry-content blockquote p { margin: 6px 0; }
.entry-content blockquote code { background: var(--panel); }
.entry-content blockquote cite { display: block; margin-top: 8px; color: var(--faint); font-style: normal; font-size: 12px; }

/* =========================================================================
   Code blocks (decorated by abow.js)
   ========================================================================= */
.code { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 22px 0; background: var(--panel); box-shadow: 0 12px 40px -24px var(--glow); }
.code-bar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--bg2); font-size: 11.5px; color: var(--faint); }
.code-bar .lang { color: var(--accent); text-transform: lowercase; }
.code-bar .dots { margin-right: 4px; }
.code-bar .dots i { width: 9px; height: 9px; }
.code-bar .spacer { flex: 1; }
.copy { border: 1px solid var(--line); background: transparent; color: var(--dim); font-family: inherit; font-size: 11px; padding: 4px 9px; border-radius: 6px; cursor: pointer; transition: .15s; }
.copy:hover { color: var(--accent); border-color: var(--accent-dim); }
.copy.is-copied { color: var(--green); border-color: var(--green); }
.code pre { margin: 0; padding: 18px 18px 18px 0; overflow-x: auto; font-size: 13px; line-height: 1.7; background: none; border: 0; }
.code pre code { display: block; background: none; border: 0; padding: 0; color: var(--fg); }
.code pre .cl { display: block; padding-left: 56px; position: relative; white-space: pre; }
.code pre .cl .ln { position: absolute; left: 0; width: 40px; text-align: right; color: var(--dim); opacity: .8; user-select: none; }
/* fallback: undecorated <pre> (e.g. before JS runs) */
.entry-content > pre { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; overflow-x: auto; font-size: 13px; line-height: 1.7; }

.tok-c { color: var(--faint); font-style: italic; }
.tok-s { color: var(--green); }
.tok-v { color: var(--accent); }
.tok-fn { color: var(--magenta); }
.tok-p { color: var(--amber); }
.tok-n { color: var(--accent); }
.tok-op { color: var(--dim); }
.tok-k { color: var(--magenta); }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 34px 0; padding-top: 24px; border-top: 1px solid var(--line); }
.tags a { font-size: 11.5px; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; transition: .15s; }
.tags a::before { content: "#"; color: var(--accent); margin-right: 2px; }
.tags a:hover { border-color: var(--accent-dim); color: var(--accent); }

/* Archive / search head */
.arc-head { padding: 14px 0 8px; }
.arc-head h1 { font-size: clamp(24px, 5vw, 36px); font-weight: 700; letter-spacing: -.02em; margin: 0; }
.arc-head h1 .slash { color: var(--accent); }
.arc-head p { color: var(--dim); font-size: 13px; margin: 10px 0 0; }
.arc-head .desc { color: var(--faint); font-size: 12.5px; margin-top: 6px; max-width: 70ch; }

/* Pagination */
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 40px 0 0; padding-top: 24px; border-top: 1px solid var(--line); font-size: 12.5px; }
.pager a, .pager .disabled { color: var(--dim); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; transition: .15s; }
.pager a:hover { color: var(--accent); border-color: var(--accent-dim); }
.pager .disabled { opacity: .35; }
.pager .nav-numbers { display: flex; gap: 6px; align-items: center; }
.pager .page-numbers { padding: 6px 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--dim); }
.pager .page-numbers.current { color: var(--accent); border-color: var(--accent-dim); background: var(--bg2); }
.pager .page-numbers:hover { color: var(--accent); }

/* =========================================================================
   Footer
   ========================================================================= */
footer.site-footer { border-top: 1px solid var(--line); margin-top: 30px; padding: 30px 0 50px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.foot-brand { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.foot-brand .caret { color: var(--accent); }
.foot-links { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: var(--dim); }
.foot-links a:hover { color: var(--accent); }
.copyr { color: var(--faint); font-size: 11px; margin-top: 26px; }
.copyr .a { color: var(--dim); }


@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  .row .thumb { display: none; }
  .row .go { display: none; }
}

/* =========================================================================
   Effekte aus React Bits (static/js/effects.js)
   ========================================================================= */
.ft-bg {
  position: absolute; top: 0; left: 0; width: 100%; height: 520px; z-index: -1; pointer-events: none; opacity: .3;
  -webkit-mask-image: linear-gradient(#000 10%, transparent 85%); mask-image: linear-gradient(#000 10%, transparent 85%);
}
.ft-bg canvas { display: block; width: 100%; height: 100%; }
.feat, .row { position: relative; isolation: isolate; --mx: -999px; --my: -999px; }
.feat::after, .row::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(260px circle at var(--mx) var(--my), color-mix(in oklch, var(--accent) 14%, transparent), transparent 70%);
}
.feat:hover::after, .row:hover::after { opacity: 1; }

/* GlitchText (404-Seite) */
.arc-head .glitch { position: relative; display: inline-block; font-size: clamp(64px, 18vw, 160px); font-weight: 700; line-height: 1; margin: 0; user-select: none; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; top: 0; color: var(--fg); background: var(--bg); overflow: hidden; clip-path: inset(0 0 0 0); }
.glitch::after { left: 5px; text-shadow: -5px 0 var(--red); animation: animate-glitch 1.5s infinite linear alternate-reverse; }
.glitch::before { left: -5px; text-shadow: 5px 0 var(--accent); animation: animate-glitch 1s infinite linear alternate-reverse; }
@keyframes animate-glitch {
  0%, 50%, 80% { clip-path: inset(20% 0 50% 0); } 5%, 30%, 55%, 85% { clip-path: inset(10% 0 60% 0); }
  10%, 35%, 60%, 90% { clip-path: inset(15% 0 55% 0); } 15%, 40%, 65%, 95% { clip-path: inset(25% 0 35% 0); }
  20%, 45%, 70%, 100% { clip-path: inset(30% 0 40% 0); } 25%, 75% { clip-path: inset(40% 0 20% 0); }
}

/* TextType-Cursor und Einblenden der Zeilen (effects.js) */
.type-cursor { color: var(--accent); margin-left: 1px; animation: blink .9s steps(1) infinite; transition: opacity .6s; }
.type-cursor.done { opacity: 0; }
.row.fx-hide { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease, background .15s, border-color .15s; }
.row.fx-hide.fx-in { opacity: 1; transform: none; }
@media print { .row.fx-hide { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .glitch::before, .glitch::after { display: none; }
}
