/* ============================================================
   moritzschacke.de — Design-System "Dark Engineering"
   ============================================================ */

@font-face {
    font-family: 'Space Grotesk';
    src: url('/assets/fonts/space-grotesk-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Space Grotesk';
    src: url('/assets/fonts/space-grotesk-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Space Grotesk';
    src: url('/assets/fonts/space-grotesk-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ---- Tokens ---- */
:root {
    /* Flächen */
    --bg:          #0c0a08;
    --bg-elev:     #14100c;
    --bg-elev-2:   #1c1610;

    /* Linien */
    --line:        rgba(236, 197, 141, 0.13);
    --line-strong: rgba(245, 158, 11, 0.32);

    /* Text */
    --text:        #ece5da;
    --text-dim:    #b3a794;
    --text-faint:  #7d735f;

    /* Akzent */
    --accent:      #f59e0b;
    --accent-soft: rgba(245, 158, 11, 0.12);
    --brand:       #b45309;

    /* Typo */
    --sans: 'Space Grotesk', system-ui, sans-serif;
    --mono: ui-monospace, 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;

    --fs-xs:   0.75rem;
    --fs-sm:   0.875rem;
    --fs-base: 1rem;
    --fs-md:   1.125rem;
    --fs-lg:   clamp(1.25rem, 1.1rem + 0.8vw, 1.6rem);
    --fs-xl:   clamp(1.6rem, 1.3rem + 1.6vw, 2.4rem);
    --fs-hero: clamp(2.2rem, 1.6rem + 3.6vw, 4rem);

    --max: 1100px;
    --space: 1rem;
    --radius: 12px;
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(180, 83, 9, 0.28), transparent),
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 100% 100%, 72px 72px, 72px 72px;
    background-attachment: fixed;
    scrollbar-color: #2a2118 var(--bg);
}

body {
    font-family: var(--sans);
    font-size: var(--fs-base);
    line-height: 1.6;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elev-2);
    border-radius: 5px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand);
}

/* ---- Aurora: langsam driftende Lichtschichten hinter allem ---- */
.aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.aurora i {
    position: absolute;
    width: 62vw;
    height: 62vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(180, 83, 9, 0.42), transparent 62%);
    top: -26vw;
    left: -14vw;
}

.aurora i:last-child {
    top: auto;
    left: auto;
    bottom: -32vw;
    right: -18vw;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.16), transparent 62%);
}

@media (prefers-reduced-motion: no-preference) {
    .aurora i {
        animation: drift-a 26s ease-in-out infinite alternate;
    }

    .aurora i:last-child {
        animation: drift-b 34s ease-in-out infinite alternate;
    }

    @keyframes drift-a {
        to { transform: translate(14vw, 10vh) scale(1.18); }
    }

    @keyframes drift-b {
        to { transform: translate(-12vw, -8vh) scale(1.12); }
    }
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p, li {
    color: var(--text-dim);
}

strong {
    color: var(--text);
    font-weight: 500;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
    text-underline-offset: 3px;
}

small {
    font-size: var(--fs-xs);
    color: var(--text-faint);
}

ul {
    padding-left: 1.25rem;
}

.container {
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
}

.mono {
    font-family: var(--mono);
}

/* ---- Section-Label:  // LABEL ──────── ---- */
.section-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--mono);
    font-size: var(--fs-xs);
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 2rem;
}

.section-label::before {
    content: '//';
    color: var(--text-faint);
}

.section-label::after {
    content: '';
    height: 1px;
    flex: 1;
    background: var(--line-strong);
}

.section {
    padding-block: clamp(3rem, 8vw, 5.5rem);
}

/* ---- Navigation ---- */
.nav {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--line);
    background: rgba(12, 10, 8, 0.82);
    backdrop-filter: blur(12px);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 3.75rem;
}

.logo {
    display: flex;
    align-items: center;
}

.logo svg {
    display: block;
    height: 2.3rem;
    width: auto;
}

.logo .logo-hex {
    stroke: var(--line-strong);
    transition: stroke 0.2s ease;
}

.logo:hover .logo-hex {
    stroke: var(--accent);
}

.logo .logo-m {
    stroke: var(--text);
    transition: stroke 0.2s ease;
}

.logo .logo-s {
    stroke: var(--accent);
    transition: stroke 0.2s ease;
}

.logo:hover .logo-m {
    stroke: var(--accent);
}

.logo:hover .logo-s {
    stroke: var(--text);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2.5vw, 1.75rem);
}

.nav-link {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding-block: 0.4rem;
}

.nav-link:hover {
    color: var(--text);
    text-decoration: none;
}

.nav-link.active {
    color: var(--accent);
}

.nav-cta {
    font-size: var(--fs-xs);
    padding: 0.45rem 0.9rem;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--mono);
    font-size: var(--fs-sm);
    font-weight: 500;
    padding: 0.75rem 1.4rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent);
    color: #1a1206;
}

.btn-primary:hover {
    box-shadow: 0 4px 24px rgba(245, 158, 11, 0.35);
    color: #1a1206;
}

.btn-ghost {
    border-color: var(--line-strong);
    color: var(--text);
    background: transparent;
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---- Chips ---- */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    list-style: none;
}

.chip {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    color: var(--text-dim);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    background: var(--bg-elev);
}

/* ---- Cards ---- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

/* Spotlight: JS setzt --mx/--my auf die Cursor-Position */
.card::before,
.stat::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(245, 158, 11, 0.13), transparent 65%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.card:hover::before,
.stat:hover::before {
    opacity: 1;
}

.card > * {
    position: relative;
}

a.card:hover {
    text-decoration: none;
    transform: translateY(-3px);
    border-color: var(--accent);
}

.card h3 {
    color: var(--text);
}

.card .card-kicker {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.card p {
    flex: 1;
}

.card .card-more {
    font-family: var(--mono);
    font-size: var(--fs-sm);
    color: var(--accent);
}

/* ---- Hero ---- */
.hero {
    position: relative;
    overflow: hidden;
    padding-block: clamp(4rem, 12vw, 8rem) clamp(3rem, 8vw, 5rem);
}

.hero-bg-name {
    position: absolute;
    right: -0.06em;
    bottom: -0.18em;
    font-size: clamp(7rem, 24vw, 21rem);
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(245, 158, 11, 0.09);
    user-select: none;
    pointer-events: none;
    white-space: nowrap;
}

.hero .container {
    position: relative;
}

.hero-type {
    font-family: var(--mono);
    font-size: var(--fs-md);
    color: var(--accent);
    margin-top: 1.5rem;
    min-height: 1.7em;
}

.hero-eyebrow {
    font-family: var(--mono);
    font-size: var(--fs-sm);
    color: var(--text-faint);
    margin-bottom: 1.25rem;
}

.hero h1 {
    max-width: 18ch;
    color: var(--text);
}

.hero h1 .accent {
    color: var(--accent);
}

.cursor {
    display: inline-block;
    width: 0.08em;
    height: 0.85em;
    margin-left: 0.12em;
    background: var(--accent);
    vertical-align: baseline;
    animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-lede {
    max-width: 56ch;
    font-size: var(--fs-md);
    margin-top: 1.5rem;
}

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 2.25rem;
}

.principles {
    font-family: var(--mono);
    font-size: var(--fs-sm);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-top: 3.5rem;
}

.principles b {
    color: var(--text-dim);
    font-weight: 500;
}

/* ---- Case-Study ---- */
.case-header {
    padding-block: clamp(3rem, 8vw, 5rem) 0;
}

.case-header .tagline {
    font-size: var(--fs-md);
    color: var(--text-dim);
    margin-top: 1rem;
    max-width: 60ch;
}

.case-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-block: 2rem;
    padding-block: 1.25rem;
    border-block: 1px solid var(--line);
}

.case-facts div {
    min-width: 12rem;
}

.case-facts dt {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 0.3rem;
}

.case-facts dd {
    color: var(--text);
    margin: 0;
}

.highlight-list {
    display: grid;
    gap: 1rem;
    padding: 0;
    list-style: none;
}

.highlight-list li {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.1rem 1.4rem;
}

.highlight-list h4 {
    color: var(--text);
    margin-bottom: 0.25rem;
}

.case-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ---- Case study: screenshot gallery ---- */
.shot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
    gap: 1.25rem;
}

.shot {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.shot-frame {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-elev);
    line-height: 0;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.shot-frame img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top center;
}

.shot-frame:hover,
.shot-frame:focus-visible {
    border-color: var(--line-strong);
    transform: translateY(-2px);
}

.shot figcaption {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.04em;
    color: var(--text-dim);
    padding-left: 0.1rem;
}

/* ---- Lightbox (via JS injiziert; ohne JS öffnet der Link das Bild direkt) ---- */
html.lightbox-open {
    overflow: hidden;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 3rem);
    background: rgba(6, 5, 4, 0.88);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.lightbox[hidden] {
    display: none;
}

.lightbox.open {
    opacity: 1;
}

.lightbox-figure {
    margin: 0;
    max-width: min(100%, 1400px);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    transform: scale(0.985);
    transition: transform 0.25s ease;
}

.lightbox.open .lightbox-figure {
    transform: none;
}

.lightbox img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    margin-inline: auto;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--bg-elev);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.lightbox figcaption {
    text-align: center;
    font-family: var(--mono);
    font-size: var(--fs-sm);
    color: var(--text-dim);
}

.lightbox-count {
    color: var(--text-faint);
    margin-left: 0.6rem;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(20, 16, 12, 0.72);
    color: var(--text);
    font-family: var(--sans);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    border-color: var(--line-strong);
    background: var(--bg-elev-2);
}

.lightbox-close {
    top: clamp(1rem, 3vw, 2rem);
    right: clamp(1rem, 3vw, 2rem);
    font-size: 1.2rem;
}

.lightbox-prev {
    left: clamp(0.5rem, 2vw, 2rem);
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: clamp(0.5rem, 2vw, 2rem);
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    transform: translateY(-50%) scale(1.06);
}

.lightbox-nav[hidden] {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .lightbox,
    .lightbox-figure {
        transition: none;
    }
}

/* ---- CV: Git-Log-Timeline ---- */
.tl {
    position: relative;
    margin-top: 1rem;
    padding-left: 2.9rem;
}

.tl::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--line);
}

.tl-fill {
    position: absolute;
    left: 10px;
    top: 6px;
    width: 2px;
    height: 0;
    max-height: calc(100% - 12px);
    background: linear-gradient(to bottom, var(--accent), rgba(245, 158, 11, 0.25));
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.tl-item {
    position: relative;
    margin-bottom: 1.4rem;
}

.tl-node {
    position: absolute;
    left: -2.9rem;
    top: 0.55rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--line-strong);
}

.tl-node::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.tl-item.head .tl-node {
    border-color: #35d49b;
    animation: pulse 2s ease-out infinite;
}

.tl-item.head .tl-node::after {
    background: #35d49b;
}

.tl-card {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.tl-card:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.tl-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem;
    font-family: var(--mono);
    font-size: var(--fs-xs);
}

.tl-hash {
    color: var(--text-faint);
}

.tl-date {
    color: var(--accent);
}

.tl-head-badge {
    color: #35d49b;
    border: 1px solid rgba(53, 212, 155, 0.45);
    border-radius: 999px;
    padding: 0.05rem 0.6rem;
}

.tl-title {
    font-size: var(--fs-md);
    font-weight: 500;
    color: var(--text);
    margin-top: 0.5rem;
}

.tl-desc {
    margin-top: 0.4rem;
}

.tl-loc {
    margin-top: 0.5rem;
}

.tl-loc a {
    font-size: var(--fs-xs);
}

/* ---- CV (Altbestand) ---- */
.cv-item {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-block: 1rem;
}

.cv-item .cv-date {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    color: var(--accent);
    margin-right: 0.75rem;
}

.cv-item .cv-title {
    font-weight: 500;
    color: var(--text);
}

.cv-description {
    padding-block: 0.6rem;
    color: var(--text-dim);
}

.cv-location a {
    font-size: var(--fs-xs);
}

.cv-school h2 {
    margin-top: 2.5rem;
}

.cv-school h2:first-child {
    margin-top: 0;
}

/* ---- Tech ---- */
.tech-collection {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-block: 1rem 2.5rem;
}

.tech-collection svg {
    display: block;
    width: clamp(2.5rem, 5vw, 3.5rem);
    height: clamp(2.5rem, 5vw, 3.5rem);
    fill: var(--text-dim);
    transition: fill 0.15s ease, transform 0.15s ease;
}

.tech-collection div:hover svg {
    fill: var(--accent);
    transform: translateY(-2px);
}

/* ---- Footer ---- */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
    background: var(--bg-elev);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding-block: 2rem;
}

.footer-claim {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    color: var(--text-faint);
}

.socials {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.social-item svg {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    fill: var(--text-dim);
    transition: fill 0.15s ease;
}

.social-item:hover svg {
    fill: var(--accent);
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: var(--fs-xs);
}

.footer-legal a {
    color: var(--text-faint);
}

.footer-legal a:hover {
    color: var(--accent);
}

/* ---- Page (generische Inhaltsseiten) ---- */
.page {
    padding-block: clamp(3rem, 8vw, 5rem);
}

.page > h1,
.page > h2 {
    margin-bottom: 1.5rem;
}

.page p + p,
.page p + ul,
.page ul + p,
.page h3,
.page h4 {
    margin-top: 1rem;
}

/* ---- Verfügbarkeits-Badge ---- */
.badge-avail {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    margin-bottom: 1.75rem;
    background: var(--bg-elev);
}

.badge-avail:hover {
    text-decoration: none;
    border-color: var(--accent);
    color: var(--text);
}

.badge-avail .dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #35d49b;
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(53, 212, 155, 0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(53, 212, 155, 0); }
    100% { box-shadow: 0 0 0 0 rgba(53, 212, 155, 0); }
}

/* ---- Stats ---- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1.25rem;
}

.stat {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-elev);
    padding: 1.4rem 1.5rem;
}

.stat-value {
    font-family: var(--mono);
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.stat-label {
    font-size: var(--fs-sm);
    color: var(--text-dim);
    margin-top: 0.35rem;
}

/* ---- CTA-Band ---- */
.cta-band {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background:
        radial-gradient(ellipse 70% 120% at 50% 130%, rgba(245, 158, 11, 0.16), transparent),
        var(--bg-elev);
    padding: clamp(2.25rem, 6vw, 4rem);
    text-align: center;
}

.cta-band h2 {
    color: var(--text);
    max-width: 22ch;
    margin-inline: auto;
}

.cta-band p {
    max-width: 48ch;
    margin: 1rem auto 0;
}

.cta-band .hero-ctas {
    justify-content: center;
}

.cta-band .cta-mail {
    margin-top: 1.5rem;
    font-family: var(--mono);
    font-size: var(--fs-xs);
    color: var(--text-faint);
}

.cta-band .cta-mail a {
    color: var(--text-dim);
}

.cta-band .cta-mail a:hover {
    color: var(--accent);
}

/* ---- Problem-Zitate (Tech) ---- */
.problem-q {
    font-family: var(--mono);
    font-size: var(--fs-md);
    color: var(--text);
    line-height: 1.4;
}

/* ---- Key-Value-Listen (Tech-Werkzeugkasten) ---- */
.kv {
    display: grid;
    gap: 0.8rem;
    margin: 0;
}

.kv div {
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: 1rem;
    align-items: baseline;
}

.kv dt {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.kv dd {
    margin: 0;
    color: var(--text-dim);
    font-size: var(--fs-sm);
}

@media screen and (max-width: 40em) {
    .kv div {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }
}

/* ---- Fakten-Leiste ---- */
.facts-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2.75rem;
    border-block: 1px solid var(--line);
    padding-block: 1rem;
    font-family: var(--mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.facts-bar b {
    color: var(--accent);
    font-weight: 500;
}

/* ---- Featured-Card ---- */
.card-featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
}

.card-featured > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.card-featured .metrics {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    border-left: 1px solid var(--line);
    padding-left: 2rem;
    margin: 0;
    min-width: 12rem;
}

.metric-value {
    font-family: var(--mono);
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--accent);
    line-height: 1.1;
}

.metric-label {
    font-size: var(--fs-xs);
    color: var(--text-dim);
    margin: 0;
}

@media screen and (max-width: 40em) {
    .card-featured {
        grid-template-columns: 1fr;
    }

    .card-featured .metrics {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1.5rem;
        border-left: none;
        border-top: 1px solid var(--line);
        padding: 1.25rem 0 0;
    }
}

/* ---- Terminal ---- */
.terminal {
    background: #0a0806;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: var(--fs-xs);
    color: var(--text-faint);
}

.terminal-bar i {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    display: inline-block;
}

.terminal-bar i:nth-child(1) { background: #ff5f57; }
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }

.terminal-bar .terminal-title {
    margin-left: 0.6rem;
}

.terminal pre {
    padding: 1.25rem 1.5rem;
    font-family: var(--mono);
    font-size: var(--fs-sm);
    line-height: 1.75;
    overflow-x: auto;
    color: var(--text-dim);
}

.t-key { color: var(--accent); }
.t-str { color: #35d49b; }
.t-fn  { color: #8ab4f8; }
.t-com { color: var(--text-faint); }

/* Interaktives Terminal */
.term-out {
    min-height: 8rem;
    max-height: 20rem;
    overflow-y: auto;
    white-space: pre-wrap;
}

.term-out b {
    color: var(--accent);
    font-weight: 500;
}

.term-out .t-cmd {
    color: var(--text);
}

.term-input-line {
    display: flex;
    gap: 0.6rem;
    padding: 0 1.5rem 1.25rem;
    font-family: var(--mono);
    font-size: var(--fs-sm);
    align-items: baseline;
}

.term-prompt {
    color: #35d49b;
    white-space: nowrap;
}

.term-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font: inherit;
    caret-color: var(--accent);
}

/* ---- Kontakt-Dialog ---- */
.contact-form {
    max-width: 820px;
}

.contact-step {
    margin-bottom: 2.25rem;
}

.contact-step h3 {
    color: var(--text);
    margin-bottom: 1rem;
}

.step-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--mono);
    font-size: var(--fs-sm);
    margin-right: 0.5rem;
}

/* Wizard-Modus (JS): Schritte erscheinen nacheinander */
.contact-form.wizard .contact-step {
    display: none;
}

.contact-form.wizard .contact-step.is-visible {
    display: block;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
}

.option-grid.is-hidden {
    display: none;
}

.option-grid + .option-grid {
    margin-top: 0.9rem;
}

.option-card {
    display: grid;
    gap: 0.3rem;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.option-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
}

.option-card:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.option-card input {
    accent-color: var(--accent);
    justify-self: start;
}

.option-card strong {
    color: var(--text);
}

.option-card span {
    font-size: var(--fs-sm);
    color: var(--text-dim);
}

.contact-flash {
    border-radius: var(--radius);
    padding: 1.1rem 1.4rem;
    margin-bottom: 2rem;
    font-size: var(--fs-sm);
}

.contact-flash.is-ok {
    border: 1px solid rgba(53, 212, 155, 0.5);
    background: rgba(53, 212, 155, 0.08);
    color: var(--text);
}

.contact-flash.is-error {
    border: 1px solid rgba(255, 107, 107, 0.5);
    background: rgba(255, 107, 107, 0.07);
    color: var(--text);
}

.contact-skip {
    margin-top: 0.5rem;
}

.skip-link {
    background: none;
    border: none;
    color: var(--text-faint);
    font-family: var(--mono);
    font-size: var(--fs-xs);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.skip-link:hover {
    color: var(--accent);
}

/* Honeypot: für Menschen unsichtbar, für Bots ein normales Feld */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---- Logbuch: Artikel-Typografie ---- */
.prose-wrap {
    max-width: 760px;
    margin-inline: auto;
}

.prose {
    margin-top: 2.5rem;
}

.prose h2,
.prose h3 {
    color: var(--text);
    margin: 2.2rem 0 0.8rem;
}

.prose h2 {
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--line);
}

.prose p,
.prose li {
    color: var(--text-dim);
    line-height: 1.75;
}

.prose p {
    margin-bottom: 1.1rem;
}

.prose ul,
.prose ol {
    margin: 0 0 1.1rem 1.4rem;
    padding: 0;
}

.prose li {
    margin-bottom: 0.35rem;
}

.prose blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.6rem 1.2rem;
    margin: 1.4rem 0;
    background: var(--bg-elev);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.prose blockquote p {
    margin: 0;
    color: var(--text);
}

.prose code {
    font-family: var(--mono);
    font-size: 0.9em;
    background: var(--bg-elev-2);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 0.1em 0.4em;
}

.prose pre {
    background: #0a0806;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem;
    overflow-x: auto;
    margin: 1.4rem 0;
    font-family: var(--mono);
    font-size: var(--fs-sm);
    line-height: 1.7;
    color: var(--text-dim);
}

.prose pre code {
    background: none;
    border: none;
    padding: 0;
}

.prose hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 2.2rem 0;
}

.prose img {
    max-width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

/* ---- Chips als Links / aktiver Tag ---- */
a.chip:hover {
    text-decoration: none;
    border-color: var(--accent);
    color: var(--text);
}

.chip-active {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---- Admin-Tabellen ---- */
.admin-table {
    display: grid;
    gap: 0.75rem;
}

.admin-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.admin-row > div:first-child {
    display: grid;
    gap: 0.15rem;
}

.admin-row-status {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.admin-row-status.is-live { color: #35d49b; }
.admin-row-status.is-draft { color: var(--text-faint); }

.admin-row-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.admin-row-actions .btn {
    padding: 0.4rem 0.8rem;
    font-size: var(--fs-xs);
}

.form-status {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    color: #35d49b;
    margin-top: 1rem;
}

.form-mono {
    font-family: var(--mono);
    line-height: 1.6;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--mono);
    font-size: var(--fs-sm);
    color: var(--text-dim);
    cursor: pointer;
}

.form-check input {
    accent-color: var(--accent);
    width: 1.05rem;
    height: 1.05rem;
}

/* ---- Analytics (Admin) ---- */
.stat-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 220px;
    padding: 1.25rem;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.stat-col {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: flex-end;
    min-width: 0;
}

.stat-col i {
    display: flex;
    align-items: flex-end;
    width: 100%;
    min-height: 2px;
    background: color-mix(in srgb, var(--accent) 25%, transparent);
    border-radius: 2px 2px 0 0;
}

.stat-col b {
    display: block;
    width: 100%;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
}

.stat-legend {
    margin-top: 0.75rem;
    font-family: var(--mono);
    font-size: var(--fs-xs);
    color: var(--text-faint);
}

.stat-key {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 2px;
    margin: 0 0.35rem 0 0.9rem;
    vertical-align: baseline;
}

.stat-key:first-of-type {
    margin-left: 0;
}

.stat-key-views {
    background: color-mix(in srgb, var(--accent) 25%, transparent);
}

.stat-key-uniques {
    background: var(--accent);
}

.stat-rows {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.5rem;
}

.stat-row {
    display: grid;
    grid-template-columns: minmax(110px, 40%) 1fr auto;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--mono);
    font-size: var(--fs-xs);
}

.stat-row-label {
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-row-bar {
    height: 6px;
    background: color-mix(in srgb, var(--line) 60%, transparent);
    border-radius: 3px;
    overflow: hidden;
}

.stat-row-bar i {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
}

.stat-row-num {
    color: var(--text);
    min-width: 2.5ch;
    text-align: right;
    white-space: nowrap;
}

.stat-row-num em {
    color: var(--text-faint);
    font-style: normal;
    margin-left: 0.35ch;
}

.stat-chart-mini {
    height: 110px;
    padding: 0.9rem;
    gap: 2px;
    margin-top: 0.75rem;
}

.stat-chart-mini .stat-col i {
    background: var(--accent);
    opacity: 0.85;
}

.chip-links {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

/* ---- Formulare (Admin) ---- */
.admin-form {
    padding: 1.5rem;
}

.form-field {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
}

.form-field label {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.form-input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    color: var(--text);
    font-family: var(--mono);
    font-size: var(--fs-sm);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-error {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    color: #ff6b6b;
    margin-bottom: 1rem;
}

/* ---- Cursor-Glow ---- */
#cursor-glow {
    position: fixed;
    left: 0;
    top: 0;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.09), transparent 60%);
    pointer-events: none;
    mix-blend-mode: screen;
    transform: translate(-50%, -50%);
    z-index: 1;
    display: none;
}

/* ---- Scroll-Reveal (JS setzt .reveal, IntersectionObserver .revealed) ---- */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(18px);
        transition: opacity 0.55s ease, transform 0.55s ease;
    }

    .reveal.revealed {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .badge-avail .dot,
    .cursor {
        animation: none;
    }
}

/* ---- Custom-Cursor-Ring ---- */
#cursor-ring {
    position: fixed;
    left: 0;
    top: 0;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(245, 158, 11, 0.55);
    border-radius: 50%;
    pointer-events: none;
    z-index: 50;
    display: none;
    transition: width 0.18s ease, height 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

#cursor-ring.grow {
    width: 56px;
    height: 56px;
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.06);
}

/* ---- Cockpit-HUD ---- */
.hud {
    position: fixed;
    left: 1.1rem;
    bottom: 1rem;
    z-index: 15;
    display: flex;
    gap: 1.1rem;
    font-family: var(--mono);
    font-size: var(--fs-xs);
    color: var(--text-faint);
    pointer-events: none;
    align-items: center;
}

.hud .hud-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #35d49b;
    animation: pulse 2.4s ease-out infinite;
}

@media screen and (max-width: 68em), (pointer: coarse) {
    .hud {
        display: none;
    }
}

/* ---- H1: Shine-Sweep ---- */
@media (prefers-reduced-motion: no-preference) {
    .hero h1 {
        background: linear-gradient(115deg, var(--text) 0%, var(--text) 38%, #ffffff 47%, var(--accent) 50%, #ffffff 53%, var(--text) 62%, var(--text) 100%);
        background-size: 300% 100%;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.19s both, shine 7s ease-in-out 2s infinite;
    }

    .hero h1 .accent {
        -webkit-text-fill-color: var(--accent);
    }

    @keyframes shine {
        0%, 55%, 100% { background-position: 110% 0; }
        75% { background-position: -10% 0; }
    }
}

/* ---- Cards: Holo-Scan beim Hover ---- */
.card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -45%;
    height: 45%;
    background: linear-gradient(180deg, transparent, rgba(245, 158, 11, 0.08), transparent);
    opacity: 0;
    pointer-events: none;
}

.card:hover::after {
    opacity: 1;
    animation: holo-scan 1.1s ease-in-out;
}

@keyframes holo-scan {
    from { transform: translateY(0); }
    to   { transform: translateY(340%); }
}

/* ---- Kapitel-Nummern auf Section-Labels ---- */
body {
    counter-reset: sec;
}

.section-label::before {
    counter-increment: sec;
    content: counter(sec, decimal-leading-zero) ' //';
}

/* ---- Overdrive (Konami / Terminal-Befehl) ---- */
html.overdrive {
    --accent: #ffb84d;
}

html.overdrive body {
    animation: hypershake 0.4s ease;
}

html.overdrive .btn-primary {
    box-shadow: 0 0 36px rgba(245, 158, 11, 0.85);
}

html.overdrive .card,
html.overdrive .stat,
html.overdrive .terminal {
    border-color: var(--accent);
    box-shadow: 0 0 26px rgba(245, 158, 11, 0.18);
}

@keyframes hypershake {
    10% { transform: translate(-7px, 3px); }
    30% { transform: translate(6px, -4px); }
    50% { transform: translate(-4px, 2px); }
    70% { transform: translate(3px, -2px); }
    90% { transform: translate(-1px, 1px); }
}

/* ---- Automation: alles sofort sichtbar ---- */
.no-anim *,
.no-anim *::before,
.no-anim *::after {
    animation: none !important;
    transition: none !important;
}

/* ---- Boot-Sequenz (einmal pro Session, via JS injiziert) ---- */
#boot {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

#boot::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 3px);
    pointer-events: none;
}

#boot.done {
    opacity: 0;
    pointer-events: none;
}

#boot pre {
    font-family: var(--mono);
    font-size: var(--fs-sm);
    line-height: 1.9;
    color: var(--text-dim);
    min-width: min(400px, 84vw);
}

#boot pre b {
    color: var(--accent);
    font-weight: 400;
}

#boot pre .ok {
    color: #35d49b;
}

/* ---- Hero-Entrance ---- */
@media (prefers-reduced-motion: no-preference) {
    .hero .badge-avail { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.05s both; }
    .hero-eyebrow      { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.12s both; }
    .hero h1           { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.19s both; }
    .hero-type         { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.26s both; }
    .hero-lede         { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.33s both; }
    .hero-ctas         { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.40s both; }
    .principles        { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.47s both; }

    @keyframes rise {
        from {
            opacity: 0;
            transform: translateY(26px);
        }
    }
}

/* ---- 3D-Tilt auf Cards (JS setzt transform inline) ---- */
.card {
    will-change: transform;
}

/* ---- View-Transitions (Chromium; andere ignorieren es) ---- */
@view-transition {
    navigation: auto;
}

/* ---- Scroll-Progress ---- */
#progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
    z-index: 20;
}

/* ---- Partikel-Canvas im Hero ---- */
#particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ---- H1-Glitch beim Hover ---- */
@media (prefers-reduced-motion: no-preference) {
    .hero h1:hover {
        animation: glitch 0.4s steps(2) 2;
    }

    @keyframes glitch {
        0%   { text-shadow: 3px 0 rgba(255, 59, 107, 0.7), -3px 0 rgba(245, 158, 11, 0.7); }
        25%  { text-shadow: -3px 0 rgba(255, 59, 107, 0.7), 3px 0 rgba(245, 158, 11, 0.7); }
        50%  { text-shadow: 2px 2px rgba(255, 59, 107, 0.6), -2px -2px rgba(245, 158, 11, 0.6); }
        100% { text-shadow: none; }
    }
}

/* ---- Footer: Sprachumschalter ---- */
.footer-langs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    margin-top: 0.9rem;
    font-family: var(--mono);
    font-size: var(--fs-xs);
}

.footer-langs a {
    color: var(--text-faint);
    text-decoration: none;
}

.footer-langs a:hover {
    color: var(--accent);
}

.footer-langs a.is-current {
    color: var(--accent);
}

/* ---- Fehlerseiten ---- */
.error-page {
    display: grid;
    min-height: 60vh;
    align-items: center;
}

.error-hero {
    max-width: 760px;
    margin-inline: auto;
    text-align: center;
    padding-block: 3rem;
}

.error-code {
    line-height: 1;
    margin: 1.5rem 0 0.5rem;
}

.error-digits {
    position: relative;
    display: inline-block;
    font-family: var(--mono);
    font-weight: 700;
    font-size: clamp(6rem, 24vw, 13rem);
    letter-spacing: -0.04em;
    color: var(--accent);
    text-shadow: 0 0 60px rgba(245, 158, 11, 0.35);
}

.error-digits::before,
.error-digits::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
    .error-digits::before {
        color: rgba(255, 59, 107, 0.8);
        animation: error-glitch-a 3.2s infinite steps(1);
    }

    .error-digits::after {
        color: rgba(255, 220, 130, 0.8);
        animation: error-glitch-b 2.7s infinite steps(1);
    }

    @keyframes error-glitch-a {
        0%, 92%, 100% { opacity: 0; transform: none; clip-path: none; }
        93% { opacity: 0.9; transform: translate(-6px, 2px); clip-path: inset(12% 0 55% 0); }
        95% { opacity: 0.9; transform: translate(5px, -3px); clip-path: inset(60% 0 8% 0); }
        97% { opacity: 0; }
    }

    @keyframes error-glitch-b {
        0%, 88%, 100% { opacity: 0; transform: none; clip-path: none; }
        89% { opacity: 0.8; transform: translate(6px, 1px); clip-path: inset(40% 0 30% 0); }
        91% { opacity: 0.8; transform: translate(-4px, 3px); clip-path: inset(5% 0 75% 0); }
        94% { opacity: 0; }
    }
}

.error-page h1 {
    margin-top: 0.5rem;
}

.error-lede {
    margin-inline: auto;
    margin-top: 1rem;
}

.error-terminal {
    max-width: 640px;
    margin: 2.5rem auto 0;
    text-align: left;
}

.error-terminal .t-dim {
    color: var(--text-faint);
}

.error-caret {
    display: inline-block;
    width: 0.7ch;
    height: 1em;
    background: var(--accent);
    vertical-align: text-bottom;
}

@media (prefers-reduced-motion: no-preference) {
    .error-caret {
        animation: error-caret-blink 1.1s steps(1) infinite;
    }

    @keyframes error-caret-blink {
        0%, 49% { opacity: 1; }
        50%, 100% { opacity: 0; }
    }
}

.error-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 2.25rem;
}

/* ---- Nav: Ctrl+K-Hint ---- */
.nav-kbd {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    color: var(--text-faint);
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    white-space: nowrap;
}

.nav-kbd:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ---- Command-Palette ---- */
.palette {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(6, 5, 4, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 14vh 1rem 0;
}

.palette[hidden] {
    display: none;
}

.palette-box {
    width: 100%;
    max-width: 560px;
    background: var(--bg-elev);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.palette-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--mono);
    font-size: var(--fs-md);
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--line);
    caret-color: var(--accent);
}

.palette-list {
    list-style: none;
    padding: 0.4rem;
    margin: 0;
    max-height: 46vh;
    overflow-y: auto;
}

.palette-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    color: var(--text-dim);
    cursor: pointer;
    font-size: var(--fs-sm);
}

.palette-item.selected {
    background: var(--accent-soft);
    color: var(--text);
}

.palette-item kbd,
.palette-foot kbd {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    color: var(--text-faint);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 0.1rem 0.45rem;
    background: var(--bg);
}

.palette-foot {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    color: var(--text-faint);
    padding: 0.7rem 1.25rem;
    border-top: 1px solid var(--line);
}

/* ---- Matrix-Canvas ---- */
#matrix-canvas {
    position: fixed;
    inset: 0;
    z-index: 40;
    pointer-events: none;
    transition: opacity 0.7s ease;
}

/* ---- Print (CV & Co.) ---- */
@media print {
    body {
        display: block;
        background: #fff;
        color: #000;
    }

    .nav,
    .site-footer,
    .cta-band,
    .marquee,
    .badge-avail,
    .hero-bg-name,
    #cursor-glow,
    #progress,
    #particles,
    .palette {
        display: none !important;
    }

    body * {
        color: #000 !important;
        background: #fff !important;
        border-color: #bbb !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .tl::before,
    .tl-fill {
        background: #999 !important;
    }

    .tl-loc a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.75em;
        color: #555 !important;
    }

    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ---- Kleiner Viewport ---- */
@media screen and (max-width: 40em) {
    .nav-links {
        gap: 0.75rem;
    }

    .nav-cta,
    .nav-kbd {
        display: none;
    }

    .case-facts {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ============================================================
   Easter Eggs
   ============================================================ */

/* ---- Egg-Zähler im HUD ---- */
#egg-count {
    pointer-events: auto;
    cursor: help;
    color: var(--accent);
    transition: text-shadow 0.3s ease;
}

#egg-count.egg-complete {
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
}

/* ---- Achievement-Toasts ---- */
#egg-toasts {
    position: fixed;
    right: 1rem;
    top: 4.5rem;
    z-index: 82;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: min(340px, 86vw);
}

.egg-toast {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    background: linear-gradient(120deg, var(--bg-elev-2), var(--bg-elev));
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 22px rgba(245, 158, 11, 0.12);
    font-family: var(--mono);
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.egg-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.egg-toast b {
    color: var(--accent);
    font-size: var(--fs-sm);
}

.egg-toast span {
    color: var(--text-dim);
    font-size: var(--fs-xs);
}

.egg-toast-gold {
    border-color: #ffd18c;
    border-left-color: #ffd18c;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 34px rgba(245, 158, 11, 0.4);
}

.egg-toast-gold b {
    color: #ffd18c;
}

/* ---- Phosphor-Mode (grüner CRT) ---- */
html.phosphor body {
    filter: hue-rotate(96deg) saturate(1.18) brightness(1.02);
}

html.phosphor::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 78;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
}

/* ---- Barrel Roll ---- */
html.barrel-roll {
    overflow: hidden;
}

html.barrel-roll body {
    animation: barrelroll 1s ease-in-out;
}

@keyframes barrelroll {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---- Zero-G ---- */
html.zerog .card,
html.zerog .stat,
html.zerog .chip,
html.zerog .metric-value,
html.zerog .btn,
html.zerog .facts-bar span {
    animation: floaty 3.5s ease-in-out infinite;
}

html.zerog .card:nth-child(2n),
html.zerog .chip:nth-child(2n) {
    animation-duration: 4.2s;
    animation-delay: 0.3s;
}

html.zerog .card:nth-child(3n),
html.zerog .chip:nth-child(3n) {
    animation-duration: 3.1s;
    animation-delay: 0.6s;
}

@keyframes floaty {
    0% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-16px) rotate(-1.4deg); }
    50% { transform: translateY(6px) rotate(1deg); }
    75% { transform: translateY(-10px) rotate(0.8deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* ---- Confetti ---- */
.fx-confetti {
    position: fixed;
    inset: 0;
    z-index: 79;
    pointer-events: none;
}

/* ---- DVD-Bouncing-Logo ---- */
.dvd-logo {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 56;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.12em;
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 10px;
    padding: 0.4rem 0.7rem;
    background: rgba(12, 10, 8, 0.62);
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.35);
    filter: hue-rotate(var(--dvd-hue, 0deg));
    will-change: transform;
    pointer-events: none;
    transition: box-shadow 0.3s ease;
}

.dvd-logo.corner {
    box-shadow: 0 0 46px 12px var(--accent), 0 0 90px rgba(245, 158, 11, 0.6);
}

/* ---- Snake ---- */
.game-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(12, 10, 8, 0.72);
    backdrop-filter: blur(4px);
}

.game-box {
    background: linear-gradient(150deg, var(--bg-elev-2), var(--bg-elev));
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(245, 158, 11, 0.15);
}

.game-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.6rem;
    font-family: var(--mono);
    font-size: var(--fs-sm);
    color: var(--text);
}

.game-score {
    color: var(--accent);
    margin-left: auto;
}

.game-close {
    font-family: var(--mono);
    font-size: var(--fs-xs);
    color: var(--text-dim);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.game-close:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.game-canvas {
    display: block;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
    image-rendering: pixelated;
    max-width: 100%;
}

.game-hint {
    margin-top: 0.55rem;
    font-family: var(--mono);
    font-size: var(--fs-xs);
    color: var(--text-faint);
    text-align: center;
}

/* Train im Terminal in Akzentfarbe */
#term-out .t-train {
    color: var(--accent);
}

/* ---- Bit — Haustier ---- */
.pet {
    position: fixed;
    right: 1.6rem;
    bottom: 1.8rem;
    z-index: 59;
    width: 78px;
    height: 84px;
    cursor: grab;
    user-select: none;
    touch-action: none;
    -webkit-user-select: none;
    animation: pet-enter 0.7s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

.pet.pet-drag {
    cursor: grabbing;
}

.pet-body {
    position: relative;
    width: 78px;
    height: 70px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid var(--accent);
    border-radius: 18px;
    background: radial-gradient(120% 120% at 50% 20%, var(--bg-elev-2), var(--bg));
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5), 0 0 26px rgba(245, 158, 11, 0.4);
    animation: pet-bob 3.2s ease-in-out infinite;
}

/* Pulsierender Halo — dauerhaft dezent, kräftig im Aufmerksamkeits-Modus */
.pet-body::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 22px;
    border: 2px solid var(--accent);
    opacity: 0;
    pointer-events: none;
}

.pet.pet-attention .pet-body::before {
    animation: pet-halo 1.6s ease-out infinite;
}

.pet.pet-attention .pet-body {
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5), 0 0 40px rgba(245, 158, 11, 0.7);
}

/* „klick mich"-Wink, solange Bit noch nie angefasst wurde */
.pet.pet-attention::after {
    content: '👋';
    position: absolute;
    left: -8px;
    top: -6px;
    font-size: 1.2rem;
    animation: pet-wave 1.2s ease-in-out infinite;
    transform-origin: 70% 70%;
}

.pet-antenna {
    position: absolute;
    top: -9px;
    left: 50%;
    width: 2px;
    height: 9px;
    background: var(--accent);
    transform: translateX(-50%);
}

.pet-antenna::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    transform: translateX(-50%);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.9);
    animation: pet-blink-led 2.4s ease-in-out infinite;
}

.pet-face {
    font-family: var(--mono);
    font-size: 1.4rem;
    line-height: 1;
    color: var(--accent);
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
    transition: transform 0.12s ease-out;
}

.pet.pet-sleepy .pet-body {
    animation-duration: 5s;
    opacity: 0.85;
}

.pet-bubble {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 10px;
    max-width: 200px;
    padding: 0.45rem 0.7rem;
    border: 1.5px solid var(--accent);
    border-radius: 10px;
    background: var(--bg-elev-2);
    color: var(--text);
    font-family: var(--mono);
    font-size: var(--fs-sm);
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 18px rgba(245, 158, 11, 0.22);
}

.pet-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 22px;
    border: 6px solid transparent;
    border-top-color: var(--accent);
}

.pet-bubble[hidden] {
    display: none;
}

.pet-heart {
    position: absolute;
    top: 4px;
    left: 50%;
    color: #ff6b6b;
    font-size: 1rem;
    pointer-events: none;
    animation: pet-heart-float 1.1s ease-out forwards;
}

.pet.pet-bounce .pet-body {
    animation: pet-bounce 0.6s ease;
}

@keyframes pet-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes pet-enter {
    0% { transform: translateY(120px) scale(0.4); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes pet-halo {
    0% { transform: scale(0.85); opacity: 0.9; }
    100% { transform: scale(1.35); opacity: 0; }
}

@keyframes pet-wave {
    0%, 100% { transform: rotate(-18deg); }
    50% { transform: rotate(18deg); }
}

@keyframes pet-blink-led {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

@keyframes pet-heart-float {
    0% { transform: translate(-50%, 0) scale(0.6); opacity: 0; }
    30% { opacity: 1; }
    100% { transform: translate(-50%, -34px) scale(1.1); opacity: 0; }
}

@keyframes pet-bounce {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-14px); }
    60% { transform: translateY(-4px); }
}

/* ---- Funkel-Cursor ---- */
.spark {
    position: fixed;
    z-index: 81;
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffd18c, var(--accent) 60%, transparent 70%);
    pointer-events: none;
    animation: spark-fade 0.75s ease-out forwards;
}

@keyframes spark-fade {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--sx, 0), var(--sy, 20px)) scale(0.2); opacity: 0; }
}

/* ---- Boss-Taste (Fake-Tabelle) ---- */
#boss-screen {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: flex;
    flex-direction: column;
    background: #f3f3f1;
    color: #222;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    cursor: pointer;
}

.boss-bar {
    padding: 0.5rem 1rem;
    background: #217346;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}

.boss-scroll {
    flex: 1;
    overflow: auto;
}

.boss-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.8rem;
}

.boss-table th,
.boss-table td {
    border: 1px solid #d0d0cc;
    padding: 2px 8px;
    text-align: right;
    min-width: 70px;
    white-space: nowrap;
}

.boss-table th {
    background: #e6e6e3;
    text-align: center;
    color: #444;
    position: sticky;
    top: 0;
}

.boss-table .boss-rownum {
    background: #e6e6e3;
    text-align: center;
    color: #666;
    min-width: 30px;
}

.boss-hint {
    padding: 0.4rem 1rem;
    background: #e6e6e3;
    color: #888;
    font-size: 0.75rem;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .pet,
    .pet-body,
    .pet-body::before,
    .pet.pet-attention::after,
    .pet-antenna::after {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html.zerog .card,
    html.zerog .stat,
    html.zerog .chip,
    html.zerog .metric-value,
    html.zerog .btn,
    html.zerog .facts-bar span,
    html.barrel-roll body {
        animation: none;
    }
}

/* ---- Schwebendes Chat-Terminal ---- */
.chatterm {
    position: fixed;
    right: 1.3rem;
    bottom: 1.3rem;
    z-index: 60;
    font-family: var(--mono);
}

.chatterm-launch {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1.5px solid var(--accent);
    background: var(--bg-elev-2);
    color: var(--accent);
    font-family: var(--mono);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 16px rgba(245, 158, 11, 0.25);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.chatterm-launch:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5), 0 0 26px rgba(245, 158, 11, 0.5);
}

.chatterm.open .chatterm-launch {
    display: none;
}

.chatterm-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(370px, 88vw);
    height: min(400px, 70vh);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: linear-gradient(160deg, var(--bg-elev-2), var(--bg-elev));
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(245, 158, 11, 0.12);
    overflow: hidden;
}

.chatterm-panel[hidden] {
    display: none;
}

.chatterm-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--line);
    background: var(--bg-elev);
    color: var(--text-dim);
    font-size: var(--fs-xs);
}

.chatterm-min {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0 0.3rem;
}

.chatterm-min:hover {
    color: var(--accent);
}

.chatterm-out.term-out {
    flex: 1;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 0.7rem 0.85rem;
    font-size: var(--fs-sm);
}

.chatterm .term-input-line {
    padding: 0.5rem 0.85rem;
    border-top: 1px solid var(--line);
}

@media print {
    .chatterm {
        display: none !important;
    }
}
