/* main.css | Dark Navy + Pure Gold theme */

/* THEME TOGGLE SWITCH ----------------------------- */
/* Style the theme switch wrapper */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
  margin: 0 5px;
}

/* Hide the default checkbox */
.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Style the slider (the track) */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fff; /* Light theme background - white */
  transition: .3s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  box-sizing: border-box;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

/* Style the round slider shape */
.slider.round {
  border-radius: 30px;
}

/* Style the circle (the movable part) */
.slider.round::before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: #000; /* Black circle for dark mode */
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  z-index: 2;
}

/* When the checkbox is checked (dark theme is active) */
[data-theme="dark"] .slider {
  background-color: #000; /* Dark black for dark mode */
  border: 1px solid #444; /* Subtle border for better visibility */
  box-shadow: 0 0 4px rgba(255,255,255,0.1); /* Subtle glow */
}

[data-theme="dark"] .slider::before {
  transform: translateX(30px);
  background-color: #fff; /* White circle for dark mode */
}

/* Style the icons */
.slider .icon {
  font-size: 14px;
  line-height: 1;
  transition: opacity 0.3s ease;
  user-select: none;
  z-index: 1;
}

.slider .sun {
  opacity: 1;
  filter: brightness(1.3); /* Increase sun brightness */
}

.slider .moon {
  opacity: 0.5;
}

/* Icon visibility based on theme */
[data-theme="dark"] .slider .sun {
  opacity: 0.5;
}

[data-theme="dark"] .slider .moon {
  opacity: 1;
}

/* Focus styles for accessibility */
.theme-switch input:focus + .slider {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Adjust toggle position in nav */
.nav__links li:last-child {
  margin-left: 0.5rem;
}

/* NAV LINKS THEME SWITCH OVERRIDE */
.nav__links .theme-switch {
  margin: 0 !important;
}

/* MOBILE THEME SWITCH VISIBILITY */
.theme-switch.mobile-switch {
  display: none;  /* hidden by default */
}
@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

  .theme-switch.mobile-switch {
    display: flex !important;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100200 !important;
  }
  /* hide desktop switch inside nav links on mobile */
  .nav__links .theme-switch {
    display: none !important;
  }
}

/* -------------------------------------------------- */
/* COLOR PALETTE */
:root {
    /* Dark theme (default) */
    --navy: #000;
    --navy-rgb: 0, 0, 0;  /* RGB values for navy */
    --navy-light: #000;
    --gold: #fff;
    --accent: #fff;
    --white: #fff;
    --text-light: #fff;
    --shadow: rgba(0, 0, 0, 1);
    --timeline-edu: #fff;
    --timeline-work: #fff;
    --bg-gradient: #000;
    --hero-gradient: #000;
    --projects-margin-top: -350px;  /* Adjust this value to move projects section up/down */
    --projects-padding-top: 3em;   /* Adjust this value to change internal spacing */
    --blog-margin-top: -50px;  /* Adjust this value to move blog section up/down */
    --blog-padding-top: 2rem;   /* Adjust this value to change internal spacing */
}

/* Light theme overrides - consolidated */
[data-theme="light"] {
    --navy: #fff;  /* Soft pastel pink */
    --navy-light: #fff;  /* Lighter pastel pink */
    --gold: #000;  /* Dark gray for text */
    --accent: #000;  /* Soft pastel blue */
    --white: #000;  /* Dark text for contrast */
    --text-light: #000;  /* Medium gray for text */
    --shadow: rgba(0, 0, 0, 1);
    --timeline-edu: #000;  /* Pastel blue */
    --timeline-work: #000;  /* Pastel gold */
    --bg-gradient: #fff;
    --hero-gradient: #fff;
}

/* Light theme: mobile menu overlay and nav links */
@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

    [data-theme="light"] .nav__links {
        background: rgba(255,255,255,0.98) !important;
        color: #000 !important;
        box-shadow: 0 2px 20px rgba(0,0,0,0.10);
    }
    [data-theme="light"] .nav__links a {
        color: #000 !important;
    }
    [data-theme="light"] .nav__mobile-toggle {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }
}

/* Text colors in light mode */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] .logo,
[data-theme="light"] .highlight,
[data-theme="light"] .timeline-col h3,
[data-theme="light"] .timeline-col--right h3,
[data-theme="light"] #contact.section h2,
[data-theme="light"] #contact.section p {
    color: #000 !important;
}

/* Links and buttons in light mode */
[data-theme="light"] .contact__links a,
[data-theme="light"] .blog__list a {
    color: #000 !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Timeline styles in light mode */
[data-theme="light"] .timeline li {
    background: rgba(255, 255, 255, 0.8) !important;
    color: #000;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .timeline {
    border-left-color: #000 !important;
}

/* Section backgrounds in light mode */
[data-theme="light"] .section--alt {
    background: var(--navy-light) !important;
}

/* Hero and Nav background in light mode */
[data-theme="light"] .hero {
    background: #fff !important;
}

[data-theme="light"] .nav {
    background: #fff !important;
}

[data-theme="light"] .logo {
    color: #000 !important;
}

[data-theme="light"] .nav__links a {
    color: #000 !important;
}

#contact.section {
    background: #000 !important;
    backdrop-filter: none !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: auto !important;
    padding: 0.6rem 0.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    border-top: 1px solid rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
    z-index: 100 !important;
}
[data-theme="light"] #contact.section {
    background: #fff !important;
    backdrop-filter: none !important;
}
[data-theme="light"] #contact.section h2,
[data-theme="light"] #contact.section p {
    color: #fff !important;
}

  /* RESET & BASE ------------------------------------ */
  *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
  html, body {
    height: 100%;
  }
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Inter', -apple, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    padding-bottom: 3.5rem; /* Add space for fixed contact section */
    background: var(--navy);
    color: var(--white);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    transition: background 0.3s ease, color 0.3s ease;
  }
  img { display: block; max-width: 100%; height: auto; }
.container { width: 90%; max-width: 1100px; margin: auto; position: relative; z-index: 3; }
.section { 
    padding: 4rem 0; 
    margin-bottom: 2rem;  /* Balanced spacing between sections */
    position: relative;
    z-index: 2 !important;
}
.section--alt {
    background: transparent;
}
  h1, h2, h3, h4 { color: var(--gold); font-weight: 700; letter-spacing: -0.5px; }
  .section h2 {
    text-align: center;
    width: 100%;
    display: block;
    margin-left: 0;
    padding-left: 0;
}

/* Make all themed elements transition smoothly */
*, *::before, *::after {
    transition: background-color 0.3s ease, 
                color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease,
                background 0.3s ease;
  }
  
  /* NAV ------------------------------------------------ */
.nav { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; position: relative; z-index: 10; }
.logo { 
    font-size: 1.5rem; 
    margin-left: 1.5rem; 
    color: var(--gold);
    text-decoration: none !important;
    border-bottom: none;
    -webkit-text-decoration: none;
    -moz-text-decoration: none;
}
  .nav__links { list-style: none; display: flex; gap: 1.25rem; align-items: center; }
  .nav__links a { text-decoration: none; color: var(--text-light); font-weight: 700; transition: opacity 0.2s ease; }
  .nav__links a:hover { opacity: 0.7; }
#darkToggle {
    background: none;
    border: 2px solid var(--accent);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s ease;
}
#darkToggle:hover {
    transform: scale(1.1);
    background: var(--accent);
    color: var(--navy);
}

/* Mobile Navigation */
.nav__mobile-toggle {
    display: none;  /* Hidden by default */
    background: var(--navy);
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    position: fixed;
    right: 1rem;
    top: 1rem;
    z-index: 100100;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.nav__mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--navy);
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    z-index: 100100;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

    .nav__mobile-toggle {
        display: flex;  /* Show only on mobile */
    }
    
    .nav__links {
        display: none;
        position: absolute;
        top: 100%;
        right: 1rem;
        flex-direction: column;
        background: var(--navy);
        padding: 1rem;
        gap: 1rem;
        z-index: 1000;
    }
    .nav__links.active {
        display: flex !important;
        z-index: 100150 !important;
    }

    /* Section spacing fixes */
    #about.section,
    #projects.section,
    #timeline.section,
    #blog.section {
        margin-top: 0;
        padding-top: 2rem;
    }

    /* Imagine gallery - 6 images per row on mobile */
    .imagine-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
        padding: 0.5rem;
        margin: 0;
    }

    .imagine-row img:nth-child(n+7) {
        display: none;
    }

    .imagine-row img {
        width: 100%;
        height: 160px;
        object-fit: cover;
    }

    /* Contact section */
    html body #contact.section {
        min-height: 32px;
        height: auto;
        padding: 0.2rem 0.5rem;
    }

    #contact.section .contact__links a {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        width: 92%;
    }

    .imagine-row {
        grid-template-columns: repeat(2, 1fr);
    }

    #about.section {
        margin-top: 0.5rem;
    }

    #projects.section {
        margin-top: 3rem;
    }
}

/* RESET & BASE ------------------------------------ */
body, html {
  background: var(--bg-gradient);
  color: var(--text-light);
  transition: background 0.3s, color 0.3s; 
  scroll-behavior: smooth; 
}
img { display: block; max-width: 100%; height: auto; }
.container { width: 90%; max-width: 1100px; margin: auto; position: relative; z-index: 3; }
.section { 
    padding: 4rem 0; 
    margin-bottom: 2rem;  /* Balanced spacing between sections */
    position: relative;
    z-index: 2 !important;
}
.section--alt {
    background: transparent;
}
  h1, h2, h3, h4 { color: var(--gold); font-weight: 700; letter-spacing: -0.5px; }
  .section h2 {
    text-align: center;
    width: 100%;
    display: block;
    margin-left: 0;
    padding-left: 0;
}

/* Make all themed elements transition smoothly */
*, *::before, *::after {
    transition: background-color 0.3s ease, 
                color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease,
                background 0.3s ease;
}

/* NAV ------------------------------------------------ */
.nav { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; position: relative; z-index: 10; }
.logo { 
    font-size: 1.5rem; 
    margin-left: 1.5rem; 
    color: var(--gold);
    text-decoration: none !important;
    border-bottom: none;
    -webkit-text-decoration: none;
    -moz-text-decoration: none;
}
  .nav__links { list-style: none; display: flex; gap: 1.25rem; align-items: center; }
  .nav__links a { text-decoration: none; color: var(--text-light); font-weight: 700; transition: opacity 0.2s ease; }
  .nav__links a:hover { opacity: 0.7; }
#darkToggle {
    background: none;
    border: 2px solid var(--accent);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s ease;
}
#darkToggle:hover {
    transform: scale(1.1);
    background: var(--accent);
    color: var(--navy);
}

/* Mobile Navigation */
.nav__mobile-toggle {
    display: none;  /* Hidden by default */
    background: var(--navy);
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    position: fixed;
    right: 1rem;
    top: 1rem;
    z-index: 100100;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.nav__mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--navy);
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    z-index: 100100;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

    .nav__mobile-toggle {
        display: flex;  /* Show only on mobile */
    }
    
    .nav__links {
        display: none;
        position: absolute;
        top: 100%;
        right: 1rem;
        flex-direction: column;
        background: var(--navy);
        padding: 1rem;
        gap: 1rem;
        z-index: 1000;
    }
    .nav__links.active {
        display: flex !important;
        z-index: 100150 !important;
    }

    /* Section spacing fixes */
    #about.section,
    #projects.section,
    #timeline.section,
    #blog.section {
        margin-top: 0;
        padding-top: 2rem;
    }

    /* Imagine gallery - 6 images per row on mobile */
    .imagine-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
        padding: 0.5rem;
        margin: 0;
    }

    .imagine-row img:nth-child(n+7) {
        display: none;
    }

    .imagine-row img {
        width: 100%;
        height: 160px;
        object-fit: cover;
    }

    /* Contact section */
    html body #contact.section {
        min-height: 32px;
        height: auto;
        padding: 0.2rem 0.5rem;
    }

    #contact.section .contact__links a {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        width: 92%;
    }

    .imagine-row {
        grid-template-columns: repeat(2, 1fr);
    }

    #about.section {
        margin-top: 0.5rem;
    }

    #projects.section {
        margin-top: 3rem;
    }
}

/* MOBILE ABOUT SHIFT */
@media (max-width: 480px) {
  .hero__content.container {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  #about.section {
    margin-top: 0 !important;
    padding-top: 0 !important;
    transform: none !important;
  }
  .section.container {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  /* keep the same gap before the next sections */
  #projects.section,
  #timeline.section,
  #blog.section {
    margin-top: 1rem !important;
  }

  /* Remove ALL margin/padding above About section and hero */
  #about.section,
  #about.section.container,
  .section#about,
  .container#about,
  #about {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  .hero__content.container {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  header.hero {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

    /* Mobile menu */
    .nav__mobile-toggle {
        display: flex;
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 100100;
    }

    .nav__links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 100vh;
        background: rgba(16, 22, 36, 0.98);
        padding: 5rem 1.5rem 2rem;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        z-index: 100150 !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .nav__links.active {
        display: flex !important;
        z-index: 100150 !important;
    }

    /* Hero adjustments */
    .hero__headline {
        font-size: 1.4rem;
        padding: 0 1rem;
        line-height: 1.4;
    }

    .hero__subhead {
        font-size: 1rem;
        padding: 0 1rem;
        margin-bottom: 0.5rem !important;
    }

    /* Section spacing */
    #about.section {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    #projects.section {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    #timeline.section {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    #blog.section {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    /* Imagine gallery */
    .imagine-scroll-gallery {
        overflow: hidden;
    }

    .imagine-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
        padding: 0.5rem;
        margin: 0;
        transform: none !important;
    }

    .imagine-row img {
        width: 100%;
        height: 160px;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .imagine-row img:hover {
        transform: scale(1.1);
    }

    /* Contact section */
    html body #contact.section {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: auto !important;
        padding: 0.6rem 0.5rem !important;
        background: var(--navy) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        border-top: 1px solid rgba(0, 0, 0, 0.2) !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
        z-index: 999999 !important;
    }

    .footer {
        position: static !important;
        width: 100% !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        z-index: auto !important;
    }

    #contact.section .contact__links {
        gap: 0.3rem;
        margin: 0;
    }

    #contact.section .contact__links a {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .container {
        width: 92%;
    }

    .hero__headline {
        font-size: 1.3rem;
    }

    .imagine-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .imagine-row img {
        height: 140px;
    }

    #contact.section {
        min-height: 28px;
        height: auto;
    }

    #contact.section .contact__links a {
        font-size: 0.75rem;
        padding: 0.15rem 0.35rem;
    }
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

    /* Mobile menu */
    .nav__mobile-toggle {
        display: flex;
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 100100;
        background: var(--navy);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid var(--gold);
        width: 40px;
        height: 40px;
    }

    .nav__links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 100vh;
        background: rgba(16, 22, 36, 0.98);
        padding: 5rem 1.5rem 2rem;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        z-index: 100150 !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .nav__links.active {
        display: flex !important;
        z-index: 100150 !important;
    }

    /* Remove section overlaps */
    #about.section,
    #projects.section,
    #timeline.section,
    #blog.section {
        margin-top: 0;
        padding-top: 2rem;
    }

    /* Imagine gallery - 6 images per row on mobile */
    .imagine-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
        padding: 0.5rem;
        margin: 0;
    }

    .imagine-row img:nth-child(n+7) {
        display: none;
    }

    .imagine-row img {
        width: 100%;
        height: 160px;
        object-fit: cover;
    }

    /* Contact section */
    #contact.section {
        min-height: 32px;
        height: auto;
        padding: 0.2rem 0.5rem;
    }

    #contact.section .contact__links {
        gap: 0.3rem;
    }

    #contact.section .contact__links a {
        padding: 0.15rem 0.4rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .imagine-row {
        grid-template-columns: repeat(2, 1fr);
    }

    #about.section {
        margin-top: 0.5rem;
    }

    #projects.section {
        margin-top: 3rem;
    }
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

    /* Mobile menu */
    .nav__mobile-toggle {
        display: flex;
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 100100;
    }

    .nav__links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 100vh;
        background: rgba(16, 22, 36, 0.98);
        padding: 5rem 1.5rem 2rem;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        z-index: 100150 !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .nav__links.active {
        display: flex !important;
        z-index: 100150 !important;
    }

    .nav__links a {
        font-size: 1.2rem;
        padding: 0.8rem;
        width: 100%;
        text-align: center;
    }

    /* Hero adjustments */
    .hero__headline {
        font-size: 1.4rem;
        padding: 0 1rem;
        line-height: 1.4;
    }

    .hero__subhead {
        font-size: 1rem;
        padding: 0 1rem;
        margin-bottom: 0.5rem !important;
    }

    /* Section spacing */
    #about.section {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    #projects.section {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    #timeline.section {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    #blog.section {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    /* Imagine gallery */
    .imagine-scroll-gallery {
        overflow: hidden;
    }

    .imagine-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
        padding: 0.5rem;
        margin: 0;
        transform: none !important;
    }

    .imagine-row img {
        width: 100%;
        height: 160px;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .imagine-row img:hover {
        transform: scale(1.1);
    }

    /* Contact section */
    html body #contact.section {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: auto !important;
        padding: 0.6rem 0.5rem !important;
        background: var(--navy) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        border-top: 1px solid rgba(0, 0, 0, 0.2) !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
        z-index: 999999 !important;
    }

    .footer {
        position: static !important;
        width: 100% !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        z-index: auto !important;
    }

    #contact.section .contact__links {
        gap: 0.3rem;
        margin: 0;
    }

    #contact.section .contact__links a {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
}

/* Mobile-only contact adjustments */
@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

  /* hide title */
  #contact h2 {
    display: none !important;
  }
  /* row layout: text left, links right */
  #contact {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: rgba(16, 22, 36, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    padding: 0.4rem 1rem !important;
    min-height: 44px !important;
    width: 100vw !important;
    box-sizing: border-box !important;
  }
  #contact p {
    margin: 0 !important;
    font-size: 0.95rem !important;
    text-align: left !important;
    white-space: normal !important;
    flex: 1 1 60%;
    color: #fff !important;
    max-width: 70vw;
    overflow-wrap: break-word;
  }
  #contact .contact__links {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 auto;
    white-space: nowrap;
  }
  #contact .contact__links li:nth-child(n+3) {
    display: none !important;
  }
  #contact .contact__links a {
    font-size: 0.87rem !important;
    background: rgba(255,255,255,0.92);
    color: #222 !important;
    border-radius: 3px;
    padding: 0.14rem 0.32rem;
    text-decoration: none;
    transition: background 0.2s;
    display: inline-block;
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  }
  #contact .contact__links a:hover {
    background: rgba(255,255,255,0.22);
  }
}

/* HERO ---------------------------------------------- */
.hero {
    background: var(--hero-gradient);
    text-align: center;
    position: relative;
    z-index: 2;
    min-height: auto;  /* Changed from 100vh to auto */
    padding-bottom: 100px;  /* Add padding to prevent overlap */
}
  #heroLights {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0.8;
    mix-blend-mode: screen;
    display: block !important;
    visibility: visible !important;
}
[data-theme="light"] #heroLights {
    mix-blend-mode: multiply;
    opacity: 0.3;
  }
  .hero__img { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 4px solid var(--gold); margin: 2rem auto 1rem auto; box-shadow: 0 4px 20px var(--shadow); }
  .hero__headline { font-size: 1.75rem; margin-bottom: 0.5rem; }
  .hero__headline .highlight { color: var(--gold); }
  .hero__subhead { font-size: 1.1rem; margin-bottom: 2rem; color: var(--white); }
  
  /* TIMELINE ------------------------------------------ */
.timeline-grid {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    margin-top: 2rem;
    z-index: 2 !important;
}
.timeline-col,
.timeline-col--right {
    flex: 1;
    max-width: 50%;
}
  .timeline {
    list-style: none;
    border-left: 2px solid var(--gold);
    padding-left: 1.5rem;
    margin: 0;
    margin-top: 2rem;
  }
  .timeline li {
    margin-bottom: 1.2rem;
    position: relative;
    padding: 0.8rem 1.2rem;
    background: rgba(255, 209, 102, 0.07);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

/* Timeline hover animation - Dark theme */
.timeline li:hover {
    transform: scale(1.03) translateX(5px);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.3), 0 0 20px rgba(255, 215, 0, 0.15);
    background: rgba(255, 209, 102, 0.15);
}

/* Timeline hover animation - Light theme */
[data-theme="light"] .timeline li:hover {
    transform: scale(1.03) translateX(5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15), 0 0 20px rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.08);
}

/* Education column hover (cyan glow in dark mode) */
.timeline-col .timeline li:hover {
    box-shadow: 0 8px 30px rgba(62, 198, 224, 0.35), 0 0 20px rgba(62, 198, 224, 0.2);
    background: rgba(62, 198, 224, 0.15);
}

[data-theme="light"] .timeline-col .timeline li:hover {
    box-shadow: 0 8px 30px rgba(0, 100, 150, 0.2), 0 0 20px rgba(0, 100, 150, 0.1);
    background: rgba(0, 100, 150, 0.1);
}

/* Work column hover (gold glow in dark mode) */
.timeline-col:nth-child(2) .timeline li:hover,
.timeline-col--right .timeline li:hover {
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.35), 0 0 20px rgba(255, 215, 0, 0.2);
    background: rgba(255, 209, 102, 0.15);
}

[data-theme="light"] .timeline-col:nth-child(2) .timeline li:hover,
[data-theme="light"] .timeline-col--right .timeline li:hover {
    box-shadow: 0 8px 30px rgba(180, 140, 0, 0.2), 0 0 20px rgba(180, 140, 0, 0.1);
    background: rgba(180, 140, 0, 0.1);
}

/* Fallback animation if JS fails */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Add back the ::before rule for the timeline dots */
  .timeline li::before {
    content: "";
    width: 0.75rem;
    height: 0.75rem;
    background: var(--gold); /* Base color, specific colors applied below */
    border-radius: 50%;
    position: absolute;
    left: -0.4rem; /* Adjusted for padding */
    top: 1.1rem; /* Adjusted for padding */
    box-shadow: 0 0 0 2px var(--navy-light);
    z-index: 2;
  }

  .timeline li.animated-popout {
    z-index: 20 !important;
  }
  
  /* Modern, vibrant color palette and timeline grid layout */
  .timeline-grid {
    display: flex;
    flex-direction: row !important;
    gap: 3rem;
    justify-content: flex-start;
    align-items: flex-start;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 1100px;
    margin: auto;
}
.timeline-col,
.timeline-col--right {
    width: 48%;
    min-width: 0;
    box-sizing: border-box;
  }
  .timeline-col h3 {
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-left: 1.2rem;
  }
  .timeline-col:nth-child(2) h3 {
    color: var(--gold);
  }
  .timeline-col .timeline li {
    background: rgba(62,198,224,0.07);
    border-radius: 0.5rem;
  }
  .timeline-col:nth-child(2) .timeline li {
    background: rgba(255,209,102,0.07);
  }
  .timeline-col .timeline li::before {
    background: var(--timeline-edu);
  }
  .timeline-col:nth-child(2) .timeline li::before {
    background: var(--timeline-work);
  }
.timeline-col--right h3 {
    margin-left: 0; /* Remove default left margin */
    margin-right: 1.2rem; /* Add right margin to match left column's spacing */
    color: var(--gold); /* Explicitly set color */
}
.timeline-col--right .timeline {
    border-left: 2px solid var(--gold);
    border-right: none;
    padding-left: 1.5rem;
    padding-right: 0;
}
.timeline-col--right .timeline li {
    text-align: left;
  }
  
  /* PROJECT TILES ------------------------------------- */
.project__grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
    gap: 2rem; 
    margin-top: 2rem; 
    margin-bottom: 8rem;  /* Reduced from 2rem */
}

.tile { padding: 2rem; border-radius: 1rem; background: var(--navy-light); box-shadow: 0 4px 20px var(--shadow); text-align: center; transition: transform 0.3s, box-shadow 0.3s; cursor: pointer; position: relative; height: 100%; display: flex; flex-direction: column; z-index: 5 !important; }
.tile img { margin-top: 1.5rem; max-width: 100%; height: auto; margin-bottom: 1rem; }
  .tile h3 { margin: 1rem 0; font-size: 1.2rem; color: var(--gold); }
.tile .btn { margin-top: auto; }
.tile--tofe { padding-top: 3.5rem;  /* Add extra padding at top to match the space taken by "In Development" */ }
  .tile--rip .tile__more { margin-top: 1rem; display: none; text-align: left; font-size: 0.9rem; }
.btn { display: inline-block; margin-top: 1rem; padding: 0.6rem 1.2rem; border-radius: 30px; background: linear-gradient(90deg, var(--gold) 60%, var(--accent) 100%); color: var(--navy); text-decoration: none; font-weight: 700; transition: background 0.3s; box-shadow: 0 2px 10px var(--shadow); border: none; }
.btn:hover { background: linear-gradient(90deg, var(--accent) 60%, var(--gold) 100%); color: var(--navy); }

  .btn--light {
    background: linear-gradient(90deg, #ffd166 60%, #fff8e1 100%);
    color: #101624;
    border: none;
    box-shadow: 0 2px 10px var(--shadow);
    font-weight: 700;
    transition: background 0.3s, color 0.3s;
  }
  .btn--light:hover {
    background: linear-gradient(90deg, #fff8e1 60%, #ffd166 100%);
    color: #101624;
  }

  .project-tile {
    transition: transform 0.35s cubic-bezier(.4,2,.6,1), box-shadow 0.35s, background 0.35s;
    will-change: transform, box-shadow;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--shadow);
    position: relative;
    z-index: 5 !important;
    text-decoration: none;
    margin-bottom: 1rem;  /* Reduced from 2rem */
  }
  .project-tile:hover {
    transform: translateY(-8px) scale(1.04) rotate(-1deg);
    box-shadow: 0 12px 40px var(--gold), 0 2px 24px var(--accent);
    background: rgba(255, 209, 102, 0.07);
  }
  .project-tile h3 {
    text-decoration: none;
  }

.project-tile {
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

.project-tile img {
    height: 180px;
    object-fit: contain;
    margin: 1.5rem auto;
}

.tile__status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    margin: 0;
    color: #8893a7;
    font-style: italic;
    font-size: 0.9rem;
  }
  
  /* AI ART GALLERY ------------------------------------ */
  #artColumns {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    height: 600px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(120deg, var(--navy) 60%, var(--accent) 100%);
    box-shadow: 0 8px 40px var(--shadow);
    border-radius: 1.5rem;
    padding: 2rem 0;
    margin-bottom: 2rem;
  }
  .column { display: flex; flex-direction: column; gap: 1rem; }
  .column img {
    width: 100%;
    border-radius: 0.75rem;
    box-shadow: 0 3px 15px var(--shadow);
    object-fit: cover;
    filter: drop-shadow(0 2px 8px var(--accent));
    transition: transform 0.5s cubic-bezier(.4,2,.6,1), box-shadow 0.5s;
  }
  .column img:hover {
    transform: scale(1.08) rotate(-2deg);
    box-shadow: 0 8px 32px var(--gold);
    z-index: 2;
  }
  
  /* BLOG LIST ----------------------------------------- */
  .blog__list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
  .blog__list a { text-decoration: none; background: var(--navy-light); padding: 0.75rem; border-radius: 0.75rem; color: var(--gold); text-align: center; font-weight: 700; box-shadow: 0 3px 10px var(--shadow); transition: transform 0.3s; }
  .blog__list a:hover { transform: translateY(-3px); }
  
  /* CONTACT ------------------------------------------- */
  .contact__links { list-style: none; display: flex; gap: 1.5rem; margin-top: 1rem; justify-content: center; }
  .contact__links a {
    text-decoration: none;
    font-weight: 700;
    color: var(--gold);
    background: var(--navy-light);
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    border: 1.5px solid var(--accent);
    transition: background 0.3s, color 0.3s;
  }
  .contact__links a:hover {
    background: var(--accent);
    color: var (--navy);
  }

  .light-ring {
    position: relative;
    display: inline-block;
    padding: 0.3em 1.2em;
    border-radius: 2em;
    background: transparent;
    color: var(--gold);
    font-weight: 700;
    z-index: 1;
    overflow: visible;
  }
  .light-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 2em;
    z-index: 0;
    border: 3px solid rgba(255,255,255,0.7);
    box-sizing: border-box;
  }
  .light-ring::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 2em;
    z-index: 1;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    pointer-events: none;
    background: conic-gradient(from 90deg, transparent 0 250deg, #fff 250deg 290deg, transparent 290deg 360deg);
    animation: border-sweep 1.2s linear infinite reverse;
    box-shadow: 0 0 12px 4px #fff8;
  }
  @keyframes border-sweep {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
  }

  html body #contact.section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    padding: 0.6rem 0.5rem;
    background: var(--navy);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 999999;
}

.footer {
    position: static;
    width: 100%;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
}

    #contact.section .contact__links {
        gap: 0.3rem;
        margin: 0;
    }

    #contact.section .contact__links a {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
}

/* CONTACT & MOBILE MENU STYLES */
#contact.section {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  display: flex;
  padding: 0.5rem 1rem;
  justify-content: space-between;
  align-items: center;
  background: rgba(var(--navy-rgb), 0.6);
  box-shadow: 0 -4px 20px rgba(var(--navy-rgb), 0.3);
  z-index: 9999;
}
#contact.section h2,
#contact.section p {
  margin: 0;
  color: var(--white);
}
.contact__links {
  display: flex;
  gap: 0.5rem;
}

.nav__mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
}
@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

  .nav__mobile-toggle {
    display: block;
  }
  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    right: 1rem;
    flex-direction: column;
    background: var(--navy);
    padding: 1rem;
    gap: 1rem;
    z-index: 1000;
  }
  .nav__links.active {
    display: flex;
  }
}
@media (min-width: 769px) {
  .main-desc {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-light);
    text-align: justify;
  }

  .nav__mobile-toggle {
    display: none !important;
  }
  .nav__links {
    display: flex !important;
    position: static;
    flex-direction: row;
    background: none;
  }
}

/* FOOTER -------------------------------------------- */
.footer { 
    text-align: center; 
    padding: 1rem 0; 
    font-size: 0.9rem; 
    color: var(--text-light);
    background: none;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    height: 48px;
  }
  
  /* ANIMATION HELPERS -------------------------------- */
  .fade { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .fade.visible { opacity: 1; transform: none; }
  
  /* MEDIA QUERIES ------------------------------------ */
  @media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

    #artColumns { grid-template-columns: repeat(3, 1fr); }
  }
  @media (max-width: 500px) {
    #artColumns { grid-template-columns: repeat(2, 1fr); }
    .nav__links { display: none; }
  }
/* Responsive timeline grid - MOVED HERE */
  @media (max-width: 900px) {
    .timeline-grid {
        flex-direction: row !important;
        gap: 1.5rem;
    }
    .timeline-col,
    .timeline-col--right {
        max-width: 50%;
        flex: 1 1 0;
        min-width: 0;
    }
}
@media (max-width: 700px) {
    .timeline-grid {
        flex-direction: column !important;
        gap: 1.5rem;
    }
    .timeline-col,
    .timeline-col--right {
        max-width: 100%;
        flex: 1 1 100%;
        min-width: 0;
    }
    #contact.section {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        padding: 1.2rem 0.5rem 0.7rem 0.5rem;
        gap: 0.5rem;
        position: fixed;
        width: 100vw;
    }
    #contact.section h2, #contact.section p {
        position: static;
        transform: none;
        margin: 0 0 0.5rem 0;
        display: block;
        text-align: left;
        font-size: 1rem;
    }
    .contact__links {
        flex-direction: column;
        align-items: flex-start;
        margin: 0;
        gap: 0.3rem;
        width: 100%;
    }
    .contact__links a {
        width: 100%;
        text-align: left;
        font-size: 0.98rem;
        padding: 0.4rem 0.7rem;
    }
  }

  /* Make the about section start higher up, closer to the hero section */
  #about.section {
    min-height: 380px;  /* Reduced from 420px */
    margin-top: -50px;  /* Reduced overlap with hero */
    padding-top: 2rem;
    padding-bottom: 4rem;  /* Reduced padding */
    text-align: justify;
    position: relative;
    z-index: 2;
  }

  #timeline.section {
    margin-top: -200px;  /* Reduced from -250px */
    padding-top: 4rem;
    padding-bottom: 6rem;  /* Added padding at bottom */
    z-index: 10;
    position: relative;
  }

#projects.section {
    margin-top: -100px; /* Moved further down from -200px */
    padding-top: 4rem;
    position: relative;
    z-index: 3;
}

#timeline.section .timeline-grid,
#timeline.section .timeline-col,
#timeline.section h3,
#timeline.section .timeline,
#timeline.section li {
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
  }

  .imagine-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
    margin-top: 2rem;
  }
  .imagine-gallery img {
    width: 100%;
    border-radius: 1.2rem;
    box-shadow: 0 4px 24px rgba(62,198,224,0.12);
    opacity: 0;
    transform: translateY(40px) scale(0.96);
    animation: fadeFloatIn 1.2s cubic-bezier(.4,2,.6,1) forwards;
    animation-delay: calc(var(--i, 0) * 0.08s);
    will-change: transform, opacity;
    transition: transform 0.4s cubic-bezier(.4,2,.6,1), box-shadow 0.4s;
  }
  .imagine-gallery img:hover {
    transform: scale(1.18) translateY(-8px);
    box-shadow: 0 0 0 6px rgba(255,255,255,0.18), 0 12px 40px var(--gold);
    filter: brightness(1.15) saturate(1.1);
    z-index: 2;
  }
  @keyframes fadeFloatIn {
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
  /* Floating animation for all images */
  .imagine-gallery img {
    animation-name: fadeFloatIn, floatY;
    animation-duration: 1.2s, 3.5s;
    animation-timing-function: cubic-bezier(.4,2,.6,1), ease-in-out;
    animation-fill-mode: forwards, alternate;
    animation-iteration-count: 1, infinite;
  }
  @keyframes floatY {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.02); }
    100% { transform: translateY(0) scale(1); }
  }

  #art.section {
    padding-top: 4rem;  /* Reduced from 6rem */
    margin-top: -100px;  /* Adjusted from -150px for less overlap */
    padding-bottom: 6rem;
    position: relative;
    z-index: 3;
  }

  #art.section h2 {
    padding-left: 0;
    margin-left: 0;
    text-align: center;
    width: 100%;
    display: block;
  }

  .imagine-scroll-gallery {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2.5rem;
    align-items: center;
  }
  .imagine-row {
    display: flex;
    gap: 1.2rem;
    overflow: visible; /* Allow zoomed images to overflow the row */
    white-space: nowrap;
    position: relative;
    will-change: transform;
    justify-content: center;
    padding-top: 28px;
    padding-bottom: 28px;
    /* Add extra space above and below so zoomed images are not cut off */
  }
  .imagine-row img {
    height: 320px;
    width: auto;
    aspect-ratio: 9/16;
    object-fit: contain;
    border-radius: 1.2rem;
    box-shadow: 0 4px 24px rgba(62,198,224,0.12);
    transition: transform 0.4s cubic-bezier(.4,2,.6,1), box-shadow 0.4s, filter 0.4s;
    background: none;
    margin-top: 0;
    margin-bottom: 0;
    /* Remove any margin collapse and ensure zoomed images fit */
  }
  .imagine-row img:hover {
    transform: scale(1.18) translateY(-8px);
    box-shadow: 0 0 0 6px rgba(255,255,255,0.18), 0 12px 40px var(--gold);
    filter: brightness(1.15) saturate(1.1);
    z-index: 2;
  }
  /* Hide scrollbars for a clean look */
  .imagine-row::-webkit-scrollbar { display: none; }
  .imagine-row { -ms-overflow-style: none; scrollbar-width: none; }

#timeline.section .container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

.timeline-grid {
    display: flex;
    flex-direction: row !important;
    gap: 4rem;
    justify-content: space-between;
    margin-top: 2rem;
    z-index: 10;
}

.timeline-col,
.timeline-col--right {
    width: calc(50% - 2rem);
    flex-shrink: 0;
}

/* Remove any conflicting styles */
.timeline-grid {
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
}

.timeline-col h3,
.timeline-col--right h3 {
    margin: 0 0 1rem 0;
}

.tile--rip img {
    margin-top: 1.5rem;
}

#projects {
    margin-bottom: 2rem;  /* Reduced from 4rem */
}

#projects.section {
    margin-top: -100px; /* Moved further down from -200px */
    padding-top: 4rem;
    position: relative;
    z-index: 3;
}

#blog.section {
    margin-top: -100px;  /* Adjusted from -150px for less overlap */
    padding-top: 4rem;
    padding-bottom: 6rem;  /* Added padding at bottom */
    position: relative;
    z-index: 10;
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

    /* Hero section adjustments */
    .hero__headline {
        font-size: 1.5rem;
        line-height: 1.4;
        margin: 0 1rem;
    }

    .hero__subhead {
        font-size: 1rem;
        margin: 1rem;
        line-height: 1.5;
        margin-bottom: 0 !important;
    }

    /* Timeline section improvements */
    .timeline-grid {
        flex-direction: column !important;
        padding: 0 1rem;
    }

    .timeline-col,
    .timeline-col--right {
        width: 100%;
        max-width: 100%;
        margin-bottom: 2rem;
    }

    /* Imagine gallery optimization */
    .imagine-row {
        gap: 0.8rem;
        padding: 1rem 0;
    }

    .imagine-row img {
        height: 260px;
        border-radius: 0.8rem;
    }

    /* Project tiles */
    .project__grid {
        padding: 0 1rem;
    }

    .project-tile {
        min-height: 280px;
    }

    /* Footer adjustments */
    .footer {
        padding: 1rem;
        margin-bottom: 60px; /* Space for fixed contact section */
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .container {
        width: 94%;
    }

    .hero__headline {
        font-size: 1.3rem;
    }

    .imagine-row img {
        height: 220px;
    }

    /* Improve touch targets */
    .nav__links a,
    .blog__list a,
    .contact__links a {
        padding: 0.8rem 1rem;
    }

    /* Better spacing for small screens */
    .section {
        padding: 2.5rem 0;
    }

    /* Adjust overlapping sections */
    #about.section {
        margin-top: 0.5rem;
    }

    #timeline.section {
        margin-top: -150px;
    }

    #projects.section {
        margin-top: -150px;
    }

    #blog.section {
        margin-top: -80px;
    }
}

/* Mobile navigation and layout fixes */
@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

    /* Fix mobile menu */
    .nav__mobile-toggle {
        display: flex;
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 100100;
    }

    .nav__links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 100vh;
        background: var(--navy);
        padding: 5rem 2rem 2rem;
        display: none;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        z-index: 1000;
    }

    .nav__links.active {
        display: flex !important;
        z-index: 100150 !important;
    }

    /* Fix section overlap */
    #about.section,
    #projects.section,
    #timeline.section,
    #blog.section {
        margin-top: 0;
        padding-top: 2rem;
    }

    /* Imagine gallery - 6 images per row on mobile */
    .imagine-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
        padding: 0.5rem;
        margin: 0;
    }

    .imagine-row img:nth-child(n+7) {
        display: none;
    }

    .imagine-row img {
        width: 100%;
        height: 160px;
        object-fit: cover;
    }

    /* Contact section */
    html body #contact.section {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: auto !important;
        padding: 0.6rem 0.5rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        border-top: 1px solid rgba(0, 0, 0, 0.2) !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
        z-index: 999999 !important;
    }

    .footer {
        position: static !important;
        width: 100% !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        z-index: auto !important;
    }

    #contact.section .contact__links {
        gap: 0.3rem;
        margin: 0;
    }

    #contact.section .contact__links a {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .imagine-row {
        grid-template-columns: repeat(2, 1fr);
    }

    #about.section {
        margin-top: 0.5rem;
    }

    #projects.section {
        margin-top: 3rem;
    }
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

    /* Mobile menu */
    .nav__mobile-toggle {  
        display: flex;
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 100100;
    }

    .nav__links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 100vh;
        background: rgba(16, 22, 36, 0.98);
        padding: 5rem 1.5rem 2rem;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        z-index: 100150 !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .nav__links.active {
        display: flex !important;
        z-index: 100150 !important;
    }

    .nav__links a {
        font-size: 1.2rem;
        padding: 0.8rem;
        width: 100%;
        text-align: center;
    }

    /* Hero adjustments */
    .hero__headline {
        font-size: 1.4rem;
        padding: 0 1rem;
        line-height: 1.4;
    }

    .hero__subhead {
        font-size: 1rem;
        padding: 0 1rem;
        margin-bottom: 0 !important;
    }

    /* Section spacing */
    #about.section {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    #projects.section {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    #timeline.section {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    #blog.section {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    /* Imagine gallery */
    .imagine-scroll-gallery {
        overflow: hidden;
    }

    .imagine-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
        padding: 0.5rem;
        margin: 0;
        transform: none !important;
    }

    .imagine-row img {
        width: 100%;
        height: 160px;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .imagine-row img:hover {
        transform: scale(1.1);
    }

    /* Contact section */
    html body #contact.section {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: auto !important;
        padding: 0.6rem 0.5rem !important;
        background: var(--navy) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        border-top: 1px solid rgba(0, 0, 0, 0.2) !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
        z-index: 999999 !important;
    }

    .footer {
        position: static !important;
        width: 100% !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        z-index: auto !important;
    }

    #contact.section .contact__links {
        gap: 0.3rem;
        margin: 0;
    }

    #contact.section .contact__links a {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .container {
        width: 92%;
    }

    .hero__headline {
        font-size: 1.3rem;
    }

    .imagine-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .imagine-row img {
        height: 140px;
    }

    #contact.section {
        min-height: 28px;
        height: auto;
    }

    #contact.section .contact__links a {
        font-size: 0.75rem;
        padding: 0.15rem 0.35rem;
    }
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

    /* Mobile menu */
    .nav__mobile-toggle {
        display: flex;
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 100100;
        background: var(--navy);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid var(--gold);
        width: 40px;
        height: 40px;
    }

    .nav__links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 100vh;
        background: rgba(16, 22, 36, 0.98);
        padding: 5rem 1.5rem 2rem;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        z-index: 100150 !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .nav__links.active {
        display: flex !important;
        z-index: 100150 !important;
    }

    /* Remove section overlaps */
    #about.section,
    #projects.section,
    #timeline.section,
    #blog.section {
        margin-top: 0;
        padding-top: 2rem;
    }

    /* Imagine gallery - 6 images per row on mobile */
    .imagine-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
        padding: 0.5rem;
        margin: 0;
    }

    .imagine-row img:nth-child(n+7) {
        display: none;
    }

    .imagine-row img {
        width: 100%;
        height: 160px;
        object-fit: cover;
    }

    /* Contact section */
    #contact.section {
        min-height: 32px;
        height: auto;
        padding: 0.2rem 0.5rem;
    }

    #contact.section .contact__links {
        gap: 0.3rem;
    }

    #contact.section .contact__links a {
        padding: 0.15rem 0.4rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .imagine-row {
        grid-template-columns: repeat(2, 1fr);
    }

    #about.section {
        margin-top: 0.5rem;
    }

    #projects.section {
        margin-top: 3rem;
    }
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

    /* Mobile menu */
    .nav__mobile-toggle {
        display: flex;
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 100100;
    }

    .nav__links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 100vh;
        background: rgba(16, 22, 36, 0.98);
        padding: 5rem 1.5rem 2rem;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        z-index: 100150 !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .nav__links.active {
        display: flex !important;
        z-index: 100150 !important;
    }

    .nav__links a {
        font-size: 1.2rem;
        padding: 0.8rem;
        width: 100%;
        text-align: center;
    }

    /* Hero adjustments */
    .hero__headline {
        font-size: 1.4rem;
        padding: 0 1rem;
        line-height: 1.4;
    }

    .hero__subhead {
        font-size: 1rem;
        padding: 0 1rem;
        margin-bottom: 0 !important;
    }

    /* Section spacing */
    #about.section {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    #projects.section {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    #timeline.section {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    #blog.section {
        margin-top: 2rem;
        padding-top: 2rem;
    }

    /* Imagine gallery */
    .imagine-scroll-gallery {
        overflow: hidden;
    }

    .imagine-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
        padding: 0.5rem;
        margin: 0;
        transform: none !important;
    }

    .imagine-row img {
        width: 100%;
        height: 160px;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .imagine-row img:hover {
        transform: scale(1.1);
    }

    /* Contact section */
    html body #contact.section {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: auto !important;
        padding: 0.6rem 0.5rem !important;
        background: var(--navy) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        border-top: 1px solid rgba(0, 0, 0, 0.2) !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
        z-index: 999999 !important;
    }

    .footer {
        position: static !important;
        width: 100% !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        z-index: auto !important;
    }

    #contact.section .contact__links {
        gap: 0.3rem;
        margin: 0;
    }

    #contact.section .contact__links a {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
}

/* Mobile-only navbar & contact section tweaks */
@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

  /* Show hamburger and hide desktop nav links */
  .nav__mobile-toggle {
    display: flex !important;
  }
  .nav__links {
    display: none !important;
  }
  .nav__links.active {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 100vh !important;
    background: rgba(16, 22, 36, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    padding: 5rem 1.5rem 2rem !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    z-index: 1001 !important;
  }
  /* Contact section tidy translucent stack */
  #contact.section {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.6rem 1rem !important;
    background: rgba(16, 22, 36, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    margin: 0 !important;
    z-index: 1000 !important;
  }
  #contact.section .contact__links {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin: 0 !important;
  }
}

/* --- COLLAPSED MOBILE NAV OVERRIDES --- */
@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

  .nav__mobile-toggle {
    display: flex !important;
    position: fixed !important;
    top: 1rem !important;
    right: 1rem !important;
    z-index: 9999 !important;
    background: var(--navy) !important;
    border: 1px solid var(--gold) !important;
    color: var(--gold) !important;
  }
  .nav__links {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 100vh !important;
    background: rgba(16,22,36,0.98) !important;
    padding: 5rem 1.5rem 2rem !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    z-index: 9998 !important;
  }
  .nav__links.active {
    display: flex !important;
    z-index: 9998 !important;
  }
}

/* SUBSCRIBE SECTION */
#subscribe {
  margin: 4rem 0;
  text-align: center;
}
.subscribe-form {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  width: fit-content !important;
  margin: 1rem auto !important;
  justify-content: center !important;
}
.subscribe-form input[type="email"] {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
  width: 300px;
  max-width: 100%;
}
.subscribe-form button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  background: var(--gold);
  color: var(--navy);
  cursor: pointer;
}
@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

  .subscribe-form {
    flex-direction: column;
  }
  .subscribe-form input[type="email"],
  .subscribe-form button {
    width: 100%;
    max-width: 400px;
  }
}

/* SUBSCRIBE SECTION ADJUSTMENTS */
.subscribe-form {
  margin: 1rem auto !important;
  justify-content: center !important;
  width: fit-content !important;
}
/* Input theme colors */
[data-theme="dark"] #subscribe .subscribe-form input {
  background: var(--navy) !important;
  color: var(--white) !important;
  border-color: var(--gold) !important;
}
[data-theme="light"] #subscribe .subscribe-form input {
  background: var(--white) !important;
  color: var(--navy) !important;
  border-color: var(--navy) !important;
}
/* Placeholder color - improved contrast for WCAG AA */
#subscribe .subscribe-form input::placeholder {
  color: rgba(255,255,255,0.7);
}
[data-theme="light"] #subscribe .subscribe-form input::placeholder {
  color: rgba(0,0,0,0.6);
}

/* FURTHER NUDGE FOR ABOUT ON MOBILE */
@media (max-width: 480px) {
  #about.section {
    margin-top: -1rem !important;  /* move up by 1rem */
  }
  /* preserve spacing for subsequent sections */
  #projects.section,
  #timeline.section,
  #blog.section {
    margin-top: 1rem !important;
  }
}

/* CUSTOM MOBILE SPACING ADJUSTMENTS */
@media (max-width: 768px) {
  .main-desc {
    font-size: 0.9rem !important;
  }

  /* Remove bottom spacing from hero */
  header.hero,
  .hero__content.container {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  /* Remove top spacing from About */
  #about.section,
  #about.section.container,
  .section#about,
  .container#about,
  #about {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  /* Tighten subhead margin */
  .hero__subhead {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  /* Reduce About section paragraph font size on mobile */
  #about.section p {
    font-size: 0.875rem !important;
  }
}  
