/* ── VT323 Font ─────────────────────────────────────────────────────── */
@font-face {
    font-family: 'VT323';
    src: url("../fonts/VT323-auhAibo.woff2") format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

/* ── Global Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { overflow-x: hidden; color-scheme: dark; overflow-anchor: none; }
body {
    background: #000;
    color: #00ff41;
    font-family: 'VT323', 'Courier New', monospace;
    overflow-x: hidden;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M0 0 L16 16 M0 0 L0 10 M0 0 L10 0' stroke='%2300ff41' stroke-width='2' fill='none'/%3E%3C/svg%3E") 0 0, auto;
}

/* ── CRT Screen ────────────────────────────────────────────────────── */
.screen {
    min-height: 100vh;
    overflow-x: hidden;
    background: radial-gradient(ellipse at center, #001500 0%, #000c00 55%, #000 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 12vh 12px 80px;
    position: relative;
}

/* ── Scanlines ──────────────────────────────────────────────────────── */
.screen::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0,0,0,0.13) 2px,
        rgba(0,0,0,0.13) 4px
    );
    pointer-events: none;
    z-index: 100;
}

/* ── CRT flicker ────────────────────────────────────────────────────── */
@keyframes flicker {
    0%, 94%, 100%  { opacity: 1; }
    95%             { opacity: 0.96; }
    97%             { opacity: 0.99; }
}
.screen { animation: flicker 9s infinite ease-in-out; }

/* ── Brand logo (h1 on home / p elsewhere + local stardust) ─────────── */
.brand-logo-wrapper {
    position: relative;
    z-index: 3;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 1.4rem;
}
.brand-mark {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 1.6rem 2.4rem;
    isolation: isolate;
}
.brand-mark__dust {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}
/* h1 (home) or p (other pages) — same look either way */
.brand-logo {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0 0 0.35rem;
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center; /* KI+ on same optical line as Fake Checker */
    justify-content: center;
    gap: 0.28em;
    font-size: clamp(2.6rem, 7.5vw, 3.8rem);
    font-weight: normal;
    line-height: 1;
    letter-spacing: 0.02em;
    text-align: center;
    white-space: nowrap;
}
.brand-logo__text {
    position: relative;
    display: inline-block;
    white-space: nowrap;
    isolation: isolate;
    word-spacing: -0.18em;
}
.brand-logo__link {
    color: inherit;
    text-decoration: none;
    -webkit-text-stroke: 0;
    text-rendering: geometricPrecision;
}
.brand-logo__link:hover,
.brand-logo__link:focus-visible {
    filter: brightness(1.12);
}
/* Dual tone like mockup: Fake brighter, Checker slightly dimmer.
   Stronger bloom = optically “fatter” stroke (matches home hero). */
.brand-logo__word--fake {
    color: #8dff9e;
    text-shadow:
        0 0 2px #00ff41,
        0 0 8px #00ff41,
        0 0 18px rgba(0, 255, 65, 0.95),
        0 0 36px rgba(0, 255, 65, 0.55),
        0 0 56px rgba(0, 255, 65, 0.28),
        -1px 0 0 rgba(255, 50, 80, 0.4),
        1px 0 0 rgba(40, 160, 255, 0.35);
}
.brand-logo__word--checker {
    color: #2aea55;
    text-shadow:
        0 0 2px rgba(0, 255, 65, 0.7),
        0 0 8px rgba(0, 255, 65, 0.65),
        0 0 18px rgba(0, 220, 60, 0.5),
        0 0 32px rgba(0, 200, 50, 0.3),
        -1px 0 0 rgba(255, 50, 80, 0.28),
        1px 0 0 rgba(40, 160, 255, 0.25);
}
/* Chromatic ghost layers (glitch) — red / cyan fringe */
.brand-logo__text::before,
.brand-logo__text::after {
    content: attr(data-glitch);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    white-space: nowrap;
    pointer-events: none;
    z-index: -1;
}
.brand-logo__text::before {
    color: rgba(255, 55, 85, 0.55);
    text-shadow: none;
    clip-path: inset(0 0 52% 0);
    animation: brand-glitch-a 2.8s steps(2, end) infinite;
}
.brand-logo__text::after {
    color: rgba(50, 170, 255, 0.5);
    text-shadow: none;
    clip-path: inset(48% 0 0 0);
    animation: brand-glitch-b 3.6s steps(2, end) infinite;
}
@keyframes brand-glitch-a {
    0%, 90%, 100% { transform: translate(0, 0); opacity: 0.25; }
    91% { transform: translate(-2px, 0); opacity: 0.65; }
    93% { transform: translate(2px, 1px); opacity: 0.45; }
    96% { transform: translate(-1px, 0); opacity: 0.55; }
}
@keyframes brand-glitch-b {
    0%, 88%, 100% { transform: translate(0, 0); opacity: 0.22; }
    89% { transform: translate(2px, 0); opacity: 0.55; }
    92% { transform: translate(-2px, 0); opacity: 0.4; }
    95% { transform: translate(1px, -1px); opacity: 0.5; }
}
.brand-logo::after {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 255, 65, 0.12) 22%,
        rgba(0, 255, 65, 0.95) 50%,
        rgba(0, 255, 65, 0.12) 78%,
        transparent 100%
    );
    background-size: 220% 100%;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.55), 0 0 22px rgba(0, 255, 65, 0.25);
    opacity: 0.75;
    animation: brand-underline 4.8s ease-in-out infinite;
}
@keyframes brand-underline {
    0%, 100% {
        background-position: 100% 50%;
        opacity: 0.55;
        box-shadow: 0 0 6px rgba(0, 255, 65, 0.35), 0 0 14px rgba(0, 255, 65, 0.15);
    }
    50% {
        background-position: 0% 50%;
        opacity: 1;
        box-shadow: 0 0 12px rgba(0, 255, 65, 0.7), 0 0 28px rgba(0, 255, 65, 0.3);
    }
}

/* ── Info block ─────────────────────────────────────────────────────── */
.info {
    text-align: center;
    margin-top: 0.4rem;
    line-height: 1.45;
}
h2.info-tagline {
    font-weight: normal;
    color: #00ff41;
    text-shadow: 0 0 7.5px #00ff41, 0 0 18px rgba(0,255,65,0.4);
    letter-spacing: 1px;
}
h2 {
    font-size: 1.6rem;
    margin-top: 0.2rem;
}
/* Outlined KI+ badge — same baseline as wordmark (mockup C) */
.brand-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    top: 0;
    box-sizing: border-box;
    height: 0.92em;
    padding: 0 0.32em;
    font-size: 0.78em;
    font-family: inherit;
    font-weight: normal;
    letter-spacing: 0.08em;
    line-height: 1;
    color: #7dff95;
    background: transparent;
    border: 2px solid #00ff41;
    border-radius: 2px;
    text-shadow:
        0 0 6px #00ff41,
        0 0 14px rgba(0, 255, 65, 0.55);
    box-shadow:
        0 0 8px rgba(0, 255, 65, 0.45),
        inset 0 0 8px rgba(0, 255, 65, 0.08);
}
.info-address {
    font-size: 1.5rem;
    color: #00ff41;
    margin-top: 0.4rem;
    letter-spacing: 1px;
    animation: glow-pulse 2.8s ease-in-out infinite;
    padding: 10px;
}
@keyframes glow-pulse {
    0%   { text-shadow: 0 0 3px #00ff41, 0 0 6px rgba(0,255,65,0.3); opacity: 0.7; }
    50%  { text-shadow: 0 0 9px #00ff41, 0 0 21px rgba(0,255,65,0.7), 0 0 36px rgba(0,255,65,0.3); opacity: 1; }
    100% { text-shadow: 0 0 3px #00ff41, 0 0 6px rgba(0,255,65,0.3); opacity: 0.7; }
}

@media (max-width: 600px) {
    /* Home tagline sizes live in index.css — do not override with !important */
    .info-address { font-size: 1.2rem; padding: 20px; }
    .info { line-height: 1.1; }
}

/* ── Screen-reader only utility ─────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ── Skip-Link (nur bei Tastatur-Fokus sichtbar) ────────────────────── */
.skip-link {
    position: absolute;
    left: 50%;
    top: -200px;
    transform: translateX(-50%);
    z-index: 500;
    padding: 0.6rem 1.2rem;
    background: #000800;
    border: 2px solid #00ff41;
    color: #00ff41;
    font-family: 'VT323', monospace;
    font-size: 1.3rem;
    letter-spacing: 0.08em;
    text-decoration: none;
    box-shadow: 0 0 16px rgba(0,255,65,0.5);
    transition: top 0.15s ease-in;
}
.skip-link:focus {
    top: 0.6rem;
    outline: none;
}
main.screen:focus { outline: none; }

/* ── Reduced motion ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .screen          { animation: none !important; }
    .info-address    { animation: none !important; }
    .brand-logo::after { animation: none !important; opacity: 0.85; }
    .brand-logo__text::before,
    .brand-logo__text::after {
        animation: none !important;
        opacity: 0 !important;
        content: none;
    }
}

/* ── Site footer (home + lexikon) ───────────────────────────────────── */
.site-footer {
    position: relative;
    z-index: 3;
    width: 100%;
    align-self: stretch;
    flex-shrink: 0;
    margin-top: auto;
    background: rgba(0, 10, 0, 0.92);
    border-top: 1px solid rgba(0, 255, 65, 0.2);
}
.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem clamp(0.65rem, 2.5vw, 1.35rem);
    width: 100%;
    max-width: 100%;
    padding: 14px clamp(10px, 3vw, 32px);
    padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
}
.site-footer__primary,
.site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem clamp(0.65rem, 2.5vw, 1.35rem);
}
.site-footer__primary {
    flex: 1 1 auto;
    min-width: 0;
}
.site-footer__legal {
    flex: 0 0 auto;
    margin-left: auto;
}
.site-footer a,
.site-footer__btn {
    flex: 0 1 auto;
    max-width: 100%;
    color: rgba(0, 255, 65, 0.72);
    font-family: 'VT323', monospace;
    font-size: 1.35rem;
    letter-spacing: 0.04em;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0.15rem 0;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s;
}
.site-footer a:hover,
.site-footer a:focus-visible,
.site-footer__btn:hover,
.site-footer__btn:focus-visible {
    color: #00ff41;
    text-decoration: underline;
    outline: none;
}

@media (max-width: 480px) {
    .site-footer__nav {
        justify-content: center;
        gap: 0.35rem 0.75rem;
        padding-left: 12px;
        padding-right: 12px;
    }
    .site-footer__primary,
    .site-footer__legal {
        display: contents;
    }
    .site-footer a,
    .site-footer__btn {
        font-size: 1.45rem;
    }
}

/* ── Mobile navigation ───────────────────────────────────────────────── */
#hamburger-btn {
    display: flex;
    position: fixed;
    top: 1rem;
    right: 1.6rem;
    z-index: 350;
    background: rgba(0,6,0,0.7);
    border: 1px solid rgba(0,255,65,0.35);
    box-shadow: none;
    width: 38px;
    height: 38px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
    opacity: 1;
    transition: opacity 0.2s, border-color 0.2s;
}
#hamburger-btn:hover,
#hamburger-btn:focus-visible,
#hamburger-btn.open {
    opacity: 1;
    border-color: rgba(0,255,65,0.75);
}
#hamburger-btn span {
    display: block;
    width: 16px;
    height: 1.5px;
    background: #00ff41;
    box-shadow: none;
    transition: transform 0.2s, opacity 0.2s;
}
#hamburger-btn.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#hamburger-btn.open span:nth-child(2) { opacity: 0; }
#hamburger-btn.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

#mobile-nav-menu {
    display: none;
    position: fixed;
    top: calc(1rem + 38px + 6px);
    right: 1.6rem;
    z-index: 340;
    background: rgba(0,8,0,0.97);
    border: 1px solid rgba(0,255,65,0.6);
    box-shadow: 0 0 12px rgba(0,255,65,0.28);
    padding: 2px 0;
    min-width: 168px;
    max-width: calc(100vw - 2rem);
    flex-direction: column;
    gap: 0;
}
#mobile-nav-menu.open { display: flex; }
.nav-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(0,255,65,0.18);
    color: #00ff41;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    line-height: 1.2;
    padding: 6px 12px;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    text-shadow: 0 0 5px #00ff41;
    display: block;
    width: 100%;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}
.nav-item:last-child { border-bottom: none; }
.nav-item:hover,
.nav-item:focus {
    background: rgba(0,255,65,0.1);
    outline: none;
}
.nav-item[aria-current="page"] { background: rgba(0,255,65,0.16); }

/* ── Custom tooltips ────────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background: #000;
    color: #00ff41;
    border: 1px solid #00ff41;
    box-shadow: 0 0 8px #00ff41;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    letter-spacing: normal;
    white-space: nowrap;
    padding: 3px 10px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s, transform 0.15s;
    z-index: 300;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus::after {
    opacity: 1;
    transform: translateY(0);
}
