:root {
    --deep-blue: #001F54;
    --royal-blue: #0047AB;
    --pure-white: #FFFFFF;
    --light-gray: #F5F7FA;
    --text-dark: #1A2332;
}

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

body {
    font-family: 'Onest', sans-serif;
    background: var(--pure-white);
    color: var(--text-dark);
    overflow-x: hidden;
    cursor: none;
    min-height: 100vh;
}

@media (max-width: 768px) {
    body {
        cursor: auto;
    }
}

/* Custom Cursor */
.cursor {
    width: 10px;
    height: 10px;
    background: var(--royal-blue);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease;
    mix-blend-mode: difference;
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 2px solid var(--royal-blue);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0.5;
    mix-blend-mode: difference;
}

/* Matrix Background */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.15;
}

/* Navigation */
.compact-nav {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
}

.nav-toggle {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 50%;
    border: 2px solid var(--royal-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 71, 171, 0.2);
}

.nav-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(0, 71, 171, 0.3);
}

.hamburger {
    width: 24px;
    height: 2px;
    background: var(--royal-blue);
    position: relative;
    transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--royal-blue);
    transition: all 0.3s ease;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

.nav-toggle.active .hamburger {
    background: transparent;
}

.nav-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle.active .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

.nav-menu {
    position: absolute;
    top: 80px;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px);
    border-radius: 20px;
    padding: 1.5rem;
    min-width: 250px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 71, 171, 0.1);
}

.nav-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu ul {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 0.5rem;
}

.nav-menu li:last-child {
    margin-bottom: 0;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-menu a:hover {
    background: var(--royal-blue);
    color: var(--pure-white);
    transform: translateX(5px);
}

.nav-menu .icon {
    font-size: 1.2rem;
    opacity: 0.7;
}

.nav-menu a:hover .icon {
    opacity: 1;
}

.nav-divider {
    height: 1px;
    background: rgba(0, 71, 171, 0.1);
    margin: 0.5rem 0;
}

/* Back Button */
.back-button {
    position: fixed;
    top: 2rem;
    left: 2rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 50px;
    border: 2px solid var(--royal-blue);
    color: var(--royal-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 71, 171, 0.2);
    z-index: 1000;
}

.back-button:hover {
    background: var(--royal-blue);
    color: var(--pure-white);
    transform: translateX(-5px);
}

/* Page Container */
.page-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 8rem 4rem 4rem 4rem;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* About Page */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 5rem;
    align-items: start;
    width: 100%;
}

.photo-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.main-photo {
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 71, 171, 0.2);
}

.main-photo img {
    width: 100%;
    height: auto;
    display: block;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.photo-grid img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.text-section h1 {
    font-family: 'Geologica', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--deep-blue);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.subtitle {
    font-size: 1.3rem;
    color: var(--royal-blue);
    margin-bottom: 2rem;
    font-weight: 600;
}

.text-block {
    margin-bottom: 3rem;
}

.text-block p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
    opacity: 0.85;
    margin-bottom: 1rem;
}

.experience {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.exp-block {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    background: rgba(0, 71, 171, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(0, 71, 171, 0.1);
    transition: all 0.3s ease;
}

.exp-block:hover {
    background: rgba(0, 71, 171, 0.05);
    transform: translateX(10px);
}

.exp-logo {
    width: 60px;
    height: 60px;
    background: var(--royal-blue);
    color: var(--pure-white);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Geologica', sans-serif;
    font-weight: 900;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.exp-content h3 {
    font-family: 'Geologica', sans-serif;
    font-size: 1.3rem;
    color: var(--deep-blue);
    margin-bottom: 0.5rem;
}

.exp-period {
    font-size: 0.9rem;
    color: var(--royal-blue);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.exp-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 1400px) {
    .page-container {
        padding: 7rem 3rem 3rem;
    }
}

@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .page-container {
        padding: 6rem 2rem 2rem;
    }
}

@media (max-width: 640px) {
    .text-section h1 {
        font-size: 2.5rem;
    }
    
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   GLOBAL MOBILE FIXES
   ============================================ */
@media (max-width: 768px) {
    /* Hide custom cursor on touch devices */
    .cursor,
    .cursor-follower {
        display: none !important;
    }

    /* Navigation: shift button away from edge */
    .compact-nav {
        top: 1rem;
        right: 1rem;
    }

    .nav-toggle {
        width: 48px;
        height: 48px;
    }

    /* Nav menu: full-width dropdown, not overflow */
    .nav-menu {
        right: 0;
        min-width: 220px;
        max-width: calc(100vw - 2rem);
    }

    /* Back button: smaller on mobile, won't overlap nav */
    .back-button {
        top: 1rem;
        left: 1rem;
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        max-width: calc(100vw - 80px); /* never reach nav button */
    }

    /* Page container scrollable on mobile */
    .page-container {
        padding: 5rem 1.25rem 2rem;
        align-items: flex-start;
        min-height: auto;
        overflow-x: hidden;
    }

    /* About grid stacks vertically */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .text-section h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    /* Photo grid: 2 columns on mobile */
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .photo-grid img {
        height: 120px;
    }

    /* Experience blocks */
    .exp-block {
        gap: 1rem;
        padding: 1.25rem;
    }

    .exp-logo {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }

    .exp-content h3 {
        font-size: 1.1rem;
    }
}
