/* adamschick.com: retro CRT terminal theme.
   Single dark look by design. Colors live in the tokens below.
   Keep public/assets/style.css and private/assets/style.css identical. */

@font-face {
  font-family: "VT323";
  font-style: normal;
  font-weight: 400;
  font-display: block;   /* no fallback-font flash: a late swap re-flows the whole page (layout shift). The file is preloaded. */
  src: url("/assets/fonts/vt323.woff2") format("woff2");   /* VT323, SIL Open Font License; latin subset, self-hosted */
}

:root {
  --bg: #020a04;
  --bg-2: #04140a;
  --fg: #5cff7a;          /* phosphor green */
  --fg-rgb: 92, 255, 122;  /* same color as --fg, for rgba() */
  --fg-dim: #45cf63;          /* secondary text and labels */
  --fg-faint: #1c7a34;        /* borders and decoration only */
  --fg-low: #2fa84a;          /* quietest color allowed for text: 4.5:1 or better on --bg */
  --glow: rgba(var(--fg-rgb), 0.32);
  --bg-bar: rgba(2, 10, 4, 0.96);
  --warn: #ffb000;        /* amber */
  --danger: #ff4d4d;
  --font: "VT323", "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --max: 820px;
  --prompt-h: 48px;
  color-scheme: dark;
}

/* Amber phosphor: `theme amber` at the prompt (saved in the browser). */
:root[data-theme="amber"] {
  --bg: #0a0600;
  --bg-2: #160d02;
  --fg: #ffb000;
  --fg-rgb: 255, 176, 0;
  --fg-dim: #e09c00;
  --fg-faint: #7a5500;
  --fg-low: #b98000;
  --warn: #fff1c2;
  --bg-bar: rgba(10, 6, 0, 0.96);
}

/* Language: every page holds both. <html class="de"> (set from the saved choice) shows German. */
html:not(.de) [data-l="de"], html.de [data-l="en"] { display: none !important; }

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }
[id] { scroll-margin-top: 16px; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at center, var(--bg-2) 0%, var(--bg) 70%) fixed;
  color: var(--fg);
  font: 22px/1.35 var(--font);
  text-shadow: 0 0 3px var(--glow);   /* one tight halo: a wide second layer made the text look out of focus */
  padding-bottom: calc(var(--prompt-h) + 24px);
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; width: 100%; }

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

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

/* ---------- link style: <text> with the text underlined ----------
   Applies to links in page text and boxes. The site-map tree is underlined only
   (no brackets, by choice). Tabs, the resume button and project cards keep their
   own [ ] styles. The brackets are inline-block so the underline stays on the text only. */
main a:not(.card):not(.btn),
.side-left .tree a { text-decoration: underline; text-underline-offset: 3px; }
main a:not(.card):not(.btn)::before { content: "<"; display: inline-block; text-decoration: none; text-indent: 0; }
main a:not(.card):not(.btn)::after { content: ">"; display: inline-block; text-decoration: none; text-indent: 0; }

/* ---------- CRT overlays ---------- */
body::before, body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
}
/* scanlines */
body::before {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.13) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  animation: flicker 6s infinite steps(1);
}
/* vignette */
body::after {
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 62%, rgba(0,0,0,0.38) 100%);
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  47% { opacity: 0.93; }
  48% { opacity: 1; }
  73% { opacity: 0.96; }
  74% { opacity: 1; }
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* ---------- header / tabs ---------- */
header { border-bottom: 2px dashed var(--fg-faint); }
header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding-top: 14px;
  padding-bottom: 12px;
}
.name { font-size: 28px; text-decoration: none; letter-spacing: 1px; }
.name::after { content: "_"; animation: blink 1s steps(1) infinite; }
header nav { display: flex; gap: 6px; flex-wrap: wrap; }
header nav a { text-decoration: none; padding: 0 8px; color: var(--fg-dim); }
header nav a::before { content: "[" attr(data-key) "]"; margin-right: 4px; color: var(--fg-low); }
header nav a[aria-current="page"] { background: var(--fg); color: var(--bg); text-shadow: none; }
header nav a[aria-current="page"]::before { color: var(--bg); }

/* ---------- content ---------- */
main { padding: 28px 16px 40px; }
h1 { font-size: 56px; line-height: 1; margin: 0 0 6px; font-weight: normal; letter-spacing: 2px; }
h2 { font-size: 30px; margin: 30px 0 6px; font-weight: normal; }
h2::before { content: "> "; color: var(--fg-dim); }
h3 { font-size: 24px; margin: 0 0 2px; font-weight: normal; }
p { margin: 0 0 10px; }
ul { margin: 0 0 10px; padding-left: 0; list-style: none; }
li { padding-left: 1.4em; text-indent: -1.4em; margin-bottom: 6px; }
li::before { content: "* "; color: var(--fg-dim); }
strong { font-weight: normal; color: var(--bg); background: var(--fg-dim); text-shadow: none; padding: 0 3px; }
.lede { color: var(--fg-dim); font-size: 24px; margin: 0 0 18px; }
.lede::before { content: "// "; }

.btn, .contact button {
  display: inline-block;
  font: inherit;
  color: var(--fg);
  background: transparent;
  border: 2px solid var(--fg);
  padding: 2px 14px;
  text-decoration: none;
  text-shadow: inherit;
  cursor: pointer;
}
.btn::before, .contact button::before { content: "[ "; }
.btn::after, .contact button::after { content: " ]"; }
.btn:hover, .btn:focus-visible, .contact button:hover, .contact button:focus-visible {
  background: var(--fg); color: var(--bg); text-shadow: none; outline: none;
}
.btn[aria-disabled="true"], .contact button:disabled { opacity: 0.5; pointer-events: none; }

.cards { display: grid; gap: 12px; margin-top: 14px; }
.card {
  display: block;
  padding: 10px 14px;
  border: 2px solid var(--fg-faint);
  color: var(--fg);
  text-decoration: none;
}
.card p { margin: 0; color: var(--fg); }
a.card:hover, a.card:focus-visible { border-color: var(--fg); background: rgba(var(--fg-rgb),0.08); color: var(--fg); text-shadow: inherit; }
a.card:hover p { color: var(--fg); }
.card h3::after { content: " ->"; color: var(--fg-faint); }
.card.no-link h3::after { content: none; }   /* a card that describes something without linking to it */
.tag { color: var(--warn); font-size: 18px; margin-left: 6px; }
.tag::before { content: "<"; } .tag::after { content: ">"; }

/* project card with ASCII art (art left, text right; stacked on phones) */
.card-art { display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: center; }
.ascii {
  margin: 0;
  font: 17px/1.05 var(--font);
  color: var(--fg-dim);
  white-space: pre;
}
.ascii .fan { color: var(--fg); }
.ascii .led { color: var(--fg); animation: blink 1.4s steps(1) infinite; }
a.card-art:hover .ascii { color: var(--fg); }
@media (max-width: 640px) {
  .card-art { grid-template-columns: 1fr; }
  .ascii { font-size: 15px; justify-self: center; }
}

/* experience entries (home page) */
.job { margin: 0 0 14px; }
.job h3 { margin: 0 0 4px; }
.job h3::before { content: "$ "; color: var(--fg-dim); }
.job .when { color: var(--warn); font-size: 20px; white-space: nowrap; margin-left: 6px; }
.job .when::before { content: "["; } .job .when::after { content: "]"; }
.job ul { margin: 0; padding-left: 1.1em; }
.job li { color: var(--fg); }
.job li strong { color: var(--fg); background: none; padding: 0; text-shadow: inherit; }

/* skills table (home page) */
.skills { display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; margin: 0 0 10px; }
.skills dt { color: var(--fg-dim); }
.skills dt::after { content: ":"; }
.skills dd { margin: 0; }
@media (max-width: 560px) {
  .skills { grid-template-columns: 1fr; gap: 0; }
  .skills dd { margin: 0 0 8px 1.1em; }
}

/* footer oscilloscope */
.scope { width: 120px; height: 20px; vertical-align: middle; margin-right: 10px; opacity: 0.85; }

/* bordered terminal box (networks block, quick contact) */
.box { border: 2px solid var(--fg-faint); padding: 10px 14px; margin: 18px 0 8px; }
.box p { margin: 0 0 6px; }
.box p:last-child, .box ul:last-child { margin-bottom: 0; }
.box-title { color: var(--fg-dim); }
.quick-contact .box-title { color: var(--warn); }
.box .links li::before { content: "> "; }

footer { border-top: 2px dashed var(--fg-faint); color: var(--fg-low); font-size: 18px; padding: 10px 0; }
footer .wrap { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- contact form ---------- */
.contact { display: grid; gap: 12px; max-width: 560px; }
.contact label { display: grid; gap: 2px; color: var(--fg-dim); }
.contact label::before { content: none; }
.contact input, .contact textarea {
  font: inherit;
  color: var(--fg);
  text-shadow: inherit;
  caret-color: var(--fg);
  background: rgba(var(--fg-rgb), 0.04);
  border: 2px solid var(--fg-faint);
  border-radius: 0;
  padding: 4px 10px;
}
.contact input:focus, .contact textarea:focus { outline: none; border-color: var(--fg); }
.contact .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact button { justify-self: start; }
.form-status { margin: 0; }
.form-status.ok { color: var(--fg); }
.form-status.err { color: var(--danger); }

/* ---------- caret ---------- */
.term-caret {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 1px;
  vertical-align: -0.12em;
  background: var(--fg);
  box-shadow: 0 0 6px var(--glow);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- reveal gating (set up by the inline script in <head>) ---------- */
.js main > *:not(script):not(.revealed) { visibility: hidden; }
.term-fallback main > * { visibility: visible !important; }

/* ---------- boot + transition overlay ---------- */
#term-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--bg);
  padding: 32px 24px;
  font-size: 24px;
  white-space: pre-wrap;
  overflow: hidden;
  display: none;
}
#term-overlay.on { display: block; }
#term-overlay .line { min-height: 1.35em; }
#term-overlay .warn { color: var(--warn); }
#term-overlay .danger { color: var(--danger); }
#term-overlay .dim { color: var(--fg-dim); }
#term-overlay .hint { position: absolute; bottom: 20px; left: 24px; color: var(--fg-low); font-size: 20px; }

/* ---------- command prompt ---------- */
#term-prompt {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  background: var(--bg-bar);
  border-top: 2px solid var(--fg-faint);
}
#term-prompt .wrap { padding-top: 6px; padding-bottom: 8px; }
#term-out { max-height: min(45vh, 16em); overflow-y: auto; color: var(--fg); white-space: pre-wrap; }
#term-out:empty { display: none; }
#term-out .err { color: var(--danger); }
#term-out .warn { color: var(--warn); }
#term-form { display: flex; align-items: center; gap: 0; }
#term-form label { white-space: nowrap; color: var(--fg-dim); }
#term-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--fg);
  text-shadow: inherit;
  caret-color: var(--fg);
  background: transparent;
  border: 0;
  outline: none;
  padding: 0 0 0 8px;
}
#term-input::placeholder { color: var(--fg-low); }

/* ---------- margin panels: site tree (left) + system panel (right) ----------
   Pinned to the screen edges. Only shown when the screen is wide enough that they
   can't touch the 820px content column: 820 + 2 x (24 edge + 240 panel + 40 gap) = 1428.
   One brightness scheme for both panels so they stay in the background:
   labels/branches = faint, content = dim, current page = full. Glow kept low. */
.side {
  display: none;
  position: fixed;
  top: 96px;
  width: 240px;
  max-height: calc(100vh - 96px - var(--prompt-h) - 40px);
  overflow: hidden auto;
  font-size: 19px;
  line-height: 1.3;
  color: var(--fg-dim);
  text-shadow: 0 0 3px rgba(var(--fg-rgb), 0.25);
  z-index: 10;
}
.side-left { left: 24px; }
.side-right { right: 24px; }
@media (min-width: 1440px) { .side { display: block; } }
.side h2 { font-size: 19px; margin: 0 0 6px; color: var(--fg-faint); }
.side h2::before { content: none; }
.side h2 + * { margin-bottom: 18px; }
.side .row { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.side .row .branch { color: var(--fg-faint); }
.side a { color: var(--fg-dim); }
.side a:hover, .side a:focus-visible { background: var(--fg-dim); color: var(--bg); text-shadow: none; }
.side a[aria-current="page"] { color: var(--fg); text-shadow: 0 0 3px var(--glow); }
.side-left .tree a[aria-current="page"]::after { content: " <"; }
.side .lock { color: var(--warn); opacity: 0.75; }
.side .kv { display: grid; grid-template-columns: 9ch 1fr; }
.side .kv > span:nth-child(odd) { color: var(--fg-faint); }
.side .kv > span:nth-child(even) { color: var(--fg-dim); }
.side .meter { display: inline-block; width: 100%; height: 0.6em; border: 1px solid var(--fg-faint); vertical-align: middle; }
.side .meter i { display: block; height: 100%; width: 60%; background: var(--fg-dim); }
.side .log .row span { color: var(--fg-faint); }
.side .log .day { color: var(--fg-faint); margin-top: 2px; }
.side .log .more { color: var(--fg-faint); }
@media (max-width: 560px) {
  body { font-size: 20px; }
  h1 { font-size: 44px; }
  h2 { font-size: 26px; }
  #term-form label .host { display: none; }
}

/* ---------- Config page: rows of choice buttons ---------- */
.opts { display: grid; grid-template-columns: max-content 1fr; gap: 12px 22px; align-items: center; margin: 0 0 14px; }
.opts dt { color: var(--fg-dim); }
.opts dt::after { content: ":"; }
.opts dd { margin: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.opts button {
  font: inherit; color: var(--fg); background: transparent; border: 2px solid var(--fg-faint);
  padding: 2px 14px; text-shadow: inherit; cursor: pointer;
}
.opts button::before { content: "( ) "; }
.opts button[aria-pressed="true"] { border-color: var(--fg); background: var(--fg); color: var(--bg); text-shadow: none; }
.opts button[aria-pressed="true"]::before { content: "(*) "; }
.opts button:hover, .opts button:focus-visible { border-color: var(--fg); outline: none; }
.opts button[data-pref="reset"]::before { content: none; }
.hint { color: var(--fg-low); font-size: 20px; }
.plain .hint { font-size: 15px; }
@media (max-width: 560px) { .opts { grid-template-columns: 1fr; gap: 4px; } .opts dd { margin-bottom: 10px; } }

/* one-line hint under the lede (class name is from when it was the language switch) */
.lang { font-size: 20px; color: var(--fg-low); margin: -10px 0 14px; }
kbd { font: inherit; color: var(--fg); border: 1px solid var(--fg-faint); padding: 0 6px; }

/* two buttons side by side */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- plain text mode: `plain` at the prompt or the header switch ----------
   Same colors, no CRT effects, a regular monospace font. The page is not gated or animated. */
.plain body { font: 17px/1.5 ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace; text-shadow: none; }
.plain body::before, .plain body::after { display: none; }
.plain h1 { font-size: 34px; letter-spacing: 0; }
.plain h2 { font-size: 22px; }
.plain h3 { font-size: 18px; }
.plain .lede { font-size: 18px; }
.plain .name { font-size: 20px; }
.plain .name::after, .plain .term-caret { animation: none; }
.plain .job .when, .plain .lang, .plain footer, .plain .side { font-size: 15px; }
.plain .ascii { font-size: 13px; line-height: 1.1; }
.plain .ascii .led { animation: none; }
.plain .scope { display: none; }

/* ---------- hidden commands ---------- */
#fx-matrix { position: fixed; inset: 0; z-index: 85; width: 100%; height: 100%; background: var(--bg); }
.fx-drive {
  position: fixed; left: 0; bottom: calc(var(--prompt-h) + 18px); z-index: 60; margin: 0;
  font: 18px/1.05 var(--font); color: var(--fg); white-space: pre; pointer-events: none;
  animation: drive 5s linear forwards;
}
@keyframes drive { from { transform: translateX(100vw); } to { transform: translateX(-100%); } }

/* ---------- print: black on white, no chrome ---------- */
@media print {
  :root, :root[data-theme="amber"] { --bg: #fff; --bg-2: #fff; --fg: #000; --fg-dim: #222; --fg-faint: #999; --fg-low: #444; --warn: #000; }
  html, body { background: #fff !important; }
  body { color: #000; font: 11pt/1.4 Georgia, "Times New Roman", serif; text-shadow: none; padding-bottom: 0; display: block; }
  body::before, body::after, header nav, .opts, #term-prompt, #term-overlay, .side, .scope, .lang, footer, .cf-turnstile, .btn-row, form.contact { display: none !important; }
  header { border-bottom: 1px solid #000; }
  .name { font-size: 16pt; } .name::after { content: none; }
  main { padding: 10pt 0 0; }
  main > * { visibility: visible !important; }
  h1 { font-size: 20pt; letter-spacing: 0; } h2 { font-size: 13pt; margin-top: 12pt; } h3 { font-size: 11pt; font-weight: bold; }
  h2::before, .job h3::before, .lede::before { content: none; }
  .lede { font-size: 11pt; }
  a { color: #000; text-decoration: none; }
  main a:not(.card):not(.btn)::before, main a:not(.card):not(.btn)::after { content: none; }
  strong, .job li strong { background: none; color: #000; font-weight: bold; padding: 0; }
  .job, .box { break-inside: avoid; }
  .box, .card { border: 1px solid #999; }
  .job .when { font-size: 10pt; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before { animation: none; }
  .term-caret, .name::after, .ascii .led { animation: none; }
  .fx-drive { animation: none; display: none; }
}
