/* ===== VARIABLES ===== */
    :root {
      --primary: #4f46e5;       /* Indigo 600 */
      --primary-dark: #4338ca;  /* Indigo 700 */
      --accent: #6366f1;        /* Indigo 500 */
      --bg: #f8fafc;            /* Slate 50 */
      --surface: #ffffff;
      --text-main: #0f172a;     /* Slate 900 */
      --text-muted: #64748b;    /* Slate 500 */
      --border: #e2e8f0;        /* Slate 200 */
      --border-hover: #6366f1;
      
      --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
      --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
      --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
      
      --radius: 8px;
      --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    }

    /* ===== RESET & BASE ===== */
    * { margin: 0; padding: 0; box-sizing: border-box; }

    body {
      font-family: var(--font-sans);
      background-color: var(--bg);
      color: var(--text-main);
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
      padding-bottom: 4rem;
    }

    /* ===== SCROLL PROGRESS ===== */
    .progress-bar {
      position: fixed;
      top: 0; left: 0; height: 3px;
      background: linear-gradient(90deg, var(--primary), var(--accent));
      width: 0%;
      z-index: 2000;
      transition: width 0.1s ease-out;
      box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    }

    /* ===== HEADER ===== */
    header {
      text-align: center;
      max-width: 800px;
      margin: 0 auto 3rem;
      padding: 3rem 1rem 1rem;
    }

    .header-icon {
      font-size: 2.5rem;
      color: var(--primary);
      margin-bottom: 1rem;
      display: inline-block;
    }

    h1 {
      font-size: 2.5rem;
      font-weight: 800;
      letter-spacing: -0.03em;
      margin-bottom: 0.75rem;
      color: var(--text-main);
    }

    .subtitle {
      font-size: 1.125rem;
      color: var(--text-muted);
      font-weight: 400;
      max-width: 600px;
      margin: 0 auto;
    }

    /* ===== GRID ===== */
    .gallery-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
      gap: 1.5rem;
      max-width: 1400px;
      margin: 0 auto 3rem;
      padding: 0 1.5rem;
    }

    /* ===== CARD DESIGN ===== */
    .lab-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      overflow: hidden;
      transition: all 0.2s ease;
      cursor: pointer;
      position: relative;
      display: flex;
      flex-direction: column;
    }

    .lab-card:hover {
      transform: translateY(-4px);
      border-color: var(--border-hover);
      box-shadow: var(--shadow-md);
    }

    .lab-card:focus-visible {
      outline: 2px solid var(--primary);
      outline-offset: 2px;
    }

    .card-header {
      padding: 1rem 1.25rem;
      display: flex;
      align-items: center;
      gap: 0.75rem;
      border-bottom: 1px solid var(--bg);
      background: #fff;
    }

    .card-icon {
      font-size: 1.5rem;
      color: var(--primary);
      flex-shrink: 0;
    }

    .lab-card h2 {
      font-size: 1rem;
      font-weight: 600;
      color: var(--text-main);
      line-height: 1.3;
    }

    .image-wrapper {
      width: 100%;
      aspect-ratio: 16 / 9;
      background-color: #f1f5f9;
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
    }

    .image-wrapper img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.4s ease;
      opacity: 0; /* Hidden until loaded */
    }
    
    .image-wrapper img.loaded {
      opacity: 1;
    }

    .lab-card:hover .image-wrapper img {
      transform: scale(1.03);
    }

    /* Placeholder for missing images */
    .placeholder-state {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      background: #f8fafc;
    }
    .placeholder-state i { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.3; }
    .placeholder-state span { font-size: 0.8rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }

    /* ===== INFO / SPEC SHEET SECTION ===== */
    .project-specs {
      background: #fff;
      border-top: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
      padding: 3rem 1.5rem;
      margin-bottom: 3rem;
    }

    .specs-container {
      max-width: 1000px;
      margin: 0 auto;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 2rem;
    }

    .spec-item {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }

    .spec-label {
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
    
    .spec-label i { font-size: 1rem; }

    .spec-value {
      font-size: 1.125rem;
      font-weight: 600;
      color: var(--text-main);
    }

    /* ===== FOOTER ===== */
    footer {
      text-align: center;
      color: var(--text-muted);
      font-size: 0.875rem;
      padding: 2rem;
    }

    /* ===== LIGHTBOX ===== */
    .lightbox {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.95);
      backdrop-filter: blur(5px);
      z-index: 1000;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      visibility: hidden;
      transition: all 0.25s ease;
    }

    .lightbox.active {
      opacity: 1;
      visibility: visible;
    }

    .lightbox-content {
      position: relative;
      max-width: 95vw;
      max-height: 90vh;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }

    .lightbox-content img {
      display: block;
      max-width: 100%;
      max-height: 90vh;
      border-radius: 4px;
      object-fit: contain;
      border: 1px solid rgba(255,255,255,0.1);
    }

    .close-btn {
      position: absolute;
      top: -40px;
      right: 0;
      background: transparent;
      border: none;
      color: #fff;
      font-size: 2rem;
      cursor: pointer;
      opacity: 0.7;
      transition: opacity 0.2s;
    }

    .close-btn:hover { opacity: 1; }

    /* ===== PRINT STYLES ===== */
    @media print {
      .progress-bar, .lightbox, .close-btn, .header-icon { display: none !important; }
      body { background: white; padding: 0; }
      .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
      .lab-card { break-inside: avoid; border: 1px solid #ccc; box-shadow: none; }
      .project-specs { border: 1px solid #000; margin: 2rem 0; }
      .image-wrapper { aspect-ratio: auto; height: auto; }
    }
    
    /* Mobile tweaks */
    @media (max-width: 600px) {
      h1 { font-size: 1.75rem; }
      .specs-container { grid-template-columns: 1fr; gap: 1.5rem; }
    }
