:root {
    --text-color: black;
    --base-color: #ffffff;
    --base-variant: #fffff1;
    --primary-color: #3a435d;
    --accent-color: #0071ff;
    --link-hover: lightskyblue;
    --navbar-color: white;
    --background-color: black;
    --background-color-box-timeline: #a5a6a3;
}

* {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

html { 
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Times New Roman', Times, serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

html, body, p, h1, h2, h3, ul, li {
    transition: background-color 0.3s ease, color 0.3s ease;
}

section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: auto;
    padding: 80px 20px 60px;
    text-align: center;
    background-color: var(--base-color);
    color: var(--text-color);
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Responsive image logo */
.logo-img {
    width: min(280px, 80vw);
    height: min(280px, 80vw);
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    margin-bottom: 2rem;
}

/* Responsive typography */
h1 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: clamp(1.8rem, 5vw, 2.5rem);
}

h2 {
    padding: 0 20px;
    margin-bottom: 2rem;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
}

h3 {
    font-size: clamp(1.2rem, 3.5vw, 1.8rem);
    text-align: center;
    color: var(--text-color); 
}

p {
    max-width: 90%;
    line-height: 1.6;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    margin-bottom: 1rem;
}

.intro-text {
    max-width: 800px;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
}

.home {
    text-align: center;
}

.link-item {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    flex-wrap: wrap;
}

.link-item img {
    width: clamp(40px, 8vw, 50px);
    height: clamp(40px, 8vw, 50px);
    margin-right: 15px;
    user-select: none;
}

.link-item a {
    text-decoration: none;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: var(--text-color);
    transition: color 0.3s ease;
    user-select: none; 
}

.link-item a:hover {
    color: var(--link-hover);
}

/* TOP NAVIGATION BAR - RESPONSIVE */
.topnav {
    height: 60px;
    background-color: black;
    overflow: hidden;
    display: flex;
    position: fixed;
    padding: 0 16px;
    align-items: center;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    flex-wrap: wrap;
}

.topnav a {
    color: white;
    text-align: center;
    padding: 14px 12px;
    text-decoration: none;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    user-select: none;
    transition: color 0.3s ease, background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.topnav a i {
    font-size: 1rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.topnav a:hover {
    color: var(--link-hover);
    background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    margin-left: auto;
}

/* PROJECTS - RESPONSIVE GRID */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.project-item {
    background: #ffffff;
    border: 1.5px solid #111;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 22px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: box-shadow 0.2s, transform 0.2s;
}

.project-item:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.project-item h3 {
    margin-bottom: 8px;
    color: #2d6cdf;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    overflow-wrap: break-word;
}

.project-item .project-description {
    font-size: clamp(0.9rem, 2vw, 1rem);
    margin-bottom: 15px;
    flex-grow: 1;
}

.project-item a {
    color: #2d6cdf;
    text-decoration: none;
    font-weight: 600;
    font-size: clamp(0.9rem, 2vw, 1rem);
    transition: color 0.2s;
    align-self: flex-start;
    margin-top: 10px;
}

.project-item a:hover {
    color: #1a4a8a;
    text-decoration: underline;
}

/* SKILLS - RESPONSIVE HEXAGONS */
.skills-grid {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.skills-item {
    margin-bottom: 50px;
}

.image-gallery-container {
    margin: 30px auto;
    max-width: 100%;
    overflow-x: auto;
}

.image-gallery-container ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 0;
    margin: 20px 0;
}

.image-gallery-container ul:not(:first-child) {
    margin-top: 0;
}

.image-gallery-container ul li {
    float: none;
}

.hex-border {
    width: clamp(100px, 15vw, 125px);
    height: clamp(115px, 17vw, 145px);
    background: black;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    -webkit-clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-border:hover .bg-image {
    transform: scale(1.05);
}

.bg-image {
    width: 90%;
    height: 90%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: white;
    transition: transform 0.3s ease, background-color 0.3s ease;
    clip-path: inherit;
    -webkit-clip-path: inherit;
}

.darkmode .bg-image {
    background-color: var(--base-variant);
}

#skills-prog-names {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    text-align: center;
    color: var(--text-color);
    padding: 0 20px;
    margin: 20px 0;
}

/* EDUCATION/EXPERIENCE TIMELINE - RESPONSIVE */
#education, #experience {
    min-height: auto;
    padding: 80px 20px 60px;
}

.timeline { 
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 0;
    width: 100%;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: #0071ff;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

.timeline-container {
    padding: 10px 60px 10px 40px;  /* Increased right padding for left items */
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-container::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #0071ff;
    border: 3px solid white;
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.left {
    left: 0;
    padding-right: 60px;
    padding-left: 0;
}

.left::after {
    right: -10px;  /* Half the circle width to center it */
}

.right {
    left: 50%;
    padding-left: 60px;
    padding-right: 0;
}

.right::after {
    left: -10px;  /* Half the circle width to center it */
}

.content {
    text-align: left;
    padding: 20px;
    background-color: var(--background-color-box-timeline);
    position: relative;
    border-radius: 6px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.content h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    margin-bottom: 10px;
    text-align: left;
}

.content p {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    line-height: 1.8;
}

/* MODAL - RESPONSIVE */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(44, 62, 80, 0.18);
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    color: #2d2d2d;
    border-radius: 16px;
    padding: 50px 28px 28px;
    box-shadow: 0 8px 32px rgba(44, 62, 80, 0.18);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    position: relative;
}

.modal-content h3 {
    color: #2d2d2d !important;
}

.close-btn {
    color: #aaa;
    position: absolute;
    right: 18px;
    top: 12px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #2d6cdf;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 12px;
    margin: 12px 0;
    border: 1px solid #e3eafc;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Times New Roman', Times, serif; 
    background: #f7f8fa;
    color: #2d2d2d;
    outline: none;
    transition: border 0.2s;
    resize: vertical;
}

.modal-content input:focus,
.modal-content textarea:focus {
    border: 1.5px solid #2d6cdf;
}

.submit-btn {
    background-color: #2d6cdf;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
    width: 100%;
}

.submit-btn:hover {
    background-color: #1a4a8a;
}

/* FOOTER */
.footer {
    background-color: black;
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: auto;
    flex-shrink: 0;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* DARK MODE */
.darkmode {
    --text-color: #ffffff;
    --base-color: #101425;
    --base-variant: #181c2f;
    --primary-color: #d1d5ff;
    --accent-color: #66aaff;
    --link-hover: #1e90ff;
    --navbar-color: #556666;
    --background-color: black;
    --background-color-box-timeline: rgb(61, 61, 61);
}

.darkmode .topnav {
    background-color: black;
}

.darkmode .footer {
    background-color: black;
    color: white;
}

.darkmode .project-item {
    background-color: var(--background-color);
    color: var(--text-color);
    border: 1.5px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.darkmode .project-item:hover {
    box-shadow: 0 6px 20px #ffffff;
    transform: translateY(-4px);
}

.darkmode .project-item a, 
.darkmode .project-item h3 {
    color: var(--accent-color);
}

.darkmode .content {
    background-color: var(--background-color-box-timeline);
    color: var(--text-color);
}
   
#theme-switch {
    cursor: pointer;
    background-color: var(--base-variant);
    border: none;
    border-radius: 50%;
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

#theme-switch svg {
    fill: var(--primary-color);
}

#theme-switch svg:last-child {
    display: none; 
}

.darkmode #theme-switch svg:first-child {
    display: none; 
}

.darkmode #theme-switch svg:last-child {
    display: block; 
}

/* ============================================
   TABLET RESPONSIVE (768px - 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .topnav a {
        padding: 14px 10px;
        font-size: 0.95rem;
    }
    
    .topnav a span {
        display: none;
    }
    
    .topnav a i {
        font-size: 1.2rem;
    }
    
    .project-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 25px;
    }
}

/* ============================================
   MOBILE RESPONSIVE (<768px)
   ============================================ */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 60px;
    }
    
    section {
        padding: 70px 15px 40px;
    }
    
    /* Mobile Navigation */
    .topnav {
        height: auto;
        min-height: 60px;
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
        position: absolute;
        right: 16px;
        top: 10px;
    }
    
    .topnav.mobile-open {
        height: auto;
    }
    
    .topnav a {
        width: 100%;
        padding: 15px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        display: none;
    }
    
    .topnav a span {
        display: inline;
    }
    
    .topnav.mobile-open a {
        display: flex;
    }
    
    #theme-switch {
        position: absolute;
        right: 60px;
        top: 10px;
    }
    
    .nav-right {
        margin-left: 0;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* Projects */
    .project-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }
    
    .project-item {
        min-height: auto;
    }
    
    /* Timeline - Mobile Stack */
    .timeline-container {
        width: 100%;
        padding: 10px 10px 10px 40px;
    }
    
    .timeline::after {
        left: 15px;
    }
    
    .left, .right {
        width: 100%;
        left: 0;
        padding-left: 50px;
        padding-right: 10px;
    }
    
    .left::after, .right::after {
        left: 6px;
        right: auto;
    }
    
    .content {
        padding: 15px;
    }
    
    /* Skills - Smaller hexagons on mobile */
    .image-gallery-container ul {
        gap: 10px;
        padding: 0 10px;
    }
    
    .hex-border {
        width: clamp(80px, 20vw, 100px);
        height: clamp(92px, 23vw, 115px);
    }
    
    /* Modal adjustments */
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        padding: 40px 20px 20px;
        max-height: 85vh;
    }
    
    h1 {
        margin-top: 20px;
    }
    
    .logo-img {
        margin-top: 20px;
    }
}

/* ============================================
   SMALL MOBILE (<480px)
   ============================================ */
@media (max-width: 480px) {
    .topnav a {
        font-size: 0.9rem;
        padding: 12px 16px;
    }
    
    h2 {
        padding: 0 10px;
    }
    
    .project-grid {
        padding: 0 10px;
    }
    
    .hex-border {
        width: 70px;
        height: 81px;
    }
    
    .image-gallery-container ul {
        gap: 8px;
    }
    
    #skills-prog-names {
        font-size: 1.1rem;
    }
}

/* Utility classes for showing/hiding on mobile */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
}


