/* =================================================================
   FONTS
   ================================================================= */

/* Regular for normal/medium weights */
@font-face {
    font-family: 'PPTelegraf';
    src: url('assets/fonts/telegraf/PPTelegraf-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* SemiBold for intermediate bold weights */
@font-face {
    font-family: 'PPTelegraf';
    src: url('assets/fonts/telegraf/PPTelegraf-SemiBold.woff2') format('woff2');
    font-weight: 600 700;
    font-style: normal;
    font-display: swap;
}

/* Apply Telegraf as a site-wide fallback in case Tailwind classes are not present */
body {
    font-family: 'PPTelegraf', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/*
::-webkit-scrollbar {
    display: none;
}
*/
/* =================================================================
   MOBILE MODAL FIX
   ================================================================= */

/* Mobile: near-fullscreen project modal (not fixed/fullscreen to avoid iOS issues) */
@media (max-width: 640px) {
    #project-modal {
        padding: 12px !important;
        align-items: center;
        justify-content: center;
    }

    #project-modal>div {
        position: relative;
        margin: 8px 0;
        width: 100%;
        max-width: 980px;
        max-height: calc(100vh - 48px);
        border-radius: 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid rgba(0, 0, 0, 0.04);
        background: white;
    }
}


/* Project modal style for all screens */
#project-modal #close-modal {
    top: 10px;
    right: 10px;
    z-index: 9999;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    border-radius: 9999px;
    border: none;
    padding: 0;
}

#project-modal #close-modal svg {
    width: 20px;
    height: 20px;
    line-height: 1;
    display: inline-block;
    color: #ffffff;
}

/* =================================================================
   ANIMATIONS
   ================================================================= */

@keyframes rotateCircle {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

@keyframes fadeInCircle {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes menuSlideDown {
    0% {
        transform: translateY(-100%);
    }

    70% {
        transform: translateY(20px);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes menuSlideUp {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-100%);
    }
}

/* =================================================================
   HERO ANIMATION
   ================================================================= */

#hero-scroll-indicator {
    opacity: 0;
}

#hero-scroll-indicator svg {
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* =================================================================
   PROJECT STACK CARDS
   ================================================================= */

#projects-stack {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    min-height: 150vh;
}

.project-stack-card {
    position: sticky;
    top: 20vh;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
    transform: translateZ(0);
}

.project-stack-card.visible {
    opacity: 1;
}

/* Varying sizes for creative look */
.project-stack-card:nth-child(1) {
    max-width: 500px;
}

.project-stack-card:nth-child(2) {
    max-width: 640px;
}

.project-stack-card:nth-child(3) {
    max-width: 560px;
}

.project-stack-card:nth-child(4) {
    max-width: 620px;
}

.project-stack-card:nth-child(5) {
    max-width: 520px;
}

.project-stack-card:nth-child(6) {
    max-width: 600px;
}

.project-stack-card:nth-child(7) {
    max-width: 580px;
}

.project-stack-card:nth-child(8) {
    max-width: 630px;
}

.project-stack-card:nth-child(9) {
    max-width: 540px;
}

.project-stack-card:nth-child(10) {
    max-width: 610px;
}

.project-stack-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 0;
}

.project-stack-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-stack-card:hover img {
    transform: scale(1.1);
}

.project-stack-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    pointer-events: none;
}

.project-stack-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

/* =================================================================
   REFERENZEN CAROUSEL
   Minimal carousel-related styles and markers for the Referenzen
   Carousel Section (HTML id: referenzen-carousel)
   ================================================================= */

/* Carousel container and items are primarily handled via Tailwind and JS; */
/* Add small defaults in case JS-inserted elements need baseline styling. */
#carousel {
    display: flex;
    will-change: transform;
}

/* Custom cursor - only hide default cursor after mouse movement */
html.custom-cursor-active,
html.custom-cursor-active * {
    cursor: none !important;
}

#custom-cursor {
    width: 30px;
    height: 30px;
    background-color: #59d49b;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%) scale(0.4);
    transition: transform 0.3s ease;
}

#custom-cursor.cursor-hover {
    transform: translate(-50%, -50%) scale(1);
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {

    html.custom-cursor-active,
    html.custom-cursor-active * {
        cursor: auto !important;
    }

    #custom-cursor {
        display: none;
    }
}

/* =================================================================
   SMOOTH SCROLL
   ================================================================= */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 50px;
}

section {
    scroll-margin-top: 40px;
}

/* =================================================================
   MOBILE FIXES - Prevent horizontal panning
   ================================================================= */

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

/* iOS-safe scroll lock (used by JS via .no-scroll) */
body.no-scroll {
    overflow: hidden !important;
}

@media (max-width: 1023px) {
    body.no-scroll {
        position: fixed !important;
        left: 0;
        right: 0;
        width: 100%;
        overflow: hidden !important;
    }
}

/* =================================================================
   HEADER
   ================================================================= */

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

.header-white {
    background: white !important;
    box-shadow: none !important;
    transition: background 0.25s, box-shadow 0.25s;
}

#header-gradient-overlay {
    transition: opacity 0.25s;
}

#header-gradient-overlay.overlay-inactive {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* =================================================================
   FULLSCREEN MENU
   ================================================================= */

#fullscreen-menu {
    transform: translateY(-100%);
    z-index: 200;
}

#fullscreen-menu.menu-open {
    animation: menuSlideDown 700ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#fullscreen-menu.menu-closing {
    animation: menuSlideUp 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* =================================================================
   ROTATING CIRCLE BUTTON
   ================================================================= */

#scroll-circle {
    position: fixed;
    right: -70px;
    bottom: 40px;
    width: 140px;
    height: 140px;
    cursor: pointer;
    z-index: 30;
    /* Only animate transform & opacity to avoid expensive layout/paint */
    transition: transform 380ms cubic-bezier(.2, .9, .2, 1), opacity 380ms ease;
    opacity: 0;
    /* start slightly translated so the entrance is transform-only */
    transform: translateX(24px) translateZ(0);
    will-change: transform, opacity;
}

@media (max-width: 768px) {
    #scroll-circle {
        width: 90px;
        height: 90px;
        right: -40px;
    }
}

#scroll-circle::before {
    content: '';
    position: absolute;
    left: -20px;
    top: -20px;
    right: -50px;
    bottom: -20px;
    pointer-events: auto;
}

@media (max-width: 768px) {
    #scroll-circle::before {
        pointer-events: none;
    }
}

#scroll-circle:hover {
    right: 30px;
}

#scroll-circle:active {
    right: 30px;
}

#scroll-circle.at-footer {
    bottom: 120px !important;
    right: 30px !important;
}

#scroll-circle svg {
    /* don't auto-rotate until visible */
    will-change: transform;
    transform: translateZ(0);
}

/* Apply rotation and reveal only when element becomes visible */
#scroll-circle.scroll-visible {
    opacity: 1;
    transform: translateX(0) translateZ(0);
}

#scroll-circle.scroll-visible svg {
    animation: rotateCircle 15s linear infinite;
}

/* =================================================================
   SECTION SEPARATOR
   Subtle horizontal rule between major sections
   ================================================================= */
.section-separator {
    width: 100%;
    height: 1px;
    margin: 1.5rem 0;
    background: linear-gradient(to right, transparent, rgba(95, 212, 165, 0.35), rgba(107, 68, 98, 0.25), rgba(95, 212, 165, 0.35), transparent);
}

@media (min-width: 768px) {
    .section-separator {
        margin: 3rem 0;
    }
}

/* =================================================================
   KOMPETENZEN CARDS - Minimal CSS (only what Tailwind can't do)
   ================================================================= */

/* Scroll reveal animation */
.kompetenz-card {
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.kompetenz-card.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Icon sizing - responsive (let Tailwind handle width, height auto for aspect ratio) */
.kompetenz-icon {
    height: auto;
    display: block;
}

/* Toggle button arrow indicator */
.kompetenz-toggle::before {
    content: '→';
    position: absolute;
    left: 0;
    transition: transform 0.3s ease;
}

.kompetenz-toggle.active::before {
    transform: rotate(-90deg);
}

/* Hidden state for expandable content */
.kompetenz-more.hidden {
    display: none;
}