/* =============================================================
   zral.net — shared stylesheet (linked by every page)
   Layout: base + chrome (all pages), startpage (search + link
   groups), projects (cards), notes (list), datenschutz (doc).
                                                               */

:root {
  --bg: #05050a;
  --surface: rgba(255, 255, 255, 0.03);
  --ink: #e8e8f2;
  --muted: #8f8fa3;
  --cyan: #00e5ff;
  --magenta: #ff2fb3;
  --border: rgba(255, 255, 255, 0.09);
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  /* Font note: self-host IBM Plex Mono as .woff2 and add an
     @font-face rule here when deploying. Falls back to system
     monospace fonts until then. */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--mono);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- Abstract background: neon aurora + grid (all pages) --- */
.bg-grid, .bg-glow { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
.bg-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, #000 40%, transparent 100%);
}
.bg-glow::before, .bg-glow::after {
  content: ""; position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%;
  opacity: 0.16;
  /* Weiche Kante per Gradient statt filter: blur(120px): gleicher Look.
     Blobs liegen statisch, keine Animation, keine Rasterisierung pro Frame. */
  background: radial-gradient(circle, var(--cyan) 0%, transparent 65%);
}
.bg-glow::before {
  background: radial-gradient(circle, var(--cyan) 0%, transparent 65%);
  top: -22vmax; left: -12vmax;
}
.bg-glow::after {
  background: radial-gradient(circle, var(--magenta) 0%, transparent 65%);
  bottom: -26vmax; right: -14vmax;
}

/* --- Scanline film (all pages) --- */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 30; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, transparent 0 2px, rgba(0, 0, 0, 0.22) 2px 4px);
  opacity: 0.5;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }

/* --- Header / navbar (all pages) --- */
header {
  position: sticky; top: 0; z-index: 20;
  padding: 28px 0 8px;
  transition: padding 0.25s ease, background 0.25s ease;
}
header.shrunk {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  /* Kein backdrop-filter: der Sticky-Header über animiertem Hintergrund
     würde sonst bei jedem Frame neu verrechnet. Fast deckend statt Glas. */
  background: rgba(5, 5, 10, 0.94);
}
header.shrunk #analog,
header.shrunk #date { display: none; }
.top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.brand { position: relative; display: inline-flex; align-items: center; }
.brand .logo { display: block; height: 30px; width: auto; transition: height 0.25s ease; }
header.shrunk .brand .logo { height: 18px; }
/* Logo glitch: two tinted copies of the logo flicker in briefly,
   screen-blended over the original (cyan + magenta ghost slices). */
.brand::before, .brand::after {
  content: ""; position: absolute; inset: 0;
  background: url("/logo.webp") center / 100% 100% no-repeat;
  pointer-events: none; opacity: 0; mix-blend-mode: screen;
}
.brand::before { filter: sepia(1) saturate(24) hue-rotate(160deg); animation: logo-glitch-a 4.1s steps(1) infinite; }
.brand::after  { filter: sepia(1) saturate(24) hue-rotate(300deg); animation: logo-glitch-b 3.3s steps(1) infinite; }
@keyframes logo-glitch-a {
  0%, 90%, 100% { transform: none; opacity: 0; }
  91% { transform: translate(3px, -2px); clip-path: inset(12% 0 55% 0); opacity: 0.85; }
  94% { transform: translate(-4px, 1px); clip-path: inset(60% 0 8% 0); opacity: 0.7; }
  97% { transform: translate(2px, 2px); clip-path: inset(30% 0 40% 0); opacity: 0.85; }
}
@keyframes logo-glitch-b {
  0%, 92%, 100% { transform: none; opacity: 0; }
  93% { transform: translate(-3px, 2px); clip-path: inset(48% 0 22% 0); opacity: 0.8; }
  96% { transform: translate(4px, -1px); clip-path: inset(6% 0 72% 0); opacity: 0.65; }
}
.time { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; display: flex; align-items: center; gap: 14px; }
.time #clock { color: var(--ink); font-size: 1.3rem; font-weight: 700; text-shadow: 0 0 18px rgba(0, 229, 255, 0.35); }
.topnav { display: flex; gap: 22px; }
.topnav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.topnav a:hover { color: var(--cyan); text-shadow: 0 0 12px rgba(0, 229, 255, 0.6); }
.topnav a.current { color: var(--cyan); text-shadow: 0 0 12px rgba(0, 229, 255, 0.6); }

#analog { flex: 0 0 auto; }
#analog .hand { stroke: currentColor; stroke-linecap: round; filter: drop-shadow(0 0 4px currentColor); }
#analog .hand-h { color: var(--magenta); stroke-width: 4.5; }
#analog .hand-m { color: var(--cyan); stroke-width: 3; }
#analog .hand-s { color: var(--ink); stroke-width: 1.3; }

/* --- Page head (all pages) --- */
.pagehead { padding: 36px 0 8px; }
.pagehead h1 {
  font-size: clamp(1.6rem, 4.5vw, 2.2rem); font-weight: 700; margin: 0;
  color: var(--ink); text-shadow: 0 0 30px rgba(0, 229, 255, 0.25);
}
.pagesub { color: var(--muted); margin: 6px 0 0; font-size: 0.95rem; }

/* --- Startpage: search + link groups --- */
.search-zone { padding: 46px 0 8px; }
#greeting { color: var(--muted); margin: 0 0 16px; font-size: 1rem; }
form.search { display: flex; gap: 10px; align-items: stretch; }
form.search input[type="text"] {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: 2px; color: var(--ink); font-family: var(--mono);
  font-size: 1.05rem; padding: 12px 16px; outline: none;
  caret-color: var(--cyan);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
form.search input[type="text"]:focus {
  border-color: rgba(0, 229, 255, 0.55);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.15);
}
form.search button {
  background: transparent; color: var(--magenta); font-family: var(--mono);
  font-weight: 700; border: 1px solid rgba(255, 47, 179, 0.5); border-radius: 2px;
  padding: 0 20px; cursor: pointer; font-size: 0.95rem;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
form.search button:hover { box-shadow: 0 0 26px rgba(255, 47, 179, 0.45); border-color: var(--magenta); }
.engines { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.engine {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); font-family: var(--mono); font-size: 0.8rem;
  padding: 4px 14px; cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.engine:hover { color: var(--ink); }
.engine.active {
  color: var(--cyan); border-color: rgba(0, 229, 255, 0.55);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.2);
}
.hint { color: var(--muted); font-size: 0.75rem; margin-top: 10px; }
.hint kbd {
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 3px;
  padding: 0 6px; font-family: var(--mono); font-size: 0.72rem; color: var(--ink);
}
.groups {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; padding: 24px 0 8px;
}
.group {
  background: var(--surface); border: 1px solid var(--border); border-radius: 2px;
  padding: 18px 18px 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.group:hover { border-color: rgba(255, 47, 179, 0.3); }
.group h2 {
  margin: 0 0 12px; font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--magenta);
}
.group ul { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.group li + li { margin-top: 6px; }
.group a { color: var(--muted); text-decoration: none; display: inline-block; }
.group a::before { content: "> "; color: rgba(0, 229, 255, 0.5); }
.group a:hover { color: var(--cyan); text-shadow: 0 0 12px rgba(0, 229, 255, 0.5); transform: translateX(2px); }

/* --- Projects page: cards --- */
.projects {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px; padding: 32px 0 8px;
}
.proj {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 2px;
  padding: 20px; color: var(--ink); text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.proj:hover {
  transform: translate(-2px, -2px);
  border-color: rgba(0, 229, 255, 0.55);
  box-shadow: 4px 4px 0 rgba(255, 47, 179, 0.35), 0 0 28px rgba(0, 229, 255, 0.15);
}
.proj-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.status { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; }
.status.active { color: var(--cyan); text-shadow: 0 0 12px rgba(0, 229, 255, 0.5); }
.status.wip { color: var(--magenta); text-shadow: 0 0 12px rgba(255, 47, 179, 0.5); }
.status.archived { color: var(--muted); }
.year { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.proj h3 { margin: 0 0 8px; font-size: 1.1rem; }
.proj p { margin: 0; font-size: 0.9rem; color: var(--muted); flex: 1; }

/* --- Notes page: list --- */
.notes { max-width: 720px; padding: 24px 0 8px; }
.note { padding: 18px 0; border-bottom: 1px solid var(--border); }
.note:last-child { border-bottom: none; }
.note-meta {
  font-size: 0.72rem; letter-spacing: 0.1em; color: var(--cyan);
  font-variant-numeric: tabular-nums;
}
.note h3 { margin: 6px 0 6px; font-size: 1.05rem; }
.note h3 a { color: var(--ink); text-decoration: none; }
.note h3 a:hover { color: var(--cyan); text-shadow: 0 0 12px rgba(0, 229, 255, 0.5); }
.note p { margin: 0; color: var(--muted); font-size: 0.9rem; max-width: 70ch; }

/* --- Legal document body (datenschutz) --- */
.doc { max-width: 72ch; padding: 32px 0 8px; }
.doc h2 { font-size: 1rem; margin: 28px 0 8px; letter-spacing: 0.06em; color: var(--magenta); }
.doc h2:first-child { margin-top: 0; }
.doc p { color: var(--muted); font-size: 0.9rem; margin: 0 0 12px; }
.doc address { font-style: normal; color: var(--ink); font-size: 0.9rem; margin: 0 0 12px; }
.doc a { color: var(--cyan); text-decoration: none; }
.doc a:hover { text-shadow: 0 0 12px rgba(0, 229, 255, 0.5); }
.tbd { color: var(--cyan); }
.notice {
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.05);
  padding: 16px 20px; border-radius: 2px; margin: 0 0 24px;
  font-size: 0.85rem; color: var(--muted);
}
.notice b { color: var(--cyan); }

/* --- Shared bits (all pages) --- */
.backtop { padding: 24px 0 0; }
.backtop a { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.backtop a:hover { color: var(--cyan); text-shadow: 0 0 12px rgba(0, 229, 255, 0.5); }
.backtop a::before { content: "> "; color: rgba(0, 229, 255, 0.5); }

footer {
  border-top: 1px solid var(--border); margin-top: 48px; padding: 26px 0 56px;
  font-size: 0.8rem; color: var(--muted);
}
footer .links { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 10px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--cyan); }
footer a.current { color: var(--cyan); }
footer .ok { color: var(--cyan); }

@media (prefers-reduced-motion: reduce) {
  .brand::before, .brand::after { animation: none; }
}
/* The clocks are hidden by site.js as soon as they would wrap
   onto a second line; they also stop running while hidden. */
