header {
    position: fixed;
    top: 0;
    left: 0;
    width: 90px; /* Width for the vertical navbar */
    height: 100vh; /* Full height */
    padding: 25px 0;
    z-index: 1001;
    transition: all 0.3s ease;
    background-color: transparent;
    border-right: none; /* Removed border */
    display: flex;
    justify-content: center; /* Center content horizontally */
    align-items: center; /* Center content vertically */
}

header.scrolled {
    background-color: transparent;
    border-bottom: none;
}



.social-links {
    display: flex;
    flex-direction: column; /* Stack icons vertically */
    gap: 20px; /* Adjust gap for vertical layout */
    align-items: center;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body.nav-active .social-links {
    transform: translateX(40px) scale(1.1);
}



/* Base style for all navbar buttons */
.icon-button {
background-color: var(--header-bg);
  color: var(--header-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 10px;
  font-size: 24px;
  line-height: 1;
  box-shadow: 4px 4px 0px #00000040;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
  padding: 0;
  border: none;
  cursor: pointer;
}

.icon-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 5px 5px 0px #00000060;
}

.icon-button:active {
    transform: translate(2px, 2px) scale(0.97);
    box-shadow: 1px 1px 0px #00000040;
}

/* Back button inherits .icon-button styles for identical alignment */

/* Ensure hamburger button inherits same shape */
#hamburger-menu {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 10px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.icon-button:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px #00000040;
}

.content-container {
    max-width: 1200px;
    width: 100%;
    padding: 0 24px;
}

h1, h2 {
    display: inline-block;
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 8px 20px;
    margin-bottom: 35px;
    font-size: 1.8em;
}

h2 {
    margin-top: 40px;
    font-size: 1.5em;
}

.content-container p {
    margin-bottom: 20px;
}

.separator {
    border-bottom: 2px dotted var(--text-color);
    margin: 40px 0;
}

.bio-list {
    list-style: none;
    padding-left: 0;
}

.bio-list li {
    margin-bottom: 10px;
}

.bio-list strong {
    display: inline-block;
    width: 150px; /* Adjust width as needed */
}

/* Overlay Navigation */
.overlay-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(204, 204, 255, 0.85), rgba(230, 230, 250, 0.9));
    backdrop-filter: blur(0px);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
    transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 1000;
    padding: 0 5%;
}

.overlay-menu.active {
    opacity: 1;
    pointer-events: auto;
    backdrop-filter: blur(20px);
    transform: scale(1);
}

.overlay-menu nav {
    text-align: left;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) 0.05s;
}

.overlay-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    max-width: 1600px;
    gap: 50px;
}

.overlay-menu.active nav {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.overlay-menu nav a {
    display: block;
    color: #333;
    font-size: 62px;
    text-decoration: none;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s var(--ease-spring), transform 0.5s var(--ease-spring);
}

.overlay-menu.active nav a {
    opacity: 1;
    transform: translateY(0);
}

.overlay-menu.active nav a:nth-child(1) { transition-delay: 0.10s; }
.overlay-menu.active nav a:nth-child(2) { transition-delay: 0.15s; }
.overlay-menu.active nav a:nth-child(3) { transition-delay: 0.20s; }
.overlay-menu.active nav a:nth-child(4) { transition-delay: 0.25s; }
.overlay-menu.active nav a:nth-child(5) { transition-delay: 0.30s; }

@keyframes slideInLeft {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.overlay-menu nav a:hover {
    color: #FFFFFF;
    transform: translateX(10px) scale(1.05);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    filter: brightness(1.2);
}



.color-picker-container {
    display: flex;
    justify-content: center;
}

/* --- Mobile Responsive Styles --- */
@media (max-width: 768px) {
    header {
        background-color: rgba(230, 230, 250, 0.5); /* Semi-transparent light lavender for glass effect */
        backdrop-filter: blur(18px) saturate(150%);
        -webkit-backdrop-filter: blur(18px) saturate(150%);
        border-bottom: none; /* remove navbar bottom border */
    }
}

.master-picker-wrapper {
    /* This will hold the iro.js picker */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px; /* Ensure space for the picker */
}

#hamburger-menu {
    border: none;
    font-family: var(--font-pixel);
    font-size: 22px;
    cursor: pointer;
    position: relative;
    z-index: 1002;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

#hamburger-menu:hover {
    transform: scale(1.1);
    box-shadow: 5px 5px 0px #00000060;
}

#hamburger-menu:active {
    transform: translate(2px, 2px) scale(1.05);
    box-shadow: 1px 1px 0px #00000060;
}

/* Hamburger Line Animation */
.hamburger-line {
    position: relative;
    display: block;
    width: 24px;
    height: 3px;
    background-color: currentColor;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hamburger-line::before,
.hamburger-line::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 3px;
    background-color: currentColor;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    left: 0;
}

.hamburger-line::before {
    transform: translateY(-8px);
}

.hamburger-line::after {
    transform: translateY(8px);
}

/* Active state - X formation */
body.nav-active .hamburger-line {
    background-color: transparent;
}

body.nav-active .hamburger-line::before {
    transform: rotate(45deg);
}

body.nav-active .hamburger-line::after {
    transform: rotate(-45deg);
}

body.nav-active #hamburger-menu {
    transform: rotate(180deg);
}

/* Y2K Window Style */
.y2k-window {
    background-color: transparent;
    width: 100%;
    max-width: 650px;
}



.window-content {
    padding: 20px;
}

.window-content h2 {
    margin-bottom: 15px;
    font-size: 1.5em;
}

.window-content h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.skills-list {
    list-style: none;
    padding-left: 0;
}

.skills-list li {
    margin-bottom: 5px;
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin: 2.5rem 0;
    max-width: 1600px;
    margin: 2.5rem auto;
    padding: 0 2rem;
    width: 100%;
    box-sizing: border-box;
}

.project-card {
    background: var(--primary-color);
    border: 3px solid var(--text-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 5px 5px 0px #00000040;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 8px 8px 0px #00000050;
}

.project-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 3px solid var(--text-color);
}

.card-content {
    padding: 20px; /* Increased padding */
}

.card-content h3 {
    margin-bottom: 10px;
    font-size: 1.2em;
}

/* Tech Stack in Project Cards */
.tech-stack {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tech-stack li {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.85em;
    border: 1px solid var(--text-color);
    box-shadow: 2px 2px 0px #00000040;
}

/* Contact Section */
.contact-links {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.contact-link-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: #000;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
    border: 2px solid var(--text-color);
    box-shadow: 5px 5px 0px #00000040;
    transition: all 0.2s ease;
}

/* Dark mode override for better contrast */
[data-theme="dark"] .contact-link-btn {
    background-color: var(--header-bg);
    color: var(--header-text);
}

.contact-link-btn:hover {
    background-color: var(--accent-color-light);
    transform: translateY(-2px);
    box-shadow: 7px 7px 0px #00000050;
}

.contact-link-btn:active {
    transform: translate(3px, 3px);
    box-shadow: 2px 2px 0px #00000040;
}

/* Floating GitHub Button */
.float-github {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: var(--header-bg);
    color: var(--header-text);
    border: 3px solid var(--text-color);
    box-shadow: 6px 6px 0px #00000040;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 1100;
    transform: translateZ(0);
    animation: gh-bob 3.2s var(--ease-spring, cubic-bezier(0.22,1,0.36,1)) infinite;
}

/* Floating Music Button */
.float-music {
    position: fixed;
    left: 22px;
    bottom: 22px;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: var(--header-bg);
    color: var(--header-text);
    border: 3px solid var(--text-color);
    box-shadow: 6px 6px 0px #00000040;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 1100;
    transform: translateZ(0);
    animation: music-bob 3.5s var(--ease-spring, cubic-bezier(0.22,1,0.36,1)) infinite;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.float-github:hover {
    transform: translateY(-4px);
    box-shadow: 8px 8px 0px #00000055;
}

.float-github:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0px #00000040;
}

.float-music:hover {
    transform: translateY(-4px);
    box-shadow: 8px 8px 0px #00000055;
}

.float-music:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0px #00000040;
}

.float-github .gh-icon {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 1px 0 rgba(0,0,0,0.15));
    animation: gh-wiggle 2.8s ease-in-out infinite;
}

.float-music .music-icon {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 1px 0 rgba(0,0,0,0.15));
    animation: music-pulse 2.5s ease-in-out infinite;
}

/* Pixel sparkles */
.float-github .sparkle,
.float-music .sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent-color-light);
    border: 2px solid var(--text-color);
    box-shadow: 2px 2px 0px #00000030;
    transform: rotate(45deg);
    opacity: 0.9;
}
.float-github .s1 { top: -8px; left: -8px; animation: sparkle 1.8s ease-in-out infinite; }
.float-github .s2 { bottom: -10px; right: -10px; animation: sparkle 2.2s ease-in-out infinite 0.3s; }
.float-github .s3 { top: -12px; right: -6px; animation: sparkle 2.6s ease-in-out infinite 0.6s; }

.float-music .s1 { top: -8px; left: -8px; animation: sparkle 2.0s ease-in-out infinite; }
.float-music .s2 { bottom: -10px; right: -10px; animation: sparkle 2.4s ease-in-out infinite 0.4s; }
.float-music .s3 { top: -12px; right: -6px; animation: sparkle 2.8s ease-in-out infinite 0.8s; }

@keyframes gh-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes music-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes gh-wiggle {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-3deg); }
  40% { transform: rotate(2deg); }
  60% { transform: rotate(-2deg); }
  80% { transform: rotate(1deg); }
}

@keyframes music-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes sparkle {
  0%, 100% { opacity: 0.3; transform: rotate(45deg) scale(0.9); }
  50% { opacity: 1; transform: rotate(45deg) scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .float-github { animation: none; }
  .float-github .gh-icon { animation: none; }
  .float-github .sparkle { animation: none; }
  .float-music { animation: none; }
  .float-music .music-icon { animation: none; }
  .float-music .sparkle { animation: none; }
}

/* ========================================
   MOBILE RESPONSIVENESS
   ======================================== */

/* Large Tablet - 768px and below */
@media (max-width: 768px) {
    /* Header transforms to horizontal top bar */
    header {
        width: 100%;
        height: 70px;
        top: 0;
        left: 0;
        right: 0;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        background-color: var(--header-bg);
        border-bottom: none; /* remove navbar bottom border */
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }

    .social-links {
        flex-direction: row;
        gap: 12px;
    }

    /* Adjust main content for horizontal header */
    main {
        margin-left: 0;
        padding: 90px 20px 40px;
    }

    /* Reduce font sizes for tablets */
    body {
        font-size: 28px;
    }

    .window-content h2 {
        font-size: 1.3em;
    }

    .window-content h3 {
        font-size: 1.1em;
    }

    /* Project grid adjustments */
    .project-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
        padding: 0 1.5rem;
    }

    /* Skills list responsive */
    .skills-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .skills-list li {
        background-color: var(--primary-color);
        padding: 8px 12px;
        border: 2px solid var(--text-color);
        box-shadow: 3px 3px 0px #00000040;
        margin-bottom: 0;
    }

    /* Contact buttons responsive */
    .contact-links {
        justify-content: center;
    }

    .contact-link-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9em;
        min-height: 44px; /* Ensure touch targets are at least 44px */
    }

    /* Blog responsive styles */
    .blog-posts {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .blog-posts-grid {
        gap: 1.5rem;
    }

    .view-all-btn,
    .read-more,
    .read-full-post {
        min-height: 44px;
        padding: 0.8rem 1.5rem;
        font-size: 0.9em;
    }
}

/* Mobile - 480px and below */
@media (max-width: 480px) {
    /* Header adjustments for mobile */
    header {
        padding: 0 15px;
        height: 65px;
    }

    .social-links {
        gap: 10px;
    }

    .icon-button {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        font-size: 20px;
    }

    #hamburger-menu {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    /* Main content adjustments */
    main {
        padding: 80px 15px 30px;
    }

    /* Reduce font sizes for mobile */
    body {
        font-size: 24px;
        line-height: 1.6;
    }

    .content-container {
        max-width: 100%;
    }

    .y2k-window {
        max-width: 100%;
    }

    .window-content {
        padding: 15px;
    }

    .window-content h2 {
        font-size: 1.2em;
        margin-bottom: 12px;
    }

    .window-content h3 {
        font-size: 1.05em;
        margin-top: 15px;
        margin-bottom: 8px;
    }

    /* Project grid for mobile */
    .project-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card-content {
        padding: 15px;
    }

    .card-content h3 {
        font-size: 1.1em;
    }

    /* Skills list mobile optimization */
    .skills-list {
        gap: 6px;
    }

    .skills-list li {
        padding: 6px 10px;
        font-size: 0.9em;
    }

    /* Contact buttons full width on mobile */
    .contact-links {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-link-btn {
        width: 100%;
        text-align: center;
        padding: 0.8rem 1rem;
        font-size: 0.85em;
        min-height: 48px; /* Larger touch targets for mobile */
    }

    /* Overlay menu mobile adjustments */
    .overlay-menu {
        padding: 20px;
    }

    .overlay-menu nav {
        gap: 20px;
    }

    .overlay-menu nav a {
        font-size: 1.8em;
        padding: 15px 20px;
    }

    /* Color picker mobile adjustments */
    .master-picker-wrapper {
        min-height: 200px;
        padding: 10px;
    }

    /* Blog mobile styles */
    .post-excerpt {
        font-size: 0.8em;
        line-height: 1.5;
    }

    .view-all-btn {
        width: 100%;
        text-align: center;
        padding: 1rem;
        font-size: 0.85em;
    }

    .post-full-content pre {
        padding: 1rem;
        font-size: 0.75em;
        overflow-x: auto;
    }

    .post-full-content code {
        font-size: 0.7em;
    }

    /* Modal mobile styles */
    .blog-modal {
        padding: 1rem;
    }

    .modal-content {
        margin-top: 1rem;
        max-height: 95vh;
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }

    .modal-title {
        font-size: 1em;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 1em;
        top: 0.75rem;
        right: 0.75rem;
    }

    .modal-body {
        padding: 1.5rem;
    }
}

/* Small Mobile - 320px and below */
@media (max-width: 320px) {
    /* Ultra-compact header */
    header {
        padding: 0 10px;
        height: 60px;
    }

    .social-links {
        gap: 8px;
    }

    .icon-button {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        font-size: 18px;
    }

    #hamburger-menu {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }

    /* Main content for very small screens */
    main {
        padding: 70px 10px 20px;
    }

    /* Ultra-compact font sizes */
    body {
        font-size: 20px;
        line-height: 1.5;
    }

    .window-content {
        padding: 12px;
    }

    .window-content h2 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }

    .window-content h3 {
        font-size: 1em;
        margin-top: 12px;
        margin-bottom: 6px;
    }

    /* Project cards ultra-compact */
    .project-grid {
        gap: 15px;
    }

    .card-content {
        padding: 12px;
    }

    .card-content h3 {
        font-size: 1em;
    }

    /* Skills ultra-compact */
    .skills-list {
        gap: 4px;
    }

    .skills-list li {
        padding: 4px 8px;
        font-size: 0.8em;
    }

    /* Contact buttons ultra-compact */
    .contact-link-btn {
        padding: 0.7rem 0.8rem;
        font-size: 0.8em;
        min-height: 44px;
    }

    /* Overlay menu ultra-compact */
    .overlay-menu nav {
        gap: 15px;
    }

    .overlay-menu nav a {
        font-size: 1.5em;
        padding: 12px 15px;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    header {
        height: 55px;
    }

    main {
        padding-top: 65px;
    }

    body {
        font-size: 22px;
    }

    .overlay-menu nav a {
        font-size: 1.4em;
        padding: 10px 15px;
    }

    .overlay-menu nav {
        gap: 15px;
    }
}

/* High DPI / Retina display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .icon-button,
    .contact-link-btn,
    .project-card {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ========================================
   ACCESSIBILITY & KEYBOARD NAVIGATION
   ======================================== */

/* Focus styles for keyboard navigation */
body.keyboard-navigation .icon-button:focus,
body.keyboard-navigation .contact-link-btn:focus,
body.keyboard-navigation .overlay-menu nav a:focus {
    outline: 3px solid var(--accent-color-light);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 5px var(--accent-color-light);
}

/* Remove focus outline for mouse users */
.icon-button:focus:not(:focus-visible),
.contact-link-btn:focus:not(:focus-visible),
.overlay-menu nav a:focus:not(:focus-visible) {
    outline: none;
}

/* Ensure minimum touch target sizes */
@media (pointer: coarse) {
    .icon-button,
    .contact-link-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .overlay-menu nav a {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .overlay-menu {
        transition: none;
    }
    
    .overlay-menu nav a {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .icon-button,
    .contact-link-btn,
    .project-card {
        border-width: 3px;
        box-shadow: 6px 6px 0px #000000;
    }
    
    .y2k-window {
        border-width: 3px;
    }
}

/* Dark mode preference support removed to maintain Y2K aesthetic */

/* Print styles */
@media print {
    header,
    .overlay-menu,
    .color-picker-container {
        display: none !important;
    }
    
    main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    .project-card,
    .y2k-window {
        break-inside: avoid;
        border: 1px solid #000;
        box-shadow: none;
    }
}

/* CSS Custom Properties for dynamic viewport height */
:root {
    --vh: 1vh;
}

/* Use custom viewport height for mobile browsers */
.overlay-menu {
    height: calc(var(--vh, 1vh) * 100);
}


