/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #ffffff;
    --secondary-bg: #f8f9fa;
    --dark-blue: #0a1929;
    --navy-blue: #1a2332;
    --text-primary: #000000;
    --text-secondary: #4a5568;
    --accent: #1a2332;
    --accent-hover: #0a1929;
    --border: #e2e8f0;
    --border-dark: #1a2332;
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--primary-bg);
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.lead {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.highlight {
    color: var(--accent);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 4px solid var(--border-dark);
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-block;
}

.nav-links a:hover {
    color: var(--accent);
    transform: scale(1.15);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown .dropbtn {
    cursor: pointer;
    pointer-events: auto;
    padding-bottom: 1rem;
    display: inline-block;
    transition: var(--transition);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: rgba(255, 255, 255, 0.98);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    border: 2px solid var(--border-dark);
    border-radius: 4px;
    top: 100%;
    left: 0;
    margin-top: 0;
}

.dropdown-content a {
    color: var(--text-secondary);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.dropdown-content a:hover {
    background-color: var(--secondary-bg);
    color: var(--accent);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropbtn {
    color: var(--accent);
    transform: scale(1.15);
}

/* Main Content */
main {
    margin-top: 80px;
}

.section {
    padding: 4rem 0;
}

/* About Section - Full Page */
.about-section {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    padding: 4rem 0;
    background-color: #ffffff;
    border-bottom: 4px solid var(--border-dark);
}

.about-content {
    display: flex;
    align-items: flex-start;
    gap: 3rem;
}

.profile-picture {
    width: 350px;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
    border: none;
    transition: var(--transition);
    background-color: #ffffff;
}

.profile-picture:hover {
    transform: scale(1.02);
}

.about-text {
    flex: 1;
}

.about-text h1 {
    margin-bottom: 0.5rem;
}

.education-brief {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.internship-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background-color: var(--primary-bg);
    border: 3px solid var(--border-dark);
    border-radius: 8px;
    margin-top: 1rem;
}

.internship-link {
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.internship-link:hover {
    background-color: var(--dark-blue);
    transform: translateX(4px);
}

.internship-link:hover .internship-text {
    color: #ffffff;
}

.resume-info {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--primary-bg);
    border: 3px solid var(--border-dark);
    border-radius: 8px;
    margin-top: 1rem;
}

.resume-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.resume-info:hover {
    background-color: var(--dark-blue);
    transform: translateX(4px);
}

.resume-info:hover .resume-link {
    color: #ffffff;
}

.resume-link .arrow {
    color: var(--accent);
    font-size: 1.25rem;
    transition: var(--transition);
}

.resume-info:hover .resume-link .arrow {
    color: #ffffff;
}

.company-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    filter: contrast(1.5) saturate(2) brightness(1.1);
    /* Enhances red colors and reduces grey/white visibility */
}

.internship-text {
    font-size: 0.95rem;
    margin: 0;
}

.about-contact-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.about-contact-links .contact-link {
    flex: 1;
}

/* Full-Page Project Sections */
.project-section {
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    margin: 0;
    background-color: #ffffff;
    border-bottom: 2px solid #cbd5e0;
}

.project-section:last-of-type {
    border-bottom: none;
}

/* Image Left Layout */
.project-section.image-left {
    flex-direction: column;
}

/* Image Right Layout */
.project-section.image-right {
    flex-direction: column;
}

.project-header {
    width: 100%;
    text-align: center;
    padding: 3rem 2rem 1.5rem;
}

.project-header h2 {
    margin: 0;
    font-size: 2.5rem;
}

.project-image-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    position: relative;
    padding: 1.5rem 2rem;
}

/* Images Grid Inside Container */
.images-grid {
    display: grid;
    gap: 1.5rem;
    width: 100%;
    max-width: 1400px;
    height: auto;
}

/* Tilt Table - 3 images in a row, compact */
.tilt-table-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1100px;
}

/* CNC Router - 3 images in a row, compact */
.cnc-router-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1100px;
}

/* Chip Guard - 2x2 grid */
.chip-guard-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 1100px;
}

/* Glue Drip - 2 images side by side, second image larger */
.glue-drip-grid {
    grid-template-columns: 1fr 1.5fr;
    max-width: 1200px;
}

.glue-drip-grid .grid-img {
    height: 450px;
    max-height: 450px;
}

/* E-bike - Small + large + small */
.ebike-grid {
    grid-template-columns: 1fr 3fr 1fr;
    max-width: 1200px;
}

.ebike-grid .large-img {
    max-height: 500px;
}

.ebike-grid .small-img {
    max-height: 250px;
}

/* RC Vehicles - Small image left + large image right (flipped) */
.rc-grid {
    grid-template-columns: 1fr 3fr;
    max-width: 1200px;
}

.rc-grid .large-img {
    max-height: 500px;
}

.rc-grid .small-img {
    max-height: 250px;
}

/* Catapult - 3 images in a row, compact */
.catapult-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1100px;
}

/* Storage - 3x2 grid, compact */
.storage-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1100px;
}

/* Automotive - 3 images in a row, similar size */
.automotive-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1200px;
}

.automotive-grid .grid-img {
    max-height: 350px;
}

/* Greenhouse - 2 images side by side */
.greenhouse-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 1100px;
}

/* Coffee Machine - 1 centered image */
.coffee-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
}

.coffee-grid .grid-img {
    height: auto;
    max-height: none;
    object-fit: contain;
}

/* Clay Pugmill - 3 images in a row */
.pugmill-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1100px;
}

/* Ergonomic Workstation & Hovercraft - 3 images in a row, compact */
.ergonomic-hovercraft-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1000px;
}

.ergonomic-hovercraft-grid .grid-img {
    max-height: 250px;
}

/* Desalinator - 3 large images in a row */
.desalinator-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1400px;
}

.desalinator-grid .large-img {
    max-height: 500px;
}

.grid-img {
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid var(--border-dark);
    transition: var(--transition);
    cursor: pointer;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    display: block;
}

.grid-img:hover {
    border-color: #2563eb;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

.project-full-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder-full {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.project-content {
    width: 100%;
    padding: 1.5rem 4rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.project-description {
    max-width: 1000px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    max-width: 600px;
    margin-top: 2rem;
}

.gallery-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--border-dark);
    transition: var(--transition);
    cursor: pointer;
}

.gallery-thumb:hover {
    transform: scale(1.05);
    border-color: var(--dark-blue);
    box-shadow: 0 4px 12px rgba(26, 35, 50, 0.3);
}

/* Engineering Portfolio Main Header */
.portfolio-main-header {
    padding: 4rem 0;
    text-align: center;
    background-color: var(--dark-blue);
    border-top: 4px solid var(--navy-blue);
    border-bottom: 4px solid var(--navy-blue);
}

.portfolio-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: 1px;
}

/* Project Section Headers */
.projects-header-section {
    padding: 3rem 0 2rem;
    text-align: center;
    background-color: var(--primary-bg);
    border-top: 4px solid var(--border-dark);
    border-bottom: 4px solid var(--border-dark);
}

.projects-header-section.professional-header,
.projects-header-section.school-header {
    background-color: var(--primary-bg);
    border-top: 4px solid var(--border-dark);
    border-bottom: 4px solid var(--border-dark);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Project Sections - Consistent White Theme */
.professional-project,
.school-project {
    background-color: #ffffff;
}

/* Projects Call-to-Action Section */
.projects-cta-section {
    padding: 5rem 0;
    background-color: var(--dark-blue);
    border-top: 4px solid var(--navy-blue);
    border-bottom: 4px solid var(--navy-blue);
    text-align: center;
}

.projects-cta-title {
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.projects-cta-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 3rem;
}

.projects-cta-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.projects-cta-button {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 2.5rem;
    background-color: #ffffff;
    border: 4px solid var(--border-dark);
    border-radius: 12px;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.projects-cta-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    border-color: var(--accent);
}

.btn-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.btn-content {
    flex: 1;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.btn-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.btn-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    display: block;
}

.btn-arrow {
    font-size: 2rem;
    color: var(--accent);
    font-weight: bold;
    flex-shrink: 0;
    transition: var(--transition);
}

.projects-cta-button:hover .btn-arrow {
    transform: translateX(8px);
}

.projects-cta-button:hover .btn-title {
    color: var(--accent);
}

/* Skills Section - Compact */
#skills {
    padding: 4rem 0;
    background-color: #ffffff;
    border-top: 4px solid var(--border-dark);
    border-bottom: 4px solid var(--border-dark);
}

#skills h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
}

.skill-category h3 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    padding: 0.4rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.skill-category li::before {
    content: "→ ";
    color: var(--accent);
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Contact Links Section - Top */
.contact-links-section {
    padding: 3rem 0;
    background-color: var(--primary-bg);
    border-top: 4px solid var(--border-dark);
    border-bottom: 4px solid var(--border-dark);
}

.contact-links-horizontal {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
}

/* Next Section Navigation */
.next-section-nav {
    padding: 4rem 0;
    background-color: var(--dark-blue);
    border-top: 4px solid var(--navy-blue);
    border-bottom: 4px solid var(--navy-blue);
}

.next-section-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem 2rem;
    background-color: #ffffff;
    border: 4px solid var(--border-dark);
    border-radius: 12px;
    text-decoration: none;
    transition: var(--transition);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.next-section-link:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
    border-color: var(--accent);
}

.next-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.next-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: var(--transition);
}

.next-section-link:hover .next-title {
    color: var(--accent);
}

.next-arrow {
    font-size: 3rem;
    color: var(--accent);
    font-weight: bold;
    transition: var(--transition);
}

.next-section-link:hover .next-arrow {
    transform: translateX(12px);
}

/* Contact Links in About Section */
.contact-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.75rem;
    background-color: #ffffff;
    border: 3px solid var(--border-dark);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.contact-link:hover {
    background-color: var(--dark-blue);
    color: #ffffff;
    transform: translateX(4px);
}

.contact-link .arrow {
    color: var(--accent);
    font-size: 1.25rem;
    transition: var(--transition);
}

.contact-link:hover .arrow {
    color: #ffffff;
}

/* Contact Section - Bottom */
#contact {
    text-align: center;
    padding: 2rem 0;
    background-color: var(--primary-bg);
    border-top: 4px solid var(--border-dark);
}

.footer-text {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Footer */
footer {
    display: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .project-content {
        padding: 3rem;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 2rem;
    }

    .nav-container {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .dropdown-content {
        min-width: 140px;
        font-size: 0.85rem;
    }

    .dropdown-content a {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .section {
        padding: 3rem 0;
    }

    .projects-cta-title {
        font-size: 2rem;
    }

    .projects-cta-subtitle {
        font-size: 1rem;
    }

    .projects-cta-button {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        gap: 1rem;
    }

    .btn-content {
        text-align: center;
    }

    .btn-title {
        font-size: 1.25rem;
    }

    .btn-subtitle {
        font-size: 0.9rem;
    }

    .next-title {
        font-size: 1.75rem;
    }

    .next-arrow {
        font-size: 2rem;
    }

    .contact-links-horizontal {
        flex-direction: column;
        gap: 1rem;
    }

    .about-section {
        padding: 3rem 0;
        min-height: auto;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
        align-items: center;
    }

    .profile-picture {
        width: 250px;
        height: auto;
        margin: 0 auto;
    }

    .about-text {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

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

    .lead {
        font-size: 1rem;
    }

    .education-brief {
        font-size: 0.85rem;
    }

    .internship-info {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1.25rem 1rem;
        text-align: center;
        width: 100%;
        max-width: 400px;
    }

    .internship-link {
        display: flex;
    }

    .internship-text {
        font-size: 0.9rem;
    }

    .company-logo {
        height: 35px;
    }

    .about-contact-links {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    .contact-link {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
    }

    .resume-info {
        width: 100%;
        padding: 1rem 1.5rem;
    }

    .resume-link {
        font-size: 0.95rem;
    }

    /* Stack project sections vertically on mobile */
    .project-section {
        flex-direction: column !important;
        min-height: auto;
    }

    .project-image-container {
        width: 100%;
        height: auto;
        min-height: 50vh;
        padding: 1.5rem;
    }

    .images-grid {
        gap: 1rem;
        max-height: none;
    }

    /* Mobile layouts for each section */
    .tilt-table-grid,
    .cnc-router-grid,
    .chip-guard-grid,
    .glue-drip-grid,
    .ebike-grid,
    .rc-grid,
    .catapult-grid,
    .storage-grid,
    .greenhouse-grid,
    .automotive-grid,
    .pugmill-grid,
    .desalinator-grid,
    .ergonomic-hovercraft-grid {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .project-content {
        padding: 2.5rem 1.5rem;
    }

    .project-description {
        font-size: 1rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .container {
        padding: 0 1.5rem;
    }
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    cursor: pointer;
    justify-content: center;
    align-items: center;
}

.image-modal.active {
    display: flex;
}

.image-modal img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border: 4px solid #2563eb;
    border-radius: 8px;
    image-rendering: high-quality;
    image-rendering: -webkit-optimize-contrast;
    -ms-interpolation-mode: bicubic;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
}

.modal-close:hover {
    color: #2563eb;
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .profile-picture {
        width: 200px;
        height: auto;
    }

    .about-text h1 {
        font-size: 1.75rem;
    }

    .lead {
        font-size: 0.95rem;
    }

    .education-brief {
        font-size: 0.8rem;
    }

    .internship-info {
        padding: 1rem;
        max-width: 100%;
    }

    .internship-text {
        font-size: 0.85rem;
    }

    .company-logo {
        height: 30px;
    }

    .contact-link {
        padding: 1rem 1.25rem;
        font-size: 0.9rem;
    }

    .resume-info {
        padding: 1rem 1.25rem;
    }

    .resume-link {
        font-size: 0.9rem;
    }

    .project-content {
        padding: 2rem 1.25rem;
    }
}
