    /* ===== CSS RESET (trimmed) ===== */
    *, *::before, *::after { box-sizing: border-box; }
    * { margin: 0; }
    html, body { height: 100%; }
    html { scroll-behavior: smooth; scroll-padding-top: 80px; }
    body { line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
    img, picture, video, canvas, svg { display: block; max-width: 100%; }
    input, button, textarea, select { font: inherit; }
    a { color: inherit; text-decoration: none; }

    html.theme-anim,
    html.theme-anim * {
      transition:
        background-color .28s ease,
        color .28s ease,
        border-color .28s ease,
        fill .28s ease,
        stroke .28s ease !important;
    }

    /* ===== THEME ===== */
    :root {
      --bg: #0b0d10;
      --bg-elev: #11151a;
      --text: #e6edf3;
      --muted: #92a2b3;
      --primary: #7c9cff;
      --primary-2: #9d7cff;
      --card: #0f1318;
      --border: #1c232d;
      --shadow: 0 10px 30px rgba(0,0,0,.35);
      --radius: 16px;
  --maxw: 1080px;
  /* Scrollbar colors (fallback-friendly) */
  --scroll-track: rgba(255,255,255,0.03); /* dark-mode track */
  --scroll-thumb: linear-gradient(180deg, #7c9cff, #9d7cff); /* gradient for modern browsers */
  --scroll-thumb-solid: #7c9cff; /* solid fallback for browsers that don't show gradients */
  --scroll-thumb-hover: #6fa0ff;
    }
    html[data-theme="light"] {
      --bg: #f8fafc;
      --bg-elev: #ffffff;
      --text: #0f172a;
      --muted: #475569;
      --primary: #3b82f6;
      --primary-2: #8b5cf6;
      --card: #ffffff;
      --border: #e2e8f0;
      --shadow: 0 10px 30px rgba(2,6,23,.06);
    }

    body { background: var(--bg); color: var(--text); font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, "Noto Sans", Arial, "Apple Color Emoji","Segoe UI Emoji"; padding-top: 70px; }

    .container { width: min(100% - 2rem, var(--maxw)); margin-inline: auto; }

    /* ===== NAV ===== */
    .nav { position: fixed; top: 0; left: 0; right: 0; backdrop-filter: blur(16px); background: color-mix(in oklab, var(--bg), transparent 20%); border-bottom: 1px solid var(--border); z-index: 1000; transition: all 0.3s ease; }
    .nav-inner { display:flex; align-items:center; justify-content: space-between; gap: 1rem; padding: .9rem 0; }
    .brand { display:flex; align-items:center; gap:.75rem; font-weight: 700; letter-spacing:.2px; }
    .nav a { opacity:.9 }
    .nav a:hover { opacity:1 }
    .nav-links { display:flex; gap: 1rem; align-items:center; }
    .nav-links a { padding:.5rem .75rem; border-radius: 10px; }
    .nav-links a[aria-current="page"], .nav-links a:hover { background: color-mix(in oklab, var(--primary), transparent 85%); }
    .nav-actions { display:flex; gap:.5rem; align-items:center }

    .btn { display:inline-flex; align-items:center; justify-content:center; gap:.5rem; padding:.6rem .9rem; border:1px solid var(--border); background: var(--bg-elev); color: var(--text); border-radius: 999px; box-shadow: var(--shadow); transition: transform .15s ease; }
    .btn:hover{ transform: translateY(-1px) }
    .btn-ghost { background: transparent; box-shadow:none }

    .menu { display:none }
    @media (max-width: 820px) {
  .menu { display:inline-flex }
  .nav-links { display:none }
  /* when opened, stack links vertically and ensure they fit the container */
  .nav-links.open { display:flex; flex-direction: column; gap: .5rem; position:absolute; left:0; right:0; top:64px; padding: .5rem; background: var(--bg-elev); border-bottom: 1px solid var(--border); box-sizing: border-box; }
  .nav-links.open a { flex: none; display:block; width:100%; padding:.6rem .75rem; text-align:center; border-radius: 8px; }
  /* Center the mobile menu button in the nav bar */
  .nav-inner { position: relative; }
  .menu { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 60; }
  /* Hide the plain text name on mobile to make space; keep the logo visible */
  .brand > span:last-child { display: none }
      /* Keep menu button centered when hovered (compose transforms) */
      .menu:hover, .menu:focus {
        transform: translate(-50%, -50%) translateY(-1px);
      }
    }

    /* ===== HERO ===== */
    .hero { 
      padding: 0; 
      position: relative; 
      overflow: hidden; 
      min-height: 98vh;
      display: flex;
      align-items: flex-start;
      padding-top: 7rem;
      background: linear-gradient(135deg, 
        color-mix(in oklab, var(--bg), var(--primary) 5%) 0%,
        color-mix(in oklab, var(--bg), var(--accent) 3%) 50%,
        var(--bg) 100%);
    }
    .hero-grid { 
      display: grid; 
      grid-template-columns: 1.1fr 0.9fr; 
      gap: 4rem; 
      align-items: center; 
      position: relative;
      z-index: 2;
    }
    @media (max-width: 960px) { .hero-grid{ grid-template-columns: 1fr; gap: 2rem; } }

    /* ===== 3D HERO BACKGROUND ===== */
    .hero-background {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 1;
      overflow: hidden;
    }

    /* 3D Floating Cubes */
    .hero-particles {
      position: absolute;
      width: 100%;
      height: 100%;
      pointer-events: none;
    }

    .particle-cube {
      position: absolute;
      width: 25px;
      height: 25px;
      background: var(--primary);
      transform-style: preserve-3d;
      animation: float 6s ease-in-out infinite;
      opacity: 0.2;
      border-radius: 4px;
      filter: blur(1px);
      box-shadow: 0 0 15px color-mix(in oklab, var(--primary), transparent 70%);
    }

    .particle-cube:nth-child(1) {
      top: 20%;
      left: 10%;
      animation-delay: 0s;
      animation-duration: 8s;
    }

    .particle-cube:nth-child(2) {
      top: 60%;
      left: 80%;
      animation-delay: -2s;
      animation-duration: 10s;
    }

    .particle-cube:nth-child(3) {
      top: 30%;
      left: 70%;
      animation-delay: -4s;
      animation-duration: 7s;
    }

    .particle-cube:nth-child(4) {
      top: 80%;
      left: 20%;
      animation-delay: -1s;
      animation-duration: 9s;
    }

    .particle-cube:nth-child(5) {
      top: 50%;
      left: 90%;
      animation-delay: -3s;
      animation-duration: 6s;
    }

    .particle-cube:nth-child(6) {
      top: 10%;
      left: 50%;
      animation-delay: -5s;
      animation-duration: 11s;
    }

    .particle-cube:nth-child(7) {
      top: 70%;
      left: 60%;
      animation-delay: -2.5s;
      animation-duration: 8s;
    }

    .particle-cube:nth-child(8) {
      top: 40%;
      left: 30%;
      animation-delay: -4.5s;
      animation-duration: 7s;
    }

    @keyframes float {
      0%, 100% {
        transform: translateY(0px) rotateX(0deg) rotateY(0deg);
      }
      25% {
        transform: translateY(-20px) rotateX(90deg) rotateY(90deg);
      }
      50% {
        transform: translateY(-40px) rotateX(180deg) rotateY(180deg);
      }
      75% {
        transform: translateY(-20px) rotateX(270deg) rotateY(270deg);
      }
    }

    /* Grid Background */
    .hero-grid-bg {
      position: absolute;
      width: 100%;
      height: 100%;
      opacity: 0.05;
      filter: blur(0.5px);
    }

    .grid-line {
      position: absolute;
      background: linear-gradient(90deg, transparent, var(--primary), transparent);
      height: 1px;
    }

    .grid-line:nth-child(1) { top: 20%; width: 100%; }
    .grid-line:nth-child(2) { top: 40%; width: 100%; }
    .grid-line:nth-child(3) { top: 60%; width: 100%; }
    .grid-line:nth-child(4) { top: 80%; width: 100%; }
    .grid-line:nth-child(5) { 
      top: 0; 
      left: 50%; 
      width: 1px; 
      height: 100%; 
      background: linear-gradient(0deg, transparent, var(--accent), transparent);
    }

    /* Glowing Orbs */
    .hero-glow {
      position: absolute;
      width: 100%;
      height: 100%;
      pointer-events: none;
    }

    .glow-orb {
      position: absolute;
      border-radius: 50%;
      filter: blur(60px);
      animation: glow 8s ease-in-out infinite alternate;
      opacity: 0.15;
    }

    .glow-1 {
      width: 300px;
      height: 300px;
      background: radial-gradient(circle, var(--primary), transparent);
      top: -10%;
      right: -10%;
      animation-delay: 0s;
      opacity: 0.3;
    }

    .glow-2 {
      width: 200px;
      height: 200px;
      background: radial-gradient(circle, var(--accent), transparent);
      bottom: 20%;
      left: -5%;
      animation-delay: -2s;
      opacity: 0.3;
    }

    .glow-3 {
      width: 150px;
      height: 150px;
      background: radial-gradient(circle, var(--primary), transparent);
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      animation-delay: -4s;
      opacity: 0.3;
    }

    @keyframes glow {
      0% {
        opacity: 0.3;
        transform: scale(1);
      }
      100% {
        opacity: 0.6;
        transform: scale(1.1);
      }
    }

    /* SPLASH / FAKE LOADING OVERLAY */
    .splash-overlay {
      position: fixed; inset: 0; display:flex; align-items:center; justify-content:center; background: var(--bg); z-index: 9999; transition: opacity .45s ease; }
    .splash-overlay.hidden { opacity: 0; pointer-events: none }
    .splash-inner { position: relative; display:grid; place-items:center; gap: 1rem }
    .splash-inner img { width: 96px; height: 96px; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.35) }
    .splash-ring { position: absolute; width: 140px; height: 140px; border-radius: 50%; border: 6px solid color-mix(in oklab, var(--bg-elev), transparent 10%); }
    .splash-overlay .splash-ring { animation: splash-spin 1s linear infinite; }
    @keyframes splash-spin { to { transform: rotate(360deg) } }

    .kicker { font-size: .95rem; color: var(--muted); letter-spacing:.12em; text-transform: uppercase; }
    .headline { font-size: clamp(2rem, 5vw, 3.4rem); line-height:1.1; font-weight: 800; margin-top: .5rem; }
    .headline .grad { background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip:text; background-clip:text; color: transparent; }
    .sub { color: var(--muted); margin-top: .9rem; max-width: 60ch; }
    .cta-row { display:flex; gap:.75rem; align-items:center; margin-top: 1.4rem; flex-wrap:wrap }

    /* ===== GALLERY ===== */
    .gallery { padding: 2rem 0; }
  .gallery-wrap { display:flex; align-items:center; gap:1rem; position:relative; overflow:visible }
  .g-frame {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 500px;
  position: relative;
  background: var(--bg-elev); /* subtle background */
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 3rem;
  padding-bottom: 3rem;
  }
  .g-item {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    transition: opacity .6s cubic-bezier(.2,.9,.2,1);
    pointer-events: none; /* avoid invisible items intercepting clicks */
  }
  .g-item img {
    max-width: 60%;
    max-height: 90%;
    object-fit: contain;
    object-position: center;
    border-radius: var(--radius);
  }
  .g-description {
    max-width: 35%;
    padding: 1.5rem;
    background: color-mix(in oklab, var(--bg-elev), transparent 10%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    transform: translateX(20px);
    transition: transform 0.6s cubic-bezier(.2,.9,.2,1), opacity 0.6s cubic-bezier(.2,.9,.2,1);
  }
  .g-item.active .g-description {
    transform: translateX(0);
  }
  .g-description h4 {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  .g-description p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
  }
  .g-item.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
  }
  /* overlay left/right buttons */
  .g-btn { 
    background: color-mix(in oklab, var(--bg), transparent 20%); 
    color: var(--text); 
    border: 1px solid var(--border); 
    padding: .5rem .8rem; 
    border-radius: 999px; 
    cursor: pointer; 
    font-size: 1.6rem; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    flex-shrink: 0;
  }
  .g-btn.g-prev { left: 0; }
  .g-btn.g-next { right: 0; }
  .g-btn:hover { 
    background: var(--primary); 
    color: white;
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.1);
  }

  /* dots */
  .g-dots { position:absolute; left:50%; transform:translateX(-50%); bottom:1rem; display:flex; gap:.5rem; z-index:6 }
  .g-dot { width:10px; height:10px; border-radius:50%; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.08); cursor:pointer; transition: transform .18s ease, background .18s ease }
  .g-dot.active { background: linear-gradient(135deg,var(--primary),var(--primary-2)); transform: scale(1.15) }
    @media (max-width: 820px) {
      .gallery-wrap {
        gap: 0.5rem;
      }
      .g-btn {
        padding: 0.4rem 0.6rem;
        font-size: 1.4rem;
      }
      .g-frame { 
        height:400px;
        margin: 0 2rem;
      }
      .g-item {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 1rem 3rem 1rem;
        text-align: center;
      }
      .g-item img {
        max-width: 85%;
        max-height: 45%;
      }
      .g-description {
        max-width: 100%;
        padding: 1rem;
        margin-bottom: 1rem;
      }
      .g-description h4 {
        font-size: 1.1rem;
      }
      .g-description p {
        font-size: 0.9rem;
      }
      .g-dots {
        bottom: 0.5rem;
      }
    }

  /* ===== LIGHTBOX / IMAGE VIEW MODE ===== */
  .lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.88);
    z-index: 2000;
    opacity: 0;
    transition: opacity .28s ease;
    pointer-events: none; /* don't block clicks when hidden */
    -webkit-tap-highlight-color: transparent;
  }
  .lightbox.show { opacity: 1; }
  .lightbox.show { pointer-events: auto; }

  .lightbox .lb-inner {
    position: relative;
  max-width: 96vw;
  max-height: 96vh;
  padding: 12px; /* spacing around image so it never touches edges */
    display: grid;
    gap: .6rem;
    align-items: center;
    justify-items: center;
  }

  .lightbox img {
  /* Constrain to viewport while preserving aspect ratio */
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  width: auto;
  height: auto;
  object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,.6);
    transform: translateZ(0);
  }

  .lightbox .lb-close {
    /* fixed to viewport top-right so it sits outside the image */
    position: fixed;
    top: 18px;
    right: 18px;
    background: color-mix(in oklab, var(--bg-elev), transparent 24%);
    border: 1px solid var(--border);
    color: var(--text);
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
    box-shadow: 0 6px 18px rgba(0,0,0,.4);
    font-size: 20px;
    line-height: 1;
    z-index: 2100; /* above the lightbox content */
  }
  .lightbox .lb-close:active { transform: translateY(1px); }

  @media (max-width: 480px) {
  .lightbox .lb-close { width: 40px; height: 40px; font-size:18px; top: 12px; right: 12px }
    .lightbox img { border-radius: 10px; }
  }

    .hero-card { 
      border: 1px solid var(--border); 
      background: color-mix(in oklab, var(--card), transparent 20%); 
      border-radius: var(--radius); 
      padding: 1rem; 
      display: grid; 
      gap: .6rem;
      backdrop-filter: blur(10px);
      transition: all 0.3s ease;
    }
    
    .hero-card:hover {
      transform: translateY(-2px);
      background: color-mix(in oklab, var(--card), transparent 10%);
      border-color: var(--primary);
    }
    
    .hero-cards { 
      display: grid; 
      grid-template-columns: repeat(2,1fr); 
      gap: 1rem; 
      margin-bottom: 2rem;
    }
    
    @media (max-width: 960px) { .hero-cards{ grid-template-columns: 1fr } }

    /* ===== HERO CONTENT ===== */
    .hero-content {
      position: relative;
      z-index: 3;
    }

    .hero-content .headline {
      font-size: clamp(2.5rem, 6vw, 4rem);
      line-height: 1.1;
      margin-bottom: 1.5rem;
      font-weight: 800;
    }

    .hero-content .grad {
      color: var(--primary) !important;
      font-weight: 800;
      font-size: inherit;
    }

    @keyframes gradient-shift {
      0%, 100% { background-position: 0% 50%; }
      50% { background-position: 100% 50%; }
    }

    .hero-cta {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.75rem 1.5rem;
      font-weight: 600;
      border-radius: 50px;
      transition: all 0.3s ease;
      background: var(--primary);
      color: white !important;
      box-shadow: 0 10px 30px color-mix(in oklab, var(--primary), transparent 70%);
      margin-right: 1rem;
      border: none;
      text-decoration: none;
      font-size: 0.9rem;
    }

    .hero-cta:hover {
      transform: translateY(-2px);
      box-shadow: 0 15px 40px color-mix(in oklab, var(--primary), transparent 60%);
      color: white !important;
      background: color-mix(in oklab, var(--primary), black 10%);
    }

    /* Light mode specific styling for better contrast */
    [data-theme="light"] .hero-cta {
      background: color-mix(in oklab, var(--primary), black 20%);
      box-shadow: 0 10px 30px color-mix(in oklab, var(--primary), transparent 80%);
    }

    [data-theme="light"] .hero-cta:hover {
      background: color-mix(in oklab, var(--primary), black 30%);
      box-shadow: 0 15px 40px color-mix(in oklab, var(--primary), transparent 70%);
    }

    .hero-cta-secondary {
      background: color-mix(in oklab, var(--card), transparent 20%);
      color: var(--text) !important;
      border: 1px solid var(--border);
      backdrop-filter: blur(10px);
      padding: 0.75rem 1.5rem;
      font-size: 0.9rem;
    }

    .hero-cta-secondary:hover {
      background: color-mix(in oklab, var(--primary), transparent 90%);
      border-color: var(--primary);
      transform: translateY(-2px);
      color: var(--text) !important;
    }

    /* ===== HERO VISUAL ===== */
    .hero-visual {
      position: relative;
      z-index: 3;
    }

    .hero-stats {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 1rem;
      margin-top: 2rem;
    }

    .stat-item {
      text-align: center;
      padding: 1.5rem 1rem;
      background: color-mix(in oklab, var(--card), transparent 30%);
      border: 1px solid color-mix(in oklab, var(--border), transparent 50%);
      border-radius: var(--radius);
      backdrop-filter: blur(10px);
      transition: all 0.3s ease;
    }

    .stat-item:hover {
      transform: translateY(-5px);
      background: color-mix(in oklab, var(--card), transparent 10%);
      border-color: var(--primary);
    }

    .stat-number {
      font-size: 2rem;
      font-weight: 700;
      color: var(--primary);
      line-height: 1;
    }

    .stat-label {
      font-size: 0.875rem;
      color: var(--muted);
      margin-top: 0.5rem;
    }

    /* ===== SCROLL INDICATOR ===== */
    .scroll-indicator {
      position: absolute;
      bottom: 5rem;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.5rem;
      color: var(--muted);
      z-index: 3;
      animation: bounce 2s infinite;
    }

    .scroll-arrow {
      width: 40px;
      height: 40px;
      border: 2px solid color-mix(in oklab, var(--primary), transparent 30%);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      background: color-mix(in oklab, var(--card), transparent 50%);
      backdrop-filter: blur(10px);
    }

    .scroll-indicator span {
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 1px;
    }

    @keyframes bounce {
      0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
      }
      40% {
        transform: translateX(-50%) translateY(-10px);
      }
      60% {
        transform: translateX(-50%) translateY(-5px);
      }
    }
    .muted { color: var(--muted);}

    /* ===== SECTIONS ===== */
    section { padding: 4rem 0; }
    .section-head { display:flex; align-items:baseline; justify-content: space-between; margin-bottom: 1.5rem; gap:1rem; }
    .section-title { 
      font-size: clamp(1.2rem, 3vw, 1.6rem); 
      font-weight: 800; 
      color: var(--primary) !important;
    }
    .section-desc { color: var(--muted); max-width: 65ch; text-align:right; }

    /* ===== PROJECT SHOWCASE ===== */
    .project-showcase {
      position: relative;
      height: 100vh;
      min-height: 700px;
      overflow: hidden;
      border-radius: var(--radius);
      background: linear-gradient(135deg, #0a0a0a, #1a1a1a);
    }

    .project-slider {
      position: relative;
      height: 100%;
      width: 100%;
    }

    .project-slide {
      position: absolute;
      inset: 0;
      opacity: 0;
      transform: translateX(100%);
      transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
      background: linear-gradient(135deg, var(--bg) 0%, var(--bg-elev) 100%);
      display: flex;
      align-items: center;
    }

    .project-slide.active {
      opacity: 1;
      transform: translateX(0);
    }

    .project-slide.prev {
      transform: translateX(-100%);
    }

    .project-container {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4rem;
      height: 100%;
      width: 100%;
      padding: 3rem 4rem;
      align-items: center;
    }

    .project-hero {
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
      z-index: 2;
    }

    .project-number {
      font-size: 6rem;
      font-weight: 900;
      line-height: 0.8;
      opacity: 0.1;
      color: var(--primary);
      position: absolute;
      top: 1rem;
      left: 1rem;
      z-index: 0;
    }

    .project-badge {
      display: inline-block;
      padding: 0.5rem 1rem;
      background: linear-gradient(135deg, var(--primary), var(--primary-2));
      color: white;
      border-radius: 999px;
      font-size: 0.8rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      width: fit-content;
      margin-bottom: 0.5rem;
    }

    .project-title {
      font-size: 3rem;
      font-weight: 900;
      line-height: 1.1;
      background: linear-gradient(135deg, var(--text), var(--muted));
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      margin-bottom: 0.5rem;
    }

    .project-subtitle {
      font-size: 1.2rem;
      color: var(--primary);
      font-weight: 600;
      margin-bottom: 1rem;
    }

    .project-description {
      font-size: 1rem;
      line-height: 1.6;
      color: var(--muted);
      margin-bottom: 1.5rem;
      max-width: 450px;
    }

    .project-tech {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      margin-bottom: 1.5rem;
    }

    .tech-tag {
      padding: 0.4rem 0.8rem;
      background: color-mix(in oklab, var(--primary), transparent 85%);
      border: 1px solid color-mix(in oklab, var(--primary), transparent 70%);
      border-radius: 999px;
      font-size: 0.85rem;
      font-weight: 500;
      color: var(--primary);
    }

    .project-actions {
      display: flex;
      gap: 1rem;
      align-items: center;
    }

    .btn-primary {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.8rem 1.5rem;
      background: linear-gradient(135deg, var(--primary), var(--primary-2));
      color: white;
      border: none;
      border-radius: 999px;
      font-weight: 600;
      text-decoration: none;
      transition: all 0.3s ease;
      box-shadow: 0 4px 16px rgba(124, 156, 255, 0.3);
      font-size: 0.9rem;
    }

    .btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(124, 156, 255, 0.4);
    }

    .btn-secondary {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.8rem 1.5rem;
      background: transparent;
      color: var(--text);
      border: 2px solid var(--border);
      border-radius: 999px;
      font-weight: 600;
      text-decoration: none;
      transition: all 0.3s ease;
      font-size: 0.9rem;
    }

    .btn-secondary:hover {
      border-color: var(--primary);
      color: var(--primary);
      transform: translateY(-2px);
    }

    /* Project Visual Styles */
    .project-visual {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 100%;
      position: relative;
    }

    /* Mobile Mockup */
    .mobile-mockup {
      position: relative;
    }

    .mobile-device {
      width: 280px;
      height: 560px;
      background: #1a1a1a;
      border-radius: 28px;
      padding: 12px;
      box-shadow: 
        0 0 0 6px #333,
        0 15px 40px rgba(0,0,0,0.4),
        inset 0 0 0 2px #555;
      position: relative;
      overflow: hidden;
    }

    .mobile-device.ai-theme {
      background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
      width: 300px;
      height: 600px;
      border-radius: 32px;
      padding: 8px;
      box-shadow: 
        0 0 0 3px #000,
        0 0 0 4px #333,
        0 20px 50px rgba(0,0,0,0.5),
        inset 0 0 0 1px #555;
    }

    .mobile-device.ai-theme::before {
      content: '';
      position: absolute;
      top: 8px;
      left: 50%;
      transform: translateX(-50%);
      width: 60px;
      height: 6px;
      background: #333;
      border-radius: 3px;
      z-index: 15;
    }

    .mobile-device.ai-theme::after {
      content: '';
      position: absolute;
      top: 20px;
      left: 50%;
      transform: translateX(-50%);
      width: 12px;
      height: 12px;
      background: #222;
      border-radius: 50%;
      z-index: 15;
    }

    .mobile-notch {
      position: absolute;
      top: 6px;
      left: 50%;
      transform: translateX(-50%);
      width: 100px;
      height: 20px;
      background: #000;
      border-radius: 10px;
      z-index: 10;
    }

    .mobile-content {
      width: 100%;
      height: 100%;
      background: transparent;
      border-radius: 16px;
      overflow: hidden;
      position: relative;
    }

    .ar-scene {
      width: 100%;
      height: 100%;
      position: relative;
    }

    .ar-image {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      opacity: 0;
      transition: opacity 1s ease;
      border-radius: 20px;
    }

    .ar-image.active {
      opacity: 1;
    }

    .mobile-content iframe {
      width: 100%;
      height: 100%;
      border: none;
      border-radius: 20px;
    }

    .mobile-device.ai-theme .mobile-content {
      border-radius: 24px;
    }

    .mobile-device.ai-theme .mobile-content iframe {
      border-radius: 24px;
      transform: none;
    }

    .floating-elements {
      position: absolute;
      inset: 0;
      pointer-events: none;
    }

    .float-icon {
      position: absolute;
      font-size: 1.5rem;
      animation: float 3s ease-in-out infinite;
      opacity: 0.6;
    }

    .float-icon:nth-child(1) {
      top: 20%;
      right: -15px;
      animation-delay: 0s;
    }

    .float-icon:nth-child(2) {
      top: 60%;
      left: -15px;
      animation-delay: 1s;
    }

    .float-icon:nth-child(3) {
      bottom: 20%;
      right: -10px;
      animation-delay: 2s;
    }

    @keyframes float {
      0%, 100% { transform: translateY(0px) rotate(0deg); }
      50% { transform: translateY(-15px) rotate(3deg); }
    }

    .award-badge {
      position: absolute;
      top: -15px;
      right: -15px;
      background: linear-gradient(135deg, #ffd700, #ffed4e);
      color: #1a1a1a;
      padding: 0.75rem;
      border-radius: 50%;
      font-size: 0.7rem;
      font-weight: 700;
      text-align: center;
      box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
      animation: pulse 2s infinite;
    }

    @keyframes pulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.05); }
    }

    /* Browser Mockup */
    .browser-mockup {
      width: 100%;
      max-width: 500px;
    }

    .browser-window {
      width: 100%;
      height: 350px;
      background: var(--card);
      border-radius: 10px;
      overflow: hidden;
      box-shadow: 0 15px 40px rgba(0,0,0,0.3);
      border: 1px solid var(--border);
    }

    .browser-header {
      height: 40px;
      background: var(--bg-elev);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      padding: 0 1rem;
      gap: 1rem;
    }

    .browser-controls {
      display: flex;
      gap: 0.4rem;
    }

    .browser-controls span {
      width: 10px;
      height: 10px;
      border-radius: 50%;
    }

    .browser-controls span:nth-child(1) { background: #ff5f57; }
    .browser-controls span:nth-child(2) { background: #ffbd2e; }
    .browser-controls span:nth-child(3) { background: #28ca42; }

    .browser-url {
      flex: 1;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 0.4rem 0.8rem;
      font-size: 0.8rem;
      color: var(--muted);
    }

    .browser-content {
      position: relative;
      height: calc(100% - 40px);
    }

    .browser-content iframe {
      width: 100%;
      height: 100%;
      border: none;
    }

    .connection-placeholder {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, var(--bg), var(--bg-elev));
      padding: 2rem;
    }

    .placeholder-content {
      text-align: center;
      max-width: 300px;
    }

    .placeholder-icon {
      font-size: 3rem;
      margin-bottom: 1rem;
      opacity: 0.7;
    }

    .placeholder-content h4 {
      font-size: 1.2rem;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 0.5rem;
    }

    .placeholder-content p {
      color: var(--muted);
      font-size: 0.9rem;
      margin-bottom: 1.5rem;
    }

    .placeholder-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.75rem 1.5rem;
      background: linear-gradient(135deg, var(--primary), var(--primary-2));
      color: white;
      border-radius: 999px;
      font-weight: 600;
      text-decoration: none;
      transition: all 0.3s ease;
      font-size: 0.9rem;
    }

    .placeholder-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(124, 156, 255, 0.4);
    }

    .browser-overlay {
      position: absolute;
      top: 0.75rem;
      right: 0.75rem;
      z-index: 5;
    }

    .live-indicator {
      display: flex;
      align-items: center;
      gap: 0.4rem;
      background: rgba(40, 202, 66, 0.9);
      color: white;
      padding: 0.4rem 0.8rem;
      border-radius: 999px;
      font-size: 0.75rem;
      font-weight: 600;
      backdrop-filter: blur(8px);
    }

    .pulse {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: white;
      animation: pulse-dot 1.5s infinite;
    }

    @keyframes pulse-dot {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.5; transform: scale(1.2); }
    }

    /* Mobile Live View Alternative */
    .mobile-live-view {
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 1.5rem;
      padding: 2rem;
      background: linear-gradient(135deg, var(--bg), var(--bg-elev));
      border-radius: var(--radius);
      border: 2px dashed var(--border);
      text-align: center;
    }

    .mobile-live-view .preview-icon {
      font-size: 3rem;
      opacity: 0.6;
    }

    .mobile-live-view h4 {
      font-size: 1.1rem;
      font-weight: 600;
      color: var(--text);
      margin: 0;
    }

    .mobile-live-view p {
      color: var(--muted);
      font-size: 0.9rem;
      margin: 0;
    }

    .mobile-live-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.75rem 1.5rem;
      background: linear-gradient(135deg, var(--primary), var(--primary-2));
      color: white;
      border-radius: 999px;
      font-weight: 600;
      text-decoration: none;
      transition: all 0.3s ease;
      font-size: 0.9rem;
    }

    .mobile-live-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(124, 156, 255, 0.4);
    }

    .ai-overlay {
      position: absolute;
      inset: 0;
      pointer-events: none;
    }

    .ai-particles {
      position: absolute;
      inset: 0;
    }

    .particle {
      position: absolute;
      width: 3px;
      height: 3px;
      background: var(--primary);
      border-radius: 50%;
      animation: particle-float 4s ease-in-out infinite;
    }

    .particle:nth-child(1) {
      top: 20%;
      left: 10%;
      animation-delay: 0s;
    }

    .particle:nth-child(2) {
      top: 60%;
      right: 15%;
      animation-delay: 1.5s;
    }

    .particle:nth-child(3) {
      bottom: 30%;
      left: 20%;
      animation-delay: 3s;
    }

    @keyframes particle-float {
      0%, 100% { transform: translateY(0px); opacity: 0.3; }
      50% { transform: translateY(-25px); opacity: 1; }
    }

    /* Navigation */
    .project-nav {
      position: absolute;
      bottom: 1.5rem;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      align-items: center;
      gap: 1.5rem;
      background: color-mix(in oklab, var(--bg), transparent 10%);
      backdrop-filter: blur(16px);
      border: 1px solid var(--border);
      border-radius: 999px;
      padding: 0.75rem 1.5rem;
      z-index: 20;
    }

    .nav-btn {
      background: transparent;
      border: none;
      color: var(--text);
      cursor: pointer;
      padding: 0.4rem;
      border-radius: 50%;
      transition: all 0.3s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
    }

    .nav-btn:hover {
      background: var(--primary);
      color: white;
      transform: scale(1.1);
    }

    .nav-btn:disabled {
      opacity: 0.3;
      cursor: not-allowed;
    }

    .nav-btn:disabled:hover {
      background: transparent;
      color: var(--text);
      transform: none;
    }

    .project-indicators {
      display: flex;
      gap: 0.5rem;
    }

    .indicator {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      border: 2px solid var(--border);
      background: transparent;
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .indicator.active {
      background: var(--primary);
      border-color: var(--primary);
      transform: scale(1.2);
    }

    /* Responsive Design */
    @media (max-width: 1200px) {
      .project-container {
        padding: 2rem 3rem;
        gap: 3rem;
      }

      .project-title {
        font-size: 2.5rem;
      }

      .mobile-device {
        width: 240px;
        height: 480px;
      }

      .mobile-device.ai-theme {
        width: 260px;
        height: 520px;
      }

      .browser-window {
        height: 300px;
      }
    }

    /* Tablet optimization */
    @media (max-width: 1024px) and (min-width: 769px) {
      .project-showcase {
        height: 90vh;
        min-height: 700px;
      }

      .project-container {
        padding: 2rem;
        gap: 2rem;
      }

      .project-title {
        font-size: 2.2rem;
      }

      .project-subtitle {
        font-size: 1.1rem;
      }

      .project-description {
        font-size: 0.95rem;
        max-width: 400px;
      }

      .mobile-device {
        width: 220px;
        height: 440px;
      }

      .mobile-device.ai-theme {
        width: 240px;
        height: 480px;
      }

      .browser-window {
        height: 280px;
        max-width: 450px;
      }

      .project-tech {
        gap: 0.4rem;
      }

      .tech-tag {
        padding: 0.3rem 0.7rem;
        font-size: 0.8rem;
      }

      .btn-primary, .btn-secondary {
        padding: 0.7rem 1.3rem;
        font-size: 0.85rem;
      }

      .project-nav {
        bottom: 2rem;
        padding: 0.6rem 1.2rem;
        gap: 1.2rem;
      }

      .nav-btn {
        width: 34px;
        height: 34px;
      }

      .indicator {
        width: 9px;
        height: 9px;
      }
    }

    @media (max-width: 1000px) {
      .project-showcase {
        height: auto;
        min-height: 600px;
      }

      .project-container {
        grid-template-columns: 1fr;
        padding: 2rem;
        gap: 2rem;
        text-align: center;
      }

      .project-number {
        position: relative;
        top: auto;
        left: auto;
        font-size: 3rem;
        opacity: 0.3;
        margin-bottom: 1rem;
      }

      .project-title {
        font-size: 2.2rem;
      }

      .mobile-device {
        width: 220px;
        height: 440px;
      }

      .mobile-device.ai-theme {
        width: 240px;
        height: 480px;
      }

      .browser-window {
        height: 280px;
      }

      /* Hide complex previews on mobile, show live view buttons */
      .browser-mockup,
      .mobile-mockup {
        display: none;
      }

      .mobile-live-view {
        display: flex;
      }

      /* Move navigation higher to avoid button overlap */
      .project-nav {
        bottom: 8rem;
        background: color-mix(in oklab, var(--bg), transparent 5%);
        backdrop-filter: blur(20px);
      }
    }

    @media (max-width: 640px) {
      .project-container {
        padding: 1rem;
        padding-bottom: 10rem; /* Extra space for navigation */
      }

      .project-title {
        font-size: 1.8rem;
      }

      .project-description {
        max-width: none;
      }

      .project-actions {
        flex-direction: column;
        width: 100%;
        margin-bottom: 2rem; /* Extra space before mobile live view */
      }

      .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
      }

      .mobile-device {
        width: 180px;
        height: 360px;
      }

      .mobile-device.ai-theme {
        width: 200px;
        height: 400px;
      }

      .browser-window {
        height: 220px;
      }

      /* Navigation positioned to not overlap buttons */
      .project-nav {
        bottom: 2rem;
        padding: 0.5rem 1rem;
        gap: 1rem;
        background: color-mix(in oklab, var(--bg), transparent 2%);
        border: 2px solid var(--border);
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        z-index: 100;
      }

      .nav-btn {
        width: 32px;
        height: 32px;
      }

      .indicator {
        width: 8px;
        height: 8px;
      }

      /* Mobile live view adjustments */
      .mobile-live-view {
        margin-top: 1rem;
        padding: 1.5rem;
        margin-bottom: 6rem; /* Space for fixed navigation */
      }

      .mobile-live-btn {
        width: 100%;
        justify-content: center;
      }

      /* Ensure project actions have space too */
      .project-actions {
        margin-bottom: 3rem;
      }
    }

    /* ===== CARDS / GRID (for other sections) ===== */
    .grid { display:grid; gap: 1rem; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    @media (max-width: 1000px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
    @media (max-width: 680px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

    .card { border:1px solid var(--border); background: var(--card); border-radius: var(--radius); padding: 1rem; display:grid; gap:.75rem; box-shadow: var(--shadow); }
    .card h3 { font-size: 1.05rem; }
    .tags { display:flex; gap:.5rem; flex-wrap: wrap; }
    .tag { font-size:.8rem; padding:.25rem .55rem; border-radius: 999px; border:1px solid var(--border); color: var(--muted); }

    /* ===== ABOUT ===== */
    .about p + p { margin-top:.6rem }

    /* ===== SKILLS ===== */
    .skills { display:flex; gap:.6rem; flex-wrap:wrap }
    .skill { border:1px solid var(--border); background: color-mix(in oklab, var(--primary), transparent 90%); padding:.45rem .7rem; border-radius: 999px; font-size:.9rem }

    /* ===== TIMELINE ===== */
    .timeline { position:relative; }
    .timeline::before { content:""; position:absolute; left: 11px; top:0; bottom:0; width:2px; background: var(--border) }
    .t-item { position:relative; padding-left: 2.2rem; margin-bottom: 0.8rem; }
    .t-item::before { content:""; position:absolute; left:6px; top:.5rem; width:12px; height:12px; border-radius:50%; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary), transparent 80%); }
    .t-meta { font-size:.85rem; color: var(--muted); }

    /* Collapsible timeline (preview + expand) */
    .timeline-body {
      position: relative; /* container for the bottom blur overlay */
      overflow: hidden;
      max-height: 360px; /* collapsed height showing a few items */
      /* slower slide-down for a smoother reveal */
      transition: max-height 1s cubic-bezier(.2,.9,.2,1), padding 1s ease;
      padding-bottom: .6rem;
    }
    .timeline-body.expanded {
      max-height: 2000px; /* large enough to show full content; animated via max-height */
      padding-bottom: 1rem;
    }
   /* Show only the first two timeline items when collapsed. When .expanded is present,
     all items become visible. This keeps layout stable and avoids relying on max-height alone. */
   .timeline-body:not(.expanded) .t-item:nth-of-type(n+3) { display: none; }
   .timeline-body.expanded .t-item { display: block; }
    /* Removed timeline pseudo-element preview; use a glossy semi-transparent toggle button instead.
       The button is frosted/blurred by default and becomes clearer when the timeline is expanded. */
    /* Wrapper around the toggle: centered glossy semi-transparent panel */
    .timeline-toggle-wrap {
      display: flex;
      justify-content: center;
      margin-top: 0.8rem;
      position: relative;
      z-index: 3;
      /* panel effect behind the button: short, semi-transparent, glossy */
      padding: 6px 12px;
      border-radius: 12px;
      margin-inline: auto;
      width: max-content;
      transition: background .28s ease, backdrop-filter .28s ease, box-shadow .28s ease;
      background: color-mix(in oklab, var(--bg-elev), transparent 36%);
      backdrop-filter: blur(6px) saturate(.95);
      -webkit-backdrop-filter: blur(6px) saturate(.95);
      box-shadow: 0 8px 20px rgba(0,0,0,.08);
      border: 1px solid color-mix(in oklab, var(--bg-elev), transparent 60%);
    }

    .timeline-toggle {
      background: transparent;
      border: none;
      color: var(--text);
      padding: .45rem .8rem;
      border-radius: 8px;
      cursor: pointer;
      font-weight: 700;
      letter-spacing: .2px;
    }

    .timeline-toggle:hover { transform: translateY(-1px); }

    /* When timeline expanded, make wrapper clearer (lighter tint, less blur) */
    .timeline-body.expanded + .timeline-toggle-wrap {
      background: color-mix(in oklab, var(--bg-elev), transparent 16%);
      backdrop-filter: blur(2px) saturate(1);
      -webkit-backdrop-filter: blur(2px) saturate(1);
      box-shadow: 0 10px 30px rgba(0,0,0,.06);
    }

    /* ===== FOOTER ===== */
    footer { padding: 2rem 0 2rem; color: var(--muted); border-top: 1px solid var(--border) }

    /* ===== UTIL ===== */
    .sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0 }
    .spacer { height: .75rem }
    .link { color: var(--primary); }
    .link:hover { text-decoration: underline }

    @media (prefers-reduced-motion: reduce) {
      .btn:hover { transform:none }
    }

/* Reveal-on-scroll animations (enabled only on first visit) */
/* Reveal animation for most elements. Skip elements that manage their own transforms
   (gallery items and cert-cards) to avoid visual conflicts. */
html.do-animate .reveal:not(.g-item):not(.cert-card) {
  opacity: 0;
  transform: translateY(18px) scale(.995);
  transition: opacity .9s cubic-bezier(.16,.84,.24,1), transform .9s cubic-bezier(.16,.84,.24,1);
  will-change: opacity, transform;
}
html.do-animate .reveal.in-view:not(.g-item):not(.cert-card) {
  opacity: 1;
  transform: none;
}

/* small stagger helper when JS sets inline transition-delay */
html.do-animate .reveal { transition-property: opacity, transform; }

    /* ===== CERTIFICATION CAROUSEL ===== */
    .cert-carousel {
      position: relative;
      display: grid;
      grid-template-columns: auto 1fr auto;
      align-items: center;
      gap: .75rem;
    }

    .cert-nav {
      background: color-mix(in oklab, var(--bg-elev), transparent 10%);
      border: 1px solid var(--border);
      width: 42px; height: 42px;
      border-radius: 999px;
      display: grid; place-items: center;
      font-size: 1.4rem;
      cursor: pointer;
      box-shadow: var(--shadow);
    }
    .cert-nav:hover { transform: translateY(-1px); }

    .cert-viewport {
      position: relative;
      height: 300px;
      perspective: 1000px;
      border-radius: var(--radius);
      overflow: hidden;                 /* hides the back half */
      background:
        radial-gradient(120% 100% at 50% 50%,
          color-mix(in oklab, var(--bg-elev), transparent 0%),
          color-mix(in oklab, var(--bg-elev), transparent 40%) 55%,
          color-mix(in oklab, var(--bg), transparent 0%) 100%);
    }
  /* Allow vertical scrolling but let JS handle horizontal swipes */
  .cert-viewport { touch-action: pan-y; cursor: grab }
  .cert-viewport:active { cursor: grabbing }

    .cert-track {
      position: absolute; inset: 0;
      margin: auto;
      width: 200px; height: 240px;
      transform-style: preserve-3d;
      display: block;
      transition: transform .6s cubic-bezier(.2,.9,.2,1);
    }

    .cert-card {
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      margin: auto;
      width: 180px; height: 220px;
      padding: 1rem;
      border-radius: var(--radius);
      background: var(--card);
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      display: grid; place-items: center;
      text-align: center;
      gap: .4rem;
      backface-visibility: hidden;
      transform-style: preserve-3d;
      transition: filter .35s ease, opacity .35s ease, transform .35s ease;
    }

    .cert-card[aria-disabled="true"] {
      cursor: default;
      pointer-events: none;
    }

    .cert-card img {
      width: 84px; height: 84px;
      object-fit: contain;
    }
    .cert-card p { font-weight: 800; }
    .cert-card .muted { font-size: .88rem; }

    /* Show only the front card; hide others completely to avoid distracting blurred sides */
    .cert-card { opacity: 0; filter: none !important; }
    .cert-card.is-front {
      opacity: 1;
      transform: translateZ(10px) scale(1.03);
      z-index: 3;
    }

   /* Ring positions (5 items) — MUST match current number of .cert-card elements.
     If you add/remove cards, either update these angles (360/N increments)
     or switch to JS-generated transforms. */
   .cert-card:nth-child(1) { transform: rotateY(  0deg) translateZ(320px); }
   .cert-card:nth-child(2) { transform: rotateY( 72deg) translateZ(320px); }
   .cert-card:nth-child(3) { transform: rotateY(144deg) translateZ(320px); }
   .cert-card:nth-child(4) { transform: rotateY(216deg) translateZ(320px); }
   .cert-card:nth-child(5) { transform: rotateY(288deg) translateZ(320px); }

    /* Responsive tweaks */
    @media (max-width: 820px) {
      .cert-viewport { height: 260px; }
      .cert-track { width: 180px; height: 220px; }
      .cert-card { width: 160px; height: 200px; }
    }

/* ===== CUSTOM THEMED SCROLLBAR (compatible) ===== */
/* Apply to page root to avoid specificity issues */
html, body {
  /* Firefox: thin scrollbar and fallback color mapping */
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb-solid) var(--scroll-track);
}

/* WebKit browsers */
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 12px; height: 12px; }
html::-webkit-scrollbar-track, body::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb-solid);
  background-image: var(--scroll-thumb); /* gradient in supporting engines */
  border-radius: 999px;
  border: 3px solid transparent; /* spacing */
  background-clip: padding-box;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22), inset 0 -4px 8px rgba(255,255,255,0.03);
}
html::-webkit-scrollbar-thumb:hover, body::-webkit-scrollbar-thumb:hover {
  background-color: var(--scroll-thumb-hover);
  filter: saturate(1.05) brightness(1.02);
}
html::-webkit-scrollbar-corner, body::-webkit-scrollbar-corner { background: transparent; }

/* Light theme fallbacks */
html[data-theme="light"] { scrollbar-color: var(--scroll-thumb-solid) rgba(0,0,0,0.04); }
html[data-theme="light"] ::-webkit-scrollbar-track { background: rgba(0,0,0,0.03); }
html[data-theme="light"] ::-webkit-scrollbar-thumb { box-shadow: 0 6px 18px rgba(2,6,23,0.06); }

/* Slightly larger on hover for easier grabbing */
body:hover ::-webkit-scrollbar { width: 14px; }

@media (prefers-reduced-motion: reduce) {
  html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb { transition: none; }
}

/* This one for the project images part */
.project-img {
  display: flex;
  justify-content: center;
}

/* ===== HERO MOBILE OPTIMIZATIONS ===== */
@media (max-width: 960px) {
  .hero {
    min-height: 85vh;
    padding-top: 4rem;
    align-items: flex-start;
  }
  
  .hero-grid {
    padding-top: 0;
  }
  
  .hero-content .headline {
    font-size: clamp(2rem, 7vw, 3rem);
    text-align: center;
    font-weight: 800;
  }
  
  .hero-content .kicker,
  .hero-content .sub {
    text-align: center;
  }
  
  .cta-row {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .hero-cta,
  .hero-cta-secondary {
    margin-right: 0;
  }
  
  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  
  .stat-item {
    padding: 1rem 0.5rem;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .scroll-indicator {
    bottom: 2rem;
  }
  
  /* Reduce 3D effects on mobile for performance */
  .particle-cube {
    animation-duration: 8s;
  }
  
  .glow-orb {
    filter: blur(20px);
  }
}

@media (max-width: 480px) {
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .cta-row {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-cta,
  .hero-cta-secondary {
    width: 100%;
    justify-content: center;
  }
}

/* ===== HERO SCROLL TRANSITION ===== */
.hero.scrolled .hero-background {
  opacity: 0.3;
  transition: opacity 0.5s ease;
}