:root {
    /* These variables now directly control the animation */
    --svg-scale-start: 15;
    --svg-scale-end: 5;
    --svg-rotation-start: 0;
    --svg-rotation-end: 90;
    --svg-scroll-scale-end: 60;
    --fade-start-percent: 25%;

    /* Control the text size here */
    --hero-headline-font-size: clamp(1rem, 5vw, 3rem);
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: #0a0a0a;
    color: #fff;
    overflow-x: hidden;
}

/* UPDATED: All class names are now prefixed with 'hero-' for uniqueness */
.hero-section {
    height: 200vh;
    position: relative;
}

.hero-sticky-container {
    height: 100vh;
    width: 100%;
    position: sticky;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.hero-svg-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
}

.hero-svg {
    width: 200px;
    height: auto;
    fill: url(#hero-animated-gradient); /* UPDATED ID */
}

.hero-text-container {
    position: relative;
    z-index: 10;
    text-align: center;
    opacity: 0;
    font-weight: 800;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-section-headline {
    font-size: var(--hero-headline-font-size);
    position: relative;
    display: inline-block;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

.hero-section-headline .char {
    display: inline-block;
    position: relative;
    padding: 0;
    margin: 0;
}

#hero-cursor { /* UPDATED ID */
    position: absolute;
    display: inline-block;
    width: 3px;
    background-color: #fff;
    opacity: 0;
    vertical-align: middle;
    animation: hero-blink 0.7s infinite; /* UPDATED Animation Name */
}

@keyframes hero-blink { /* UPDATED Animation Name */
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-content-after {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1a1a1a;
    font-size: 2rem;
}

/* CITIES SECTION STYLES */
.cities-section {
    background: #000000;
}

.city-image {
    transition: transform 0.3s ease;
}

.city-card {
    transition: all 0.3s ease;
    height: 448px !important; /* Exact height to prevent overflow */
}

.city-card:hover .city-image {
    transform: scale(1.1);
}

.city-image-section {
    height: 320px !important; /* Image section height */
}

.city-info-section {
    height: 128px !important; /* Info section height */
}

.carousel-button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.carousel-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.carousel-button:active {
    transform: scale(0.95);
}

.animated-underline {
    position: relative;
    text-decoration: none;
    color: white;
    display: inline-block;
    width: fit-content;
}

.animated-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.5);
    transition: width 0.3s ease;
}

.animated-underline:hover::after {
    width: 0%;
    animation: reanimateUnderline 0.3s ease forwards;
}

@keyframes reanimateUnderline {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Mobile horizontal scroll for cities */
.cities-mobile-scroll {
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cities-mobile-scroll::-webkit-scrollbar {
    display: none;
}

.cities-mobile-cards {
    display: flex;
    gap: 1rem;
    padding: 0 1.5rem;
}

.cities-mobile-card {
    flex: 0 0 280px;
}

/* Mobile card height fix */
.cities-mobile-card .city-card {
    height: 384px !important; /* Mobile card height */
}

.cities-mobile-image-section {
    height: 288px !important; /* Mobile image section */
}

.cities-mobile-info-section {
    height: 96px !important; /* Mobile info section */
}

/* PROJECT SLIDER SECTION STYLES */
:root {
    --projects-camera-perspective: 1200px;
    --projects-camera-rotate-x: 35deg;
    --projects-camera-rotate-y: 0deg;
    --projects-camera-rotate-z: 10deg;
    --projects-camera-scale: 1;
}

@media (max-width: 768px) {
    :root {
        --projects-camera-scale: 0.9;
    }
}

/* SVG clip path definitions */
.projects-clip-svg {
    position: absolute;
    width: 0;
    height: 0;
}

.projects-slider-section {
    height: 100vh;
    overflow: hidden;
    position: relative;
    perspective: var(--projects-camera-perspective);
    background-color: #000000;
}

.projects-camera-view {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: scale(var(--projects-camera-scale)) rotateX(var(--projects-camera-rotate-x)) rotateY(var(--projects-camera-rotate-y)) rotateZ(var(--projects-camera-rotate-z));
    transition: transform 0.5s ease;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.projects-slider-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    transform-style: preserve-3d;
    pointer-events: none;
}

.projects-card-wrapper {
    display: flex;
    align-items: center;
    gap: 80px;
    position: relative;
    padding-left: calc(50vw - 180px);
    padding-right: calc(50vw - 180px);
    will-change: transform;
    z-index: 1;
    transform-style: preserve-3d;
    pointer-events: none;
}

.projects-project-card {
    flex-shrink: 0;
    width: 360px;
    aspect-ratio: 4 / 5;
    transition: transform 0.5s ease-out, border-color 0.3s ease;
    will-change: transform;
    isolation: isolate;
    border: 1px solid #2a2a2a;
    border-radius: 1.5rem;
    overflow: hidden;
    position: relative;
    background-color: #0a0a0a;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    cursor: pointer;
}

/* Apply mask only on desktop for corner leakage fix */
@media (min-width: 769px) {
    .projects-project-card {
        -webkit-mask-image: -webkit-radial-gradient(white, black);
        mask-image: radial-gradient(white, black);
    }
}

.projects-card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 1.5rem;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    background: radial-gradient(circle at var(--x) var(--y), rgba(255, 255, 255, 0.15), transparent 40%);
    z-index: 30;
}

.projects-project-tag {
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    color: white;
}

.projects-image-wrapper {
    clip-path: inset(0% 0% 0% 0%);
    transition: clip-path 0.7s cubic-bezier(0.86, 0, 0.07, 1);
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 1.5rem;
    overflow: hidden;
    z-index: 10;
}

.projects-project-card:hover .projects-image-wrapper {
    clip-path: url(#projects-infinity-clip);
}

.projects-project-image {
    transition: transform 0.7s cubic-bezier(0.86, 0, 0.07, 1);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.projects-project-card:hover .projects-project-image {
    transform: scale(1.1);
}

.projects-card-gradient-bg {
    opacity: 0;
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    z-index: 0;
    transition: opacity 0.5s cubic-bezier(0.86, 0, 0.07, 1);
}

.projects-project-card:hover .projects-card-gradient-bg {
    opacity: 1;
}

.projects-darken-overlay {
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.86, 0, 0.07, 1);
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
}

.projects-project-card:hover .projects-darken-overlay {
    opacity: 1;
}

.projects-project-description {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.5s ease, max-height 0.5s ease;
    color: #d1d5db;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Show description on hover for desktop */
.projects-project-card:hover .projects-project-description {
    opacity: 1;
    max-height: 6rem;
}

/* Move content up on hover */
.projects-project-card:hover .projects-card-top-content {
    transform: translateY(-10px);
    transition: transform 0.5s ease-out;
}

/* Show read more icon on hover */
.projects-project-card:hover .projects-read-more-icon {
    opacity: 1;
    transform: translateX(0);
}

.projects-background-svg-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 127.5vh;
    height: auto;
    z-index: 0;
    opacity: 0;
    pointer-events: none;
}

.projects-background-svg-container svg {
    width: 100%;
    height: 100%;
}

#projects-background-path {
    fill: rgba(255, 255, 255, 0.03);
    transition: fill 0.5s ease-in-out;
}

.projects-section-title {
    position: absolute;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.25rem;
    font-weight: 700;
    color: white;
    z-index: 30;
    opacity: 0;
}

.projects-gradient-top {
    position: absolute;
    inset: 0 0 auto 0;
    height: 12rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 1), transparent);
    z-index: 20;
    pointer-events: none;
}

.projects-gradient-bottom {
    position: absolute;
    inset: auto 0 0 0;
    height: 12rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 1), transparent);
    z-index: 20;
    pointer-events: none;
}

.projects-view-more-card {
    flex-shrink: 0;
    width: 360px;
    aspect-ratio: 4 / 5;
    position: relative;
    border-radius: 1.5rem;
    background-color: #0d0d0d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    text-decoration: none;
    color: white;
    z-index: 0;
    overflow: hidden;
    pointer-events: auto;
    cursor: pointer;
}

@keyframes projects-rotate {
    100% {
        transform: rotate(1turn);
    }
}

.projects-view-more-card::before {
    content: '';
    position: absolute;
    z-index: -2;
    left: -50%;
    top: -50%;
    width: 200%;
    height: 200%;
    background-color: #1a232a;
    background-repeat: no-repeat;
    background-size: 50% 50%, 50% 50%;
    background-position: 0 0, 100% 0, 100% 100%, 0 100%;
    background-image: conic-gradient(#f91c23, #0a0bff, #eb0ffd, #9820fe, #f91c23);
    animation: projects-rotate 4s linear infinite;
}

.projects-view-more-card::after {
    content: '';
    position: absolute;
    z-index: -1;
    left: 2px;
    top: 2px;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    background: #000000;
    border-radius: calc(1.5rem - 2px);
}

.projects-card-content {
    position: relative;
    z-index: 20;
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.projects-card-top-content {
    flex: 1;
    min-height: 0;
    transition: transform 0.5s ease-out;
}

.projects-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0;
}

.projects-project-title {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: white;
    margin: 0;
    line-height: 1.2;
}

.projects-project-year {
    color: #9ca3af;
    font-weight: 500;
    font-size: 1rem;
    margin: 0;
    flex-shrink: 0;
}

.projects-project-description-wrapper {
    margin-top: 1rem;
    padding-right: 1rem;
}

.projects-project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.projects-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    padding-top: 1rem;
    min-height: fit-content;
}

.projects-card-top-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
    z-index: 20;
    pointer-events: none;
}

/* Ensure the read more icon is properly positioned */
.projects-read-more-icon {
    opacity: 0;
    transform: translateX(10px);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    z-index: 1;
    transition: background-color 0.2s ease, opacity 0.4s ease, transform 0.4s ease;
    color: white;
    text-decoration: none;
    flex-shrink: 0;
}

/* Disable CSS hover on mobile to let JS handle it */
@media (max-width: 768px) {
    .projects-project-card:hover .projects-project-description {
        opacity: 0;
        max-height: 0;
    }

    .projects-project-card:hover .projects-card-top-content {
        transform: none;
    }

    .projects-project-card:hover .projects-read-more-icon {
        opacity: 0;
        transform: translateX(10px);
    }
}

.projects-read-more-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
