:root {
    --primary-green: #589632;
    --dark-bg: #0e1117;
}

/* ===== BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    font-family: Arial, sans-serif;
    background: #ffffff;
    color: #333333;
    line-height: 1.6;
}

/* ===== NAVIGATION ===== */
.navbar {
    display: none !important;
}

.top-nav {
    position: fixed;
    top: 25px;
    right: 40px;
    z-index: 1000;
    display: flex;
    gap: 30px;
}

.top-nav a {
    color: #589632;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 0;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.top-nav a:hover {
    color: #74a83d;
    border-bottom-color: #589632;
}

/* ===== SECTIONS ===== */
section {
    padding: 60px 20px;
}

h2 {
    text-align: center;
    margin-bottom: 30px;
}

/* ===== ANIMATION ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s ease forwards;
}

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

.highlight {
    color: #589632;
    font-weight: 600;
}

/* ===== HERO ===== */
.hero {
    position: relative;
    width: 100%;
    height: 60vh;
    overflow: hidden;
    background: #0e1117;
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-nile-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: auto;
    height: 90%;
    max-height: 700px;

    opacity: 0.28;
    z-index: 3;
    pointer-events: none;

    filter: brightness(1.1) contrast(1.1);
}

.hero-content {
    position: absolute;
    z-index: 20;
    text-align: center;
    color: white;
    width: 100%;
    pointer-events: none;
}

.hero-content * {
    pointer-events: auto;
}

.hero h1 {
    font-size: clamp(28px, 5vw, 48px);
    margin-bottom: 10px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero p {
    color: #dddddd;
    font-size: 1.2rem;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.6),
        rgba(0,0,0,0.2),
        rgba(0,0,0,0.7)
    );
    z-index: 5;
    pointer-events: none;
}

/* ===== CONTACT LINKS ===== */
.contact-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.contact-link {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    padding: 8px 20px;
    border-radius: 30px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.contact-link:hover {
    background: #589632;
}

.contact-section {
    position: relative;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden;
}

#contact > * {
    position: relative;
    z-index: 2;
}

/* ===== INTRO ===== */
.intro {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 60px 20px;
    color: #555555;
}

.intro p {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* ===== PROJECTS ===== */
.projects {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        to bottom,
        #101510 0%,
        #0c110d 100%
    );
    border-bottom: 60px solid #0c110d;
}

.projects h2 {
    font-size: 2rem;
    margin-bottom: 50px;
    color: #ffffff;
    text-decoration: underline;
    position: relative;
    z-index: 2;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}




.card {
    width: 100%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 10px;
}


.card img {
    width: 100%;
    height: auto;
    display: block;
}

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: #fff;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.card:hover .overlay {
    transform: translateY(0);
}

.overlay h3 {
    color: #589632;
}

.projects-bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}
/* Column 1 */
.card-tilemap {
    grid-column: 1;
    grid-row: 1;
}

.card-germany {
    grid-column: 1;
    grid-row: 2;
}

.card-ahrensfelde {
    grid-column: 1;
    grid-row: 3;
}

/* Column 2 */
.card-nile {
    grid-column: 2;
    grid-row: 1 / 4; /* spans full height */
}

/* Column 3 */
.card-malta {
    grid-column: 3;
    grid-row: 1;
}

.card-walkability {
    grid-column: 3;
    grid-row: 2;
}



/* ===== ENERGY PROJECT BUTTON ===== */
.energy-btn {
    margin-top: 15px;
    padding: 8px 16px;
    background: #589632;
    border: none;
    color: white;
    font-size: 0.9rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.energy-btn:hover {
    background: #74a83d;
}

/* ===== ENERGY MODAL ===== */
.energy-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.energy-modal-content {
    background: #0e1117;
    padding: 25px;
    border-radius: 10px;
    max-width: 95vw;
    max-height: 95vh;
    text-align: center;
    overflow-y: auto;
}

.energy-modal-content img {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.energy-description {
    margin-top: 20px;
    color: #8b949e;
}

.energy-description h3 {
    color: white;
    margin-bottom: 10px;
}

.energy-close {
    position: absolute;
    top: 25px;
    right: 35px;
    font-size: 35px;
    color: white;
    cursor: pointer;
}

/* ===== SKILLS ===== */
.skills-section {
    padding: 80px 20px;
    background: #0e1117;
    text-align: center;
}

.skills-section h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 40px;
    display: block;
    visibility: visible;
    opacity: 1;
    position: relative;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.skills-network {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.skill {
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px;
    color: white;
    font-weight: 600;
    transition: transform 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.skill.center {
    width: 160px;
    height: 160px;
    background: linear-gradient(135deg, #589632, #74a83d);
    font-size: 1.1rem;
}

.skill.large {
    width: 130px;
    height: 130px;
    font-size: 1rem;
}

.skill.medium {
    width: 110px;
    height: 110px;
    font-size: 0.9rem;
}

.skill.small {
    width: 90px;
    height: 90px;
    font-size: 0.8rem;
}

/* Skill colors */
.skill.python { background: #1abc9c; }
.skill.qgis { background: #2ecc71; }
.skill.arcgis { background: #2980b9; }
.skill.postgis { background: #d35400; }
.skill.leaflet { background: #27ae60; }
.skill.network-analysis { background: #8e44ad; }
.skill.cartography { background: #34495e; }
.skill.project { background: #f39c12; }
.skill.POSTGRESQL { background: #19429b; }
.skill.webdev { background: #e6227d; }

.skill i {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.skill span {
    display: block;
    line-height: 1.3;
}

/* ===== CONTACT ===== */
.contact-section {
    padding: 80px 40px;
    background: #0e1117;
}

.contact-section h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 50px;
    text-align: center;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: stretch;
}

.contact-info {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 40px;
}

.collaboration-message {
    text-align: center;
}

.collaboration-message i {
    font-size: 3rem;
    color: #589632;
}

.collaboration-message h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #589632;
    font-size: 2.4rem;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.1);
}

.social-icon i {
    line-height: 1;
}

/* ===== MAP ===== */
.map-wrapper {
    position: relative;
    width: 100%;
    height: 500px;
    border-radius: 20px;
    overflow: hidden;
    background: #f0f0f0;
    border: 1px solid #333;
}

#berlin-map {
    width: 100%;
    height: 100%;
    z-index: 10;
}

.leaflet-container {
    width: 100%;
    height: 100%;
    z-index: 20;
}

.location-badge {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: #ffffff;
    padding: 10px 20px;
    border-radius: 30px;
    z-index: 30;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0,0,0,0.95);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: #0e1117;
    padding: 30px;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    display: flex;
    gap: 30px;
    position: relative;
}

.modal-content img {
    width: 50%;
    border-radius: 8px;
    max-height: 400px;
    object-fit: cover;
}

.modal-text {
    width: 50%;
}

.modal-text h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.modal-text p {
    color: #8b949e;
    margin-bottom: 10px;
}

.modal-text a {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background: #589632;
    color: white;
    text-decoration: none;
    border-radius: 6px;
}

.modal-content.kathmandu-full {
    max-width: 95vw !important;
    width: 95vw !important;
    height: auto;
    flex-direction: column;
    align-items: center;
}

.modal-content.kathmandu-full .close {
    position: fixed;
    top: 25px;
    right: 30px;
    font-size: 40px;
    color: white;
    z-index: 2000;
}

.modal-content.kathmandu-full img {
    width: 100% !important;
    max-height: 90vh;
    object-fit: contain;
}

.modal-content.kathmandu-full .modal-text {
    width: 100%;
    text-align: center;
}

.close {
    position: absolute;
    right: 30px;
    top: 20px;
    font-size: 35px;
    cursor: pointer;
    color: #8b949e;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 40px;
    background: #0e1117;
    color: #8b949e;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: #8b949e;
    font-size: 1.3rem;
}

/* ===== PAGINATION ===== */
.pagination {
    text-align: center;
    margin-top: 60px;
    position: relative;
    z-index: 10;
}

.page-number {
    display: inline-block;
    margin: 0 8px;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    background: #ffffff;
    color: #0e1117;
}

.page-number.active {
    background: #589632;
    color: white;
}

.page-number:hover {
    background: #74a83d;
    color: white;
}

/* ===== MOBILE (max-width: 768px) ===== */
@media (max-width: 768px) {
    .grid {
        column-count: 1;
    }
    
    .top-nav {
        top: 15px;
        right: 20px;
        gap: 15px;
    }

    .top-nav a {
        font-size: 0.8rem;
        padding: 5px 0;
    }

    .hero {
        height: 50vh;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .contact-links {
        gap: 10px;
    }

    .contact-link {
        padding: 6px 15px;
        font-size: 0.9rem;
    }

    .intro {
        padding: 40px 15px;
    }

    .intro p {
        font-size: 1rem;
    }

    .skills-section {
        padding: 40px 15px;
    }

    .skills-section h2 {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }

    .skills-network {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        max-width: 100%;
        padding: 0 5px;
    }

    .skill {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1/1;
        padding: 8px 4px;
        margin: 0 auto;
        max-width: 90px;
    }

    .skill.center {
        max-width: 90px;
        width: 100% !important;
        height: auto !important;
    }

    .skill.large,
    .skill.medium,
    .skill.small {
        max-width: 85px;
        width: 100% !important;
        height: auto !important;
    }

    .skill i {
        font-size: 1.2rem;
        margin-bottom: 3px;
    }

    .skill span {
        font-size: 0.6rem;
        line-height: 1.2;
        word-break: break-word;
    }

    .contact-section {
        padding: 40px 15px;
    }

    .contact-section h2 {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }

    .contact-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .contact-info {
        height: auto;
        min-height: 300px;
        padding: 25px;
        gap: 20px;
    }

    .map-wrapper {
        height: 300px;
        width: 100%;
    }

    .social-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }

    .modal-content {
        flex-direction: column;
        padding: 20px;
    }

    .modal-content img {
        width: 100%;
        max-height: 200px;
    }

    .modal-text {
        width: 100%;
    }
}

.nepal-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.97);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.nepal-modal-content {
    width: 95vw;
    height: 90vh;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.nepal-modal-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.nepal-close {
    position: fixed;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    z-index: 3000;
}

/* ===== SMALLER MOBILE (max-width: 480px) ===== */
@media (max-width: 480px) {
    .skills-network {
        gap: 5px;
    }

    .skill {
        max-width: 75px !important;
    }

    .skill.center {
        max-width: 75px !important;
    }

    .skill i {
        font-size: 1rem;
    }

    .skill span {
        font-size: 0.5rem;
    }

    .social-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}


/* ===== PAGINATION BUTTONS ===== */
/*.pagination {
    text-align: center;
    margin-top: 20px; /* reduced spacing *
    position: relative;
    z-index: 10;
}*/


.pagination-top {
    margin-bottom: 20px;
}

.pagination {
    text-align: center;
    margin-top: 20px; /* reduced spacing */
    position: relative;
    z-index: 10;
}


.page-btn {
    display: inline-block;
    margin: 0 8px;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    background: #ffffff;
    color: #0e1117;
    cursor: pointer;
}

.page-btn:hover {
    background: #74a83d;
    color: white;
}

.page-btn.disabled {
    background: #cccccc;
    color: #666666;
    cursor: default;
    pointer-events: none;
}


/* ===== TOUCH DEVICES ===== */
@media (hover: none) and (pointer: coarse) {
    .card:hover,
    .skill:hover,
    .contact-link:hover {
        transform: none;
    }
}
/* ===== NEPAL 3D TERRAIN SECTION ===== */
.nepal-3d-section {
    background: #0e1117;
    padding: 60px 20px;
    text-align: right;
}

.nepal-3d-section h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 10px;
}

.nepal-3d-subtitle {
    color: #8b949e;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.nepal-3d-caption {
    color: #444;
    margin-top: 15px;
    font-size: 0.8rem;
}

.nepal-3d-container {
    width: 100%;
    max-width: 1200px;
    height: 600px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.nepal-3d-container model-viewer {
    display: block;
    width: 100%;
    height: 100%;
    background: #0e1117;
}

@media (max-width: 768px) {
    .nepal-3d-container {
        height: 350px;
    }
}


/* ===== MODEL-VIEWER CUSTOMIZATION ===== */
model-viewer {
    display: block;
    width: 100%;
    height: 100%;
    background: #0a0c10;
    --poster-color: transparent;
}

.model-viewer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(14, 17, 23, 0.9);
    color: white;
    z-index: 10;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(88, 150, 50, 0.3);
    border-top: 4px solid #589632;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Model viewer custom controls */
model-viewer::part(default-progress-bar) {
    background: #589632;
}

model-viewer::part(ar-button) {
    background: #589632;
    border-radius: 30px;
}

/* Ensure container properly handles model-viewer */
.nepal-3d-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 600px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    background: #0e1117;
}

.nepal-3d-container model-viewer {
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .nepal-3d-container {
        height: 350px;
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
    }
}

.nepal-3d-container {
    position: relative;
    width: 100%;
    height: 600px;
}

model-viewer {
    width: 100%;
    height: 100%;
    display: block;
}

.axis-widget {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 100px;
    height: 100px;
    perspective: 500px;
    pointer-events: none;
    z-index: 10;
}

.axis-arrows {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s linear;
}

.arrow {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-style: preserve-3d;
}

.arrow .line {
    width: 2px;
    height: 40px;
    background: white;
    position: absolute;
    bottom: 0;
    left: -1px;
}

.arrow .head {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid white;
    position: absolute;
    top: -10px;
    left: -6px;
}

.arrow span {
    position: absolute;
    top: -25px;
    left: -5px;
    font-size: 12px;
    font-weight: bold;
}

/* X axis (Red) */
.x-axis { transform: rotateY(90deg); }
.x-axis .line, .x-axis .head { background: red; border-bottom-color: red; }

/* Y axis (Green) */
.y-axis { transform: rotateX(-90deg); }
.y-axis .line, .y-axis .head { background: lime; border-bottom-color: lime; }

/* Z axis (Blue) */
.z-axis {}
.z-axis .line, .z-axis .head { background: blue; border-bottom-color: blue; }

.axis-overlay {
    position: absolute;
    top: 25px;
    right: 25px;   /* move to right */
    left: auto;    /* remove left positioning */
    width: 65px;
    height: 65px;
    pointer-events: none;
    z-index: 20;
    opacity: 0.85;
}

.axis-overlay svg {
    width: 100%;
    height: 100%;
    transform-origin: 50% 50%;
    transition: transform 0.1s linear;
}
.nepal-download-wrapper {
    text-align: center;
    margin-top: 25px;
}

.download-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #589632;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: 0.3s ease;
}

.download-btn:hover {
    background: #74a83d;
}