:root {
    /* Material Design Color Palette */
    --primary-color: #42a5f5;
    --primary-dark: #1976d2;
    --primary-light: #64b5f6;
    --secondary-color: #757575;
    --accent-color: #ff9800;
    
    /* Background Colors - Dark Theme */
    --background: #121212;
    --surface: #1e1e1e;
    --surface-variant: #2c2c2c;
    
    /* Text Colors - Dark Theme */
    --text-primary: rgba(255, 255, 255, 0.87);
    --text-secondary: rgba(255, 255, 255, 0.60);
    --text-disabled: rgba(255, 255, 255, 0.38);
    --text-on-primary: #ffffff;
    
    /* Material Design Elevation Shadows - Dark Theme */
    --elevation-0: none;
    --elevation-1: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.4);
    --elevation-2: 0 3px 6px rgba(0, 0, 0, 0.4), 0 3px 6px rgba(0, 0, 0, 0.5);
    --elevation-3: 0 10px 20px rgba(0, 0, 0, 0.5), 0 6px 6px rgba(0, 0, 0, 0.6);
    --elevation-4: 0 14px 28px rgba(0, 0, 0, 0.6), 0 10px 10px rgba(0, 0, 0, 0.7);
    --elevation-5: 0 19px 38px rgba(0, 0, 0, 0.7), 0 15px 12px rgba(0, 0, 0, 0.8);
    
    /* Legacy support */
    --primary-bg: #1e1e1e;
    --card-bg: #1e1e1e;
    --light-bg: #121212;
    --white: #ffffff;
    --primary-accent: #42a5f5;
    --secondary-accent: #1976d2;
    --border-color: rgba(255, 255, 255, 0.12);
    --shadow-sm: var(--elevation-1);
    --shadow-md: var(--elevation-2);
    --shadow-lg: var(--elevation-3);
    --shadow-xl: var(--elevation-4);
    
    /* Typography - Material Design uses Roboto */
    --font-heading: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Roboto', sans-serif;
    --font-accent: 'Roboto', sans-serif;
    --font-ui: 'Roboto', sans-serif;
    
    /* Border Radius - Material Design uses 4px, 8px, 12px, 16px */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 999px;
    
    /* Spacing - Material Design uses 8px grid */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;

    /* Game UI Elements (Adapted for dark theme) */
    --game-panel-bg: #1e1e1e;
    --game-border-glow: 0 0 10px rgba(66, 165, 245, 0.3);
    --game-console-bg: #121212;
    --game-terminal-green: #42a5f5;
    --game-unity-blue: #42a5f5;
    --game-unreal-orange: #ff9800;
  }

  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
  }

  body {
    font-family: var(--font-body);
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
    max-width: 100vw;
    font-weight: 400;
  }

  body::after,
  body::before {
    content: none;
  }

  /* Top Navigation Bar - Material Design */
  .top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--surface);
    padding: var(--spacing-md) var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: var(--elevation-2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid var(--border-color);
  }

  .brand-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.15px;
    transition: opacity 0.2s ease;
  }

  .brand-name:hover {
    opacity: 0.8;
  }

  .nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    font-family: var(--font-ui);
    position: static;
    top: auto;
    right: auto;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-top: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }

  .nav:hover {
    border-color: transparent;
    box-shadow: none;
  }

  .nav::before {
    display: none;
  }

  .nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.5px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: var(--spacing-sm) var(--spacing-md);
    position: relative;
    background: transparent;
    border: none;
    white-space: normal;
    border-radius: var(--radius-md);
  }

  .nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .nav a:hover::before {
    opacity: 1;
  }

  .nav a.active::after {
    content: '';
    position: absolute;
    bottom: var(--spacing-xs);
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--primary-color);
    border-radius: var(--radius-sm);
  }

  .nav a:hover,
  .nav a.active {
    color: var(--primary-color);
    background: transparent;
    transform: none;
    border-color: transparent;
    box-shadow: none;
  }

  .floating-social {
    position: fixed;
    top: 110px;
    left: 2rem;
    display: inline-flex;
    gap: var(--spacing-sm);
    z-index: 1200;
    background: var(--surface);
    backdrop-filter: blur(12px);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    box-shadow: var(--elevation-3);
    transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1), left 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .floating-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .floating-social a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .floating-social a:hover {
    transform: translateY(-2px);
    background: rgba(66, 165, 245, 0.2);
  }

  .floating-social.bottom-left {
    left: 1.5rem;
    transform: translateY(0);
  }

  @media (max-width: 768px) {
    .floating-social {
      display: none;
    }
  }

  /* Hamburger Menu Button (Hidden on Desktop) */
  .hamburger-menu {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 0.75rem;
    box-shadow: var(--elevation-2);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .hamburger-menu span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-on-primary);
    border-radius: 2px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .hamburger-menu:hover {
    background: var(--primary-light);
    box-shadow: var(--elevation-3);
  }

  .hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }

  .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  /* Mobile Menu Overlay */
  .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .mobile-menu-overlay.active {
    display: flex;
    opacity: 1;
  }

  .mobile-menu-content {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-right: none;
    padding: var(--spacing-xl);
    overflow-y: auto;
    position: relative;
    box-shadow: var(--elevation-5);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  }

  .mobile-menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
  }

  .mobile-menu-close:hover {
    background: rgba(234, 67, 53, 0.1);
    color: #ea4335;
    border-color: #ea4335;
    transform: rotate(90deg);
  }

  .mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 3rem;
  }

  .mobile-nav a {
    color: var(--text-primary);
    text-decoration: none;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    font-family: var(--font-ui);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none;
    letter-spacing: 0.5px;
    border: none;
    position: relative;
  }

  .mobile-nav a::before {
    display: none;
  }

  .mobile-nav a:hover,
  .mobile-nav a.active {
    color: var(--text-on-primary);
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateX(4px);
    box-shadow: var(--elevation-1);
  }

  /* Header - Material Design */
  header {
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 10rem 3rem 4rem;
    background: var(--background);
    box-shadow: none;
  }

  .header-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 10vw, 4rem);
    font-weight: 400;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.2;
    text-transform: none;
    text-shadow: none;
    position: relative;
    z-index: 2;
  }

  .header-subtitle {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    color: var(--primary-color);
    margin-bottom: var(--spacing-lg);
    font-weight: 400;
    letter-spacing: 0.15px;
    text-transform: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    justify-content: center;
    text-shadow: none;
    position: relative;
    z-index: 2;
  }

  .header-subtitle::before {
    content: '';
    display: none;
  }

  .header-description {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    margin-top: 0;
    margin-bottom: var(--spacing-xxl);
    font-weight: 400;
    max-width: 700px;
    line-height: 1.6;
    position: relative;
    z-index: 2;
  }

  /* Featured Section in Header */
  .header-featured-section {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: var(--spacing-xl);
  }

  .header-featured-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: var(--spacing-md);
    position: relative;
    font-weight: 400;
    text-transform: none;
    letter-spacing: -0.5px;
    color: var(--text-primary);
  }

  .header-featured-title span {
    color: var(--text-primary);
    position: relative;
  }

  .header-featured-description {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--spacing-xl);
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Sections */
  section {
    padding: var(--spacing-xxl) var(--spacing-lg);
    position: relative;
    z-index: 10;
    background: var(--background);
  }

  .section-container {
    max-width: 1400px;
    margin: 0 auto;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: var(--spacing-xl) var(--spacing-lg);
    box-shadow: none;
    position: relative;
    overflow: visible;
    transition: none;
    font-family: var(--font-body);
  }

  .section-container::before {
    display: none;
  }

  .section-container::after {
    display: none;
  }

  .section-container:hover {
    transform: none;
  }

  .section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    text-align: left;
    margin-bottom: var(--spacing-xl);
    position: relative;
    font-weight: 400;
    text-transform: none;
    letter-spacing: -0.5px;
    color: var(--text-primary);
  }

  .section-title span {
    color: var(--text-primary);
    position: relative;
  }

  .section-title::after {
    display: none;
  }

  /* Featured Section */
  .featured-section {
    margin-bottom: 6rem;
  }

  .featured-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    margin-top: 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }

  .featured-card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    min-height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    box-shadow: var(--elevation-2);
    gap: var(--spacing-xl);
  }

  .featured-card::before {
    display: none;
  }

  .featured-card::after {
    display: none;
  }

  .featured-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--elevation-4);
  }

  .featured-card .project-image {
    width: 350px;
    height: 350px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: none;
    flex-shrink: 0;
    box-shadow: var(--elevation-2);
  }

  .featured-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
  }

  .featured-card .project-header {
    padding: 0 0 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .featured-card .project-info {
    gap: 0.75rem;
  }

  .featured-card .project-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
  }

  .featured-card .project-description {
    padding: 0 0 1.5rem;
    font-size: 1.3rem;
    line-height: 1.8;
    text-align: left;
  }

  .featured-card .tech-stack-highlight {
    font-size: 1.1rem;
    padding: var(--spacing-sm) var(--spacing-lg);
    margin-bottom: var(--spacing-md);
  }

  .featured-card .tech-stack-highlight span {
    font-size: 1.1rem !important;
  }

  .featured-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
  }

  .featured-card .view-features-btn,
  .featured-actions .view-features-btn,
  .featured-actions button.view-features-btn,
  .featured-actions a.view-features-btn {
    font-size: 1rem !important;
    padding: var(--spacing-md) var(--spacing-xl) !important;
    width: 150px !important;
    height: auto !important;
    min-height: 44px !important;
    text-align: center !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;
    font-family: var(--font-ui) !important;
    font-weight: 500 !important;
    letter-spacing: 0.5px !important;
    line-height: 1 !important;
  }

  .tech-stack-highlight {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(66, 165, 245, 0.15);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-md);
    box-shadow: var(--elevation-1);
    margin-top: var(--spacing-sm);
    width: fit-content;
  }

  .tech-stack-highlight img {
    filter: brightness(1);
  }

  .tech-stack-highlight span {
    color: var(--primary-color) !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    text-shadow: none;
  }

  .featured-card .project-features {
    display: none;
  }

  /* Game Details Popup */
  .game-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: var(--spacing-lg);
  }

  .game-popup.active {
    opacity: 1;
    pointer-events: all;
  }

  .game-popup-content {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--elevation-5);
  }

  .game-popup.active .game-popup-content {
    transform: scale(1) translateY(0);
  }

  .game-popup-header {
    padding: 2rem 2.5rem 1.5rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
  }

  .game-popup-header::before {
    display: none;
  }

  .game-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    background: var(--surface-variant);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    color: var(--primary-color);
    font-size: 1.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: var(--elevation-2);
    line-height: 1;
  }

  .game-popup-close:hover {
    border-color: var(--primary-color);
    color: var(--text-on-primary);
    background: var(--primary-color);
    transform: rotate(90deg) scale(1.1);
    box-shadow: var(--elevation-4);
  }

  .game-popup-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-bottom: 2px solid var(--border-color);
    display: block;
  }

  .game-popup-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    text-transform: none;
    letter-spacing: -0.5px;
  }

  .game-popup-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
  }

  .game-popup-links span {
    color: var(--text-accent);
    font-size: 0.9rem;
    font-weight: 500;
  }

  .game-popup-links a {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    background: transparent;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-full);
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-ui);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none;
    letter-spacing: 0.5px;
  }

  .game-popup-links a:hover {
    background: var(--primary-color);
    color: var(--text-on-primary);
    transform: translateY(-2px);
    box-shadow: var(--elevation-2);
    border-color: var(--primary-color);
  }

  .game-popup-description {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    padding: 0 2.5rem;
  }

  .game-popup-features {
    padding: 0 2.5rem 2.5rem;
  }

  .game-popup-features .features-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    text-transform: none;
    letter-spacing: 0.25px;
  }

  .game-popup-features .features-title::before {
    content: '⚙ ';
    margin-right: 0.5rem;
    opacity: 0.7;
  }

  .game-popup-features .features-list {
    margin: 0;
    padding-left: 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.8;
    font-family: var(--font-body);
  }

  .game-popup-features .features-list li {
    margin-bottom: 0.6rem;
    position: relative;
    padding-left: 0.5rem;
  }

  .game-popup-features .features-list li::marker {
    color: var(--primary-color);
  }

  .game-popup-features .features-list li::before {
    content: '▶';
    position: absolute;
    left: -1rem;
    color: var(--primary-color);
    font-size: 0.7rem;
    opacity: 0.7;
  }

  /* Portfolio Grid */
  .portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 3rem;
  }

  .project-card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    position: relative;
    overflow: visible;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    box-shadow: var(--elevation-1);
  }

  .project-card::before {
    display: none;
  }

  .project-card::after {
    display: none;
  }

  .project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--elevation-3);
  }

  .project-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    flex-shrink: 0;
    background: var(--surface);
    padding: 0.25rem;
  }

  .project-image:not(img) {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 500;
    background: var(--surface-variant);
    color: var(--text-primary);
    font-size: 0.9rem;
  }

  .project-card:hover .project-image {
    transform: scale(1.05);
    border-color: var(--primary-color);
  }

  .portfolio-grid .project-header {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0;
    margin: 0;
    align-self: start;
  }

  .portfolio-grid .project-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto auto auto auto;
    column-gap: 1.5rem;
    row-gap: 0;
    align-items: start;
    padding: 1.5rem;
    min-height: 320px;
    height: 100%;
  }

  .portfolio-grid .project-image {
    width: 130px;
    height: 130px;
    border-width: 2px;
    border-radius: 16px;
    padding: 0.15rem;
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
  }

  .project-header {
    padding: 0;
    margin-bottom: 0;
    border-bottom: none;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .project-header::after {
    display: none;
  }

  .project-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .portfolio-grid .project-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .project-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: -0.5px;
    flex-shrink: 0;
  }

  .portfolio-grid .tech-stack-highlight {
    grid-column: 2;
    grid-row: 2;
    margin-top: 0.25rem;
    align-self: start;
  }

  .project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
  }

  .project-links span {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
  }

  .project-links a {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    background: transparent;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-full);
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-ui);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none;
    letter-spacing: 0.5px;
    box-shadow: none;
  }

  .project-links a:hover {
    background: var(--primary-color);
    color: var(--text-on-primary);
    transform: translateY(-2px);
    box-shadow: var(--elevation-1);
  }

  .portfolio-grid .project-links {
    grid-column: 2;
    grid-row: 6;
    width: auto;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-left: auto;
  }

  .portfolio-grid .project-links span {
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
  }

  .portfolio-grid .project-links a {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    border-width: 2px;
    box-shadow: none;
    font-size: 0.9rem;
    letter-spacing: 1px;
  }

  .project-description {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 0;
    font-size: 0.95rem;
    font-family: var(--font-body);
    padding: 0;
    flex: 1;
  }

  .portfolio-grid .project-description {
    grid-column: 1 / span 2;
    grid-row: 4;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    font-style: italic;
    line-height: 1.5;
    align-self: start;
  }

  /* Separator lines */
  .portfolio-grid .card-separator {
    grid-column: 1 / span 2;
    height: 3px;
    margin: 1rem 0;
    position: relative;
    overflow: visible;
    align-self: start;
  }

  .portfolio-grid .card-separator:first-of-type {
    grid-row: 3;
  }

  .portfolio-grid .card-separator:last-of-type {
    grid-row: 5;
  }

  .portfolio-grid .card-separator::before,
  .featured-card .card-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    transform: translateY(-50%);
    background: var(--border-color);
    border-radius: 0;
    opacity: 1;
  }

  .featured-card .card-separator {
    height: 1px;
    margin: var(--spacing-md) 0;
    position: relative;
    overflow: visible;
    width: 100%;
  }

  .portfolio-grid .card-separator::after {
    display: none;
  }

  @keyframes wave-dash {
    0% {
      background-position: 0 0;
    }

    100% {
      background-position: 8px 0;
    }
  }

  .project-features {
    display: none;
  }

  .view-features-btn {
    margin: 0;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-on-primary);
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: none;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    align-self: flex-start;
    box-shadow: var(--elevation-1);
  }

  .view-features-btn:hover {
    background: var(--primary-light);
    color: var(--text-on-primary);
    transform: translateY(-2px);
    box-shadow: var(--elevation-2);
  }

  .portfolio-grid .view-features-btn {
    grid-column: 1 / span 2;
    grid-row: 6;
    justify-self: flex-start;
    align-self: end;
    background: var(--primary-color);
    border: none;
    color: var(--text-on-primary);
    border-radius: var(--radius-full);
    padding: var(--spacing-sm) var(--spacing-lg);
    letter-spacing: 0.5px;
    box-shadow: var(--elevation-1);
    margin-top: 0;
  }

  .portfolio-grid .view-features-btn:hover {
    background: var(--primary-light);
    color: var(--text-on-primary);
    box-shadow: var(--elevation-2);
  }

  .features-title {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    text-transform: none;
    letter-spacing: 0.25px;
  }

  .features-title::before {
    display: none;
  }

  .features-list {
    margin: 0;
    padding-left: 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    font-family: var(--font-body);
  }

  .features-list li {
    margin-bottom: 0.4rem;
    position: relative;
    padding-left: 0.5rem;
  }

  .features-list li::marker {
    color: var(--primary-color);
  }

  .features-list li::before {
    content: '▶';
    position: absolute;
    left: -1rem;
    color: var(--primary-color);
    font-size: 0.7rem;
    opacity: 0.7;
  }

  /* Loading Animation */
  .loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
  }

  .loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
  }

  .loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 2rem;
    box-shadow: none;
  }

  .loading-text {
    color: var(--primary-color);
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
  }

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

    100% {
      transform: rotate(360deg);
    }
  }

  /* Aspect Ratio Based Navigation */
  /* Show hamburger menu when aspect ratio is below 1909/1769 */
  @media (max-aspect-ratio: 1909/1769) {

    /* Hide desktop nav */
    .nav {
      display: none;
    }

    /* Show hamburger menu */
    .hamburger-menu {
      display: flex;
    }
  }

  /* Show full navbar when aspect ratio is 1909/1769 or above */
  @media (min-aspect-ratio: 1909/1769) {

    /* Show desktop nav */
    .nav {
      display: flex;
    }

    /* Hide hamburger menu */
    .hamburger-menu {
      display: none;
    }
  }

  /* Mobile Responsiveness */
  @media (max-width: 768px) {
    header {
      padding: 8rem 1.5rem 3rem;
    }

    .header-featured-section {
      padding-top: var(--spacing-lg);
    }

    .header-featured-title {
      font-size: 1.5rem;
    }

    .header-featured-description {
      font-size: 0.9rem;
      margin-bottom: var(--spacing-lg);
    }

    /* Prevent horizontal scrolling */
    html,
    body {
      overflow-x: hidden;
      width: 100%;
      max-width: 100vw;
    }

    /* Ensure images don't overflow */
    img {
      max-width: 100%;
      height: auto;
      display: block;
    }

    /* Ensure containers respect viewport */
    .section-container,
    .project-card,
    .featured-card,
    .game-popup-content {
      max-width: 100%;
      box-sizing: border-box;
    }

    /* Touch-friendly buttons */
    button,
    .view-features-btn,
    .nav a,
    .game-popup-close {
      min-height: 44px;
      min-width: 44px;
    }

    .game-popup {
      padding: 0.5rem;
    }

    .game-popup-content {
      max-width: 100%;
      max-height: 95vh;
      border-radius: 8px;
      margin: 0.5rem;
    }

    .game-popup-image {
      height: 200px;
      width: 100%;
      object-fit: cover;
    }

    .game-popup-header {
      padding: 1.5rem 1.5rem 1rem;
    }

    .game-popup-title {
      font-size: 1.5rem;
      word-wrap: break-word;
    }

    .game-popup-description {
      padding: 0 1.5rem;
      font-size: 1rem;
      word-wrap: break-word;
    }

    .game-popup-features {
      padding: 0 1.5rem 1.5rem;
    }

    .game-popup-close {
      width: 35px;
      height: 35px;
      font-size: 1.3rem;
      top: 0.5rem;
      right: 0.5rem;
    }

    header {
      min-height: auto;
      padding: 5rem 1rem 2rem;
    }

    .header-title {
      font-size: clamp(2rem, 8vw, 3rem);
      letter-spacing: 2px;
      margin-bottom: 1rem;
    }

    .header-subtitle {
      font-size: 1.1rem;
      letter-spacing: 1px;
    }

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

    section {
      padding: 3rem 1rem;
    }

    .section-container {
      padding: 2rem 1.5rem;
      border-radius: 12px;
    }

    .section-title {
      font-size: 2rem;
      margin-bottom: 2rem;
      letter-spacing: 2px;
    }

    .featured-grid {
      grid-template-columns: 1fr;
      gap: 1.5rem;
    }

    .featured-card {
      min-height: auto;
      max-width: 100%;
    }

    .featured-card .project-image {
      height: 250px;
      width: 100%;
      object-fit: cover;
    }

    .featured-card .project-header {
      padding: 1.5rem 1.5rem 1rem;
    }

    .featured-card .project-title {
      font-size: 1.6rem;
      word-wrap: break-word;
    }

    .featured-card {
      flex-direction: column;
      padding: 1.5rem;
      gap: 1.5rem;
    }

    .featured-card .project-image {
      width: 100%;
      height: 250px;
      border-radius: 12px;
      margin-right: 0;
    }

    .featured-card .project-description {
      padding: 0 0 1.5rem;
      font-size: 1rem;
    }

    .portfolio-grid {
      grid-template-columns: 1fr;
      gap: 1.5rem;
    }

    .project-card {
      min-height: auto;
      max-width: 100%;
    }

    .project-header {
      padding: 1rem 1.5rem 0.5rem;
    }

    .project-title {
      font-size: 1.2rem;
      word-wrap: break-word;
    }

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

    .project-description {
      padding: 0 1.5rem 1rem;
      font-size: 0.95rem;
      word-wrap: break-word;
    }

    .project-links {
      flex-wrap: wrap;
      gap: 0.4rem;
    }

    .project-links a {
      font-size: 0.75rem;
      padding: 0.35rem 0.8rem;
    }

    .view-features-btn {
      margin: 0 1.5rem 1.5rem;
      padding: 0.65rem 1.25rem;
      font-size: 0.8rem;
    }

    .project-features {
      padding: 0 1.5rem 1.5rem;
    }
  }

  @media (max-width: 480px) {
    .hamburger-menu {
      width: 45px;
      height: 45px;
      top: 0.75rem;
      right: 0.75rem;
      padding: 0.6rem;
    }

    .hamburger-menu span {
      width: 22px;
      height: 2.5px;
    }

    .mobile-menu-content {
      max-width: 100%;
      padding: 1.5rem;
    }

    .mobile-nav a {
      padding: 0.9rem 1.25rem;
      font-size: 0.9rem;
    }

    header {
      padding: 4.5rem 0.75rem 1.5rem;
    }

    .header-title {
      font-size: clamp(1.8rem, 8vw, 2.5rem);
      letter-spacing: 1px;
    }

    .header-subtitle {
      font-size: 1rem;
    }

    .header-description {
      font-size: 0.9rem;
    }

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

    .section-title {
      font-size: 1.75rem;
      margin-bottom: 1.5rem;
    }

    .game-popup-content {
      margin: 0.25rem;
      max-height: 98vh;
    }

    .game-popup-image {
      height: 150px;
    }

    .game-popup-header {
      padding: 1.25rem 1.25rem 0.75rem;
    }

    .game-popup-title {
      font-size: 1.3rem;
    }

    .game-popup-description {
      padding: 0 1.25rem;
      font-size: 0.95rem;
    }

    .game-popup-features {
      padding: 0 1.25rem 1.25rem;
    }

    .game-popup-close {
      width: 44px;
      height: 44px;
      font-size: 1.5rem;
      top: 0.5rem;
      right: 0.5rem;
      border-width: 2px;
      box-shadow: var(--elevation-2);
    }

    .featured-grid {
      grid-template-columns: 1fr;
      gap: 1.25rem;
    }

    .featured-card {
      min-height: auto;
    }

    .featured-card {
      flex-direction: column;
      padding: var(--spacing-lg);
    }

    .featured-card .project-image {
      width: 100%;
      height: 250px;
      max-width: 100%;
    }

    .featured-card .project-header {
      padding: 1.25rem 1.25rem 0.75rem;
    }

    .featured-card .project-title {
      font-size: 1.8rem;
    }

    .featured-card .project-description {
      padding: 0 1.25rem;
      font-size: 1.1rem;
    }

    .featured-card .tech-stack-highlight {
      font-size: 0.95rem;
    }

    .featured-card .tech-stack-highlight span {
      font-size: 0.95rem !important;
    }

    .featured-actions {
      padding: 0;
      flex-wrap: wrap;
      display: flex;
      gap: 1rem;
      align-items: center;
    }

    .featured-card .view-features-btn,
    .featured-actions .view-features-btn,
    .featured-actions button.view-features-btn,
    .featured-actions a.view-features-btn {
      margin: 0 !important;
      padding: var(--spacing-sm) var(--spacing-lg) !important;
      font-size: 0.9rem !important;
      width: 120px !important;
      height: auto !important;
      min-height: 40px !important;
      text-align: center !important;
      white-space: nowrap !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      box-sizing: border-box !important;
      text-decoration: none !important;
      border: none !important;
      cursor: pointer !important;
      font-family: var(--font-ui) !important;
      font-weight: 500 !important;
      letter-spacing: 0.5px !important;
      line-height: 1 !important;
    }

    .tech-stack-highlight {
      display: inline-flex;
      align-items: center;
      gap: 0.75rem;
      background: rgba(66, 165, 245, 0.15);
      padding: 0.5rem 1.25rem;
      border-radius: 50px;
      border: 1px solid var(--primary-color);
      margin-top: 0.5rem;
      box-shadow: var(--elevation-1);
    }

    .portfolio-grid {
      gap: 1.25rem;
    }

    .project-card {
      min-height: auto;
    }

    .project-image {
      height: 180px;
    }

    .project-header {
      padding: 1rem 1rem 0.5rem;
    }

    .project-title {
      font-size: 1.1rem;
    }

    .project-links {
      gap: 0.3rem;
    }

    .project-links a {
      font-size: 0.7rem;
      padding: 0.3rem 0.7rem;
    }

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

    .view-features-btn {
      margin: 0 1rem 1rem;
      padding: 0.6rem 1rem;
      font-size: 0.75rem;
    }

    .project-features {
      padding: 0 1rem 1rem;
    }
  }