body {
    font-family: 'Stolzl', 'Inter', sans-serif;
}

.hover-underline-animation {
    display: inline-block;
    position: relative;
}

.hover-underline-animation::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: currentColor;
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

.hover-underline-animation:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.square-image {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.rectangle-image {
    aspect-ratio: 5 / 4;
    object-fit: cover;
}

/* Square Pattern Background */
.square-pattern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image:
        linear-gradient(to right, currentColor 1px, transparent 1px),
        linear-gradient(to bottom, currentColor 1px, transparent 1px);
    background-size: 80px 80px;
}

.dark .square-pattern {
    color: #fff;
}

/* Fancy square hover link */
.square-link {
    position: relative;
    /* create space so the corner lines have breathing room */
    padding: 0.5rem 0.75rem;
    /* ensure the gradient corners use current text color for light/dark */
    color: inherit;
    /* corner config */
    --corner-size: 10px;
    /* initial corner segment length */
    --corner-thickness: 1px;
    --corner-radius: 2px;
    /* subtle rounding when fully expanded */
    background:
        /* top-left horizontal */
        linear-gradient(currentColor, currentColor) left top / var(--corner-size) var(--corner-thickness) no-repeat,
        /* top-left vertical   */
        linear-gradient(currentColor, currentColor) left top / var(--corner-thickness) var(--corner-size) no-repeat,
        /* bottom-right horizontal */
        linear-gradient(currentColor, currentColor) right bottom / var(--corner-size) var(--corner-thickness) no-repeat,
        /* bottom-right vertical   */
        linear-gradient(currentColor, currentColor) right bottom / var(--corner-thickness) var(--corner-size) no-repeat;
    transition: background-size 300ms ease, box-shadow 300ms ease, transform 300ms ease;
}

.square-link:hover {
    /* expand corner lines to form an elegant square frame */
    background-size:
        /* top */
        100% var(--corner-thickness),
        /* left */
        var(--corner-thickness) 100%,
        /* bottom */
        100% var(--corner-thickness),
        /* right */
        var(--corner-thickness) 100%;
    /* subtle inset glow to hint interaction */
    box-shadow: inset 0 0 0 6px transparent, 0 0 0 0 transparent;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .square-link {
        transition: none;
    }
}

.square-decor {
    position: relative;
}

.square-decor-top-right::before {
    top: -16px;
    right: -16px;
}

.square-decor-bottom-left::before {
    bottom: -16px;
    left: -16px;
}

/* Animated corner squares */
.corner-square {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 1px solid currentColor;
    opacity: 0.2;
    transition: all 0.5s ease;
}

.corner-square-top-left {
    top: 0;
    left: 0;
}

.corner-square-top-right {
    top: 0;
    right: 0;
}

.corner-square-bottom-left {
    bottom: 0;
    left: 0;
}

.corner-square-bottom-right {
    bottom: 0;
    right: 0;
}

.group:hover .corner-square {
    opacity: 0.5;
}

/* Square badge */
.square-badge {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid currentColor;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* Grid squares overlay */
.grid-squares {
    background-image:
        linear-gradient(to right, currentColor 1px, transparent 1px),
        linear-gradient(to bottom, currentColor 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.1;
}

/* Mobile Menu Styles */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    background-color: #ffffff; /* Fallback */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

/* Removed system-preference dark mode media query */


.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-menu-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close svg {
    width: 2rem;
    height: 2rem;
}

.mobile-menu-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 6rem 2rem 2rem;
}

/* Mobile Navigation Links */
.mobile-nav {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
    align-items: flex-start;
}

/* Mobile Menu Logo */
.mobile-nav-logo {
    display: inline-block;
    margin-bottom: 1rem;
    /* padding: 1rem; */
    transition: all 0.3s ease;
    transform: translateY(-20px);
    opacity: 0;
    border: 2px solid transparent;
}

.mobile-menu-overlay.active .mobile-nav-logo {
    transform: translateY(0);
    opacity: 1;
    transition-delay: 0s;
}

.mobile-nav-logo:hover {
    background-color: transparent;
}

.dark .mobile-nav-logo:hover {
    background-color: transparent;
}

.mobile-nav-logo img {
    filter: none !important;
    transition: transform 0.3s ease;
}

.mobile-nav-logo:hover img {
    transform: scale(1.05);
}

.mobile-nav-link {
    position: relative;
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
}

.mobile-menu-overlay.active .mobile-nav-link {
    transform: translateY(0);
    opacity: 1;
}

.mobile-nav-link:nth-child(2) {
    transition-delay: 0.1s;
}

.mobile-nav-link:nth-child(3) {
    transition-delay: 0.2s;
}

.mobile-nav-link:nth-child(4) {
    transition-delay: 0.3s;
}

.mobile-nav-link:nth-child(5) {
    transition-delay: 0.4s;
}

.mobile-nav-link:nth-child(6) {
    transition-delay: 0.5s;
}

.mobile-nav-link:hover {
    transform: translateX(5px);
    opacity: 0.7 !important;
}

.dark .mobile-nav-link:hover {
    background-color: transparent;
}

/* Removed link decorations ::before and ::after */

/* Hamburger Menu Animation */
.menu-toggle {
    position: relative;
    z-index: 10000;
    cursor: pointer;
    background: transparent;
    border: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle span {
    pointer-events: none;
    display: block;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Hide mobile menu on desktop */
@media (min-width: 1024px) {
    .mobile-menu-overlay {
        display: none;
    }

    .menu-toggle {
        display: none !important;
    }
}

/* Color Transition Text Effect */
.color-transition-text {
    background: linear-gradient(90deg,
            #1a1a1a 0%,
            #4a5568 25%,
            #1a1a1a 50%,
            #4a5568 75%,
            #1a1a1a 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: colorShift 8s ease-in-out infinite;
    transition: all 0.3s ease;
}

.dark .color-transition-text {
    background: linear-gradient(90deg,
            #ffffff 0%,
            #cbd5e0 25%,
            #ffffff 50%,
            #cbd5e0 75%,
            #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes colorShift {

    0%,
    100% {
        background-position: 0% center;
    }

    50% {
        background-position: 100% center;
    }
}

#lottie {
    background-color: transparent;
    width: 40%;
    height: 40%;
    display: block;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
    text-align: center;
    opacity: 1;
}

/* Scroll Reveal Animations */
.reveal-on-scroll {
    opacity: 0 !important;
    transform: translateY(30px) scale(0.98) !important;
    /* Added slight scale for depth */
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), transform 1.2s cubic-bezier(0.22, 1, 0.36, 1), filter 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform, filter;
    /* Start slightly blurry for a cinematic focus focus */
    filter: blur(4px);
}

.reveal-on-scroll.revealed {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    filter: blur(0);
}

.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

.reveal-delay-4 {
    transition-delay: 0.4s;
}

@keyframes move-top-top {
    0% {
        transform: translateY(2rem);
    }

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

@keyframes fade {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* Initial State */
.to-anim {
    transform: translateY(2rem);
    opacity: 0;
}

/* Triggered State */
.anim .to-anim {
    animation-name: move-top-top, fade;
    animation-duration: 0.8s;
    animation-fill-mode: forwards;
    animation-timing-function: ease-in-out;
}

/* Project Slider */
.project-slider {
    position: relative;
    width: 100%;
    min-height: 400px;
    overflow: hidden;
}

.project-slide {
    display: none !important;
    width: 100%;
    opacity: 0;
    transition: opacity 1.6s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1;
}

.project-slide.active {
    display: grid !important;
    z-index: 2;
}

.project-slide.active.revealed {
    opacity: 1;
}

/* Extra slow cinematic reveal for slider projects only */
.project-slide .reveal-on-scroll {
    transition: opacity 1.5s cubic-bezier(0.22, 1, 0.36, 1), transform 1.5s cubic-bezier(0.22, 1, 0.36, 1), filter 1.5s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* Ensure slides start unrevealed so we can re-trigger animations */
.project-slide:not(.active) .reveal-on-scroll {
    opacity: 0 !important;
    transform: translateY(30px) scale(0.98) !important;
    filter: blur(4px);
    transition: none !important;
}