/* =========================================================
    MOBILE: Up to 425px
  ========================================================= */
@media (max-width: 426px) {
  .header {
    background: linear-gradient(
      90deg,
      rgba(25, 0, 87, 0.7) 0%,
      rgba(64, 40, 121, 0.7) 50.48%,
      rgba(25, 0, 87, 0.7) 100%
    );
    border: 1px solid #7d68b3;
    border-radius: 72px;
    box-shadow: 0 0 20px 0 rgba(125, 104, 179, 0.2);
    height: 60px;
    margin: 0 8px;
    padding: 0 28px;
    width: 96%;
  }

  .logo img {
    height: 40px;
    width: 32px;
  }

  .nav {
    display: none;
  }

  .burger {
    display: block;
  }

  .mobile-menu {
    backdrop-filter: blur(24px);
    background: linear-gradient(
      90deg,
      rgba(25, 0, 87, 0.96) 0%,
      rgba(64, 40, 121, 0.96) 50.48%,
      rgba(25, 0, 87, 0.96) 100%
    );
    border: 1px solid #7d68b3;
    border-radius: 32px;
    box-shadow: 0 0 20px 0 rgba(125, 104, 179, 0.2);
    display: none;
    left: 50%;
    padding-top: 50px;
    position: fixed;
    top: 40px; /* slightly below the header (adjust if header height changes) */
    transform: translateX(-50%);
    width: 96%;
    z-index: 999; /* Above the sticky header */
  }

  .mobile-menu.active {
    display: flex !important;
    flex-direction: column;
  }

  .mobile-menu a {
    align-items: center;
    color: #fff;
    display: flex;
    font-weight: 600;
    height: 60px;
    padding: 0 20px;
    text-decoration: none;
  }

  .divider {
    background: #7d68b3;
    height: 2px;
    width: 100%;
  }
}

/* =========================================================
    TABLET: 426px – 768px
  ========================================================= */

@media (max-width: 768px) {
  .projects-header {
    margin-top: 32px; /* smaller spacing for mobile */
  }
}

@media (min-width: 426px) and (max-width: 768px) {
  .header {
    background: linear-gradient(
      90deg,
      rgba(25, 0, 87, 0.7) 0%,
      rgba(64, 40, 121, 0.7) 50.48%,
      rgba(25, 0, 87, 0.7) 100%
    );
    border: 1px solid #7d68b3;
    border-radius: 72px;
    box-shadow: 0 0 20px 0 rgba(125, 104, 179, 0.2);
    height: 64px;
    margin: 0 auto;
    padding: 0 28px;
    width: 374px;
  }

  .logo img {
    height: 40px;
    width: 32px;
  }

  .nav {
    display: none;
  }

  .burger {
    display: block;
  }

  .mobile-menu {
    backdrop-filter: blur(24px);
    background: linear-gradient(
      90deg,
      rgba(25, 0, 87, 0.96) 0%,
      rgba(64, 40, 121, 0.96) 50.48%,
      rgba(25, 0, 87, 0.96) 100%
    );
    border: 1px solid #7d68b3;
    border-radius: 32px;
    box-shadow: 0 0 20px 0 rgba(125, 104, 179, 0.2);
    display: none;
    left: 50%;
    padding-top: 50px;
    position: fixed;
    top: 40px; /* slightly below the header (adjust if header height changes) */
    transform: translateX(-50%);
    width: 96%;
    z-index: 999; /* Above the sticky header */
  }

  .mobile-menu.active {
    display: flex !important;
    flex-direction: column;
  }

  .mobile-menu a {
    align-items: center;
    color: #fff;
    display: flex;
    font-weight: 600;
    height: 60px;
    padding: 0 20px;
    text-decoration: none;
  }

  .divider {
    background: #7d68b3;
    height: 2px;
    width: 100%;
  }
}

/* =========================================================
    SMALL LAPTOP: 769px – 1024px
  ========================================================= */
@media (min-width: 769px) and (max-width: 1024px) {
  .header {
    backdrop-filter: blur(20px);
    background: linear-gradient(
      90deg,
      rgba(25, 0, 87, 0.7) 0%,
      rgba(64, 40, 121, 0.7) 50.48%,
      rgba(25, 0, 87, 0.7) 100%
    );
    border: 1px solid #7d68b3;
    border-radius: 90px;
    box-shadow: 0 0 40px 0 rgba(125, 104, 179, 0.2);
    height: 100px;
    margin: 0 auto 30px auto;
    padding: 0 40px;
    width: 90%;
  }

  .logo img {
    height: 50px;
  }

  .nav {
    display: flex;
    gap: 36px;
  }

  .nav a {
    font-size: 20px;
  }

  .burger {
    display: none;
  }
}

/* =========================================================
    DESKTOP: 1025px – 1440px
  ========================================================= */
@media (min-width: 1025px) and (max-width: 1440px) {
  .header {
    height: 110px;
    margin: 0 auto 30px auto;
    padding: 0 60px;
    width: 90%;
  }

  .logo img {
    height: 60px;
  }

  .nav {
    display: flex;
    gap: 40px;
  }

  .nav a {
    font-size: 22px;
  }

  .burger {
    display: none;
  }
}

/* =========================================================
    LARGE SCREENS: 1441px+
  ========================================================= */
@media (min-width: 1441px) {
  .header {
    height: 116px;
    margin: auto;
    max-width: 1320px;
    padding: 0 60px;
  }

  .logo img {
    height: 64px;
  }

  .nav {
    display: flex;
    gap: 48px;
  }

  .nav a {
    font-size: 24px;
  }

  .burger {
    display: none;
  }
}

/* ---------- Tablet (768px → 1023px) --------- */
@media (min-width: 768px) and (max-width: 1023px) {
  /* content stays left but with modest gutter from left edge */
  .create-content {
    max-width: 700px;
    text-align: left;
  }

  .create-title {
    font-size: 32px;
  }

  .create-subtitle {
    font-size: 20px;
  }

  /* CTA button: left aligned below the subtitle, slightly smaller */
  .create-btn {
    display: inline-flex;
    font-size: 18px;
    margin-top: 20px;
    padding: 14px 20px;
  }

  /* Bee reduced */
  .create-bee {
    bottom: 10px;
    height: 240px;
    right: 40px;
    width: 300px;
    z-index: -1;
  }

  /* Move the up button into the section top-right (absolute so it aligns with the heading) */
  .create-top-btn {
    border-radius: 8px;
    bottom: 8px; /* align with top of the create block area */
    position: fixed;
    right: 16px;
  }
}

/* ---------- Mobile (≤767px) ---------- */
@media (max-width: 767px) {
  .create-top-btn {
    height: 48px;
    width: 48px;
  }

  .create-top-btn img {
    height: 48px;
    width: 48px;
  }
  .create-divider {
    margin: 32px auto;
  }
  .create-together {
    margin: 0;
    min-height: 200px;
 
  }

  /* critical: keep content LEFT aligned — matches your screenshot */
  .create-content {
    max-width: calc(100% - 32px);
    text-align: left;
    margin-bottom: 24px;
  }

  .create-title {
    font-size: 24px; /* your requested size */
    line-height: 1.05;
  }

  .create-subtitle {
    font-size: 16px;
    font-weight: 300;
    margin-top: 12px;
    max-width: 420px; /* keep it short, will break into ~2 lines */
  }

  /* button: left aligned under subtitle, compact */
  .create-btn {
    align-items: center;
    display: inline-flex;
    font-size: 16px;
    gap: 10px;
    justify-content: center;
    margin-left: 0;
    margin-top: 20px;
    padding: 12px 16px; /* your requested size */
    width: auto; /* do not center-stretch */
  }

  /* small bee (your requested size) */
  .create-bee {
    bottom: -8px;
    height: 130px;
    right: 8px;
    width: 157px;
    z-index: -1;
  }

  /* Put the up-button near the heading (absolute inside the section)
      so it sits to the right of the heading as in your example */
  .create-top-btn {
    align-items: center;
    border-radius: 8px;
    bottom: 12px;
    display: flex;
    justify-content: center;
    position: fixed; /* absolute relative to .create-together */
    right: 16px;
    z-index: 10;
    /* keep same visuals as desktop but smaller */
  }
}

/* =========================
    FOOTER — Responsive overrides
    (active under 1024px)
    ========================= */
@media (max-width: 1024px) {
  .footer {
    height: auto;
    padding: 24px;
  }

  .footer-content {
    display: block;
    margin: 0 auto;
    max-width: 1440px;
    padding: 0;
    position: relative;
  }

  /* LOGO — stays on the left */
  .footer-left {
    align-items: center;
    display: flex;
    gap: 20px;
    padding-left: 0;
    position: relative;
    z-index: 2;
  }

  .footer-logo img {
    height: auto;
    width: 100px;
  }

  /* ICONS — top right */
  .footer-social {
    display: flex;
    gap: 18px;
    position: absolute;
    right: 24px;
    top: 12px;
    z-index: 2;
  }

  .social-link {
    height: 44px;
    width: 44px;
  }

  .social-link img {
    display: block;
    height: auto;
    width: 80%;
  }

  /* TEXT — bottom right, larger gap */
  .footer-text {
    bottom: -10px;
    font-size: 15px;
    margin: 0;
    position: absolute;
    right: 24px;
    text-align: right;
    white-space: nowrap;
    z-index: 2;
  }

  /* Hide bee on smaller screens */
  .create-bee {
    display: none !important;
  }

  /* Yellow stain — flipped and pinned above footer */
  .yellow-stain {
    bottom: 100%;
    left: unset;
    pointer-events: none;
    position: absolute;
    right: 0;
    transform: scaleX(-1);
    width: 280px;
    z-index: -1;
  }

  .yellow-stain img {
    display: block;
    height: auto;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .yellow-stain {
    height: auto;
    width: 10.5rem;
  }
  .footer {
    padding: 16px;
  }

  .footer-logo img {
    width: 68px;
  }

  .footer-social .social-link {
    height: 24px;
    width: 24px;
  }

  .footer-text {
    font-size: 12px;
    right: 7px;
  }
}

/*New*/

/* Tablet: 426px – 768px */
@media (max-width: 768px) {
  .main-container {
    padding: 0 24px; /* Reduced padding for tablets */
  }
}

/* Mobile: ≤425px */
@media (max-width: 425px) {
  .main-container {
    padding: 0 16px; /* Minimal padding for mobile */
  }
}

/* Mobile: ≤768px */
@media (max-width: 768px) {
  .grid-container {
    margin-bottom: 40px; /* 40px spacing on mobile */
  }
}

/* Adjust the grid container and section for mobile */
@media (max-width: 500px) {
  .grid-container {
    width: 100%;
    box-sizing: border-box;
  }

  .grid-section {
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .grid-top,
  .grid-bottom {
    flex-wrap: nowrap; /* Keep the row layout */
    gap: 10px;
    justify-content: center; /* Center items if they shrink */
  }

  .grid-item {
    flex-shrink: 1; /* Allow items to shrink proportionally */
    flex-basis: auto; /* Use the calculated width as a base */
  }

  /* Override percentage widths with minimum values on small screens */

  /* Ensure aspect ratio is maintained */
  .grid-item {
    aspect-ratio: auto; /* Let the image determine aspect ratio */
    max-width: 100%; /* Prevent overflow */
  }

  .grid-image {
    width: 100%;
    height: auto;
    object-fit: cover;
  }
}

/* Fine-tune for very small screens */
@media (max-width: 425px) {
  .grid-top,
  .grid-bottom {
    gap: 10px; /* Reduce gap for tighter layout */
  }

  /* Use even smaller minimums if needed */
  :root {
    --g1-min: 210px; /* Adjusted from 60px */
    --g2-min: 150px; /* Adjusted from 100px */
    --g3-min: 144px; /* Adjusted from 70px */
    --g4-min: 66px; /* Adjusted from 44px */
    --g5-min: 108px; /* Adjusted from 60px */
  }
}

@media (max-width: 424px) {
  .grid-400x400 {
    width: 111px;
  }
  .grid-704x400 {
    width: 197px;
  }
  .grid-488x304 {
    width: 135px;
  }
  .grid-220x304 {
    width: 62px;
  }
  .grid-364x304 {
    width: 101px;
  }
}
