/* ==========================================================================
   achterberg.dev — shared stylesheet
   ========================================================================== */

/* ---- Tokens: dark (default) ---------------------------------------- */
:root {
  --bg:            #0b0b0d;
  --grid:          rgba(255,255,255,.030);
  --border:        #242427;
  --border-soft:   #1b1b1e;
  --panel:         #101013;
  --text:          #ededec;
  --text-body:     #a2a2a7;
  --muted:         #6f6f77;
  --accent:        #f97316;
  --accent-soft:   rgba(249,115,22,.06);
  --green:         #4ade80;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --nav-h: 52px;
  --wide:  1200px;
  --narrow: 730px;
  --pad:   32px;
}

/* ---- Tokens: light -------------------------------------------------- */
html[data-theme="light"] {
  --bg:            #f6f6f4;
  --grid:          rgba(0,0,0,.040);
  --border:        #dedcd7;
  --border-soft:   #e7e5e0;
  --panel:         #fbfbfa;
  --text:          #17171a;
  --text-body:     #55555c;
  --muted:         #83838c;
  --accent:        #d1580c;
  --accent-soft:   rgba(209,88,12,.06);
  --green:         #2f9e52;
}

/* ---- Base ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background-color: var(--bg);
  /* --grid-line setzt site.js, wenn das Korn darüberliegt (siehe unten) */
  background-image:
    linear-gradient(to right,  var(--grid-line, var(--grid)) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line, var(--grid)) 1px, transparent 1px);
  background-size: 84px 84px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---- Layout --------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--pad);
}
.wrap--narrow { max-width: var(--narrow); }

/* ==========================================================================
   Navigation
   ========================================================================== */
.site-nav {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  height: var(--nav-h);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  padding: 0 22px;
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .09em;
  color: var(--text);
  white-space: nowrap;
}

.nav-right { display: flex; align-items: stretch; }

.nav-right a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-left: 1px solid var(--border);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--muted);
  transition: color .15s ease;
}
.nav-right a:hover { color: var(--text); }

.nav-right a[aria-current="page"] { color: var(--text); }
.nav-right a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease;
}
.theme-btn:hover { color: var(--accent); }
.theme-btn .icon-moon { display: none; }
html[data-theme="light"] .theme-btn .icon-sun  { display: none; }
html[data-theme="light"] .theme-btn .icon-moon { display: block; }

/* Menü fürs Handy (baut site.js): Auf breiten Bildschirmen unsichtbar, auf
   schmalen stehen CV, PROJECTS, BLOG und CLAVICHAT hinter „MENÜ“. */
.nav-menu-btn, .nav-menu { display: none; }
@media (max-width: 640px) {
  .site-nav.has-menu .nav-right > a { display: none; }
  .site-nav.has-menu .nav-menu-btn {
    display: flex;
    align-items: center;
    padding: 0 14px;
    border: 0;
    border-left: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .08em;
    cursor: pointer;
    transition: color .15s ease;
  }
  .site-nav.has-menu .nav-menu-btn:hover,
  .site-nav.has-menu .nav-menu-btn[aria-expanded="true"] { color: var(--accent); }
  .site-nav.has-menu .nav-menu:not([hidden]) {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 60;
    min-width: 220px;
    border: 1px solid var(--border);
    background: var(--panel);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  }
  .nav-menu a {
    position: relative;
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .12em;
    color: var(--muted);
    text-decoration: none;
  }
  .nav-menu a:first-child { border-top: 0; }
  .nav-menu a:hover,
  .nav-menu a[aria-current="page"] { color: var(--text); }
  .nav-menu a[aria-current="page"]::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: 2px;
    background: var(--accent);
  }
}
@media (max-width: 380px) {
  .brand { padding: 0 12px; }
  .nav-login > button,
  .site-nav.has-menu .nav-menu-btn { padding: 0 11px; }
}

/* ==========================================================================
   Section heading:  ▪ LABEL ────────────────
   ========================================================================== */
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
}
.section-head .sq { width: 7px; height: 7px; background: var(--accent); flex: none; }
.section-head .label {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  color: var(--muted);
  white-space: nowrap;
}
.section-head .rule { flex: 1; height: 1px; background: var(--border); }

.section-intro {
  margin: 0 0 30px;
  color: var(--text-body);
  font-size: 15.5px;
  line-height: 1.65;
}

/* ==========================================================================
   Blueprint corner ticks
   ========================================================================== */
.tickbox { position: relative; border: 1px solid var(--border); }
.tickbox::before,
.tickbox::after {
  content: "";
  position: absolute;
  width: 9px; height: 9px;
  background-image:
    linear-gradient(var(--accent), var(--accent)),
    linear-gradient(var(--accent), var(--accent));
  background-size: 9px 1px, 1px 9px;
  background-position: center center;
  background-repeat: no-repeat;
  pointer-events: none;
}
.tickbox::before { top: -5px;    left: -5px;  }
.tickbox::after  { bottom: -5px; right: -5px; }

/* ==========================================================================
   Hero (home)
   ========================================================================== */
.hero {
  border-bottom: 1px solid var(--border);
  padding: 104px 0 90px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 26px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--muted);
}
.eyebrow .dash { width: 26px; height: 1px; background: var(--accent); flex: none; }

.hero h1 {
  margin: 0 0 34px;
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(2.75rem, 8.6vw, 7rem);
  line-height: .93;
  letter-spacing: -.022em;
  color: var(--text);
}

.hero-bio {
  margin: 0 0 54px;
  max-width: 615px;
  color: var(--text-body);
  font-size: 17px;
  line-height: 1.72;
}

/* ---- Meta bar ------------------------------------------------------- */
.meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  margin-bottom: 32px;
}
.meta-cell { padding: 16px 20px; }
.meta-cell + .meta-cell { border-left: 1px solid var(--border); }

.meta-label {
  display: block;
  margin-bottom: 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.meta-value {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
}
.meta-value a { text-decoration: none; transition: color .15s ease; }
.meta-value a:hover { color: var(--accent); }

.dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 9px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none } }

/* ---- Contact buttons ------------------------------------------------ */
.contact { display: flex; flex-wrap: wrap; gap: 10px; }
.contact a {
  padding: 10px 17px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  color: var(--text-body);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.contact a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ==========================================================================
   Index grid (home)
   ========================================================================== */
.index-section { padding: 74px 0 130px; }

.index-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.card { display: block; text-decoration: none; }
.card > .card-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 26px 28px;
  transition: background .15s ease;
}
.card:hover > .card-body { background: var(--accent-soft); }

.card--featured { grid-column: 1 / -1; }
.card--featured > .card-body { min-height: 212px; justify-content: flex-end; }
.card:not(.card--featured) > .card-body { min-height: 128px; }

.card-name {
  margin: 0 0 9px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text);
}
.card-name .arrow { color: var(--accent); }

.card-desc {
  margin: 0;
  max-width: 46ch;
  color: var(--text-body);
  font-size: 13.5px;
  line-height: 1.6;
}

/* ==========================================================================
   Page shell (subpages)
   ========================================================================== */
.page { padding: 74px 0 140px; }

/* ==========================================================================
   Projects
   ========================================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.project { display: flex; flex-direction: column; }
.project .card-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px 24px 20px;
  text-decoration: none;
  transition: background .15s ease;
}
.project:hover .card-body { background: var(--accent-soft); }

.project h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.005em;
  color: var(--text);
}
.project h3 .dot { margin: 0; animation: none; }

.project p {
  margin: 0 0 20px;
  color: var(--text-body);
  font-size: 13.5px;
  line-height: 1.6;
}

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.tag {
  padding: 4px 8px;
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ==========================================================================
   Blog
   ========================================================================== */
.empty-state { padding: 52px 30px; text-align: center; }
.empty-state .headline {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
}
.empty-state p {
  margin: 0;
  color: var(--text-body);
  font-size: 14.5px;
  line-height: 1.6;
}
.empty-state a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

.post-list { display: flex; flex-direction: column; gap: 12px; }
.post .card-body { display: block; padding: 22px 24px; text-decoration: none; transition: background .15s ease; }
.post:hover .card-body { background: var(--accent-soft); }
.post-date { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--muted); }
.post h3 { margin: 8px 0 8px; font-size: 16px; font-weight: 700; color: var(--text); }
.post p { margin: 0; color: var(--text-body); font-size: 13.5px; line-height: 1.6; }

/* ==========================================================================
   CV
   ========================================================================== */
.cv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 58px;
}
.cv-header h1 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -.01em;
  color: var(--text);
}
.cv-tagline,
.cv-location {
  margin: 0 0 7px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-body);
}
.cv-location { color: var(--muted); margin-bottom: 18px; }

.cv-portrait {
  width: 112px; height: 112px;
  flex: none;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--panel);
}

.icon-row { display: flex; gap: 8px; }
.icon-row a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  color: var(--text-body);
  transition: color .15s ease, border-color .15s ease;
}
.icon-row a:hover { color: var(--accent); border-color: var(--accent); }

.cv-about {
  margin: 0 0 56px;
  color: var(--text-body);
  font-size: 15px;
  line-height: 1.78;
}

.job-list { display: flex; flex-direction: column; gap: 18px; margin-bottom: 56px; }

.job { padding: 24px 26px; }
.job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.job-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.job-title-row h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.badge {
  padding: 3px 7px;
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.job-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.job-role {
  margin: 5px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-body);
}
.job-sep { border: 0; border-top: 1px solid var(--border-soft); margin: 18px 0; }
.job p.job-desc { margin: 0; color: var(--text-body); font-size: 13.5px; line-height: 1.68; }

.skill-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 56px; }
.skill-block { padding: 20px 22px; }
.skill-block h3 {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.skill-block .tags { margin-top: 0; }

/* ==========================================================================
   Command menu
   ========================================================================== */
.cmd-hint {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  padding: 11px 16px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--border);
}
kbd {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 3px;
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-body);
}

.cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 14vh 20px 20px;
  background: rgba(0,0,0,.55);
}
html[data-theme="light"] .cmd-overlay { background: rgba(40,40,40,.28); }
.cmd-overlay[hidden] { display: none; }

.cmd-panel {
  width: 100%;
  max-width: 520px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.cmd-input {
  width: 100%;
  padding: 16px 18px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
}
.cmd-input:focus { outline: none; }
.cmd-input::placeholder { color: var(--muted); }

.cmd-list { list-style: none; margin: 0; padding: 6px; max-height: 46vh; overflow-y: auto; }
.cmd-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-body);
}
.cmd-list li[aria-selected="true"] { background: var(--accent-soft); color: var(--text); }
.cmd-list li[aria-selected="true"] .cmd-kind { color: var(--accent); }
.cmd-kind {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.cmd-empty { padding: 22px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  :root { --pad: 20px; --nav-h: 48px; }
  .brand { padding: 0 16px; font-size: 12px; }
  .nav-right a { padding: 0 14px; font-size: 11px; letter-spacing: .08em; }
  .theme-btn { width: 46px; }

  .hero { padding: 64px 0 56px; }
  .hero-bio { margin-bottom: 38px; }
  .meta { grid-template-columns: repeat(2, 1fr); }
  .meta-cell:nth-child(3), .meta-cell:nth-child(4) { border-top: 1px solid var(--border); }
  .meta-cell:nth-child(3) { border-left: 0; }

  .index-section, .page { padding: 52px 0 110px; }
  .index-grid, .project-grid, .skill-grid { grid-template-columns: 1fr; }
  .card--featured > .card-body { min-height: 150px; }

  .cv-header { flex-direction: column-reverse; align-items: flex-start; gap: 22px; }
}

@media (max-width: 560px) {
  .meta { grid-template-columns: 1fr; }
  .meta-cell + .meta-cell { border-left: 0; border-top: 1px solid var(--border); }
  .job-head { flex-direction: column; gap: 8px; }
}

/* ==========================================================================
   Eigener Mauszeiger (Zielkreuz) – öffentliche Seiten, nur mit Maus.
   Den normalen Zeiger blendet schon das Stylesheet aus, ab dem ersten Bild
   der Seite – sonst blitzte er nach jedem Seitenwechsel kurz auf. Erkannt
   werden die öffentlichen Seiten am Login-Knopf oben und an der
   Befehlsleiste unten; beides gibt es nur dort. Die Budgetmaxxer-
   Produktseiten tragen dafür data-fx am <html> (nicht die Webversion).
   ========================================================================== */
@media (hover: hover) and (pointer: fine) {
  html:has(#nav-login), html:has(#nav-login) *,
  html:has(.cmd-hint), html:has(.cmd-hint) *,
  html[data-fx], html[data-fx] * { cursor: none !important; }
  html:has(#nav-login) :is(input, textarea, select, [contenteditable]),
  html:has(.cmd-hint) :is(input, textarea, select, [contenteditable]),
  html[data-fx] :is(input, textarea, select, [contenteditable]) { cursor: text !important; }
}

.reticle {
  position: fixed;
  top: 0; left: 0;
  z-index: 1000;
  width: 32px; height: 32px;
  margin: -16px 0 0 -16px;          /* Mitte des Kreuzes = Spitze des Zeigers */
  /* Differenz statt Deckfarbe: über dem dunklen Grund bleibt das Kreuz
     orange, über orangem Text wird es fast schwarz – der Text scheint
     dunkel hindurch. Über hellem Text wirkt es bläulich. Die Farbe ist
     Orange plus Hintergrund, damit nach dem Abziehen genau das Orange
     der Seite übrig bleibt. */
  color: #ff7e23;
  mix-blend-mode: difference;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
}
/* Auf hellem Grund ergäbe Differenz ein blaues Kreuz. Dort multipliziert
   es: auf dem Grund orange, über Text dunkler. */
html[data-theme="light"] .reticle {
  color: var(--accent);
  mix-blend-mode: multiply;
}
.reticle.is-on { opacity: 1; }
/* Drehen und Vergrössern setzt site.js – immer eine Vierteldrehung weiter.
   site.js liest die Dauer hier aus: Beim Klick wartet das Zurückdrehen,
   bis die Rechtsdrehung fertig ist. */
.reticle-rot {
  display: block;
  transition: transform .22s cubic-bezier(.3, .7, .3, 1);
}

/* Koordinaten der Maus, oben links unter der Menüleiste */
.reticle-pos {
  position: fixed;
  top: calc(var(--nav-h) + 14px);
  left: 16px;
  z-index: 45;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
}
.reticle-pos.is-on { opacity: 1; }

/* ==========================================================================
   Grundrauschen und Lichtschein – site.js malt das Korn und bewegt das
   Licht. Beides liegt hinter dem Inhalt: auf der Seite über dem Grund
   (z-index -1), in Menüleiste und Befehlszeile über deren Grund.
   ========================================================================== */
.fx { z-index: -1; overflow: hidden; pointer-events: none; }
.fx--page { position: fixed; inset: 0; }
.fx--bar  { position: absolute; inset: 0; }

/* Korn: eine Kachel, fünf Lagen im Wechsel. Versatz in Vielfachen von
   4 px, damit das Korn auch bei 125 % Skalierung pixelgenau bleibt. */
.grain {
  position: absolute;
  inset: -160px;
  background-size: 160px 160px;
  animation: grain .19s steps(1, end) infinite;
  will-change: transform;
}
@keyframes grain {
  0%  { transform: translate(0, 0); }
  20% { transform: translate(84px, 40px); }
  40% { transform: translate(28px, 116px); }
  60% { transform: translate(132px, 72px); }
  80% { transform: translate(56px, 148px); }
}
/* Das Korn deckt den Grund zu gut zwei Dritteln ab (hell noch mehr). Die
   Rasterlinien darunter macht site.js passend zur Deckkraft kräftiger
   (--grid-line aus --grid), damit sie gleich hell bleiben. */

/* Licht: rund, Mitte knapp ein Zehntel Weiß, nach außen wie eine
   Glockenkurve auslaufend. */
.glow-move {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;              /* Nullpunkt = Mitte des Lichts */
  opacity: 0;
  transition: opacity .5s ease;
  will-change: transform;
}
.glow-move.is-on { opacity: 1; }
html[data-theme="light"] .glow-move { display: none; }
.glow-light {
  position: absolute;
  left: -480px; top: -480px;
  width: 960px; height: 960px;
  background: radial-gradient(circle closest-side,
    rgba(255,255,255,0.0800),
    rgba(255,255,255,0.0774) 10%,
    rgba(255,255,255,0.0700) 20%,
    rgba(255,255,255,0.0591) 30%,
    rgba(255,255,255,0.0466) 40%,
    rgba(255,255,255,0.0341) 50%,
    rgba(255,255,255,0.0230) 60%,
    rgba(255,255,255,0.0140) 70%,
    rgba(255,255,255,0.0074) 80%,
    rgba(255,255,255,0.0028) 90%,
    transparent);
}

/* ==========================================================================
   Aufleuchten wie eine Leuchtröhre (Name oben links, Startseite: Karten
   und Koordinaten, Projects: Projektnamen; Budgetmaxxer: Schritte und
   Funktionen, Regeln in budgetmaxxer.css)
   Harte Sprünge statt weicher Übergänge – so flackert es wie beim
   Einschalten. Beim Verlassen blendet die Farbe weich zurück.
   ========================================================================== */
@keyframes neon-on {
  0%        { color: color-mix(in srgb, var(--accent) 35%, var(--bg)); }
  12%       { color: var(--accent); }
  24%       { color: color-mix(in srgb, var(--accent) 12%, var(--bg)); }
  38%       { color: color-mix(in srgb, var(--accent) 75%, var(--bg)); }
  50%       { color: color-mix(in srgb, var(--accent) 28%, var(--bg)); }
  66%, 100% { color: var(--accent); }
}
.brand:not(.bmx-brand),
.index-grid .card-name,
.project h3,
.meta-value a { transition: color .35s ease; }
.brand:not(.bmx-brand):hover,
.index-grid .card:hover .card-name,
.project:hover h3,
.meta-value a:hover {
  color: var(--accent);
  animation: neon-on .5s steps(1, end);
}

@media print {
  body { background: #fff; color: #000; }
  .site-nav, .cmd-hint, .cmd-overlay, .reticle, .reticle-pos, .fx { display: none !important; }
  .page { padding: 0; }
  .tickbox::before, .tickbox::after { display: none; }
}

/* ==========================================================================
   Bedienelemente (geteilt mit Postfach & Dateien)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-body);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.btn--primary { color: var(--text); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-soft); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.field { display: block; margin-bottom: 18px; }
.field-label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); }

/* ==========================================================================
   Login-Fenster in der Navigation
   ========================================================================== */
.nav-login { position: relative; display: flex; align-items: stretch; }
.nav-login > button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  cursor: pointer;
  transition: color .15s ease;
}
.nav-login > button:hover,
.nav-login.open > button { color: var(--accent); }

.login-pop {
  position: absolute;
  top: calc(100% + 1px);
  right: -1px;
  z-index: 60;
  width: 308px;
  padding: 22px 22px 20px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  text-align: left;
}
.login-pop[hidden] { display: none; }
.login-pop .section-head { margin-bottom: 16px; }
.login-pop .field { margin-bottom: 14px; }
.login-pop input { font-size: 13px; padding: 9px 11px; }
.login-pop .pop-note {
  margin: 15px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
/* Hinweis auf Clavichat (setzt site.js darunter). Das Fenster steckt in
   .nav-right – dessen Menü-Link-Stil hier ausdrücklich zurücksetzen. */
.login-pop .pop-note--sc { margin-top: 12px; padding-top: 12px; }
.nav-right .login-pop .pop-note--sc a {
  display: inline;
  padding: 0;
  border: 0;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: normal;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s ease;
}
.nav-right .login-pop .pop-note--sc a:hover { color: var(--accent); }

.nav-user {
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-left: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Öffentliche Seiten: die Adresse ist ein Knopf, der ein kleines Fenster
   zum Abmelden öffnet. Beim Überfahren leuchtet sie auf wie die Karten. */
.nav-account { position: relative; display: flex; align-items: stretch; }
.nav-account > .nav-user {
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: color .35s ease;
}
.nav-user-mail { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-account > .nav-user:hover {
  color: var(--accent);
  animation: neon-on .5s steps(1, end);
}
.nav-account.open > .nav-user { color: var(--accent); }
.account-pop { width: 230px; padding: 18px 18px 18px; }
.account-pop .section-head { margin-bottom: 16px; }

@media (max-width: 900px) {
  .nav-login > button { padding: 0 14px; font-size: 11px; }
  .login-pop { width: min(300px, calc(100vw - 24px)); }
}

/* ==========================================================================
   Blog-Beiträge (posts/*.html)
   Gehört hierher und nicht in app.css: die öffentlichen Seiten laden nur
   dieses Stylesheet.
   ========================================================================== */
.post-full { margin-bottom: 10px; }

.post-full .post-date {
  display: block;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  color: var(--muted);
}

.post-full h1 {
  margin: 0 0 22px;
  font-size: clamp(1.9rem, 4.4vw, 2.7rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.022em;
  color: var(--text);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 38px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
}
/* Ohne Schlagwörter trägt die Trennlinie die Überschrift */
.post-full h1:last-of-type + .post-body { border-top: 1px solid var(--border); padding-top: 34px; }

.post-body {
  color: var(--text-body);
  font-size: 16.5px;
  line-height: 1.8;
}
.post-body > *:first-child { margin-top: 0; }
.post-body > *:last-child  { margin-bottom: 0; }

.post-body p { margin: 0 0 20px; }

.post-body h2 {
  margin: 44px 0 14px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
}
.post-body h3 {
  margin: 34px 0 12px;
  font-size: 17.5px;
  font-weight: 700;
  color: var(--text);
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.post-body ul, .post-body ol { margin: 0 0 20px; padding-left: 24px; }
.post-body li { margin-bottom: 9px; }
.post-body li::marker { color: var(--accent); }

.post-body blockquote {
  margin: 0 0 20px;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--accent);
  color: var(--text);
  font-size: 17px;
  font-style: italic;
}

.post-body pre {
  margin: 0 0 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  overflow-x: auto;
}
.post-body code {
  padding: 2px 5px;
  border: 1px solid var(--border-soft);
  background: var(--panel);
  font-family: var(--mono);
  font-size: .88em;
}
.post-body pre code { padding: 0; border: 0; background: none; }

.post-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 0 20px;
  border: 1px solid var(--border);
}

.post-body hr { margin: 34px 0; border: 0; border-top: 1px solid var(--border); }

.post-body table {
  width: 100%;
  margin: 0 0 20px;
  border-collapse: collapse;
  font-size: 14.5px;
}
.post-body th, .post-body td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
}
.post-body th { color: var(--text); font-weight: 600; }

.post-back {
  margin: 56px 0 0;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
}
.post-back a { color: var(--muted); text-decoration: none; transition: color .15s ease; }
.post-back a:hover { color: var(--accent); }

@media (max-width: 900px) {
  .post-body { font-size: 16px; }
  .post-tags { margin-bottom: 30px; padding-bottom: 24px; }
  .post-body h2 { margin-top: 34px; font-size: 20px; }
  .post-body h3 { margin-top: 28px; }
}

/* ==========================================================================
   Bilder in Beiträgen
   Gilt für die veröffentlichte Seite UND für die Vorschau im Editor —
   deshalb bewusst nicht unter .post-body verschachtelt.
   ========================================================================== */
.post-figure {
  margin: 0 0 22px;
  padding: 0;
}
.post-figure img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: 1px solid var(--border);
}
.post-figure figcaption {
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* ---- Platzierung ----------------------------------------------------- */

/* Volle Textbreite */
.post-figure.fig-full { width: 100%; }

/* Zentriert, schmaler als der Text */
.post-figure.fig-center {
  margin-left: auto;
  margin-right: auto;
}
.post-figure.fig-center figcaption { text-align: center; }

/* Über die Textspalte hinaus — wirkt nur, wo Platz ist */
.post-figure.fig-wide {
  width: min(112%, 100vw - 40px);
  margin-left: 50%;
  transform: translateX(-50%);
}

/* Text umfließt */
.post-figure.fig-left {
  float: left;
  width: 46%;
  margin: 4px 26px 18px 0;
}
.post-figure.fig-right {
  float: right;
  width: 46%;
  margin: 4px 0 18px 26px;
}

/* Umflossene Bilder dürfen den nächsten Abschnitt nicht überlappen */
.post-body h2, .post-body h3, .editor-area h2, .editor-area h3 { clear: both; }
.post-body::after, .editor-area::after { content: ""; display: block; clear: both; }

@media (max-width: 700px) {
  /* Auf dem Handy ist Textumfluss unlesbar — alles volle Breite */
  .post-figure.fig-left,
  .post-figure.fig-right,
  .post-figure.fig-wide {
    float: none;
    width: 100%;
    margin: 0 0 22px;
    transform: none;
  }
}

/* Kopfzeile einer Beitragskarte: Datum, Lesezeit und Schlagwörter in einer Zeile */
.post-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}
.post-line .post-date { margin: 0; }
.post-line .tags { margin: 0; gap: 6px; }
.post-line .tag { padding: 3px 7px; font-size: 9px; }
