/* ==========================================================================
   LAYOUT: Kopf, Menü, Spalten, Fuß.  Desktop zuerst, darunter die Handy-Regeln.
   ========================================================================== */

.skip-link { position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--ink); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* Kupferbahn ganz oben mit "Strom", der durchläuft */
.trace-line {
    height: 8px;
    background:
        repeating-linear-gradient(90deg, var(--gold) 0 12px, transparent 12px 96px) 0 0 / 96px 100% repeat-x,
        var(--copper-dim);
    animation: current 3s steps(8) infinite;
}
@keyframes current { to { background-position: 96px 0, 0 0; } }

#main { max-width: 1240px; margin: 0 auto; padding: 0 20px 24px; }

/* ---- Kopfzeile ---- */
.topbar { padding: 22px 0 10px; }

.logo { display: flex; align-items: center; gap: 20px; color: var(--silk); text-decoration: none; margin-bottom: 18px; width: fit-content; }
.logo:hover { background: none; color: var(--silk); }
.logo-robot { display: block; line-height: 0; filter: drop-shadow(5px 5px 0 var(--ink)); }
.logo-title { display: block; font-family: var(--font-pixel); font-size: 1.9rem; color: var(--gold); text-shadow: 4px 4px 0 var(--ink), 0 0 18px rgba(255, 211, 77, .35); }
.logo-sub { display: block; font-size: 1.6rem; color: var(--silk-dim); margin-top: 6px; }
.logo-sub .amp { color: var(--copper); }
.cursor { animation: blink 1s steps(1) infinite; color: var(--led-green); }
@keyframes blink { 50% { opacity: 0; } }
.px-blink { animation: ledblink 1.4s steps(1) infinite; }
@keyframes ledblink { 50% { opacity: .25; } }

/* ---- Menü: jeder Punkt sieht aus wie ein Chip mit Beinchen ---- */
.menu ul { list-style: none; margin: 0; padding: 8px 0 0; display: flex; flex-wrap: wrap; gap: 16px 12px; }
.menu li { margin: 0; }
.menu a {
    position: relative;
    display: block;
    padding: 10px 16px 8px;
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    color: var(--silk);
    background: var(--ink);
    text-decoration: none;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000;
    /* Beinchen oben und unten */
    background-image:
        linear-gradient(90deg, transparent 0 6px, var(--solder) 6px 10px, transparent 10px 20px),
        linear-gradient(90deg, transparent 0 6px, var(--solder) 6px 10px, transparent 10px 20px);
    background-size: 20px 5px, 20px 5px;
    background-position: 0 -3px, 0 calc(100% + 3px);
    background-repeat: repeat-x;
}
.menu a::before { /* Pin-1-Markierung */
    content: ''; position: absolute; left: 6px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--pcb-line);
}
.menu a { padding-left: 26px; }
.menu a:hover, .menu a:focus-visible { background-color: var(--pcb-light); color: var(--gold); transform: translateY(-2px); }
.menu .current a { color: var(--gold); background-color: var(--pcb-light); }
.menu .current a::before { background: var(--led-green); box-shadow: 0 0 8px 2px var(--led-green); }

/* ---- Spalten ---- */
.page { display: block; margin-top: 18px; }
.page.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }

main { min-width: 0; }

/* Der eigentliche Inhalt steckt in "Fenstern" */
.content_item, .content, .panel {
    background: var(--pcb);
    border: var(--px) solid var(--copper-dim);
    box-shadow: var(--panel-shadow);
    padding: 24px 28px;
    margin-bottom: 36px;
}
.content_item > :last-child, .panel > :last-child { margin-bottom: 0; }

.sidebar { position: sticky; top: 16px; }
.sidebar .panel { padding: 16px 18px; margin-bottom: 28px; font-size: 1.25rem; }
.sidebar h2 { font-size: .85rem; border-bottom: 3px dotted var(--copper-dim); padding-bottom: 8px; }

/* ---- Fuß ---- */
.site-footer { margin-top: 24px; padding-top: 18px; border-top: 4px dashed var(--copper-dim); text-align: center; color: var(--silk-dim); }
.footer-links { font-size: 1.2rem; }
.footer-small { font-size: 1.15rem; }
.footer-small .heart { display: inline-block; vertical-align: middle; line-height: 0; animation: beat 1.2s steps(2) infinite; }
@keyframes beat { 50% { transform: scale(1.25); } }
.leds { display: flex; justify-content: center; gap: 14px; margin-bottom: 14px; }
.leds i { width: 12px; height: 12px; background: var(--led-red); box-shadow: 0 0 10px 2px var(--led-red); animation: chase 1.6s steps(1) infinite; }
.leds i:nth-child(3n+2) { background: var(--led-green); box-shadow: 0 0 10px 2px var(--led-green); }
.leds i:nth-child(3n) { background: var(--led-blue); box-shadow: 0 0 10px 2px var(--led-blue); }
.leds i:nth-child(2) { animation-delay: .2s; } .leds i:nth-child(3) { animation-delay: .4s; }
.leds i:nth-child(4) { animation-delay: .6s; } .leds i:nth-child(5) { animation-delay: .8s; }
.leds i:nth-child(6) { animation-delay: 1s; }  .leds i:nth-child(7) { animation-delay: 1.2s; }
.leds i:nth-child(8) { animation-delay: 1.4s; }
@keyframes chase { 0%, 50% { opacity: 1; } 51%, 100% { opacity: .2; } }

/* ==========================================================================
   Kleinere Bildschirme (Handy / schmales Fenster)
   ========================================================================== */
@media (max-width: 960px) {
    .page.with-sidebar { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: static; }
}

@media (max-width: 640px) {
    body { font-size: 1.25rem; background-size: 24px 24px, 100% 100%; }
    #main { padding: 0 12px 16px; }
    .logo { gap: 12px; }
    .logo-robot svg { width: 56px; height: 56px; }
    .logo-title { font-size: 1.05rem; }
    .logo-sub { font-size: 1.2rem; }
    h1 { font-size: 1.05rem; }
    h2 { font-size: .9rem; }
    .content_item, .content, .panel { padding: 16px 14px; margin-bottom: 26px; }
    .menu ul { gap: 14px 8px; }
    .menu a { font-size: .6rem; padding: 9px 10px 7px 20px; }
    .menu a::before { left: 5px; }
    .hide-small { display: none; }
    pre { font-size: .75em; }
    table { display: block; overflow-x: auto; }
}
