/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 24px 0;
    z-index: 100;
    mix-blend-mode: difference;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .nav {
        padding: 16px 0;
        mix-blend-mode: normal;
        /* Disable difference mode for glass bg to show */
        background: rgba(10, 10, 10, 0.7);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-family-display);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: #fff;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-item {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s ease;
}

.nav-item:hover {
    color: #fff;
}

/* Hero Section: Bento Grid */
.hero-bento-section {
    padding: 120px 0 60px;
    /* Reduced top padding for mobile */
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    /* Explicit gap for mobile */
    width: 100%;
}

@media (min-width: 960px) {
    .hero-bento-section {
        padding: 160px 0 80px;
    }

    .bento-grid {
        grid-template-columns: repeat(12, 1fr);
        grid-template-rows: minmax(300px, auto) 180px;
        gap: var(--grid-gap);
    }

    /* Box 1: Intro (Big Left) */
    .box-intro {
        grid-column: span 8;
        grid-row: span 1;
    }

    /* Box 2: Visual (Big Right) */
    .box-visual {
        grid-column: span 4;
        grid-row: span 2;
    }

    /* Box 3: Status (Bottom Left) */
    .box-status {
        grid-column: span 4;
        grid-row: span 1;
    }

    /* Box 4: Tech Stack (Bottom Middle) */
    .box-tech {
        grid-column: span 4;
        grid-row: span 1;
    }
}

.bento-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    /* Smaller radius for mobile */
    padding: 24px;
    /* Reduced padding for mobile */
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

@media (min-width: 768px) {
    .bento-box {
        border-radius: var(--radius-lg);
        padding: 40px;
    }
}

.bento-box:hover {
    border-color: var(--glass-border-hover);
}

/* Specific Box Styles */
.box-intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.intro-title {
    font-size: clamp(32px, 8vw, 64px);
    /* Optimized clamp for mobile */
    line-height: 1.1;
    margin-bottom: 16px;
    font-weight: 700;
}

.intro-desc {
    font-size: 16px;
    /* Readable text size */
    color: var(--text-secondary);
    max-width: 480px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.intro-actions {
    display: flex;
    flex-wrap: wrap;
    /* allow wrap on very small screens */
    gap: 12px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    flex: 1;
    /* Stretch buttons on mobile */
    text-align: center;
}

@media (min-width: 480px) {
    .btn {
        flex: 0 1 auto;
        /* Reset flex for larger buttons */
        width: auto;
    }
}

.btn-primary {
    background: #fff;
    color: #000;
}

.btn-primary:hover {
    background: #ccc;
    transform: translateY(-2px);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Box Visual (Avatar) */
.box-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    /* Slightly darker */
}

/* Blob Mask (Recycled from previous step) */
.hero-blob-mask {
    width: 100%;
    height: 100%;
    max-width: 300px;
    max-height: 300px;
    /* Morphing Shape logic preserved if you want, or simpler circle */
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: blobMorph 10s ease-in-out infinite;
    overflow: hidden;
}

.hero-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.bento-box:hover .hero-avatar-img {
    filter: grayscale(0%);
}


/* Box Status */
.box-status {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
    animation: pulse 2s infinite;
}

.status-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.location-badge {
    margin-top: auto;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    justify-content: space-between;
}

/* Box Tech (Marquee) */
.box-tech {
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    /* Mask edges */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.tech-track {
    display: flex;
    gap: 24px;
    animation: marquee 20s linear infinite;
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 500;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Mobile Nav Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    z-index: 102;
}

.bar {
    width: 24px;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease;
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        /* Transparency is MANDATORY for blur to be visible. 
           0.9 keeps it dark/blocking, but allows the filter to run. */
        background: rgba(10, 10, 10, 0.9);

        /* Extreme blur to hide all details */
        backdrop-filter: blur(50px);
        -webkit-backdrop-filter: blur(50px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        transform: translateY(-100%);
        transition: transform 0.5s var(--ease-out-expo);
        z-index: 101;
    }

    .nav-links.active {
        transform: translateZ(0);
        /* Hardware accel */
        mix-blend-mode: normal;
        /* Ensure image looks natural */
    }

    .nav-item {
        font-size: 24px;
        font-family: var(--font-family-display);
    }

    /* Hamburger Animation */
    .mobile-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .mobile-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .mobile-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* Decorative background glow behind avatar */
.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(120, 119, 198, 0.2), transparent 70%);
    z-index: -1;
    filter: blur(60px);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: var(--container-padding);
    display: flex;
    align-items: center;
    gap: 16px;
    opacity: 0;
    animation: fadeIn 1.5s ease 1s forwards;
}

.scroll-text {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.scroll-line {
    width: 40px;
    height: 1px;
    background: var(--text-secondary);
    transform-origin: left;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(40px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(2deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

/* Section Common */
.section {
    padding: 80px 0;
    /* Reduced from 120px */
}

@media (max-width: 768px) {
    .section {
        padding: 60px 0;
        /* Even tighter on mobile */
    }
}

.section-header {
    margin-bottom: 40px;
    /* Reduced from 60px */
}

@media (max-width: 768px) {
    .section-header {
        margin-bottom: 24px;
        /* Tighter on mobile */
    }
}

.section-label {
    display: block;
    position: relative;
    /* Ensure it stacks */
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 32px;
    /* Increased from 12px for more breathing room */
}

.section-title {
    font-family: var(--font-family-display);
    font-size: 40px;
    font-weight: 500;
    color: #fff;
}

/* Work Grid */
.work-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Project Cards: Unlocked Motion */
.project-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    /* Faster exit */
}

/* Hover State: Container */
.project-card:hover {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 255, 255, 0.05);
    transform: translateY(-4px);
}

.project-link-wrapper {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
    position: relative;
    z-index: 10;
}

/* Featured Card Layout */
.project-card.featured .project-link-wrapper {
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 960px) {
    .project-card.featured .project-link-wrapper {
        grid-template-columns: 1fr 1.2fr;
    }
}

.project-content {
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.8), transparent);
    /* Readability fade */
}

/* Animations Elements */
.project-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-family: var(--font-family-display);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transform: translateY(0);
    transition: transform 0.5s ease;
}

.project-title {
    font-family: var(--font-family-display);
    font-size: 40px;
    margin-bottom: 24px;
    color: var(--text-primary);
    line-height: 1.1;
    transform: translateY(0);
    transition: transform 0.5s ease;
}

/* Reveal Logic: Description & Action */
.project-description {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 40px;
    max-width: 440px;
    line-height: 1.6;

    /* Hidden State */
    opacity: 0.6;
    transform: translateY(10px);
    transition: all 0.5s ease;
    filter: blur(0px);
}

.project-action {
    font-size: 14px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;

    /* Hidden State */
    opacity: 0.8;
    transform: translateX(-10px);
    transition: all 0.5s ease;
}

/* Hover: Reveal Details */
.project-card:hover .project-description {
    opacity: 1;
    color: #fff;
    transform: translateY(0);
}

.project-card:hover .project-action {
    opacity: 1;
    transform: translateX(0);
}

/* Hover: Shift Title Up slightly to make room */
.project-card:hover .project-title {
    transform: translateY(-4px);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.project-action .arrow {
    background: rgba(255, 255, 255, 0.1);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .arrow {
    transform: translateX(8px) scale(1.1);
    background: #fff;
    color: #000;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* Image Container */
.project-image-container {
    min-height: 400px;
    background: #050505;
    position: relative;
    overflow: hidden;
}

.project-placeholder-visual {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
    filter: grayscale(100%) brightness(0.8);
}

.project-card:hover .project-placeholder-visual {
    transform: scale(1.05);
    /* Smooth zoom */
    filter: grayscale(0%) brightness(1.1);
    /* Color bloom */
}

/* Project Images */
.project-elite {
    background-image: url('../assets/images/elite-marry-me.png');
}

.project-invitation {
    background-image: url('../assets/images/invitation.png');
}

.project-enews {
    background-image: url('../assets/images/enews.png');
}

.project-graphic {
    background-image: url('../assets/images/graphic-design.png');
}

/* Compact Cards Layout Fix */
.project-card.compact .project-link-wrapper {
    display: block;
    /* Stacked */
    position: relative;
    height: 320px;
}

.project-card.compact .project-content {
    position: relative;
    z-index: 2;
    height: 100%;
    justify-content: flex-end;
    /* Text at bottom */
    padding: 32px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent 80%);
}

.project-card.compact .project-image-container.compact-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.4;
    transition: opacity 0.5s ease;
}

.project-card.compact:hover .project-image-container.compact-img {
    opacity: 0.2;
    /* Dim more to show text */
}

.project-card.compact .project-title {
    font-size: 24px;
    margin-bottom: 8px;
    transform: translateY(20px);
    /* Pushed down initially */
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.project-card.compact .project-description {
    font-size: 14px;
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Compact Hover Reveal */
.project-card.compact:hover .project-title {
    transform: translateY(0);
}

.project-card.compact:hover .project-description {
    max-height: 60px;
    /* Reveal text */
    opacity: 1;
    margin-bottom: 16px;
}

.project-card.compact .project-action-icon {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
}

.project-card.compact:hover .project-action-icon {
    background: #fff;
    color: #000;
    transform: rotate(45deg);
}

/* Cursor */
.cursor-dot {
    width: 5px;
    height: 5px;
    background-color: #fff;
}

.cursor-outline {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

/* Project Images */
.project-elite {
    background-image: url('../assets/images/elite-marry-me.png');
}

.project-invitation {
    background-image: url('../assets/images/invitation.png');
}

.project-enews {
    background-image: url('../assets/images/enews.png');
}

.project-graphic {
    background-image: url('../assets/images/graphic-design.png');
}

/* Compact Cards Layout Fix */
.project-card.compact .project-link-wrapper {
    padding: 0;
    /* Reset padding to handle image full width possibility or grid */
    display: grid;
    grid-template-columns: 1fr 100px;
    height: 100%;
}

.project-card.compact .project-content {
    padding: 32px;
    z-index: 2;
}

.project-card.compact .project-image-container.compact-img {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    /* Subtle texture background for compact cards */
    transition: opacity 0.4s ease;
    mix-blend-mode: overlay;
}

.project-card.compact:hover .project-image-container.compact-img {
    opacity: 0.2;
}

.project-card.compact .project-action-icon {
    position: absolute;
    top: 32px;
    right: 32px;
    z-index: 3;
}



/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 60px;
    /* Good stack spacing for mobile */
    align-items: start;
}

@media (min-width: 960px) {
    .about-grid {
        grid-template-columns: 1.5fr 1fr;
        gap: 120px;
        /* Wide breather for desktop */
    }
}

.about-headline {
    font-family: var(--font-family-display);
    font-size: clamp(24px, 5vw, 40px);
    line-height: 1.4;
    /* Increased from 1.25 to prevent ascender clash */
    margin-top: 16px;
    /* Explicit gap from label */
    margin-bottom: 32px;
    color: var(--text-primary);
    font-weight: 500;
}

.about-text {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 540px;
}

.detail-group {
    margin-bottom: 48px;
}

.detail-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.scrolling-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tag {
    font-size: 13px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 100px;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-list li {
    margin-bottom: 16px;
}

.detail-main {
    display: block;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.detail-sub {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    padding: 120px 0 60px;
    background: var(--bg-core);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.footer-cta {
    display: inline-block;
    font-family: var(--font-family-display);
    font-size: clamp(32px, 5vw, 64px);
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 120px;
    transition: color 0.3s ease;
}

.footer-cta:hover {
    color: var(--accent);
}

.footer-meta {
    display: flex;
    flex-direction: column;
    gap: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 32px;
}

@media (min-width: 768px) {
    .footer-meta {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.footer-socials {
    display: flex;
    gap: 24px;
}

.footer-socials a {
    font-size: 13px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.footer-socials a:hover {
    color: #fff;
}

.footer-copy {
    font-size: 13px;
    color: #444;
}

.source-link {
    color: #444;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color 0.2s ease;
}

.source-link:hover {
    color: var(--text-secondary);
}