
@font-face {
    font-family: 'Londrina Solid';
    font-style: normal;
    font-weight: 300;
    src: url('fonts/londrina-solid-v19-latin-300.woff2') format('woff2');
}
@font-face {
    font-family: 'Londrina Solid';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/londrina-solid-v19-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Londrina Solid';
    font-style: normal;
    font-weight: 900;
    src: url('fonts/londrina-solid-v19-latin-900.woff2') format('woff2');
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 300;
    src: url('fonts/plus-jakarta-sans-v12-latin-300.woff2') format('woff2');
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/plus-jakarta-sans-v12-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 500;
    src: url('fonts/plus-jakarta-sans-v12-latin-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 600;
    src: url('fonts/plus-jakarta-sans-v12-latin-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 700;
    src: url('fonts/plus-jakarta-sans-v12-latin-700.woff2') format('woff2');
}

:root {
    --font-display: 'Londrina Solid', cursive;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --accent: #E65F2B;

    --accent-text: #A84A2B;
    --accent-2: #bbdeff;
    --accent-light: #F7EFE9;
    --bg: #FBF9F6;
    --text-main: #242424;
    --text-secondary: #605E5C;
    --border-width: 2.5px;
    --section-gap: 120px;
    --marker-bg: #FCE6DC;
}

[data-theme="dark"] {
    --bg: #1C1B1A;
    --text-main: #F5F4F2;
    --text-secondary: #A19F9D;
    --accent-light: #2D2B2A;
    --marker-bg: rgba(230, 95, 43, 0.25);
    --accent-text: var(--accent);
}

* { margin: 0; padding: 0; box-sizing: border-box; scroll-behavior: smooth; }

html, body { overflow-x: clip; }

[id] { scroll-margin-top: 90px; }

body {
    font-family: var(--font-body);
    font-size: 1.1rem;
    background-color: var(--bg);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    text-align: left;
    transition: background-color 0.3s, color 0.3s;
    position: relative;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 40px; position: relative; }
.full-width { width: 100%; }
.no-margin { margin: 0; }
.no-top-margin { margin-top: 0; }
.no-bottom-margin { margin-bottom: 0; }
.grid-clear-bottom { clear: both; margin-bottom: 0; }

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

h1, h2, h3, h4 { text-wrap: balance; }
p, li, figcaption, blockquote { text-wrap: pretty; }

#scroll-progress {
    position: fixed; top: 0; left: 0; width: 0%; height: 4px;
    background: var(--accent); z-index: 1001; transition: width 0.1s;
}

#loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg); display: flex; justify-content: center;
    align-items: center; z-index: 2000; transition: opacity 0.5s ease;
}

.loader-name {
    font-family: var(--font-display);
    font-size: 4rem; line-height: 0.8;
    text-transform: uppercase; text-align: center;
}

.breathe-span {
    display: inline-block;
    animation: letter-breathe 4s ease-in-out infinite;
    -webkit-text-stroke: var(--border-width) var(--text-main);
    paint-order: stroke fill;
}
@keyframes letter-breathe {
    0%, 100% { color: var(--accent); transform: translateY(0); }
    50% { color: #ffd5b3; transform: translateY(-5px); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
@keyframes click-me-shake {
    0%, 85%, 100% { transform: rotate(0); }
    87% { transform: rotate(-4deg) scale(1.08); }
    92% { transform: rotate(4deg) scale(1.08); }
    96% { transform: rotate(-4deg) scale(1.08); }
}

.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.2, 1, 0.3, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }

.marker {
    background-image: linear-gradient(120deg, var(--marker-bg) 0%, var(--marker-bg) 100%);
    background-repeat: no-repeat;
    background-size: 0% 100%;
    background-position: 0 80%;
    transition: background-size 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
    display: inline;
    padding: 0 4px;
}
.reveal.active .marker { background-size: 100% 100%; }

.bg-decor { position: fixed; inset: 0; width: auto; height: auto; overflow: clip; pointer-events: none; z-index: -1; }
.floating-svg { position: absolute; fill: none; stroke: var(--accent-2); stroke-width: 2.5; opacity: 0.3; transition: transform 0.2s ease-out; }
.decor-zig-top { top: 15%; right: 5%; width: 120px; }
.decor-zig-left { top: 45%; left: -2%; width: 80px; stroke: var(--accent); }
.decor-wave-bottom { bottom: 10%; right: 10%; width: 150px; opacity: 0.2; }
.decor-circle-right { top: 70%; right: 15%; width: 40px; stroke: var(--accent-2); }

@media (max-width: 750px) { .floating-svg { transform: none !important; transition: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .breathe-span {
        animation-duration: 4s !important;
        animation-iteration-count: infinite !important;
    }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .reveal.active { opacity: 1; transform: none; }
    .marker { background-size: 100% 100% !important; }
    .floating-svg { display: none; }
}

.washi-tape::before {
    content: ""; position: absolute; top: -10px; left: -15px;
    width: 60px; height: 24px; background: var(--accent);
    opacity: 0.7; transform: rotate(-15deg); z-index: 20;
    pointer-events: none;
    clip-path: polygon(2% 15%, 98% 5%, 100% 85%, 95% 95%, 5% 90%, 0% 50%);
}
.washi-tape-alt::after {
    content: ""; position: absolute; top: -8px; right: -12px;
    width: 55px; height: 22px; background: var(--accent-2);
    opacity: 0.6; transform: rotate(12deg); z-index: 20;
    pointer-events: none;
    clip-path: polygon(5% 5%, 95% 10%, 98% 90%, 90% 98%, 10% 95%, 2% 40%);
}

#lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.0); display: none;
    justify-content: center; align-items: center;
    z-index: 1000; padding: 40px; transition: background 0.4s ease;
}
#lightbox.active { background: rgba(0,0,0,0.9); }
#lightbox img {
    max-width: 85%; max-height: 85%; object-fit: contain;
    border: var(--border-width) solid #fff;
    transform: scale(0.8); opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#lightbox.active img { transform: scale(1); opacity: 1; }

.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; background: none; border: 0; color: #fff; font-size: 3.2rem; line-height: 1; padding: 10px 16px; cursor: pointer; opacity: .75; }
.lb-nav:hover { opacity: 1; }
.lb-nav[hidden] { display: none; }
.lb-prev { left: 6px; }
.lb-next { right: 6px; }
#lightbox-close {
    position: absolute; top: 20px; right: 20px;
    background: none; border: none; color: white;
    cursor: pointer; width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
}
#lightbox-close svg { width: 28px; height: 28px; stroke: white; stroke-width: 2.5; fill: none; }

nav {
    padding: 20px 0; display: flex; justify-content: flex-start;
    position: sticky; top: 0;

    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 95%, transparent);
    backdrop-filter: blur(10px); z-index: 100;
}
nav .container { width: 100%; display: flex; justify-content: space-between; align-items: center; }
nav ul { display: flex; list-style: none; gap: 25px; }
nav ul li a {
    text-decoration: none; color: var(--text-main);
    font-size: 0.75rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.1em;
}

.theme-toggle {
    background: none; border: none; color: var(--text-main);
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; width: 40px; height: 40px;
}
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: block; }

.nav-dropdown.nav-dropdown-trigger { position: relative; display: inline-block; }
.nav-dropdown-link { padding-bottom: 10px; cursor: pointer; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: -15px;
    background: var(--bg);
    border: var(--border-width) solid var(--text-main);
    border-radius: 8px;
    padding: 12px 18px;
    min-width: 180px;
    box-shadow: 6px 6px 0px var(--text-main);
    list-style: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
    z-index: 150;
}
.nav-dropdown:hover .dropdown-menu { display: flex; }
.dropdown-menu li { width: 100%; }
.dropdown-menu li a { white-space: nowrap; display: block; padding: 2px 0; }

header.hero {
    min-height: calc(100vh - 80px); display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    align-items: center; gap: 50px;
    padding: 60px 0; position: relative;
}
header.hero h1 {
    font-size: clamp(5rem, 14vw, 10rem);
    line-height: 0.8;
    margin-bottom: 30px;
    max-width: 100%;
}
header.hero .subline {
    font-size: 1.1rem; color: var(--text-main);
    font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; display: block; max-width: 100%;
}
.greeting { color: var(--accent); margin-right: 5px; }
.mobile-br { display: none; }

header.hero .about-content { min-width: 0; }
header.hero .about-visual.hero-visual { width: 100%; max-width: 380px; position: static; justify-self: end; }
.hero-visual .item.hero-portrait-frame {
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    transform: rotate(4deg) !important;
}
.image-cover { width: 100%; height: 100%; object-fit: cover; display: block; }

#about {
    padding: 60px 0 var(--section-gap);
    display: flex; flex-direction: column; gap: 60px; align-items: stretch; width: 100%;
}
.about-content h2 { font-size: 4.5rem; margin-bottom: 25px; line-height: 0.9; }
.about-content p { font-size: 1.25rem; line-height: 1.6; margin-bottom: 20px; font-weight: 500; }

.item.service-card {
    aspect-ratio: auto;
    padding: 24px 20px;
    border: 0 !important;
    background: var(--accent-light);
    background: color-mix(in srgb, var(--accent-light) 35%, var(--bg));
    box-shadow: none !important;
    transform: none !important;
    transition: none;
}
.item.service-card-image-frame {
    width: 100%; height: auto; aspect-ratio: 1 / 1;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 18px; cursor: pointer;
    border: 0 !important;
    box-shadow: none !important;
    transform: none !important;
}
.grid .service-card-image { width: 100%; height: 100%; object-fit: cover; object-position: center center; display: block; }

section.portfolio { padding-bottom: var(--section-gap); }
.section-header { margin: 80px 0 40px; display: flex; flex-direction: row; align-items: center; justify-content: space-between; }
.section-header h2 { font-size: 2.5rem; display: inline-block; position: relative; padding-right: 20px; line-height: 1; }
.section-header h2::after {
    content: ''; position: absolute; bottom: -5px; left: 0;
    width: 100%; height: 6px; background: var(--accent); border-radius: 10px;
}
section.portfolio .section-header:nth-of-type(2) h2::after { background: var(--accent-2); }
.section-header.portfolio-section-header { flex-wrap: wrap; width: 100%; margin: var(--section-gap) 0 20px; clear: both; gap: 12px; }
.section-header.portfolio-section-header--first { flex-wrap: wrap; width: 100%; margin: 0 0 20px; clear: both; }

.section-intro { width: 100%; clear: both; margin-bottom: 10px; display: block; }
.section-intro-text { font-size: 1.1rem; font-weight: normal; text-align: left; line-height: 1.4; margin: 0; }
.portfolio-intro--flex { width: 100%; clear: both; margin-bottom: 35px; display: flex; }
.portfolio-intro { width: 100%; clear: both; margin-bottom: 35px; display: block; }
.fluffel-intro-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 900; margin: 0 0 10px; line-height: 1.2; }
.fluffel-intro-subline { margin-bottom: 22px; font-size: 1.1rem; line-height: 1.6; }

.case-studies { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.project-row { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; width: 100%; }
.project-copy { flex: 1; min-width: 320px; }
.project-visual { flex: 0 0 450px; max-width: 100%; }
.item.project-image-frame { width: 100%; aspect-ratio: 4/3; cursor: pointer; }
.project-image-frame img.project-image { width: 100%; height: 100%; object-fit: cover; }
.project-title { font-family: var(--font-display); font-size: 1.8rem; margin-bottom: 10px; text-transform: uppercase; }
.project-meta { font-size: 0.9rem; font-weight: 700; color: var(--accent); margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.05em; }
.project-description { font-size: 1.05rem; line-height: 1.6; }
#auftragsarbeiten .case-studies > .project-row {
    background: var(--accent-light);
    background: color-mix(in srgb, var(--accent-light) 35%, var(--bg));
    padding: 24px 20px; border-radius: 8px; box-sizing: border-box; border: 0;
}

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; margin-bottom: 60px; overflow: visible !important; }
.item {
    grid-column: span 4; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: #fff; border: var(--border-width) solid var(--text-main);
    aspect-ratio: 1/1; position: relative; overflow: visible !important;
}
.item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item.large { grid-column: span 6; }

#grid-frei > .item,
#grid-fluffel > .item {
    transform: none;
}
#grid-frei > .item:hover,
#grid-fluffel > .item:hover {
    transform: translateY(-6px);
    box-shadow: 12px 12px 0 var(--accent-2);
}
.grid-fluffel-layout { clear: both; margin-bottom: var(--section-gap); }

.toggle-container { display: none; gap: 15px; cursor: pointer; align-items: center; }
.toggle-option { color: var(--text-main); opacity: 0.3; transition: all 0.3s; display: flex; align-items: center; }
.toggle-option.active { opacity: 1; color: var(--accent); transform: scale(1.2); }
.toggle-option svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2.5; fill: none; }

#mehr-ueber-mich.about-me-layout { width: 100%; padding: 0; margin-bottom: 0; display: flex; flex-wrap: wrap; gap: 50px; align-items: flex-start; }
#mehr-ueber-mich .about-me-portrait { flex: 0 1 340px; aspect-ratio: 4 / 5; transform: rotate(-3deg); }
#mehr-ueber-mich .about-me-copy { flex: 1 1 420px; }
.about-extras { grid-column: 1 / -1; width: 100%; clear: both; margin-top: var(--section-gap); margin-bottom: var(--section-gap); display: block !important; }
.about-extras-title { margin-bottom: 20px; font-size: 1.5rem; text-align: left; line-height: 1.3; }
.about-extras p.about-fact-copy { font-size: 1.1rem; font-weight: normal; }
.about-fact { background: rgba(0,0,0,0.02); border-radius: 8px; margin-bottom: 12px; padding: 15px; cursor: pointer; width: 100%; box-sizing: border-box; }
.about-fact-summary { font-weight: 600; font-size: 1.1rem; display: list-item; text-align: left; }
.about-fact-label { margin-left: 8px; }
.about-fact-details { margin-top: 10px; margin-bottom: 0; font-size: 1.1rem; line-height: 1.5; font-weight: normal; text-align: left; }

#kontakt { padding: 80px 0; margin-bottom: 10px; text-align: center; }
#kontakt.contact-heading-section { padding-bottom: 18px; margin-bottom: 8px; }
#kontakt .lust { font-weight: 300; font-size: 2.5rem; text-transform: uppercase; display: block; color: var(--text-secondary); margin-bottom: 10px; }
#kontakt .fluffiges { font-family: var(--font-display); font-size: clamp(4rem, 15vw, 10rem); line-height: 0.8; display: block; margin-bottom: 40px; }
.contact-divider { width: 100%; max-width: 1100px; border: 0; border-top: 1px solid var(--text-secondary); opacity: .28; margin: 50px auto 60px; }

section.fluffel-contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 0.75fr); align-items: center; gap: clamp(24px, 5vw, 70px); }
section.fluffel-contact.contact-panel { width: 100%; max-width: 1100px; margin: 0 auto 80px; }
section.fluffel-contact img[src*="zeigender_Fluffi"] { display: block; width: 100%; max-width: 360px; height: auto; justify-self: end; transform: scaleX(-1); }

.contact-email {
    font-size: 2.2rem; font-weight: 900; color: var(--text-main);
    text-decoration: none; display: inline-block;
    font-family: var(--font-display); transition: all 0.3s;
    border-bottom: 3px solid var(--accent);
}
.contact-email:hover { color: var(--accent); border-color: var(--text-main); animation-play-state: paused; }
.contact-email--static { animation: none; transition: none; }
.contact-email--pulse { animation: pulse 3s ease-in-out infinite; }
.fact-spacing { margin-bottom: 12px; }

#floating-contact {
    position: fixed; bottom: 50px; right: 50px;
    width: 65px; height: 65px; z-index: 99; text-decoration: none;
    transform: translateY(150px) scale(0.5); opacity: 0;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
    pointer-events: none;
}
#floating-contact.visible { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
#floating-contact .btn-inner {
    width: 100%; height: 100%; background: var(--accent);
    border: var(--border-width) solid var(--text-main);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: var(--text-main);
    transition: transform 0.2s;
}
#floating-contact.visible .btn-inner { animation: click-me-shake 3s infinite; }
#floating-contact:hover .btn-inner { transform: scale(1.1) rotate(-5deg); animation-play-state: paused; }
#floating-contact svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.5; }

footer {
    padding: 80px 0 60px; font-size: 0.9rem; font-weight: 600;
    color: var(--text-secondary); border-top: 1px solid rgba(0,0,0,0.05); text-align: left;
}
.footer-note { margin-top: 8px; font-weight: 500; }
.footer-credit { margin-top: 10px; font-weight: 500; }
.footer-credit a { margin-right: 0; white-space: nowrap; }
.footer-links { margin-top: 15px; display: block; }
.contact-email-plain { margin-top: 18px; font-size: 0.95rem; color: var(--text-secondary); }
.contact-email-plain a { color: var(--text-main); font-weight: 700; }
footer a { color: var(--text-main); text-decoration: none; margin-right: 30px; }

@media (max-width: 750px) {
    .container { padding: 0 25px; }

    nav { padding: 8px 0; }
    nav .container { gap: 8px; }
    nav ul { flex: 1 1 0; flex-wrap: wrap; min-width: 0; gap: 8px 6px; }
    nav ul li { min-width: 0; }
    nav ul li a { font-size: 0.65rem; letter-spacing: 0.02em; white-space: nowrap; }
    .theme-toggle { flex: 0 0 34px; width: 34px; height: 34px; }

    .nav-dropdown:hover .dropdown-menu { display: none; }
    .nav-dropdown[data-open="true"] .dropdown-menu { display: flex; }

    header.hero {
        min-height: 45vh;
        padding: 40px 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 28px;
    }
    header.hero .about-content {
        order: 2;
    }

    header.hero .about-visual.hero-visual {
        order: 1;
        align-self: center;
        justify-self: center;
        width: 100%;
        max-width: 290px;
        margin: 0 auto;
    }
    header.hero h1 {
        font-size: clamp(3rem, 15vw, 8rem) !important;
        line-height: 0.85;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    header.hero .subline { font-size: 0.85rem; }
    .mobile-br { display: block; }

    #about { text-align: left; padding-top: 40px; }
    .about-content h2 { font-size: 3.5rem; }
    #about .grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 22px;
    }
    #about .grid > article.service-card {
        grid-column: 1 / -1 !important;
        width: 100%;
        padding: 20px 18px;
        border: none !important;
        box-shadow: none !important;
        background: color-mix(in srgb, var(--accent-light) 35%, var(--bg)) !important;
    }
    #about .grid .service-card-image-frame {
        width: min(100%, 340px);
        margin: 0 auto 18px;
        aspect-ratio: 1 / 1;
        transform: rotate(-1deg) !important;
        border: none !important;
        box-shadow: none !important;
    }
    #about .grid > article.service-card:nth-child(2) .service-card-image-frame { transform: rotate(1deg) !important; }
    #about .grid > article.service-card:nth-child(3) .service-card-image-frame { transform: rotate(-0.7deg) !important; }

    #auftragsarbeiten .case-studies { grid-template-columns: minmax(0, 1fr); gap: 28px; box-sizing: border-box; }
    .project-row { flex-direction: column; align-items: stretch; gap: 20px; }
    .project-visual, .project-copy { flex: 1 1 auto; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }

    .toggle-container { display: flex; }
    .section-header.portfolio-section-header { margin-top: 64px; margin-bottom: 18px; gap: 12px; }

    #grid-frei, #grid-fluffel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    #grid-frei > .item, #grid-frei > .item.large, #grid-fluffel > .item, #grid-fluffel > .item.large { grid-column: span 1; min-width: 0; }

    #grid-frei.single-col, #grid-fluffel.single-col { display: flex; flex-direction: column; gap: 20px; }
    #grid-frei.single-col > .item, #grid-frei.single-col > .item.large, #grid-fluffel.single-col > .item, #grid-fluffel.single-col > .item.large { width: 100%; }

    #mehr-ueber-mich .about-me-portrait { width: min(100%, 340px); margin: 0 auto; }

    #kontakt .lust { font-size: 1.5rem; }
    #kontakt .fluffiges { font-size: 4.5rem; }
    .contact-email { font-size: 1.5rem; }

    section.fluffel-contact { display: flex; flex-direction: column; align-items: center; gap: 24px; }
    section.fluffel-contact.contact-panel { margin-bottom: 48px; }
    section.fluffel-contact img[src*="zeigender_Fluffi"] { width: min(78%, 320px); }

    #floating-contact { bottom: 40px; right: 40px; }
    #lightbox { padding: 10px; }
    #lightbox img { max-width: 100%; max-height: 100%; }
}

footer.has-friends { position: relative; z-index: 5; margin-top: 150px; }
.footer-friends {
    position: absolute; top: 1px; right: max(25px, calc(50% - 560px));
    display: flex; align-items: flex-end; gap: 40px;
    transform: translateY(-100%);
}
.footer-friend { position: relative; margin: 0; }
.footer-friend img { display: block; height: auto; }
.footer-friend--schneck img {
    width: 125px; margin-bottom: -10px;
    animation: schneck-schlurf 40s ease-in-out infinite;
}

.footer-friend--rudi img { --rudi-cut: 50px; width: 112px; margin-bottom: calc(var(--rudi-cut) * -1); clip-path: inset(0 0 var(--rudi-cut) 0); }
@keyframes schneck-schlurf {
    0%   { transform: translateX(-90px) scaleX(1); }
    48%  { transform: translateX(0) scaleX(1); }
    50%  { transform: translateX(0) scaleX(-1); }
    98%  { transform: translateX(-90px) scaleX(-1); }
    100% { transform: translateX(-90px) scaleX(1); }
}

.footer-friend--rudi img {
    transform-origin: 50% calc(100% - 50px);
    animation: rudi-atmet 4s ease-in-out infinite;
    will-change: transform;
}
@keyframes rudi-atmet {
    0%, 100% { transform: rotate(-2deg); }
    50%      { transform: rotate(2deg); }
}

.footer-friend--schneck { cursor: pointer; }

.footer-friend.spricht .footer-bubble { opacity: 1; }
.footer-friend--schneck.turbo { animation: schneck-eile .12s ease-in-out infinite alternate; }
@keyframes schneck-eile { from { transform: translateY(0) rotate(-1.5deg); } to { transform: translateY(-2px) rotate(1.5deg); } }

.footer-friend--rudi { cursor: pointer; }
.footer-friend--rudi.taucht img { animation: rudi-taucht 1.8s ease-in-out; }
@keyframes rudi-taucht {
    0%       { transform: none;              clip-path: inset(0 0 var(--rudi-cut) 0); }
    12%      { transform: scaleY(.9);        clip-path: inset(0 0 var(--rudi-cut) 0); }
    40%, 68% { transform: translateY(105%);  clip-path: inset(0 0 calc(var(--rudi-cut) + 105%) 0); }
    88%      { transform: translateY(-4%);   clip-path: inset(0 0 calc(var(--rudi-cut) - 4%) 0); }
    100%     { transform: none;              clip-path: inset(0 0 var(--rudi-cut) 0); }
}
@media (prefers-reduced-motion: reduce) { .footer-friend--schneck img, .footer-friend--rudi img, .footer-friend--rudi.taucht img { animation: none; } }

.footer-bubble {
    position: absolute; bottom: calc(100% + 16px); left: 50%; z-index: 2;
    width: max-content; max-width: 140px; padding: 4px 8px;
    border: 14px solid transparent;
    border-image: url("Portfolio/Fluffel/Fluffel_Sprechblase.svg") 26 / 14px stretch;
    color: #2b2622;

    font-family: var(--font-display); text-transform: uppercase; letter-spacing: .03em;
    font-size: .88rem; font-weight: 700; line-height: 1.15; text-align: center;
    transform: translateX(-50%) rotate(-2deg);
    transition: opacity .25s, transform .25s;
}

.footer-friend--rudi .footer-bubble { transform: translateX(-62%) rotate(2deg); }
.footer-friend--rudi .footer-bubble::after { left: 60%; }

.footer-bubble::before {
    content: ""; position: absolute; inset: -8px; z-index: -1;
    background: rgba(255, 253, 247, .6); border-radius: 12px;
}

.footer-bubble::after {
    content: ""; position: absolute; left: 30%; top: calc(100% + 8px);
    width: 20px; height: 22px;
    background: url("Portfolio/Fluffel/Fluffel_Sprechblase_Strich.svg") center / contain no-repeat;
}

@media (hover: hover) {
    .footer-bubble { opacity: 0; pointer-events: none; }
    .footer-friend:hover .footer-bubble { opacity: 1; }
}
@media (max-width: 750px) {
    footer.has-friends { margin-top: 120px; }
    .footer-friends { gap: 24px; right: 16px; }
    .footer-friend--schneck img { width: 90px; margin-bottom: -7px; }
    .footer-friend--rudi img { --rudi-cut: 36px; width: 80px; transform-origin: 50% calc(100% - 36px); }
    .footer-bubble { max-width: 110px; font-size: .8rem; padding: 2px 6px; }

    .footer-friend--schneck .footer-bubble { transform: translateX(-74%) rotate(-2deg); }
    .footer-friend--schneck .footer-bubble::after { left: 55%; }
}

@media (max-width: 750px) {
    nav .container { padding-inline: 16px; }
    nav > .container > ul { gap: 8px 7px; }
    nav ul li a[href="#kontakt"] { font-size: 0; letter-spacing: 0; padding: 2px; }

    nav > .container > ul > li:has(> a[href="#kontakt"]) { flex-basis: 100%; }
    nav .theme-toggle { align-self: flex-start; margin-top: 2px; }
    nav ul li a[href="#kontakt"]::before {
        content: ""; display: block; width: 20px; height: 20px; background: currentColor;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E") center / contain no-repeat;
                mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E") center / contain no-repeat;
    }
}