/* ============================================================
   Fortschrittswerk 3D — Design System
   Einmal aufgeräumt. Kein !important-Chaos mehr.
   ============================================================ */

/* --- Fonts --- */
@font-face {
  font-family: 'Press Start 2P';
  src: url('../fonts/pressstart2p.woff2') format('woff2');
  font-display: swap;
}

/* --- Design Tokens --- */
:root {
  --bg:        #000;
  --surface:   #080808;
  --surface-2: #0f0f0f;
  --brand:     #00ff41;
  --brand-dim: #00cc33;
  --fg:        #ccffdd;
  --fg-dim:    #88dd99;
  --fg-muted:  #3d6b4d;
  --frame-w:   3px;
  --frame-r:   4px;
  --crt-opacity: .52;
  --header-h:  56px;
  --max-w:     58rem;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  padding-top: var(--header-h);
  overflow-x: hidden;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--fg); }
img, video { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; }

/* --- Typography --- */
.retro {
  font-family: 'Press Start 2P', ui-monospace, monospace;
  letter-spacing: .3px;
}
h1.retro { font-size: clamp(1rem, 3vw, 1.4rem); line-height: 1.4; }
h2.retro { font-size: .75rem; line-height: 1.4; }
h3.retro { font-size: .65rem; line-height: 1.4; }
.ascii-h { white-space: pre; font-family: 'Press Start 2P', monospace; font-size: .65rem; line-height: 1.4; display: block; color: var(--brand); }
p { color: var(--fg-dim); }
p strong { color: var(--fg); }
.lead { font-size: 1rem; color: var(--fg-dim); margin-bottom: 1rem; }
.muted { color: var(--fg-muted); font-size: .85em; }

/* --- Layout --- */
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 1rem; }
section { padding: 3.5rem 0; scroll-margin-top: var(--header-h); }
section.alt { background: rgba(255,255,255,.02); }

/* --- Header --- */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--brand);
  z-index: 100;
  display: flex;
  align-items: center;
}
#site-header .wrap { width: 100%; display: flex; align-items: center; justify-content: space-between; }
/* Logo button — click opens OscilloJump */
#f3d-logo {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  position: relative;
}
#f3d-logo img {
  height: 48px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 6px rgba(0,255,65,.4));
  transition: filter .2s, transform .15s;
}
#f3d-logo:hover img {
  filter: drop-shadow(0 0 14px rgba(0,255,65,.8));
  transform: scale(1.05);
}
#f3d-logo:active img {
  transform: scale(0.97);
}
/* Tooltip hint on hover */
#f3d-logo::after {
  content: '▶ OSCILLOJUMP';
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  font-family: 'Press Start 2P', monospace;
  font-size: .42rem;
  color: var(--brand);
  background: rgba(0,0,0,.92);
  border: 1px solid rgba(0,255,65,.3);
  padding: .25rem .5rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 200;
  letter-spacing: .06em;
}
#f3d-logo:hover::after { opacity: 1; }
nav.desktop { display: none; align-items: center; gap: 1.25rem; font-size: .7rem; }
nav.desktop a { color: var(--fg-dim); transition: color .15s; }
nav.desktop a:hover { color: var(--fg); }
.nav-cta {
  border: 1px solid var(--brand);
  padding: .3rem .75rem;
  color: var(--brand);
  font-size: .65rem;
  transition: background .15s, color .15s;
}
.nav-cta:hover { background: var(--brand); color: #000; }
.btn-icon {
  border: 1px solid var(--brand);
  padding: .3rem .6rem;
  font-size: .65rem;
  background: transparent;
  color: var(--fg-dim);
  transition: color .15s, border-color .15s;
}
.btn-icon:hover { color: var(--fg); border-color: var(--fg); }
#menuBtn { color: var(--fg-dim); border: 1px solid var(--brand); padding: .3rem .7rem; font-size: .7rem; background: transparent; }
#mobileNav {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: rgba(0,0,0,.97);
  border-bottom: 2px solid var(--brand);
  padding: 1rem;
  z-index: 99;
  font-size: .7rem;
  gap: .75rem;
  flex-direction: column;
}
#mobileNav a { color: var(--fg-dim); padding: .4rem 0; border-bottom: 1px solid rgba(255,255,255,.05); }
#mobileNav a:last-child { border: none; }
#mobileNav.open { display: flex; }
@media (min-width: 768px) {
  nav.desktop { display: flex; }
  #menuBtn { display: none; }
}

/* --- Progress Bar --- */
#progressBar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--brand);
  transform-origin: top;
  transform: scaleY(0);
  z-index: 200;
  transition: transform .1s linear;
}

/* --- CRT Overlay --- */
#crtOverlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  display: none;
  mix-blend-mode: multiply;
  opacity: var(--crt-opacity);
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0) 58%, rgba(0,0,0,.35) 100%),
    repeating-linear-gradient(0deg, rgba(0,255,65,.10) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.04) 0 2px, transparent 2px 4px);
}
body.crt #crtOverlay { display: block; }
@media (prefers-reduced-motion: no-preference) {
  #crtOverlay { animation: crt-flicker 2s ease-in-out infinite; }
}
@keyframes crt-flicker {
  0%, 100% { opacity: var(--crt-opacity); }
  40% { opacity: calc(var(--crt-opacity) * .72); }
  70% { opacity: calc(var(--crt-opacity) * .94); }
}

/* --- Blink cursor --- */
.cursor {
  display: inline-block;
  width: 6px; height: 1em;
  background: var(--brand);
  margin-left: 3px;
  vertical-align: -2px;
  animation: blink 1s steps(2,end) infinite;
}
@keyframes blink { 0%,49%{opacity:1} 50%,100%{opacity:0} }

/* --- H2 Scan-Wipe --- */
.h2-wipe {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 900ms steps(30, end);
}
.h2-wipe.visible { clip-path: inset(0 0 0 0); }
@media (prefers-reduced-motion: reduce) {
  .h2-wipe { transition: none; clip-path: none; }
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  border: 2px solid var(--brand);
  padding: .6rem 1.2rem;
  color: var(--brand);
  font-size: .75rem;
  background: transparent;
  transition: background .15s, color .15s;
  position: relative;
  overflow: hidden;
}
.btn:hover { background: var(--brand); color: #000; }
.btn.primary { background: var(--brand); color: #000; }
.btn.primary:hover { background: var(--brand-dim); }
.btn:active { transform: translateY(1px); }

/* Ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0,255,65,.25);
  transform: scale(0);
  animation: ripple .5s ease-out forwards;
  pointer-events: none;
  width: 16px; height: 16px;
}
@keyframes ripple { to { transform: scale(10); opacity: 0; } }

/* --- Cards / Frames --- */
.card {
  border: var(--frame-w) solid var(--brand);
  border-radius: var(--frame-r);
  padding: 1rem;
  background: var(--surface);
}

/* Content image frames */
.framed {
  box-shadow: 0 0 0 var(--frame-w) var(--brand);
  border-radius: var(--frame-r);
}
figcaption { font-size: .8rem; color: var(--fg-muted); margin-top: .4rem; }

/* --- Slider --- */
.slider-wrap {
  position: relative;
  border-radius: var(--frame-r);
  box-shadow: 0 0 0 var(--frame-w) var(--brand);
  overflow: hidden;
}
.slider-track {
  display: flex;
  transition: transform .25s ease;
  touch-action: pan-y;
  will-change: transform;
}
.slider-slide { min-width: 100%; }
.slider-slide img { width: 100%; height: auto; display: block; object-fit: cover; }
.slider-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.55);
  border: 1px solid var(--brand);
  color: var(--fg);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-family: monospace;
  z-index: 10;
  transition: background .15s;
  min-width: 44px; min-height: 44px;
}
.slider-btn:hover { background: rgba(0,255,65,.2); }
.slider-btn.prev { left: .5rem; }
.slider-btn.next { right: .5rem; }

/* --- Lightbox --- */
#lightbox { position: fixed; inset: 0; z-index: 5000; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.9); }
#lightbox.open { display: flex; }
#lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; box-shadow: 0 0 0 2px var(--brand); border-radius: var(--frame-r); }
#lightbox-close { position: absolute; top: 1rem; right: 1rem; background: transparent; border: 1px solid var(--brand); color: var(--fg); padding: .4rem .7rem; font-size: 1.2rem; }
body.lb-open { overflow: hidden; }

/* --- Gallery / Project Grid --- */
.gallery-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; justify-content: center; }
.filter-btn {
  border: 1px solid var(--brand);
  padding: .25rem .75rem;
  font-size: .7rem;
  background: transparent;
  color: var(--fg-dim);
  
  transition: background .15s, color .15s;
}
.filter-btn:hover, .filter-btn.active { background: var(--brand); color: #000; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}
.project-card {
  border: var(--frame-w) solid var(--brand);
  border-radius: var(--frame-r);
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
}
.project-card:hover { box-shadow: 0 0 0 calc(var(--frame-w) + 1px) var(--brand), 0 8px 24px rgba(0,0,0,.5); transform: translateY(-2px); }
.project-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.project-card .project-info { padding: .75rem 1rem; }
.project-card h3 { font-size: .65rem; color: var(--fg); margin-bottom: .35rem; font-family: 'Press Start 2P', monospace; }
.project-card p { font-size: .8rem; color: var(--fg-dim); line-height: 1.5; }
.project-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.tag { font-size: .65rem; border: 1px solid var(--brand); padding: .1rem .45rem;  color: var(--brand); }

/* --- Spec Grid (Maschinen) --- */
.spec-grid { display: grid; gap: 1rem; }
@media (min-width: 768px) { .spec-grid { grid-template-columns: repeat(3, 1fr); } }
.spec-card {
  border: var(--frame-w) solid var(--brand);
  border-radius: var(--frame-r);
  padding: 1rem;
  background: var(--surface);
}
.spec-card h3 { color: var(--brand); font-size: .65rem; font-family: 'Press Start 2P', monospace; margin-bottom: .6rem; }
.spec-card li { list-style: none; padding: .15rem 0; font-size: .85rem; color: var(--fg-dim); }
.spec-card li::before { content: "▸ "; color: var(--brand); }

/* --- Generator Callout --- */
.gen-callout {
  border-left: 4px solid var(--brand);
  background: rgba(0,255,65,.05);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--frame-r) var(--frame-r) 0;
  font-size: .85rem;
  text-align: center;
}
.gen-callout a { color: var(--brand); }
.gen-callout a:hover { text-decoration: underline; }

/* --- Command Palette --- */
#cmdPalette { position: fixed; inset: 0; z-index: 4000; display: none; }
#cmdPalette.open { display: block; }
.cmd-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); }
.cmd-panel {
  position: absolute;
  left: 50%; top: 14%;
  transform: translateX(-50%);
  width: min(700px, 92vw);
  background: #050505;
  border: 2px solid var(--brand);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 18px 60px rgba(0,0,0,.7);
}
.cmd-hint { font-size: .7rem; color: var(--fg-muted); margin-bottom: .5rem; font-family: monospace; }
#cmdInput {
  width: 100%;
  padding: .65rem .85rem;
  background: #000;
  color: var(--fg);
  border: 1px solid var(--brand);
  border-radius: 8px;
  font-size: .9rem;
  outline: none;
}
#cmdList { margin-top: .6rem; max-height: 50vh; overflow-y: auto; list-style: none; }
#cmdList li { padding: .6rem .85rem; border: 1px solid transparent; border-radius: 8px; font-size: .8rem; cursor: pointer; color: var(--fg-dim); }
#cmdList li:hover, #cmdList li.selected { border-color: var(--brand); background: rgba(0,255,65,.08); color: var(--fg); }

/* --- Snake Modal --- */
#snakeModal { position: fixed; inset: 0; z-index: 6000; display: none; }
#snakeModal.open { display: block; }
.snake-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.9); }
.snake-panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  background: #050505;
  border: 2px solid var(--brand);
  border-radius: 14px;
  padding: 1rem;
  width: min(640px, 92vw);
  text-align: center;
  font-family: ui-monospace, monospace;
  color: var(--fg);
}
#snakeCanvas { width: 100%; height: auto; display: block; image-rendering: pixelated; border-radius: 8px; }
.snake-row { display: flex; justify-content: space-between; align-items: center; margin: .4rem 0; font-size: .75rem; }
#snakeClose { border: 1px solid var(--brand); border-radius: 8px; padding: .4rem .8rem; background: rgba(0,255,65,.1); color: var(--fg); }
/* Mobile D-Pad */
.snake-dpad { display: none; margin-top: .75rem; }
@media (pointer: coarse) { .snake-dpad { display: grid; } }
.snake-dpad { grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(3, 56px); gap: 6px; justify-content: center; }
.dpad-btn {
  border: 1px solid var(--brand);
  border-radius: 10px;
  background: rgba(0,255,65,.1);
  color: var(--fg);
  font-size: 1.1rem;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
}
.dpad-btn:active { transform: translateY(1px); }
.dpad-center { grid-column: 2; grid-row: 2; }

/* --- Toasts --- */
.toast {
  position: fixed;
  left: 50%; bottom: 1.5rem;
  transform: translateX(-50%);
  background: rgba(8,8,8,.96);
  color: var(--fg);
  border: 1px solid var(--brand);
  border-radius: 10px;
  padding: .6rem 1rem;
  font-family: ui-monospace, monospace;
  font-size: .8rem;
  z-index: 3000;
  display: none;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { display: block; }

/* --- Footer --- */
footer {
  border-top: 2px solid rgba(0,255,65,.25);
  padding: 2rem 0;
  text-align: center;
  font-size: .75rem;
  color: var(--fg-muted);
}
footer a { color: var(--fg-muted); }
footer a:hover { color: var(--brand); }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: .75rem; flex-wrap: wrap; }

/* --- Reveal Animation --- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { transition: none; opacity: 1; transform: none; } }

/* --- Focus --- */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* --- Utility --- */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.grid-2 { display: grid; gap: 1.25rem; }
@media (min-width: 680px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; gap: 1rem; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.flex-center { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* ============================================================
   NERD DESIGN SYSTEM — Extensions
   Terminal green aesthetic, LCARS-style panels, scanner frames
   ============================================================ */

/* --- Enhanced card glow on hover --- */
.card {
  transition: box-shadow .2s, border-color .2s;
}
.card:hover {
  box-shadow: 0 0 18px rgba(0,255,65,.12), 0 4px 16px rgba(0,0,0,.4);
  border-color: var(--brand);
}
.project-card {
  transition: box-shadow .2s, transform .15s, border-color .2s;
}
.project-card:hover {
  box-shadow: 0 0 20px rgba(0,255,65,.15), 0 8px 24px rgba(0,0,0,.5);
  border-color: var(--brand);
  transform: translateY(-3px);
}
.spec-card {
  transition: box-shadow .2s, border-color .2s;
}
.spec-card:hover {
  box-shadow: 0 0 16px rgba(0,255,65,.1);
  border-color: var(--brand);
}

/* --- Header ambient glow --- */
#site-header {
  box-shadow: 0 0 24px rgba(0,255,65,.08);
}

/* --- section.alt scanline texture --- */
section.alt {
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0,255,65,.018) 0px,
      rgba(0,255,65,.018) 1px,
      transparent 1px,
      transparent 4px
    ),
    rgba(255,255,255,.018);
}

/* --- Section header decoration (LCARS-style) --- */
.section-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.75rem;
}
.section-header::before {
  content: '';
  display: block;
  width: 4px;
  height: 1.8rem;
  background: var(--brand);
  box-shadow: 0 0 10px rgba(0,255,65,.5);
  flex-shrink: 0;
}
.section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(0,255,65,.4), transparent);
}
.section-label {
  font-family: 'Press Start 2P', monospace;
  font-size: .55rem;
  color: rgba(0,255,65,.35);
  letter-spacing: .12em;
  white-space: nowrap;
}
.section-num {
  font-family: 'Press Start 2P', monospace;
  font-size: .45rem;
  color: var(--brand);
  background: rgba(0,255,65,.07);
  border: 1px solid rgba(0,255,65,.25);
  padding: .2rem .45rem;
  letter-spacing: .08em;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(0,255,65,.1);
}
.section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(.7rem, 1.5vw, .9rem);
  color: var(--fg);
  letter-spacing: .08em;
  line-height: 1.4;
}

/* Terminal status line (below hero) */
.sys-status {
  font-family: ui-monospace, monospace;
  font-size: .65rem;
  color: var(--fg-muted);
  letter-spacing: .05em;
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.sys-status .ss-ok  { color: var(--brand); }
.sys-status .ss-dim { color: rgba(0,255,65,.3); }
.sys-status .ss-sep { color: rgba(0,255,65,.2); }

/* Horizontal rule terminal-style */
.term-hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,255,65,.2) 20%, rgba(0,255,65,.2) 80%, transparent);
  margin: 0;
}

/* Project quote inside gallery cards */
.p-quote {
  font-family: ui-monospace, monospace;
  font-size: .65rem;
  color: var(--fg-muted);
  border-left: 2px solid rgba(0,255,65,.3);
  padding-left: .6rem;
  margin-top: .6rem;
  line-height: 1.5;
  font-style: italic;
}

/* --- Scanner frame corners --- */
.scanner-frame {
  position: relative;
  display: block;
}
.scanner-frame .sc-tl,
.scanner-frame .sc-tr,
.scanner-frame .sc-bl,
.scanner-frame .sc-br {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--brand);
  border-style: solid;
  pointer-events: none;
  z-index: 2;
  transition: width .3s, height .3s;
}
.scanner-frame:hover .sc-tl,
.scanner-frame:hover .sc-tr,
.scanner-frame:hover .sc-bl,
.scanner-frame:hover .sc-br {
  width: 28px;
  height: 28px;
}
.scanner-frame .sc-tl { top: -5px; left: -5px;   border-width: 2px 0 0 2px; box-shadow: -2px -2px 8px rgba(0,255,65,.3); }
.scanner-frame .sc-tr { top: -5px; right: -5px;  border-width: 2px 2px 0 0; box-shadow:  2px -2px 8px rgba(0,255,65,.3); }
.scanner-frame .sc-bl { bottom: -5px; left: -5px; border-width: 0 0 2px 2px; box-shadow: -2px  2px 8px rgba(0,255,65,.3); }
.scanner-frame .sc-br { bottom: -5px; right: -5px;border-width: 0 2px 2px 0; box-shadow:  2px  2px 8px rgba(0,255,65,.3); }

/* --- Skill meters --- */
.skill-meters { margin: 1rem 0; }
.skill-row    { margin-bottom: .85rem; }
.skill-label-row {
  display: flex;
  justify-content: space-between;
  font-size: .55rem;
  font-family: 'Press Start 2P', monospace;
  color: var(--fg-dim);
  margin-bottom: .28rem;
  letter-spacing: .02em;
}
.skill-label-row span { color: var(--brand); }
.skill-bar {
  height: 4px;
  background: var(--surface-2);
  border: 1px solid rgba(0,255,65,.2);
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-dim), var(--brand));
  box-shadow: 0 0 8px var(--brand);
  width: 0;
  transition: width 1.3s cubic-bezier(.4,0,.2,1);
}

/* --- Term-block (terminal panel) --- */
.term-block {
  background: #000;
  border: 1px solid rgba(0,255,65,.3);
  padding: 1rem 1.2rem;
  font-family: ui-monospace, 'Share Tech Mono', 'Courier New', monospace;
  font-size: .78rem;
  line-height: 1.9;
  position: relative;
  overflow: hidden;
}
.term-block::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  animation: term-scan 4s linear infinite;
  pointer-events: none;
}
@keyframes term-scan {
  0%   { top: 0;    opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
.term-block .t-prompt { color: var(--brand); }
.term-block .t-key    { color: var(--fg); }
.term-block .t-dim    { color: var(--fg-muted); }
.term-block .t-val    { color: var(--fg-dim); }
.term-block .t-blank  { display: block; height: .4rem; }

/* --- Hero glitch text effect --- */
@keyframes glitch-1 {
  0%,100% { clip-path: inset(0 0 96% 0); transform: translate(-2px, 0); }
  50%      { clip-path: inset(33% 0 50% 0); transform: translate( 2px, 0); }
}
@keyframes glitch-2 {
  0%,100% { clip-path: inset(66% 0 10% 0); transform: translate( 2px, 0); }
  50%      { clip-path: inset(10% 0 80% 0); transform: translate(-2px, 0); }
}
.glitch {
  position: relative;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.glitch::before {
  color: #0ff;
  animation: glitch-1 3.5s steps(2) infinite;
  opacity: .5;
}
.glitch::after {
  color: #f0f;
  animation: glitch-2 4.1s steps(2) infinite;
  opacity: .5;
}

/* --- CRT-light mode (subtle) --- */
body.crt-light #crtOverlay {
  display: block;
  opacity: .18;
}

/* --- Profil stat rows (shared) --- */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: .45rem 0;
  border-bottom: 1px solid rgba(0,255,65,.07);
  gap: 1rem;
  font-size: .82rem;
}
.stat-row:last-child { border-bottom: none; }
.stat-key {
  font-size: .58rem;
  font-family: monospace;
  color: var(--fg-muted);
  letter-spacing: .08em;
  flex-shrink: 0;
}
.stat-val { color: var(--fg); text-align: right; }

/* --- Framed image glow --- */
.framed {
  transition: box-shadow .3s;
}
.scanner-frame:hover .framed {
  box-shadow: 0 0 24px rgba(0,255,65,.2);
}

/* --- Lightbox: terminal-style caption --- */
#lightbox-caption {
  position: absolute;
  bottom: 1rem; left: 50%;
  transform: translateX(-50%);
  font-family: ui-monospace, monospace;
  font-size: .7rem;
  color: var(--fg-dim);
  background: rgba(0,0,0,.75);
  padding: .35rem .75rem;
  border: 1px solid rgba(0,255,65,.25);
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Footer glow --- */
footer {
  box-shadow: 0 -1px 20px rgba(0,255,65,.05);
}

/* --- Ticker strip --- */
.ticker-wrap {
  overflow: hidden;
  border-top: 1px solid rgba(0,255,65,.2);
  border-bottom: 1px solid rgba(0,255,65,.2);
  padding: .4rem 0;
  margin: 1.5rem 0;
  background: rgba(0,255,65,.02);
}
.ticker-inner {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  animation: ticker-scroll 35s linear infinite;
  font-size: .6rem;
  font-family: 'Press Start 2P', monospace;
  color: var(--fg-muted);
  letter-spacing: .05em;
}
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Nav active state glow --- */
nav.desktop a[style*="var(--brand)"] {
  text-shadow: 0 0 10px rgba(0,255,65,.5);
}

/* ══════════════════════════════════════════════════════════
   ASCII CHARACTER BACKGROUND
   Barely visible repeating terminal-char pattern on body
   ══════════════════════════════════════════════════════════ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* SVG tile: repeating ASCII chars at ~3.5% opacity — barely visible */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='80'%3E%3Cstyle%3Etext%7Bfont-family:monospace%3Bfont-size:10px%3Bfill:%2300ff41%3Bfill-opacity:.038%7D%3C/style%3E%3Ctext x='0' y='10'%3E01001101 10110%3C/text%3E%3Ctext x='0' y='22'%3E%3E_ F3D.SYS%3C/text%3E%3Ctext x='0' y='34'%3E%7C %7C%5B%5D%7C %7C 00%3C/text%3E%3Ctext x='0' y='46'%3E%23%23 BOOT OK%3C/text%3E%3Ctext x='0' y='58'%3E1010 %7C%7C %3E_%3C/text%3E%3Ctext x='0' y='70'%3E%3C%3E %5B%5D %7B%7D %%3C/text%3E%3C/svg%3E");
  background-size: 120px 80px;
  background-repeat: repeat;
}
