/* Global Settings */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: default;
}

body {
    background-color: #FFFFFF;
    color: #333333;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 300;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    transition: background-color 0.8s ease, color 0.8s ease;
}

/* Color Pollution Effect */
#bg-pollution {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: #000000;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    transition: width 1.2s cubic-bezier(0.8, 0, 0.2, 1), height 1.2s cubic-bezier(0.8, 0, 0.2, 1);
}

body.black-theme {
    background-color: #000000;
    color: #FFFFFF;
}

body.black-theme #bg-pollution {
    width: 300vmax;
    height: 300vmax;
}

/* Custom Cursor */
#custom-cursor {
    width: 8px;
    height: 8px;
    background-color: #0cffd1; /* Future Fluorescent Cyan-Green */
    box-shadow: 0 0 8px #0cffd1; /* Subtle Neon Glow */
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.interactive:hover {
    cursor: none !important;
}

/* Main Container */
main {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

main > section {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

main > section.active {
    opacity: 1;
    pointer-events: all;
}

/* Hero Section */
.cube-wrapper {
    perspective: 1000px;
    width: 100px;
    height: 100px;
    margin-bottom: 40px;
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-30deg) rotateY(45deg);
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), scale 0.1s ease;
}

.cube:active {
    scale: 0.92;
}

.face {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #222222 0%, #333333 50%, #111111 100%);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5), 0 0 5px rgba(0,0,0,0.3);
}

.face.front  { transform: rotateY(0deg) translateZ(50px); background: linear-gradient(135deg, #444444 0%, #222222 100%); }
.face.back   { transform: rotateY(180deg) translateZ(50px); }
.face.right  { transform: rotateY(90deg) translateZ(50px); background: linear-gradient(135deg, #333333 0%, #111111 100%); }
.face.left   { transform: rotateY(-90deg) translateZ(50px); }
.face.top    { transform: rotateX(90deg) translateZ(50px); background: linear-gradient(135deg, #555555 0%, #333333 100%); }
.face.bottom { transform: rotateX(-90deg) translateZ(50px); background: #000000; }

.hint {
    letter-spacing: 0.1em;
    opacity: 0.6;
}

/* Menu Grid Systems */
.menu-grid {
    display: grid;
    gap: 30px 60px;
    text-align: center;
}

.menu-grid.primary {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.menu-grid.works {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.menu-item {
    letter-spacing: 0.2em;
    transition: color 0.3s ease, opacity 0.3s ease;
    padding: 10px;
    cursor: pointer;
}

.menu-item:hover {
    color: #0cffd1; /* Change to fluorescent cyan-green */
    text-decoration: underline;
    text-decoration-color: #0cffd1;
    text-underline-offset: 4px;
    text-decoration-thickness: 0.5px;
}

.back-btn {
    margin-top: 80px;
    letter-spacing: 0.2em;
    opacity: 0.6;
    transition: opacity 0.3s ease, color 0.3s ease;
    cursor: pointer;
    padding: 10px;
}

.back-btn:hover {
    opacity: 1;
    color: #0cffd1;
    text-decoration: underline;
    text-decoration-color: #0cffd1;
    text-underline-offset: 4px;
}

/* Helper Classes */
.fade-out {
    opacity: 0 !important;
}

/* Detail Page Layout */
.detail-page {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.detail-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

.left-col {
    width: 18%;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start; /* Align with top text */
    padding-right: 40px; /* Symmetry: space between number and line */
    padding-top: 15vh; /* Match right-col detail-header margin-top */
}

.split-line {
    width: 1px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
}

.right-col {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    padding-left: 40px; /* Symmetry: space between line and content */
    display: flex;
    flex-direction: column;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.right-col::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.big-number {
    font-size: 120px;
    font-weight: 700; /* Bold as per latest request */
    color: #FFFFFF;
    line-height: 1; /* Tight line height for better alignment */
    margin-top: -15px; /* Offset to align top of '1' with top of title text */
}

.detail-header {
    margin-top: 15vh;
    margin-bottom: 60px;
    max-width: calc(85% * 0.666); /* 2/3 rule: text width cannot exceed 2/3 of image width */
}

.detail-header .title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: 0.05em;
}

.detail-header .description p {
    font-size: 11px;
    line-height: 1.6;
    opacity: 0.8;
}

.image-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 85%;
    margin-bottom: 10vh;
}

.portfolio-img {
    width: 100%;
    aspect-ratio: 1.414 / 1;
    object-fit: cover;
    background-color: #111111;
}

.portfolio-img.auto-height {
    aspect-ratio: auto;
    height: auto;
}


.fixed-back {
    position: fixed;
    bottom: 40px;
    left: 40px;
    font-size: 11px;
    letter-spacing: 0.1em;
    opacity: 0.6;
    transition: opacity 0.3s ease, color 0.3s ease;
    cursor: pointer;
    z-index: 100;
    padding: 10px;
}

.fixed-back:hover {
    opacity: 1;
    color: #0cffd1;
    text-decoration: underline;
    text-decoration-color: #0cffd1;
    text-underline-offset: 4px;
}

/* Resume Page Styles */
.resume-wrapper {
    display: flex;
    max-width: 900px;
    width: 90%;
    height: 100%;
    margin: 0 auto;
    position: relative;
    padding-top: 80px;
    transform: translateX(130px); /* Shift entire resume content 130px to the right (150px - 20px) */
}

.resume-left {
    width: 220px;
    flex-shrink: 0;
}

.photo-sticky {
    position: sticky;
    top: 80px;
}

.resume-photo {
    width: 100%;
    height: auto;
    border-radius: 4px;
    /* No filter as requested */
    transition: transform 0.3s ease;
}

.resume-right {
    flex: 1;
    margin-left: 40px; /* Exact 40px as requested */
    max-width: 600px; /* Max width 600px as requested */
    padding-bottom: 150px;
    overflow-y: auto;
    scrollbar-width: none;
}

.resume-right::-webkit-scrollbar {
    display: none;
}

.resume-header {
    margin-bottom: 40px;
}

.resume-header .name {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.contact-info {
    font-size: 11px;
    color: #999999;
    letter-spacing: 0.05em;
}

.resume-section {
    margin-bottom: 40px; /* 40px spacing between major sections */
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px; /* 10px bottom margin for title */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    letter-spacing: 0.1em;
}

.resume-item {
    margin-bottom: 20px;
}

.resume-item p {
    font-size: 11px;
    line-height: 1.6;
    margin-bottom: 5px;
}

.resume-item .desc {
    opacity: 0.7;
    font-size: 11px;
}

.resume-footer-back {
    margin-top: 40px;
    font-size: 11px;
    letter-spacing: 0.1em;
    opacity: 0.6;
    transition: opacity 0.3s ease, color 0.3s ease;
    cursor: pointer;
    display: inline-block;
    padding: 10px 0;
}

.resume-footer-back:hover {
    opacity: 1;
    color: #0cffd1;
    text-decoration: underline;
    text-decoration-color: #0cffd1;
    text-underline-offset: 4px;
}

/* Contact Page Styles */
#contact-page {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.contact-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 40px;
    letter-spacing: 0.1em;
}

.contact-methods {
    font-size: 12px;
    line-height: 2.0;
    color: #E0E0E0;
    margin-bottom: 40px;
}

.contact-note {
    font-size: 10px;
    color: #888888;
    margin-bottom: 40px;
    letter-spacing: 0.05em;
}

.fixed-back-center {
    font-size: 11px;
    letter-spacing: 0.1em;
    opacity: 0.6;
    transition: opacity 0.3s ease, color 0.3s ease;
    cursor: pointer;
    padding: 10px;
}

.fixed-back-center:hover {
    opacity: 1;
    color: #0cffd1;
    text-decoration: underline;
    text-decoration-color: #0cffd1;
    text-underline-offset: 4px;
}

/* Pop-out Animation */
@keyframes popOutBounce {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    60% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.pop-out-animation {
    animation: popOutBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Mobile Responsiveness (max-width: 768px) */
@media screen and (max-width: 768px) {
    /* 1. Interaction: Hide custom cursor */
    #custom-cursor {
        display: none !important;
    }
    
    * {
        cursor: auto !important;
    }

    /* CRITICAL: Lock global scroll and ensure 100dvh for mobile browsers */
    html, body {
        height: 100dvh;
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    main {
        height: 100dvh;
        width: 100%;
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* 2. Global Section Base Style: Absolutely centered by default */
    main > section {
        position: absolute;
        height: 100dvh;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        overflow: hidden;
        padding: 0;
    }

    /* 3. Hero and Menu Pages: Absolute centering */
    #hero-section,
    #primary-menu,
    #works-menu,
    #contact-page {
        height: 100dvh !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    /* Menu Grids: Single column */
    .menu-grid.primary,
    .menu-grid.works {
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding: 0;
        justify-content: center;
        align-items: center;
    }

    .menu-item {
        font-size: 14px;
        padding: 10px;
    }

    /* 4. Precision Local Scroll: Isolated to detail-page and resume-page */
    .detail-page,
    #resume-page {
        display: block !important; /* Switch from flex center to block for natural flow */
        overflow-y: auto !important; /* ENABLE LOCAL SCROLL ON SECTION */
        -webkit-overflow-scrolling: touch;
        padding: 0; /* Remove padding to avoid clipping top content */
    }

    /* Detail Page Container: Natural flow */
    .detail-container {
        flex-direction: column;
        padding: 60px 20px; /* Top padding for space */
        height: auto;
        width: 100%;
        display: block;
    }

    .left-col {
        width: 100%;
        justify-content: flex-start;
        padding-right: 0;
        padding-top: 0;
        margin-bottom: 20px;
        display: block;
    }

    .big-number {
        font-size: 60px;
        margin-top: 0;
        text-align: left;
    }

    .split-line {
        display: none; /* Hide vertical line on mobile */
    }

    .right-col {
        padding-left: 0;
        width: 100%;
        height: auto;
        overflow: visible; /* Content flows in parent's scroll */
        display: block;
    }

    .detail-header {
        margin-top: 0;
        margin-bottom: 40px;
        max-width: 100% !important; /* Cancel 2/3 rule on mobile */
    }

    .detail-header .title {
        font-size: 18px;
    }

    .detail-header .description p {
        font-size: 12px;
        line-height: 1.6;
    }

    .image-stack {
        width: 100%;
        gap: 10px; /* Strict 10px gap as requested */
        display: flex;
        flex-direction: column;
        margin-bottom: 60px;
    }

    .portfolio-img {
        width: 100%;
        height: auto;
        aspect-ratio: auto; /* Allow natural aspect ratio for images */
    }

    .fixed-back {
        position: relative;
        bottom: 0;
        left: 0;
        margin-top: 20px;
        padding: 20px 0;
        text-align: left;
        width: 100%;
        display: block;
    }

    /* 5. Resume Page: Isolated scrolling flow */
    .resume-wrapper {
        flex-direction: column;
        transform: none !important; /* Revert desktop right shift */
        width: 100%;
        padding: 60px 20px;
        height: auto;
        display: block;
    }

    .resume-left {
        width: 100%;
        margin-bottom: 30px;
        display: block;
    }

    .photo-sticky {
        position: static; /* Disable sticky for better mobile scroll */
        display: flex;
        justify-content: center;
    }

    .resume-photo {
        width: 180px;
        margin: 0 auto;
    }

    .resume-right {
        margin-left: 0;
        max-width: 100%;
        padding-bottom: 60px;
        overflow: visible;
        display: block;
    }

    .resume-header .name {
        font-size: 26px;
        text-align: center;
    }

    .contact-info {
        text-align: center;
    }

    .resume-footer-back {
        display: block;
        text-align: center;
        margin-top: 40px;
    }

    /* 6. Contact Page: Always centered */
    #contact-page .contact-container {
        padding: 0 20px;
    }

    .contact-title {
        font-size: 20px;
    }
    
    .contact-methods {
        font-size: 11px;
    }
}


