* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-top: #121212;
    --bg-bottom: #1c1c1c;
    --text-main: #f4f2eb;
    --text-sub: #aaaaaa;
    --card-bg: #1e1e1e;
    --card-bg-project: #262626;
    --badge-bg: #f4f2eb;
    --badge-text: #121212;
    --icon-color: #f4f2eb;
    --shimmer-color: rgba(255, 255, 255, 0.04);
    --circle-color: rgba(255, 255, 255, 0.03);
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-top);
    color: var(--text-main);
    overflow-x: hidden;
    height: 100vh;
    user-select: none;
    -webkit-user-select: none;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.loader-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #121212;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-text-wrapper {
    position: relative;
    font-family: 'Syne', sans-serif;
    font-size: clamp(3rem, 12vw, 8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    user-select: none;
}

.loader-text-bg {
    color: rgba(255, 255, 255, 0.12);
}

.loader-text-fill {
    position: absolute;
    top: 0;
    left: 0;
    color: #f4f2eb;
    width: 0%;
    overflow: hidden;
    white-space: nowrap;
    transition: width 0.1s linear;
}

.bg-circles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--circle-color) 0%, rgba(255, 255, 255, 0) 70%);
    filter: blur(40px);
    animation: floatBounce 18s infinite ease-in-out alternate;
}

.circle-1 {
    width: 450px;
    height: 450px;
    top: -100px;
    left: -100px;
    animation-duration: 22s;
}

.circle-2 {
    width: 550px;
    height: 550px;
    bottom: -150px;
    right: -100px;
    animation-duration: 26s;
    animation-delay: -5s;
}

.circle-3 {
    width: 350px;
    height: 350px;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 20s;
    animation-delay: -10s;
}

@keyframes floatBounce {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    33% {
        transform: translate(40px, -60px) scale(1.15);
        opacity: 0.6;
    }
    66% {
        transform: translate(-30px, 50px) scale(0.85);
        opacity: 0.4;
    }
    100% {
        transform: translate(30px, -30px) scale(1.05);
        opacity: 0.5;
    }
}

header {
    width: 100%;
    position: fixed;
    top: 24px;
    left: 0;
    z-index: 100;
    pointer-events: none;
}

.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    padding: 0 40px;
    position: relative;
    z-index: 101;
    width: 100%;
}

.nav-menu {
    pointer-events: auto;
    display: flex;
    list-style: none;
    gap: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px 34px;
    border-radius: 50px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.1s ease, color 0.4s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-menu a.active {
    opacity: 1;
}

.nav-menu a:active {
    transform: scale(0.92);
}

section.snap-page {
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 2;
}

.hero-section {
    background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

.hero-grid-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(85vw, 650px);
    height: min(60vh, 380px);
    z-index: 3;
    display: flex;
    gap: 16px;
    opacity: 0.35;
    pointer-events: none;
    overflow: hidden;
    mask-image: radial-gradient(circle, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
}

.grid-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.grid-item {
    width: 100%;
    height: 140px;
    border-radius: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.grid-col-up {
    animation: scrollUp 18s linear infinite;
}

.grid-col-down {
    animation: scrollDown 22s linear infinite;
}

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

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

.hero-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    font-family: 'Syne', sans-serif;
    font-size: clamp(3rem, 18vw, 18rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    text-align: center;
    white-space: nowrap;
    color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='800' viewBox='0 0 400 800'%3E%3Crect width='400' height='800' fill='%23f4f2eb'/%3E%3Cg%3E%3CanimateTransform attributeName='transform' type='translate' from='0 0' to='0 -400' dur='5s' repeatCount='indefinite'/%3E%3Ccircle cx='70' cy='60' r='55' fill='%23e63946'/%3E%3Ccircle cx='260' cy='120' r='65' fill='%232a9d8f'/%3E%3Ccircle cx='340' cy='50' r='45' fill='%231d3557'/%3E%3Ccircle cx='140' cy='210' r='60' fill='%23f4a261'/%3E%3Ccircle cx='310' cy='280' r='75' fill='%23e63946'/%3E%3Ccircle cx='60' cy='350' r='50' fill='%232a9d8f'/%3E%3Ccircle cx='70' cy='460' r='55' fill='%23e63946'/%3E%3Ccircle cx='260' cy='520' r='65' fill='%232a9d8f'/%3E%3Ccircle cx='340' cy='450' r='45' fill='%231d3557'/%3E%3Ccircle cx='140' cy='610' r='60' fill='%23f4a261'/%3E%3Ccircle cx='310' cy='680' r='75' fill='%23e63946'/%3E%3Ccircle cx='60' cy='750' r='50' fill='%232a9d8f'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat-y;
    background-size: 100% auto;
    -webkit-background-clip: text;
    background-clip: text;
    pointer-events: none;
}

.scroll-down-btn {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: none;
    opacity: 0;
    transition: transform 0.15s ease, background-color 0.4s ease, opacity 0.5s ease;
}

.scroll-down-btn svg {
    width: 22px;
    height: 22px;
    fill: var(--icon-color);
    transition: fill 0.4s ease;
}

.scroll-down-btn:active {
    transform: translateX(-50%) scale(0.9);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-4px); }
}

.hero-section.animate-in .scroll-down-btn {
    opacity: 1;
    animation: bounce 2.2s infinite ease-in-out;
    transition-delay: 0.2s;
}

.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.scroll-top-btn:active {
    transform: scale(0.95);
}

.scroll-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.scroll-icon {
    position: absolute;
    width: 20px;
    height: 20px;
    fill: var(--icon-color);
    opacity: 0;
    transform: translateY(8px) scale(0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.scroll-top-btn.is-footer .scroll-text {
    opacity: 0;
    transform: translateY(-8px) scale(0.5);
}

.scroll-top-btn.is-footer .scroll-icon {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.about-section {
    background-color: var(--bg-top);
    padding: 90px 40px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: background-color 0.4s ease;
    position: relative;
}

.about-signature-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-12deg);
    font-family: 'Reenie Beanie', cursive;
    font-size: clamp(8rem, 28vw, 32rem);
    color: rgba(255, 255, 255, 0.035);
    pointer-events: none;
    white-space: nowrap;
    z-index: 1;
    user-select: none;
    line-height: 1;
}

.about-container {
    max-width: 1000px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: calc(100vh - 120px);
    padding-right: 4px;
    position: relative;
    z-index: 2;
}

.badge-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.badge {
    background-color: var(--badge-bg);
    color: var(--badge-text);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.1s ease, background-color 0.4s ease, color 0.4s ease;
}

.badge:active {
    transform: scale(0.95);
}

.scramble-title {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2rem, 4.5vw, 4rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
    word-break: break-word;
    display: block;
    min-height: auto;
    padding: 4px 0;
    transition: color 0.4s ease;
}

.about-desc {
    font-size: clamp(0.9rem, 1.3vw, 1.15rem);
    line-height: 1.6;
    color: var(--text-sub);
    max-width: 850px;
    word-break: break-word;
    transition: color 0.4s ease;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 6px;
}

.info-card {
    background-color: var(--card-bg-project);
    border: none;
    border-radius: 0 16px 16px 16px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, background-color 0.4s ease;
    width: 100%;
    touch-action: manipulation;
}

.info-card * {
    pointer-events: none;
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card-icon {
    width: 18px;
    height: 18px;
    fill: var(--text-main);
    opacity: 0.9;
    flex-shrink: 0;
}

.info-card h4 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.4s ease;
}

.info-card p {
    font-size: 0.8rem;
    color: var(--text-sub);
    word-break: break-word;
    transition: color 0.4s ease;
}

.project-section {
    background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: background-color 0.4s ease;
}

.project-container {
    max-width: 1000px;
    width: 100%;
    height: calc(80vh - 120px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-flex-layout {
    display: flex;
    gap: 20px;
    width: 100%;
    flex: 1;
}

.project-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.project-right {
    flex: 1;
    display: flex;
    height: 100%;
}

.project-card {
    background-color: var(--card-bg-project);
    border: none;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, background-color 0.4s ease;
    width: 100%;
    touch-action: manipulation;
}

.project-card:active {
    background-color: #333;
}

.project-card.flex-main {
    flex: 1;
}

.project-card.flex-compact {
    flex: 0 0 auto;
    padding: 18px 20px;
}

.project-card.full-height {
    height: 100%;
}

.card-top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
    width: 100%;
}

.arrow-icon {
    width: 16px;
    height: 16px;
    fill: var(--text-sub);
    transition: fill 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.project-card:active .arrow-icon {
    fill: var(--text-main);
    transform: translate(2px, -2px);
}

.project-card-img-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.project-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.project-card-body {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    justify-content: flex-end;
}

.project-card::after {
    content: '';
    position: absolute;
    top: -50%;
    bottom: -50%;
    left: -50%;
    width: 60%;
    transform: translateX(-150%) skewX(-20deg);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        var(--shimmer-color) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 3.2s infinite ease-in-out;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-150%) skewX(-20deg); }
    60%, 100% { transform: translateX(350%) skewX(-20deg); }
}

.project-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-sub);
    transition: color 0.4s ease;
}

.project-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 4px 0;
    word-break: break-word;
    transition: color 0.4s ease;
}

.project-desc {
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.4;
    word-break: break-word;
    transition: color 0.4s ease;
}

.dots-indicator {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-sub);
    opacity: 0.3;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dot.active {
    opacity: 1;
    transform: scale(1.2);
    background-color: var(--text-main);
}

.footer-section {
    background-color: var(--bg-top);
    padding: 100px 40px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.4s ease;
}

.footer-container {
    max-width: 1000px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.footer-top {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 24px;
    margin-top: 140px;
}

.footer-brand p {
    color: var(--text-sub);
    margin-top: 10px;
    font-size: 1rem;
    transition: color 0.4s ease;
}

.footer-links {
    display: flex;
    flex-direction: row;
    gap: 24px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.social-link svg {
    width: 18px;
    height: 18px;
    fill: var(--icon-color);
    transition: transform 0.2s ease, fill 0.4s ease;
}

.social-link:hover svg {
    transform: translate(3px, -3px);
}

.social-link:active {
    transform: scale(0.95);
}

.footer-bottom {
    padding-top: 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    transition: border-color 0.4s ease;
}

.footer-present {
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.3;
    color: var(--text-main);
    transition: color 0.4s ease;
    font-family: 'Syne', sans-serif;
    font-size: clamp(1.3rem, 3vw, 3.8rem);
}

.about-desc,
.info-card,
.project-card,
.footer-brand p,
.footer-links,
.footer-bottom {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
    transition: opacity 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.badge-container {
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
              transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.animate-in .badge-container,
.animate-in .about-desc,
.animate-in .info-card,
.animate-in .project-card,
.animate-in .footer-brand p,
.animate-in .footer-links,
.animate-in .footer-bottom {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.about-section.animate-in .badge-container { transition-delay: 0.05s; }
.about-section.animate-in .about-desc { transition-delay: 0.12s; }
.about-section.animate-in .info-card:nth-child(1) { transition-delay: 0.18s; }
.about-section.animate-in .info-card:nth-child(2) { transition-delay: 0.24s; }
.about-section.animate-in .info-card:nth-child(3) { transition-delay: 0.30s; }

.project-section.animate-in .project-card { transition-delay: 0.1s; }

.footer-section.animate-in .footer-brand p { transition-delay: 0.1s; }
.footer-section.animate-in .footer-links { transition-delay: 0.18s; }
.footer-section.animate-in .footer-bottom { transition-delay: 0.26s; }

@media (max-width: 768px) {
    header {
        top: 16px;
    }

    .navbar {
        padding: 0 12px;
    }

    .nav-menu {
        display: flex;
        gap: 12px;
        padding: 14px 24px;
        max-width: calc(100vw - 24px);
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-menu a {
        font-size: 0.8rem;
    }

    .about-section, .project-section, .footer-section {
        padding: 20px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .project-container, about-container, footer-container {
        height: auto;
        max-height: calc(90vh - 120px);
    }

    .project-flex-layout {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 16px;
        padding: 4px 0 12px 0;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    .project-left, .project-right {
        min-width: 100%;
        width: 100%;
        scroll-snap-align: center;
        scroll-snap-stop: always;
        flex: none;
        height: auto;
    }

    .project-left {
        gap: 12px;
    }

    .project-card {
        padding: 16px;
    }

    .project-card.flex-compact {
        padding: 14px 16px;
    }

    .dots-indicator {
        display: flex;
    }

    .info-card {
        padding: 28px 18px;
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
    }

    .scroll-top-btn {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}
