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

html { scroll-behavior: smooth; }

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── NAV ── */
nav {
    position: fixed;
    top: 16px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 10px 28px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 50px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    z-index: 1000;
    /* entrance animation */
    opacity: 0;
    transform: translateY(-24px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s;
}

nav.nav-loaded {
    opacity: 1;
    transform: translateY(0);
}

nav a {
    color: #555;
    font-size: 15px;
    font-style: italic;
    text-decoration: none;
    transition: color 0.2s, font-size 0.2s ease;
    letter-spacing: 0.01em;
    display: inline-block;
}

nav a:hover { color: #000; font-size: 20px; text-decoration: none; }
nav a.active { color: #000; font-weight: 600; font-size: 20px; }

.nav-btn {
    background: #000;
    color: #fff !important;
    font-style: normal !important;
    padding: 7px 18px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 14px !important;
    transition: background 0.2s !important;
}
.nav-btn:hover { background: #333; text-decoration: none !important; }

.nav-hamburger {
    font-size: 20px;
    color: #555;
    text-decoration: none;
    font-style: normal;
    display: inline-block;
    transition: color 0.2s, transform 0.2s ease;
    line-height: 1;
}
.nav-hamburger:hover {
    color: #000;
    transform: scale(1.2);
}
.nav-hamburger.active {
    color: #000;
    font-weight: 600;
}

/* ── MENU PAGE ── */
.menu-page {
    background: #fff;
}

.menu-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: Garamond, serif;
    font-style: italic;
    font-size: 2rem;
    color: #333;
}

/* ── HAMBURGER DROPDOWN ── */
.nav-hamburger-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 2px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.nav-hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #555;
    border-radius: 2px;
    transition: background 0.2s, transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
    transform-origin: center;
}

.nav-hamburger-btn:hover span { background: #000; }

/* Animate to X when open */
.nav-hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger-btn.open span:nth-child(2) { opacity: 0; width: 0; }
.nav-hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* The dropdown panel */
.nav-dropdown {
    position: fixed;
    /* aligns with the nav pill: top 16px + pill height (~44px) + 8px gap */
    top: 68px;
    right: 20px;
    width: calc(100% - 40px); /* matches nav pill left/right margins */
    max-width: calc(100vw - 40px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 20px;
    box-shadow: 0 8px 48px rgba(0,0,0,0.12);
    z-index: 999;
    padding: 48px 60px 56px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* hidden state */
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-dropdown.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.nav-dropdown-link {
    font-family: Garamond, serif;
    font-style: italic;
    font-size: clamp(2.4rem, 6vw, 5rem);
    color: #bbb;
    text-decoration: none;
    line-height: 1.15;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
    width: fit-content;
}

.nav-dropdown-link:hover {
    color: #000;
    transform: translateX(8px);
}

.nav-dropdown-divider {
    width: 100%;
    height: 1px;
    background: rgba(0,0,0,0.07);
    margin: 4px 0;
}

.nav-dropdown-footer {
    margin-top: auto;
    padding-top: 32px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: #aaa;
}

/* ── SCROLL REVEAL ── */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* stagger delays for work images */
.col_span4:nth-child(1) { transition-delay: 0s; }
.col_span2:nth-child(2) { transition-delay: 0.1s; }
.col_span2:nth-child(3) { transition-delay: 0.2s; }
.col_span4:nth-child(4) { transition-delay: 0.3s; }

/* stagger delays for about panels */
.sectionabout1 { transition-delay: 0s; }
.sectionabout2 { transition-delay: 0.15s; }
.sectionabout3 { transition-delay: 0.3s; }

/* ── SECTIONS SHARED ── */
section { min-height: 100vh; }

/* ── HOME ── */
#home {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 80px;
    padding: 0 40px;
    position: relative;
}

.avatar-wrap {
    position: relative;
    display: inline-block;
    width: 380px;
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

.avatar {
    width: 100%;
    display: block;
    transition: opacity 0.4s ease;
}

.avatar-hover {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.avatar-wrap:hover .avatar-default { opacity: 0; }
.avatar-wrap:hover .avatar-hover   { opacity: 1; }

.hometext {
    max-width: 560px;
    text-align: center;
}
.hometext h1 {
    font-family: Garamond, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
    animation: sway 1.4s ease-in-out infinite;
}

.hometext p {
    font-size: 1.8rem;
    line-height: 1.55;
    color: #333;
    font-family: 'Courier New', Courier, monospace;
    transition: color 0.3s ease;
}

.emoji {
    font-size: 24px;
    margin-top: 12px;
    display: inline-block;
    animation: float 1.4s ease-in-out infinite;
}
.scroll-indicator {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 15px;
    color: #888;
}

.scroll-indicator .arrow {
    font-size: 22px;
    margin-top: 6px;
    display: inline-block;
    animation: arrowbounce 1.4s ease-in-out infinite;
}

@keyframes arrowbounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50%       { transform: translateY(10px); opacity: 0.5; }
}

/* ── WORK ── */
#work {
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 100px 20px 60px;
}

.mainwork {
    max-width: 1024px;
    width: 100%;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    padding: 10px;
    border-radius: 6px;
    background: #fff;
}

.wrapperwork {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    padding: 16px;
}

.col_span4 { grid-column: span 4; }
.col_span2 { grid-column: span 2; }
.row_span2 { grid-row: span 2; }

.wrapperwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
    display: block;
    transition: transform 0.3s ease;
}
.wrapperwork img:hover { transform: scale(1.04); }

/* ── ABOUT ── */
#about {
    background: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 100px 20px 60px;
}

.mainabout {
    max-width: 1100px;
    width: 100%;
    box-shadow: 0 0 10px rgba(0,0,0,0.15);
    padding: 10px;
    border-radius: 6px;
    background: #fff;
}

.wrapperabout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    padding: 20px;
}

.sectionabout1 {
    font-family: Garamond, serif;
    font-weight: 400;
    font-size: 22px;
    padding: 20px;
    background: #fff;
    color: #333;
    border-radius: 5px;
    line-height: 1.6;
}
.sectionabout2, .sectionabout3 {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.7;
    padding: 20px;
    background: #fff;
    color: #333;
    border-radius: 5px;
}

/* ── RESUME ── */
#resume {
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 120px 20px 80px;
}

#resume h2 {
    font-family: Garamond, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 2.5rem;
    color: #111;
}

#resume p {
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    color: #555;
    text-align: center;
    max-width: 480px;
    line-height: 1.6;
}

.resume-btn {
    display: inline-block;
    background: #000;
    color: #fff;
    padding: 14px 36px;
    font-size: 16px;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
    font-family: system-ui, sans-serif;
}
.resume-btn:hover { background: #333; }

/* ── CONTACT ── */
#contact {
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 80px 20px;
    min-height: 50vh;
}

#contact h2 {
    font-family: Garamond, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 2.5rem;
    color: #fff;
}
#contact p {
    font-family: 'Courier New', Courier, monospace;
    color: #aaa;
    font-size: 15px;
}
#contact a.contact-link {
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px;
    text-decoration: underline;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    nav { gap: 14px; padding: 8px 18px; top: 10px; right: 10px; }
    nav a { font-size: 13px; }

    #home {
        flex-direction: column;
        gap: 36px;
        padding: 110px 20px 60px;
        text-align: center;
    }
    .avatar-wrap { width: 240px; }
    .hometext h1 { font-size: 2rem; }
    .hometext p { font-size: 1.2rem; }

    .wrapperwork { grid-template-columns: 1fr 1fr; }
    .col_span4, .col_span2 { grid-column: span 2; }

    .wrapperabout { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    nav { gap: 8px; padding: 6px 14px; }
    .nav-btn { padding: 5px 12px; }

    .wrapperwork { grid-template-columns: 1fr; }
    .col_span4, .col_span2, .row_span2 {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
}

/* stagger delays for work images */
.col_span4.row_span2:nth-child(1) { transition-delay: 0s; }
.col_span2.row_span2:nth-child(2) { transition-delay: 0.1s; }
.col_span2.row_span2:nth-child(3) { transition-delay: 0.2s; }
.col_span4.row_span2:nth-child(4) { transition-delay: 0.3s; }

/* stagger delays for resume + contact */
#resume h2      { transition-delay: 0s; }
#resume p       { transition-delay: 0.1s; }
.resume-btn     { transition-delay: 0.2s; }
#contact h2     { transition-delay: 0s; }
#contact p      { transition-delay: 0.1s; }
.contact-link   { transition-delay: 0.2s; }

/* ── PAGE LOAD ENTRANCE ANIMATIONS ── */

/* Home elements fade + rise on load */
.home-enter {
    animation: homeEnter 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes homeEnter {
    from {
        opacity: 0;
        transform: translateY(32px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Avatar scales + fades in */
.avatar-wrap.home-enter {
    animation: avatarEnter 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes avatarEnter {
    from {
        opacity: 0;
        transform: scale(0.88) translateY(24px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Scroll indicator fades in from below, stays in translated position */
.scroll-indicator.home-enter {
    animation: scrollEnter 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes scrollEnter {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}