:root {
        --bg-gradient: radial-gradient(circle at top, #f4f9ffd3, #fbfbfb);
        --text: #1f2937;
        --muted: #6b7280;
        --primary: #7c8cff;
        --border: rgba(0, 0, 0, 0.08);
        --card-bg: rgba(249, 250, 251, 0.5);
        --glow: rgba(124, 140, 255, 0.3);
        --btn-bg: white;
        --glass-bg: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(255,255,255,0.35));
      }

      [data-theme="dark"] {
        --bg-gradient: radial-gradient(circle at top, #111827, #030712);
        --text: #f3f4f6;
        --muted: #9ca3af;
        --primary: #a5b4fc;
        --border: rgba(255,255,255,0.1);
        --card-bg: rgba(31, 41, 55, 0.7);
        --glow: rgba(165, 180, 252, 0.2);
        --btn-bg: #1f2937;
        --glass-bg: linear-gradient(135deg, rgba(31, 41, 55, 0.8), rgba(17, 24, 39, 0.6));
      }

      /* Fix back button icon in dark mode */
      [data-theme="dark"] .back img { filter: brightness(0) invert(1); }

      /* Theme Toggle Styling */
      #theme-toggle {
        position: fixed; bottom: 25px; right: 25px; z-index: 1000;
        width: 50px; height: 50px; background: var(--primary);
        color: white; border: none; border-radius: 50%; cursor: pointer;
        display: flex; align-items: center; justify-content: center;
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
      }

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

    body {
      font-family: 'Inter', sans-serif;
      /* FIXED: Background now uses the CSS variable */
      background: var(--bg-gradient);
      background-attachment: fixed;
      color: var(--text);
      line-height: 1.5;
      overflow-x: hidden;
      min-height: 100vh;
      transition: background 0.3s ease, color 0.3s ease;
    }

    .back {
      position: fixed;
      top: 25px;
      left: 25px;
      z-index: 1000;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 50px;
      height: 50px;
      background: var(--btn-bg); /* Uses variable */
      border-radius: 50%;
      box-shadow: 0 10px 20px rgba(0,0,0,0.1);
      transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      border: 1px solid var(--border);
    }

    .back img {
      width: 30px;
      height: 30px;
      object-fit: contain;
      pointer-events: none;
      -webkit-user-drag: none;
    }

    .back:hover { transform: scale(1.1); }
    .back:active { transform: scale(0.9); }


    .glass {
      background: var(--glass-bg); /* Uses variable */
      backdrop-filter: blur(22px) saturate(140%);
      -webkit-backdrop-filter: blur(22px) saturate(140%);
      border: 1px solid var(--border);
      box-shadow: 0 20px 40px rgba(0,0,0,0.08);
      border-radius: 30px;
    }

    .top {
      padding: 50px 0 20px;
      display: flex;
      justify-content: center;
    }

    .icon-top {
      height: 180px;
      width: 180px;
      border-radius: 50%;
      transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      object-fit: cover;
      border: 6px solid var(--btn-bg);
      box-shadow: 0 15px 30px rgba(0,0,0,0.1), 0 0 0 10px rgba(124, 140, 255, 0.05);
      cursor: pointer;
      pointer-events: none;
      -webkit-user-drag: none;
    }

    .section-title {
      text-align: center;
      margin: 20px 0 40px;
      font-size: clamp(32px, 5vw, 48px);
      font-weight: 800;
      background: linear-gradient(to right, #4f46e5, var(--primary));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .card-img-container {
      width: 100%;
      height: 500px;
      border-radius: 20px;
      overflow: hidden;
      margin-bottom: 20px;
      background: var(--card-bg);
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      border: 1px solid var(--border);
    }

    .card img {
      position: absolute;
      top: 40%;
      left: 50%;
      transform: translate(-50%, -40%) scale(1); 
      width: 100%;
      height: auto;
      object-fit: contain; 
      transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
      filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1));
      pointer-events: none;
      -webkit-user-drag: none;
    }

    .card:hover img { 
      transform: translate(-50%, -40%) scale(1.05); 
    }

    .card h3 { margin-bottom: 10px; font-size: 22px; color: var(--text); }
    .description-container {
      position: relative;
      margin-bottom: 20px;
    }

    .card p { 
      color: var(--muted); 
      font-size: 15px; 
      white-space: pre-line;
      overflow: hidden;
      transition: max-height 0.4s ease;
    }

    .card p.collapsed {
      max-height: 100px;
      -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
      mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    }

    .card p.expanded {
      max-height: 240px;
      overflow-y: auto;
      -webkit-mask-image: none;
      mask-image: none;
    }

    .read-more-btn {
      background: rgba(124, 140, 255, 0.1);
      border: none;
      color: var(--primary);
      font-weight: 700;
      font-size: 12px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      cursor: pointer;
      padding: 6px 12px;
      border-radius: 8px;
      margin-top: 10px;
      transition: all 0.3s ease;
    }

    .read-more-btn:hover {
      background: var(--primary);
      color: white;
    }

    .card-footer {
      display: flex;
      gap: 10px;
      margin-top: auto;
    }

    .card .explore-link {
      display: inline-block;
      text-decoration: none;
      color: var(--primary);
      font-weight: 600;
      padding: 12px 24px;
      background: var(--btn-bg);
      border: 1px solid var(--border);
      border-radius: 14px;
      width: 100%;
      text-align: center;
      transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    }

    .card .explore-link:hover {
      background: var(--primary);
      color: white !important;
      transform: translateY(-3px);
      box-shadow: 0 10px 20px var(--glow);
    }
    .card a.explore-link:active {
      transform: translateY(-1px);
    }

    .card {
      padding: 24px;
      display: flex;
      flex-direction: column;
      transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
      width: 100%;
      max-width: none;
      }
    
.features {
  
  width: min(100%, 1780px);
  margin: 0 auto 80px;
  padding: 0 20px;
  display: grid;
  gap: 30px;
  grid-template-columns: repeat(auto-fit, minmax(500px, 360px));
  justify-content: center;
  justify-items: stretch;
}

/* 4 columns only on very wide (4K) screens */
@media (min-width: 2200px) {
  .features {
    width: min(100%, 1580px);            /* caps 4K to 4 columns */
    grid-template-columns: repeat(auto-fit, minmax(260px, 360px));
  }
}

/* 2 columns on tablets */
@media (max-width: 1100px) {
  .features {
    width: min(100%, 820px);             /* caps tablet to 2 columns */
    grid-template-columns: repeat(auto-fit, minmax(240px, 360px));
  }
}

/* 1 column on mobile */
@media (max-width: 700px) {
  .features {
    width: min(100%, 520px);
    grid-template-columns: 1fr;
  }
}

}


@media (max-width: 1500px) {
      /* .features {
        grid-template-columns: repeat(2, 1fr); 
      } */
      .card-img-container { 
        height: 500px; 
      }
    }

    @media (max-width: 1100px) {
      .card-img-container {
        height: 420px;
      }
    }
    @media (max-width: 780px) {
      /* .features {
        grid-template-columns: 1fr;
      } */
      .card-img-container { 
        height: 380px; 
      }
      .card {
        max-width: 100%; 
      }
    }


/* Lucide icon helpers */
.lucide{width:16px;height:16px;vertical-align:-3px;margin-right:6px;}
