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

body {
    overflow: hidden;
    background: #000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
}

canvas {
    display: block;
}

/* Start Overlay */
#start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a15 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

#start-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.start-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
}

.start-content h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #00ff88, #00dddd, #6666ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(0, 255, 136, 0.3);
}

.start-content .subtitle {
    font-size: 1.5rem;
    color: #888;
    margin-bottom: 40px;
}

.instructions {
    margin-bottom: 40px;
}

.instructions > p {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 30px;
}

.controls-info {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.key {
    background: linear-gradient(135deg, #2a2a4a, #1a1a2e);
    border: 1px solid #444;
    border-radius: 6px;
    padding: 8px 16px;
    font-family: monospace;
    font-size: 0.9rem;
    color: #00ff88;
}

#start-button {
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    border: none;
    padding: 20px 60px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #000;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 3px;
}

#start-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

/* Navigation HUD */
#nav-hud {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    z-index: 100;
    min-width: 180px;
}

.nav-section {
    margin-bottom: 15px;
}

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

.nav-title {
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.teleport-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.teleport-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--accent, #00ff88);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--accent, #00ff88);
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.teleport-btn:hover {
    background: var(--accent, #00ff88);
    color: #000;
    transform: translateX(3px);
}

.teleport-btn:hover .hotkey {
    background: #000;
    color: var(--accent, #00ff88);
}

.hotkey {
    background: var(--accent, #00ff88);
    color: #000;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.speed-buttons {
    display: flex;
    gap: 6px;
}

.speed-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    border-radius: 6px;
    padding: 6px 10px;
    color: #888;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.speed-btn:hover {
    border-color: #00ff88;
    color: #00ff88;
}

.speed-btn.active {
    background: #00ff88;
    border-color: #00ff88;
    color: #000;
    font-weight: bold;
}

/* Contact HUD */
#contact-hud {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(10, 10, 20, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    z-index: 100;
    min-width: 200px;
}

.contact-name {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: #00ff88;
}

.contact-links {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.contact-links a {
    color: #888;
    transition: all 0.3s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-links a:hover {
    color: #00ff88;
    transform: scale(1.2);
}

.contact-links svg {
    width: 24px;
    height: 24px;
}

.contact-location {
    font-size: 0.9rem;
    color: #666;
}

/* Proximity Indicator */
#proximity-indicator {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 20, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    padding: 15px 30px;
    z-index: 100;
    font-size: 1.1rem;
    animation: pulse 2s infinite;
}

#proximity-indicator .key {
    margin: 0 5px;
}

#section-name {
    color: #00ff88;
    font-weight: bold;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 255, 136, 0.2); }
    50% { box-shadow: 0 0 30px rgba(0, 255, 136, 0.4); }
}

/* Content Modal */
#content-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#content-modal:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #0a0a15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

#content-modal:not(.hidden) .modal-content {
    transform: scale(1);
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #666;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover {
    color: #ff4444;
}

#modal-title {
    font-size: 2rem;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 255, 136, 0.3);
}

/* Modal Content Styles */
.skill-category {
    margin-bottom: 25px;
}

.skill-category h3 {
    color: #00ff88;
    font-size: 1rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.9rem;
    color: #ccc;
}

.experience-item, .project-item, .education-item, .opensource-item {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border-left: 3px solid;
}

.experience-item { border-color: #6666ff; }
.project-item { border-color: #ff6600; }
.education-item { border-color: #aa44ff; }
.opensource-item { border-color: #00dddd; }

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.item-title {
    font-size: 1.2rem;
    font-weight: bold;
}

.item-subtitle {
    color: #888;
    font-size: 0.95rem;
}

.item-date {
    color: #666;
    font-size: 0.9rem;
    white-space: nowrap;
}

.item-description {
    color: #aaa;
    line-height: 1.6;
}

.item-description ul {
    margin-top: 10px;
    padding-left: 20px;
}

.item-description li {
    margin-bottom: 8px;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tech-tag {
    background: rgba(255, 102, 0, 0.1);
    border: 1px solid rgba(255, 102, 0, 0.3);
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 0.8rem;
    color: #ff6600;
}

.gpa {
    color: #00ff88;
    font-weight: bold;
}

/* Loading */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    transition: opacity 0.5s ease;
}

#loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 60px;
    height: 60px;
    border: 3px solid #333;
    border-top-color: #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hidden utility class */
.hidden {
    display: none !important;
}

/* Crosshair */
#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 50;
}

#crosshair::before,
#crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
}

#crosshair::before {
    width: 2px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}

#crosshair::after {
    width: 100%;
    height: 2px;
    top: 50%;
    transform: translateY(-50%);
}

/* Scrollbar styling for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.3);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .start-content h1 {
        font-size: 2rem;
    }

    .controls-info {
        grid-template-columns: repeat(3, 1fr);
    }

    #nav-hud {
        top: auto;
        bottom: 20px;
        left: 10px;
        right: 10px;
        min-width: auto;
    }

    .teleport-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .teleport-btn {
        flex: 1;
        min-width: 45%;
        text-align: center;
    }

    #contact-hud {
        top: 10px;
        right: 10px;
        padding: 15px;
    }

    .modal-content {
        margin: 20px;
        padding: 25px;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   MOBILE TOUCH HUD — PUBG-style joystick + look swipe + tap-to-interact
   ════════════════════════════════════════════════════════════════════════ */

/* By default treat as desktop. Mobile-only elements hidden. */
.mobile-only { display: none !important; }
.desktop-only { display: block; }
.controls-info .control.desktop-only { display: flex; }
#start-button.desktop-only { display: inline-block; }

#mobile-hud {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 80;
    display: none; /* shown when body has .is-touch */
}

/* Touch-device only: the JS isTouchDevice() check adds body.is-touch when
   the device truly supports touch input (not just a narrow viewport). This
   prevents desktop iframes from triggering the mobile HUD. */
body.is-touch .desktop-only,
body.is-touch .controls-info,
body.is-touch #start-button.desktop-only { display: none !important; }

body.is-touch .mobile-only { display: block !important; }
body.is-touch #start-button-mobile.mobile-only { display: inline-block !important; }
body.is-touch .instructions.mobile-only { display: block !important; }
body.is-touch #proximity-indicator .mobile-only { display: inline !important; }

body.is-touch #mobile-hud { display: block; }

/* Hide the desktop-style nav HUD (teleport + speed buttons) on phones —
   it's heavy. Mobile uses tap-to-interact instead. */
body.is-touch #nav-hud { display: none !important; }

/* ── Joystick (bottom-left) ───────────────────────────────────────────── */
#mobile-joystick {
    position: absolute;
    left: 24px;
    bottom: 36px;
    width: 132px;
    height: 132px;
    pointer-events: auto;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

#mobile-joystick-base {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%,
            rgba(0, 255, 136, 0.05) 0%,
            rgba(0, 255, 136, 0.02) 60%,
            transparent 100%);
    border: 2px solid rgba(0, 255, 136, 0.35);
    box-shadow:
        0 0 24px rgba(0, 255, 136, 0.15),
        inset 0 0 24px rgba(0, 255, 136, 0.08);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
#mobile-joystick-base::before {
    /* Crosshair dot */
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 6px; height: 6px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(0, 255, 136, 0.4);
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.6);
}

#mobile-joystick-stick {
    position: absolute;
    top: 50%; left: 50%;
    width: 56px; height: 56px;
    margin: -28px 0 0 -28px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%,
            rgba(0, 255, 136, 0.9) 0%,
            rgba(0, 200, 110, 0.85) 55%,
            rgba(0, 140, 80, 0.75) 100%);
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.5),
        0 0 18px rgba(0, 255, 136, 0.5),
        inset 0 -4px 10px rgba(0, 0, 0, 0.25),
        inset 0 4px 10px rgba(255, 255, 255, 0.2);
    transition: transform 0.06s linear;
    will-change: transform;
}

/* ── Look swipe zone (everything not joystick / buttons) ──────────────── */
#mobile-look-zone {
    position: absolute;
    inset: 0;
    pointer-events: auto;
    touch-action: none;
    z-index: 1;
}

/* Action buttons — only used for vertical movement (up / down) on mobile.
   They're subtle and live on the right edge. */
.mobile-action-btn {
    position: absolute;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(10, 20, 30, 0.5);
    border: 2px solid rgba(0, 255, 136, 0.35);
    color: #00ff88;
    font-size: 1.6rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.45),
        0 0 14px rgba(0, 255, 136, 0.18);
    user-select: none;
    transition: transform 0.08s ease, background 0.12s ease;
    z-index: 2;
}
.mobile-action-btn:active,
.mobile-action-btn.is-active {
    transform: scale(0.94);
    background: rgba(0, 255, 136, 0.18);
}
#mobile-jump-btn    { bottom: 110px; }
#mobile-descend-btn { bottom: 36px; }

/* ── Proximity indicator becomes a tappable pill on touch devices ───── */
body.is-touch #proximity-indicator {
    cursor: pointer;
    touch-action: manipulation;
    bottom: auto;
    top: 22%;
    animation: proxPulseMobile 1.6s ease-in-out infinite;
}
body.is-touch #proximity-indicator:active {
    transform: translateX(-50%) scale(0.97);
}
@keyframes proxPulseMobile {
    0%, 100% { box-shadow: 0 0 24px rgba(0, 255, 136, 0.45); }
    50%      { box-shadow: 0 0 36px rgba(0, 255, 136, 0.75); }
}

/* Start overlay is more compact on phone */
body.is-touch .start-content {
    padding: 28px 22px;
    max-width: 92vw;
}
body.is-touch .start-content h1 { font-size: 2rem; }
body.is-touch .start-content .subtitle { font-size: 1rem; }
body.is-touch .instructions p { font-size: 0.95rem; }
body.is-touch #start-button-mobile {
    font-size: 1rem;
    padding: 14px 28px;
}

/* Contact HUD smaller on phone */
body.is-touch #contact-hud {
    top: 12px;
    right: 12px;
    padding: 10px 12px;
    font-size: 0.78rem;
}


/* ════════════════════════════════════════════════════════════════════════
   CINEMATIC MODE — passive preview, no UI, no input
   Activated by ?cinematic=1 on the URL.
   ════════════════════════════════════════════════════════════════════════ */
body.cinematic-mode {
    cursor: default !important;
}
body.cinematic-mode #start-overlay,
body.cinematic-mode #nav-hud,
body.cinematic-mode #contact-hud,
body.cinematic-mode #proximity-indicator,
body.cinematic-mode #mobile-hud,
body.cinematic-mode #crosshair,
body.cinematic-mode #content-modal,
body.cinematic-mode #loading,
body.cinematic-mode #perspective-notification,
body.cinematic-mode #speed-notification {
    display: none !important;
}

