/* Anpassungen für kleine Bildschirme – wird nach dem Seiten-CSS geladen */

img {
    max-width: 100%;
}

@media (max-width: 768px) {
    .row-mapper {
        flex-direction: column;
        gap: 1rem;
        margin: 1rem;
    }

    .textblock {
        max-width: 100%;
    }

    .beschreibung {
        height: auto;
        margin: 0 auto;
    }

    .zweitetech {
        padding-top: 2rem;
    }

    .glass.p-5 {
        padding: 1.5rem !important;
    }

    .center-wrapper {
        padding-inline: 0.5rem;
    }

}

@media (max-width: 575.98px) {
    h1.display-5 {
        font-size: 1.9rem;
    }

    .projects-container {
        padding-inline: 0.5rem;
    }

    .coni {
        padding-inline: 0;
    }
}

/* ===================== Geräte-Anpassungen (PC ab 1200 px bleibt unverändert) ===================== */

/* Hero-Porträt: Seitenverhältnis immer erhalten (war bei schmalerer Spalte oval) */
.rounded-lg-3,
.beschreibung {
    height: auto;
}

/* iPad quer und kleiner */
@media (max-width: 1199.98px) {
    /* Hintergrund als feste Ebene in Bildschirmgröße: bleibt scharf, statt über die
       ganze (auf Tablets/Handys sehr lange) Seite gestreckt zu werden */
    body {
        background-image: none !important;
        background-color: #05050b;
    }

    body::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: -2;
        background: url("../Dateien/backgroundfinal.webp") center top / cover no-repeat;
        pointer-events: none;
    }

    /* Gehirn zwischen den beiden schmaleren Karten kleiner, damit es keine Überschrift berührt */
    .brain {
        width: 220px;
        height: 220px;
    }

    /* Buch: mehr Abstand zur Überschrift "State of Mind" */
    .mind-card .container-fluid {
        padding-top: 2.75rem !important;
    }
}

/* iPad hochkant und kleiner */
@media (max-width: 991.98px) {
    /* Glanz-Streifen der Hero-Karte stand hier dauerhaft schräg über dem Text (kein Hover auf Touch) */
    .glass-box::before {
        display: none;
    }

    /* Porträt unter dem Text mittig */
    .col-lg-4.offset-lg-1 {
        text-align: center;
    }

    .contact-ghost {
        opacity: 0.6;
    }
}

/* Handy */
@media (max-width: 767.98px) {
    .buch {
        width: 220px;
        height: 220px;
    }

    .mind-card .container-fluid {
        padding-top: 3.5rem !important;
    }

    /* Logische Seite: auf schmalem Bildschirm linksbündig lesbarer */
    #work .creative,
    #work .creative h2,
    #work .creative p {
        text-align: left !important;
    }

    /* Tech-/3D-Seite: rechtsbündige Absätze linksbündig */
    .glass.linksalign p,
    .glass.rechtsalign p {
        text-align: left !important;
    }

    .hero-actions .btn {
        flex: 1 1 auto;
        text-align: center;
    }
}

@media (max-width: 575.98px) {
    /* Kopfleiste kompakt in einer Zeile */
    .contact-bar {
        margin: 14px 12px;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        gap: 0.75rem;
    }

    .contact-bar > span {
        font-size: 0.95rem !important;
        white-space: nowrap;
    }

    .contact-bar .lang-flag {
        width: 22px;
        height: 22px;
    }

    .contact-bar .language-flags {
        gap: 0.45rem !important;
    }

    .icon-links {
        gap: 0.6rem;
    }

    .icon-links img {
        height: 22px;
    }

    /* Hero */
    .display-4 {
        font-size: 2.1rem;
    }

    .rounded-lg-3 {
        max-width: 300px;
    }

    .service-title {
        font-size: 1.6rem;
    }

    /* großer Kontur-Schriftzug überlagert auf dem Handy das kleine Label */
    .contact-ghost {
        display: none;
    }
}

/* Große Bildschirme / Fernseher: gleiche Optik wie am PC, nur proportional größer */
@media (min-width: 2400px) {
    html {
        zoom: 1.3;
    }
}

@media (min-width: 3200px) {
    html {
        zoom: 1.75;
    }
}

/* Projektseiten auf dem Handy: rechtsbündige Textblöcke linksbündig */
@media (max-width: 767.98px) {
    .textblock.text-right,
    .textblock.text-right p {
        text-align: left !important;
    }
}

/* Porträt: festes Seitenverhältnis, kann nie oval werden (egal welche Breite/Höhe von außen kommt) */
.rounded-lg-3 {
    aspect-ratio: 765 / 762;
    object-fit: contain;
}

/* Touch-Geräte (iPhone, iPad): kein Hover -> Glanz-Streifen blieb nach dem Antippen schräg stehen */
@media (hover: none) {
    .glass-box::before,
    .hover-effect-5::before {
        display: none;
    }

    .glass-box:hover {
        box-shadow: none;
    }
}

/* Handy: alles kompakter, damit mehr auf den Bildschirm passt */
@media (max-width: 575.98px) {
    .display-4 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }

    h1.display-5 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .lead {
        font-size: 1rem;
        margin-bottom: 0.6rem;
    }

    .lead #flagge {
        width: 20px;
        height: 20px;
    }

    .available-badge {
        font-size: 12px;
        padding: 5px 12px;
    }

    .hero-actions {
        margin-top: 1rem;
        gap: 0.5rem;
    }

    .hero-actions .btn {
        padding: 0.45rem 0.9rem;
        font-size: 0.95rem;
    }

    .rounded-lg-3 {
        max-width: 230px;
        margin-bottom: 24px;
    }

    body {
        font-size: 0.95rem;
    }
}

/* Handy: alles eine Stufe kleiner (alle rem-Größen von Bootstrap und den Seiten skalieren mit) */
@media (max-width: 575.98px) {
    html {
        font-size: 14px;
    }

    .row.p-4 {
        padding: 0.75rem !important;
    }

    .display-4 {
        font-size: 1.6rem;
    }

    h1.display-5 {
        font-size: 1.35rem;
    }

    .available-badge {
        font-size: 11px;
    }

    .hero-actions .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .rounded-lg-3 {
        max-width: 180px;
        margin-bottom: 16px;
    }

    /* Footer: mittig, kleine Schrift, Icons darunter */
    .footer footer {
        flex-direction: column;
        justify-content: center !important;
        gap: 0.6rem;
        text-align: center;
        font-size: 0.8rem;
    }

    .footer .social-links img {
        height: 20px;
    }
}

@media (max-width: 575.98px) {
    .contact-headline {
        font-size: 1.6rem;
    }
}

/* Tech-/3D-/Projektseiten auf dem Handy: Porträt und Skill-Icons kleiner */
@media (max-width: 575.98px) {
    .bild {
        max-width: 140px;
        height: auto;
    }

    .skill img,
    .top-skill img {
        width: 60px;
        height: 60px;
        object-fit: contain;
    }
}
