:root {
    --bg-color: #faf9f6;
    --h-color: #000000;
    --h-color-sub: #707070;
    --h-hover-background-color: #5a189a99;
    --h-hover-color: #ebf8f1;
    --p-color: #292929;
    --contact-color: invert(0); /* black */
    --selection-color: #5a189a99;
    --text-selection-color: #ebf8f1;
    --nav-border-color: #bebebe;
    --grid-div-color: #0f0f0f;

    --bg-color-dark: #0f0f0f;
    --h-color-dark: #f2f2f2;
    --h-color-sub-dark: #b1b1b1;
    --grid-dark-div-color: #272727;

    --footer-bg: #272727;

    --nav-toggle-bg: #d6d6d6;
}

::-moz-selection {
    color: var(--text-selection-color);
    background-color: var(--selection-color);
}

::selection {
    color: var(--text-selection-color);
    background-color: var(--selection-color);
}

body {
    background-color: var(--bg-color);
    margin: 0;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

* {
    scroll-behavior: smooth;
}

@font-face {
    font-family: Inter;
    src: url(./src/Inter.ttf);
}

@font-face {
    font-family: KronaOne;
    src: url(./src/KronaOne.ttf);
}

@font-face {
    font-family: Playfair;
    src: url(./src/Playfair.ttf);
}

nav {
    display: flex;
    position: fixed;
    overflow: hidden;
    top: 0px;
    width: 100%;
    height: auto;
    gap: 32px;

    margin: 0;
    justify-content: center;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--nav-border-color);

    z-index: 9999;

    transition: transform 0.3s ease-in-out;
}

nav a {
    text-decoration: none;
}

nav a * {
    font-family: Playfair;
    font-weight: 600;
    font-size: 30px;
    color: var(--h-color);
    transition: color 0.08s ease-in-out;
    transition: background-color 0.08s ease-in-out;
    margin-top: 12px;
    margin-bottom: 12px;
}

nav a *:hover {
    background-color: var(--h-hover-background-color);
    color: var(--h-hover-color)
}

nav ul {
    padding: 0;
    margin: 0;
    list-style-type: none;
}

/* Mobile nav toggle styles */
.nav-toggle {
    display: none; /* shown on small screens via media query */
    background: var(--nav-toggle-bg);
    border: none;
    cursor: pointer;
    /* Larger hit area and size (visible on mobile when display is overridden in media query) */
    width: 48px;
    height: 48px;
    padding: 8px;
    border-radius: 0;
    appearance: none; /* standard property for consistency */
}
.nav-toggle:focus {
    /* Default focus cleared; we'll show a visible ring only for keyboard users via :focus-visible */
    outline: none;
}

/* Keep keyboard accessibility: visible focus ring for keyboard users */
.nav-toggle:focus-visible {
    outline: 2px solid var(--h-hover-background-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Remove inner focus border in Firefox */
.nav-toggle::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/* Remove default mobile tap highlight */
.nav-toggle {
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
}

/* On touch devices (coarse pointer), don't show focus outlines when tapping */
@media (pointer: coarse) {
    .nav-toggle:focus {
        outline: none;
        box-shadow: none;
    }
}

.nav-toggle .bar {
    display: block;
    width: 28px; /* wider bar for bigger visual */
    height: 3px; /* slightly thicker */
    background: var(--h-color);
    position: relative;
    transition: transform 0.25s ease, opacity 0.25s ease;
    transform-origin: center;
}
.nav-toggle .bar::before,
.nav-toggle .bar::after {
    content: "";
    position: absolute;
    left: 0;
    width: 28px;
    height: 3px;
    background: var(--h-color);
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle .bar::before { top: -9px; }
.nav-toggle .bar::after { top: 9px; }

/* Hide/show helper for grouped links */
.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

/* When the toggle has the open class, animate hamburger into an X */
.nav-toggle.open .bar {
    transform: rotate(45deg);
}
.nav-toggle.open .bar::before {
    transform: rotate(-90deg) translateX(-0px);
    top: 0;
}
.nav-toggle.open .bar::after {
    opacity: 0;
}

section {
    font-family: Inter;
    display: flex;
    justify-content: center;
    align-items: center;
}

section h1 {
    font-family: Playfair;
    font-weight: 600;
}

.about-me {
    display: flex;
    height: 100vh;
}

.about-me .pfp {
    display: flex;
    border-radius: 100%;
    width: 300px;
    height: 300px;
}

.about-me .about-me-desc {
    margin-left: 50px;
}

.about-me .about-me-contact {
    display: flex;
    gap: 12px;
}

.about-me .about-me-contact a {
    display: inline-block;
}

.about-me .about-me-contact a,
.about-me .about-me-contact a img {
    height: 30px;
    width: 30px;
    filter: var(--contact-color);
    transition: transform 0.15s ease-in-out;
}

.about-me .about-me-contact a img:hover {
    transform: rotate(0.2rad) scale(1.1);
}

@keyframes jump {
    0%, 100% {
        transform: translateY(0); /* Default position */
    }
    50% {
        transform: translateY(-10px); /* Move up */
    }
}

.about-me-arrow {
    position: absolute;
    bottom: 20px;
    animation: jump 3s infinite; /* 1-second animation, repeats infinitely */
}

.about-me-arrow,
.about-me-arrow img {
    height: 44px;
    width: 44px;
}

.info {
    flex-direction: column;
    background-color: var(--bg-color-dark);
    color: var(--h-color-dark);
    padding: 10vh 10vw;
}

.light-info {
    background-color: var(--bg-color);
    color: var(--h-color);
}

.info h1 {
    margin: 20px;
    text-align: center;
}

.info-container {
    width: 95%;
    height: 95%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 50px;
    justify-items: center;
    text-align: center;
    margin-bottom: 80px;
}

.info-container a {
    text-decoration: underline wavy;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;

    /* WebKit prefixed fallbacks */
    -webkit-text-decoration-thickness: 1.5px;
    -webkit-text-underline-offset: 3px;

    color: var(--h-color-dark);
    transition: font-weight 0.3s ease-in-out;
}

.light-info-container a {
    color: var(--h-color);
}

.info-container a:hover {
    font-weight: 600;
}

.info-container div {
    position: relative;
}

.info-container div:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -25px; /* Abstand zum Element */
    transform: translateY(-50%); /* vertikal zentrieren */
    width: 1px; /* Breite des Trenners */
    height: 70%;
    background-color: var(--grid-dark-div-color); /* Farbe des Trenners */
}

.light-info-container div:not(:last-child)::after {
    background-color: var(--grid-div-color);
}


.info-container div:nth-child(3n)::after {
    display: none; /* Entfernt den Trenner nach jedem dritten Element */
}

.info-item h2 {
    font-family: Playfair;
    font-weight: 400;
}

.info-item h2 span {
    font-weight: 300;
    font-size: 20px;
    color: var(--h-color-sub-dark);
}

.light-info-item h2 span {
    color: var(--h-color-sub);
}

.info-item h2 span img {
    height: 50px;
    width: 50px;
}

footer {
    background-color: var(--footer-bg);
    color: var(--h-color-dark);
    padding: 3vh 3vw;
    font-family: Inter;
    font-size: 16px;
    font-weight: 700;
}

footer ul {
    display: flex;
    list-style-type: none;
    gap: 50px;
}


@media (max-width: 900px) {
    nav {
        gap: 12px;
        font-size: 18px;
        padding: 8px 0;
    }
    /* Make nav adapt for mobile: collapse links; keep nav centered */
    /* Collapse the nav on mobile when closed so no sliver remains visible */
    nav {
        max-height: 0; /* collapsed */
        overflow: hidden;
        border-bottom: none;
        transition: max-height 0.28s ease, padding 0.28s ease, border-bottom 0.12s ease;
        padding-top: 0;
        padding-bottom: 0;
    }
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed; /* keep it out of the document flow so nav remains centered */
        right: 12px; /* moved to top-right */
        top: 16px;
        z-index: 10001;
    }
    .nav-links {
        display: none; /* hidden by default on small screens */
        flex-direction: column;
        gap: 12px;
        width: 100%;
        margin-top: 8px;
        text-align: center;
    }
    nav.open .nav-links {
        display: flex;
    }
    nav.open {
        /* keep nav visible when opened (no translate hide) */
        transform: translateY(0) !important;
        max-height: 500px; /* allow links to show */
        padding-top: 8px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--nav-border-color);
    }
    nav a * {
        font-size: 20px;
        margin-top: 8px;
        margin-bottom: 8px;
    }
    .about-me {
        flex-direction: column;
        align-items: center;
        height: 100dvh;
    }
    .about-me .pfp {
        width: 180px;
        height: 180px;
        margin-bottom: 20px;
    }
    .about-me .about-me-desc {
        margin-left: 0;
        margin-top: 16px;
        text-align: center;
    }
    .about-me .about-me-contact {
        justify-content: center;
    }
    .about-me .about-me-contact a,
    .about-me .about-me-contact a img {
        width: 34px;
        height: 34px;
    }
    .about-me-arrow {
        bottom: 5dvh;
        margin-bottom: 0;
    }
    .info-container,
    .light-info-container {
        grid-template-columns: 1fr;
        gap: 24px;
        width: 100%;
    }
    .info-container div:not(:last-child)::after,
    .light-info-container div:not(:last-child)::after {
        display: none;
    }
    section {
        padding: 24px 8px;
    }
    .info h1,
    .light-info h1 {
        margin: 12px 0;
        font-size: 1.7em;
    }
    .info-item h2,
    .light-info-item h2 {
        font-size: 1.2em;
    }
    .info-item h2 span img,
    .light-info-item h2 span img {
        height: 48px;
        width: 48px;
    }
}