@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css');

@font-face {
    font-family: 'ChangwonDanggamAsak';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2108@1.1/CWDangamAsac-Bold.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-green: #174528;
    --brand-green: #12532a; /* New brand green */
    --text-white: #ffffff;
    --text-black: #000000;
    --font-main: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: #051A0E;
    color: var(--text-white);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ================= Hero Section ================= */
.hero-section {
    position: relative;
    background-color: #051A0E; /* Very dark green background */
    color: var(--brand-green); /* Updated brand color */
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for modern browsers */
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Clips the blob */
}

/* Header */
.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 3vw 4vw;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 0.8vw;
    letter-spacing: 0.5px;
    z-index: 1000;
    mix-blend-mode: exclusion;
    pointer-events: none;
}

@media (max-width: 768px) {
    .header {
        padding: 5vw 8vw 5vw 5vw !important; /* Increased right padding to 8vw to prevent cutoff */
    }
    .header-left {
        gap: 6vw !important; /* Slightly reduced gap from 8vw to ensure fit on narrower screens */
    }
    .header-left a {
        font-size: 4vw !important; /* Slightly reduced from 4.2vw */
        letter-spacing: 0.1em;
        white-space: nowrap;
    }
}

.header-left {
    display: flex;
    gap: 2vw;
}

.header-left a {
    text-transform: uppercase;
}

.header-left .logo-link {
    font-weight: 700;
}

.header-right {
    text-align: right;
}

.header-right.social-icons {
    display: flex;
    gap: 1.5vw;
    align-items: center;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.social-icons a:hover {
    transform: translateY(-3px);
    opacity: 0.8;
}

/* Layer styling for perfectly stacked text */
.text-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Typography First - Huge Text */
.massive-text {
    font-family: var(--font-main);
    font-size: 26vw; /* Increased size to fill width */
    font-weight: 800; /* Thick Gothic style */
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    margin: 0;
    user-select: none;
}

/* Scatter-to-Gather Animation */
.scatter-gather-text {
    animation: gatherEffect 2.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes gatherEffect {
    0% {
        letter-spacing: 20vw;
        filter: blur(15px);
        opacity: 0;
        transform: scale(1.1);
    }
    100% {
        letter-spacing: -0.02em; /* Slightly tighter for impact */
        filter: blur(0px);
        opacity: 1;
        transform: scale(1);
    }
}

/* Base text is Neon Green */
.base-layer .massive-text {
    color: var(--brand-green);
}

/* ================= 3D Glass Blob ================= */
.glass-blob {
    position: absolute;
    width: 35vw;
    height: 35vw;
    min-width: 300px;
    min-height: 300px;
    /* Organic Blob Shape */
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    
    /* The Glass Refraction */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.02);
    
    /* 3D Glossy Edges */
    box-shadow: 
        inset 0 0 40px rgba(255, 255, 255, 0.15),
        inset -20px -20px 40px rgba(0, 0, 0, 0.4),
        0 20px 50px rgba(0, 0, 0, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    
    overflow: hidden; /* Critical: clips the magnified text inside */
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%); /* Centered purely by transform */
    z-index: 10;
    pointer-events: none; /* Let mouse interact with the page, not the blob */
    
    /* Blob Morphing Animation */
    animation: morph 8s ease-in-out infinite alternate;
}

@keyframes morph {
    0%   { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
    33%  { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
    66%  { border-radius: 50% 50% 30% 70% / 50% 60% 30% 40%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 50% 40% 50%; }
}

/* The text inside the blob */
.glass-layer .massive-text {
    color: #ffffff; /* Turns white inside the lens */
    opacity: 0.95;
    
    /* Chromatic Aberration Effect */
    text-shadow: 
        8px 0 0 rgba(255, 0, 0, 0.8),
        -8px 0 0 rgba(0, 255, 255, 0.8);
}

/* Hide scrollbar for Chrome, Safari and Opera */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Pagination */
.page-btn {
    @apply w-10 h-10 flex items-center justify-center border border-white/10 text-xs transition-all duration-300;
}
.page-btn.active {
    @apply bg-brand-green border-brand-green text-white;
}
.page-btn:hover:not(.active) {
    @apply border-white text-white;
}

/* Admin Dashboard Custom scrollbar */
.scrollbar-style::-webkit-scrollbar {
    width: 2px;
}
.scrollbar-style::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}
.scrollbar-style::-webkit-scrollbar-thumb {
    background: var(--brand-green);
}

/* Quill Editor Overrides */
.ql-toolbar.ql-snow {
    border: none !important;
    background: #f3f4f6;
    padding: 8px !important;
}
.ql-container.ql-snow {
    border: none !important;
}
.ql-editor {
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.6;
}
.ql-editor img {
    margin: 20px 0;
    width: 100%;
    height: auto;
}

/* Modal Animations */
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.animate-slide-up {
    animation: slideUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Responsive Grid fixes & Mobile Typography Floors */
@media (max-width: 768px) {
    #portfolio-container, #recent-works-container {
        @apply gap-4 bg-transparent p-4;
    }
    .portfolio-item {
        @apply border border-white/10;
    }

    /* Universal font floor for mobile */
    .text-xs, .text-\[10px\], .text-\[11px\], .text-\[12px\] {
        font-size: 14px !important;
    }

    /* Large Category requirement (Adjusted to be 'sub-menu' size) */
    .mobile-category-large {
        font-size: 16px !important; /* Reduced from 28px as per 'sub-menu' request */
        letter-spacing: 0.05em !important;
    }

    /* Header adjustments */
    .header {
        padding: 20px !important;
    }
    
    /* FAB adjustments for touch & space */
    .fab-container {
        right: 15px !important; /* Move closer to edge */
        bottom: 20px !important;
        gap: 10px !important;
    }
    .fab-btn {
        width: 48px !important; /* Smaller size */
        height: 48px !important;
    }
    .fab-btn svg {
        width: 22px !important;
        height: 22px !important;
    }
    .fab-label {
        right: 60px !important; /* Adjust label position */
    }
}

/* Floating Action Buttons (FAB) */
.fab-container {
    position: fixed;
    bottom: 40px;
    right: 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 5000;
}

.fab-btn {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--brand-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 35px rgba(0,0,0,0.6);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(255,255,255,0.15);
}

.fab-btn svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.fab-btn:hover svg {
    transform: scale(1.15);
}

.fab-btn:hover {
    transform: translateY(-5px) scale(1.1);
    background: #ffffff;
    color: var(--brand-green);
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

.fab-label {
    position: absolute;
    right: 75px;
    background: rgba(0,0,0,0.8);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.fab-btn:hover .fab-label {
    opacity: 1;
}

/* Specific Home Grid adjustment */
#recent-works-container {
    @apply grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-[1px] bg-white/10;
}
