

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
  font-family: "Poppins", sans-serif;
  text-transform: uppercase;
  background-color: #ffffff;
  
  /* Prevent horizontal overflow on all devices */
  max-width: 100vw;
  position: relative;

  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.fonts-loading .core-item {
  opacity: 0;
  pointer-events: none;
}

html.fonts-loaded .core-item {
  opacity: 1 !important;
  transition: opacity 0.3s ease;
}

.core-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  width: 100vw;
  height: 100vh;
  /* Modern viewport units for better mobile support */
  height: 100dvh; /* Dynamic viewport height */
  padding: 0;
  overflow: hidden;
  z-index: 1;
  
  /* Prevent layout issues on mobile */
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
}

#webgl-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.logo {
  position: fixed;
  top: 2rem;
  left: 2rem;
  font-size: 2rem;
  color: black;
  text-decoration: none;
  z-index: 1000;
  pointer-events: auto;
  line-height: 1;
  padding: 0;
  margin: 0;
}

.logo a {
  color: black;
  text-decoration: none;
}

.logo:hover {
  cursor: default;
  transition: all 0.3s ease-in-out;
}

.home-link {
  position: fixed;
  top: 45%;
  right: 64%;
  font-size: 2.5rem;
  color: black;
  text-decoration: none;
  transition: all 300ms ease;
  z-index: 1000;
  pointer-events: auto;
  padding: 0.5rem 1rem;
  animation: none;
}

.home-link:hover {
  color: grey;
  text-decoration: wavy;
  text-decoration-color: rgb(181, 181, 181);
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-15px);
  }
  50% {
    transform: translateY(0);
  }
  75% {
    transform: translateY(-8px);
  }
}

.dark-mode-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  font-size: 0.9rem;
  font-family: "Poppins", sans-serif;
  text-transform: uppercase;
  color: #000000;
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 0;
  cursor: none !important;
  transition: all 0.3s ease;
  z-index: 10000;
  pointer-events: auto;
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1;
}

.dark-mode-btn:hover {
  background: transparent;
  color: #000000;

  cursor: none !important;
  animation: pulse 0.8s ease;
}

.dark-mode-btn:active {
  transform: translateY(0);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1) translateY(-2px);
  }
  50% {
    transform: scale(1.1) translateY(-2px);
  }
}

.page-title {
  position: fixed;
  top: 2rem;
  left: 2rem;
  font-size: 2.5rem;
  font-family: "Poppins", sans-serif;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 8px;
  color: #000000;
  z-index: 10000;
  pointer-events: none;
  user-select: none;
  transition: all 0.6s cubic-bezier(0.87, 0, 0.13, 1);
  opacity: 0.85;
  line-height: 1;
  padding: 0;
  margin: 0;
}


body.dark-mode .page-title {
  color: #ffffff;
}

.page-counter {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  font-size: 0.9rem;
  font-family: "Poppins", sans-serif;
  text-transform: uppercase;
  color: #000000;
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 0;
  font-weight: 400;
  letter-spacing: 0.5px;
  z-index: 10000;
  pointer-events: none;
  user-select: none;
  transition: all 0.3s ease;
  line-height: 1;
}

body.dark-mode .page-counter {
  color: #ffffff;
}

#pages-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.page-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: none;
  transform-origin: center center;

  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transform: translateZ(0);
}

.page-section.active {
  display: block;
  z-index: 10;
}

nav {
  display: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  font-size: 1.5rem;
}

.nav-links a {
  color: black;
  text-decoration: none;
  transition: all 300ms ease;
}

.nav-links a:hover {
  color: grey;
  text-decoration: underline;
  text-underline-offset: 1rem;
  text-decoration-color: rgb(181, 181, 181);
}

.dark-mode-toggle {
  cursor: pointer;
  color: #e0e0e0;
  font-weight: bold;
}

.dark-mode-toggle:hover {
  color: #bb86fc;
}

#hamburger-nav {
  display: none;
}

.hamburger-menu {
  position: relative;
  display: inline-block;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 24px;
  width: 30px;
  cursor: pointer;
}

.hamburger-icon span {
  width: 100%;
  height: 2px;
  background-color: black;
  transition: all 0.3s ease-in-out;
}

.menu-links {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  width: fit-content;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
  z-index: 101;
}

.menu-links a {
  display: block;
  padding: 10px;
  text-align: center;
  font-size: 1.5rem;
  color: black;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
}

.menu-links li {
  list-style: none;
}

.menu-links.open {
  max-height: 300px;
}

.hamburger-icon.open span:first-child {
  transform: rotate(45deg) translate(10px, 5px);
}

.hamburger-icon.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-icon.open span:last-child {
  transform: rotate(-45deg) translate(10px, -5px);
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background-color: transparent;
}

footer p {
  text-align: center;
  color: rgb(85, 85, 85);
}

footer a {
  color: black;
  text-decoration: none;
  transition: all 300ms ease;
}

footer a:hover {
  color: grey;
}

.core-item {
  position: absolute;
  pointer-events: none;
  overflow: hidden;
  border-radius: 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.6s ease;
  transform-origin: center center;
  opacity: 1 !important;

  /* GPU acceleration for smooth performance */
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000px;
  perspective: 1000px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Modern responsive features */
  contain: layout style paint;
  content-visibility: auto;
  
  /* Prevent image overflow on any device */
  max-width: 100vw;
  max-height: 100vh;
}

.core-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
  opacity: 1 !important;
  
  /* Modern responsive image optimization */
  max-width: 100%;
  height: auto;
  min-height: 100%;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.core-item:hover {
  box-shadow: 0 20px 60px rgba(110, 0, 245, 0.3);
  z-index: 20;
}

.core-item:hover img {
  transform: scale(1.05);
}

.core-item.clickable-image {
  pointer-events: auto;
  isolation: isolate;
}

.core-item.clickable-image:hover {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  z-index: inherit;
}

.core-item.clickable-image:hover img {
  transform: scale(1.05);
}

.clickable-image.item-2 {
  transform: translateZ(0);
  backface-visibility: hidden;
}

.item-1 {
  /* Responsive sizing using viewport units */
  width: clamp(200px, 20vw, 280px);
  height: clamp(260px, 25vw, 360px);
  top: -10%;
  left: 13%;
  z-index: 3;
}

.item-2 {
  /* Responsive sizing using viewport units */
  width: clamp(280px, 31vw, 440px);
  height: clamp(300px, 33vw, 474px);
  top: 10%;
  right: 33%;
  z-index: 2;
  will-change: auto;
  contain: layout style paint;
}

.item-3.center-image {
  /* Responsive sizing using viewport units */
  width: clamp(260px, 27vw, 380px);
  height: clamp(340px, 35vw, 500px);
  top: 67%;
  left: 21%;
  transform: translateY(-50%);
  z-index: 10;
}

.item-3.center-image:hover {
  transform: translateY(-50%) scale(1.4);
}

.item-4 {
  /* Responsive sizing using viewport units */
  width: clamp(190px, 18.5vw, 260px);
  height: clamp(250px, 24vw, 340px);
  bottom: 22%;
  left: 2%;
  z-index: 4;
}

.item-5 {
  /* Responsive sizing using viewport units */
  width: clamp(210px, 21vw, 300px);
  height: clamp(280px, 28vw, 400px);
  bottom: 25%;
  right: 1%;
  z-index: 3;
}

.item-6 {
  /* Responsive sizing using viewport units */
  width: clamp(180px, 17vw, 240px);
  height: clamp(230px, 22vw, 310px);
  bottom: 6%;
  left: 58%;
  z-index: 2;
}

.item-7 {
  /* Responsive sizing using viewport units */
  width: clamp(170px, 15.5vw, 220px);
  height: clamp(220px, 20.5vw, 290px);
  top: -5%;
  left: 90%;
  transform: translateX(-50%);
  z-index: 3;
}

.item-8 {
  /* Responsive sizing using viewport units */
  width: clamp(200px, 20vw, 280px);
  height: clamp(260px, 25vw, 360px);
  bottom: 2%;
  right: 20%;
  z-index: 4;
}

body.dark-mode {
  background-color: #000000;
  color: #e0e0e0;
}

body.dark-mode .dark-mode-btn {
  color: #ffffff;
}

body.dark-mode .dark-mode-btn:hover {
  background: transparent;
  color: #ffffff;

  cursor: none !important;
  animation: pulse 0.8s ease;
}

body.dark-mode .logo,
body.dark-mode .logo a,
body.dark-mode .home-link {
  color: #e0e0e0;
}

body.dark-mode .home-link:hover {
  color: #bb86fc;
  text-decoration-color: #d0a6ff;
  animation: bounce 0.6s ease;
}

body.dark-mode .hamburger-icon span {
  background-color: #e0e0e0;
}

body.dark-mode .menu-links {
  background-color: #1e1e1e;
}

body.dark-mode .menu-links a {
  color: #e0e0e0;
}

body.dark-mode .core-item {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

body.dark-mode .core-item:hover {
  box-shadow: 0 20px 60px rgba(187, 134, 252, 0.3);
}

body.dark-mode .core-item.clickable-image:hover {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

body.dark-mode footer {
  background-color: transparent;
  color: #e0e0e0;
}

body.dark-mode footer p {
  color: #b0b0b0;
}

body.dark-mode footer a {
  color: #bb86fc;
}

body.dark-mode footer a:hover {
  color: #d0a6ff;
}

@media screen and (min-width: 769px) and (max-width: 1200px) {

  .logo {
    font-size: 1.5rem;
    top: 1.5rem;
    left: 1.5rem;
  }

  .home-link {
    font-size: 1.2rem;
    top: 1.5rem;
    right: 1.5rem;
    padding: 0.4rem 0.8rem;
  }

  .dark-mode-btn {
    font-size: 0.8rem;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.4rem 0.8rem;
  }

  .item-1 {
    width: 18vw;
    height: 24vw;
    top: 5%;
    left: 8%;
  }

  .item-2 {
    width: 22vw;
    height: 28vw;
    top: 22%;
    right: 15%;
  }

  .item-3.center-image {
    width: 25vw;
    height: 32vw;
    top: 50%;
    left: 15%;
    transform: translateY(-50%);
  }

  .item-3.center-image:hover {
    transform: translateY(-50%) scale(1.2);
  }

  .item-4 {
    width: 16vw;
    height: 22vw;
    bottom: 2%;
    left: 1%;
  }

  .item-5 {
    width: 18vw;
    height: 24vw;
    bottom: 8%;
    right: 8%;
  }

  .item-6 {
    width: 10vw;
    height: 14vw;
    bottom: 18%;
    left: 55%;
  }

  .item-7 {
    width: 14vw;
    height: 18vw;
    top: 2%;
    left: 55%;
    transform: translateX(-50%);
  }
}

@media screen and (max-width: 768px) {

  .core-item {
    position: absolute !important;
    z-index: 5;
    will-change: transform;
    pointer-events: none;

    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  .page-section {
    overflow: visible !important;
    -webkit-overflow-scrolling: touch;

    position: relative;
  }

  .logo {
    font-size: 1.2rem;
    top: 1rem;
    left: 1rem;
    padding: 0;
    margin: 0;
    line-height: 1;
  }

  .home-link {
    font-size: 1rem;
    top: 1rem;
    right: 1rem;
    padding: 0.3rem 0.6rem;
  }

  .dark-mode-btn {
    font-size: 0.75rem;
    bottom: 1rem;
    right: 1rem;
    padding: 0.3rem 0;
    line-height: 1;
  }

  .page-counter {
    font-size: 0.75rem;
    bottom: 1rem;
    left: 1rem;
    padding: 0.3rem 0;
    line-height: 1;
  }

  .page-title {
    font-size: 1.2rem;
    top: 1rem;
    left: 1rem;
    letter-spacing: 4px;
    padding: 0;
    margin: 0;
    line-height: 1;
  }

  .item-1 {
    width: 32vw;
    height: 42vw;
    top: 2%;
    left: 2%;
  }

  .item-2 {
    width: 28vw;
    height: 35vw;
    top: 35%;
    right: 3%;
  }

  .item-3.center-image {
    width: 42vw;
    height: 55vw;
    top:31%;
    left: 8%;
  }

  .item-4 {
    width: 23vw;
    height: 32vw;
    bottom: 5%;
    left: -5%;
  }

  .item-5 {
    width: 23vw;
    height: 30vw;
    bottom: 26%;
    right: 3%;
  }

  .item-6 {
    width: 27vw;
    height: 35vw;
    bottom: 23%;
    left: 35%;
  }

  .item-7 {
    width: 25vw;
    height: 32vw;
    top: 12%;
    left: 37.5%;
  }

  footer {
    height: 8vh;
  }
}

@supports (-webkit-touch-callout: none) {
  @media screen and (max-width: 768px) {

    .item-1 {
      top: 3%;
      left: 1%;
    }

    .item-7 {
      top: 15%;
      width: 22vw;
      height: 28vw;
    }

    .item-4 {
      bottom: 18%;
      left: 0%;
    }

    .item-6 {
      bottom: 12%;
      left: 38%;
    }

    .item-3.center-image {
      top: 30%;
      left: 6%;
    }
  }
}

@supports (-webkit-appearance: none) and (display: flex) {
  @media screen and (max-width: 768px) {
    .core-item {
      -webkit-transform: translateZ(0);
      transform: translateZ(0);
    }
  }
}

@supports not (-webkit-touch-callout: none) {
  @media screen and (max-width: 768px) {

    .item-1 {
      width: 30vw;
      height: 39vw;
      top: 3%;
      left: 3%;
      z-index: 3;
    }

    .item-7 {
      width: 23vw;
      height: 30vw;
      top: 14%;
      left: 38%;
      z-index: 5;
    }

    .item-3.center-image {
      width: 40vw;
      height: 52vw;
      top: 32%;
      left: 9%;
      z-index: 6;
    }

    .item-4 {
      width: 22vw;
      height: 30vw;
      bottom: 6%;
      left: -3%;
      z-index: 2;
    }

    .item-6 {
      width: 26vw;
      height: 34vw;
      bottom: 24%;
      left: 36%;
      z-index: 4;
    }

    .item-2 {
      width: 27vw;
      height: 34vw;
      top: 36%;
      right: 4%;
      z-index: 5;
    }

    .item-5 {
      width: 22vw;
      height: 29vw;
      bottom: 27%;
      right: 4%;
      z-index: 3;
    }
  }
}

@media screen and (max-width: 480px) {

  .core-container {
    gap: 1rem;
    padding: 4rem 0.5rem 1.5rem;
  }

  .logo {
    font-size: 1rem;
    top: 0.8rem;
    left: 0.8rem;
    padding: 0;
    margin: 0;
    line-height: 1;
  }

  .home-link {
    font-size: 0.9rem;
    top: 0.8rem;
    right: 0.8rem;
    padding: 0.2rem 0.5rem;
  }

  .dark-mode-btn {
    font-size: 0.7rem;
    bottom: 0.8rem;
    right: 0.8rem;
    padding: 0.2rem 0;
    line-height: 1;
  }

  .page-counter {
    font-size: 0.7rem;
    bottom: 0.8rem;
    left: 0.8rem;
    padding: 0.2rem 0;
    line-height: 1;
  }

  .page-title {
    font-size: 1rem;
    top: 0.8rem;
    left: 0.8rem;
    letter-spacing: 3px;
    padding: 0;
    margin: 0;
    line-height: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Separate animation for centered item-7 to preserve translateX */
@keyframes fadeInUpCentered {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.core-item {
  animation: fadeInUp 0.8s ease-out forwards;
}

.item-1 { animation-delay: 0.1s; }
.item-2 { animation-delay: 0.2s; }
.item-3 { animation-delay: 0.3s; }
.item-4 { animation-delay: 0.4s; }
.item-5 { animation-delay: 0.5s; }
.item-6 { animation-delay: 0.6s; }

/* Only use centered animation on desktop where item-7 is centered */
.item-7 { 
  animation: fadeInUpCentered 0.8s ease-out forwards;
  animation-delay: 0.7s; 
}

/* On mobile grid, item-7 uses normal animation */
@media screen and (max-width: 768px) {
  .item-7 {
    animation: fadeInUp 0.8s ease-out forwards !important;
  }
}

.logo,
.home-button {
  animation: fadeInUp 0.8s ease-out 0.2s forwards;
  opacity: 0;
}

#custom-cursor {
  width: 20px;
  height: 20px;
  border: 2px solid #000000 !important;
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s;
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse), (max-width: 768px) {
  #custom-cursor {
    display: none !important;
  }
}

body.dark-mode #custom-cursor {
  border-color: #bb86fc !important;
}

@media (hover: hover) and (pointer: fine) {

  *,
  *::before,
  *::after {
    cursor: none !important;
  }

  html,
  body,
  div,
  span,
  p,
  a,
  img,
  button,
  input,
  textarea,
  select,
  label,
  section,
  article,
  header,
  footer,
  nav,
  main {
    cursor: none !important;
  }

  a:hover,
  a:active,
  a:focus,
  a:visited,
  button:hover,
  button:active,
  button:focus,
  input:hover,
  input:active,
  input:focus,
  textarea:hover,
  textarea:active,
  textarea:focus,
  select:hover,
  select:active,
  select:focus,
  [onclick]:hover,
  [role="button"]:hover,
  [tabindex]:hover {
    cursor: none !important;
  }

  [draggable],
  [draggable="true"],
  ::-webkit-scrollbar,
  ::-webkit-scrollbar-thumb,
  ::-webkit-scrollbar-track,
  ::selection {
    cursor: none !important;
  }

  *:hover,
  *:active,
  *:focus,
  *:focus-visible,
  *:focus-within {
    cursor: none !important;
  }
}

/* ============================================
   RESPONSIVE IMAGE BREAKPOINTS
   Modern, fluid scaling for all devices
   ============================================ */

/* Extra large screens (1920px+) */
@media screen and (min-width: 1920px) {
  .core-item {
    /* Scale up slightly for large monitors */
    transform: scale(1.1) translate3d(0, 0, 0);
  }
}

/* Large screens (1400px - 1920px) - Default sizing works well */

/* Medium screens (1024px - 1400px) */
@media screen and (max-width: 1400px) {
  .item-1 { width: clamp(180px, 18vw, 250px); height: clamp(230px, 23vw, 320px); }
  .item-2 { width: clamp(260px, 28vw, 400px); height: clamp(280px, 30vw, 430px); }
  .item-3.center-image { width: clamp(240px, 25vw, 350px); height: clamp(310px, 32vw, 460px); }
  .item-4 { width: clamp(170px, 17vw, 230px); height: clamp(220px, 22vw, 300px); }
  .item-5 { width: clamp(190px, 19vw, 270px); height: clamp(250px, 25vw, 360px); }
  .item-6 { width: clamp(160px, 15vw, 210px); height: clamp(200px, 20vw, 270px); }
  .item-7 { width: clamp(150px, 14vw, 200px); height: clamp(190px, 19vw, 260px); }
}

/* Tablet landscape (900px - 1024px) */
@media screen and (max-width: 1024px) {
  .item-1 { width: clamp(160px, 22vw, 220px); height: clamp(210px, 28vw, 290px); }
  .item-2 { width: clamp(240px, 35vw, 360px); height: clamp(260px, 38vw, 390px); }
  .item-3.center-image { width: clamp(220px, 32vw, 320px); height: clamp(280px, 40vw, 420px); }
  .item-4 { width: clamp(150px, 20vw, 200px); height: clamp(200px, 26vw, 270px); }
  .item-5 { width: clamp(170px, 24vw, 240px); height: clamp(220px, 30vw, 320px); }
  .item-6 { width: clamp(140px, 18vw, 190px); height: clamp(180px, 24vw, 240px); }
  .item-7 { width: clamp(130px, 17vw, 180px); height: clamp(170px, 22vw, 230px); }
}

/* Small devices (600px - 768px) - Optimized viewport-based layout */
/* ============================================
   MOBILE/TABLET LAYOUT - CSS GRID APPROACH
   Smart, maintainable, works on all devices
   ============================================ */

/* Tablets and larger phones (600px - 768px) */
@media screen and (max-width: 768px) {
  .core-container {
    position: relative !important;
    height: auto !important;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 7rem 1.5rem 2rem;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-content: start;
  }
  
  .core-item {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 130% !important; /* 1:1.3 aspect ratio */
    top: unset !important;
    left: unset !important;
    right: unset !important;
    bottom: unset !important;
    transform: none !important;
    overflow: hidden;
  }
  
  .core-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  /* Center image takes full width */
  .item-3.center-image {
    grid-column: 1 / -1;
    padding-bottom: 75% !important; /* Wider aspect ratio for hero */
    transform: none !important;
  }
}

/* Small phones (400px - 600px) */
@media screen and (max-width: 600px) {
  .core-container {
    padding: 6rem 1rem 1.5rem;
    gap: 1rem;
    grid-template-columns: repeat(2, 1fr);
  }
  
  .core-item {
    padding-bottom: 135% !important;
  }
  
  .item-3.center-image {
    padding-bottom: 80% !important;
  }
}

/* Tiny phones (< 400px) */
@media screen and (max-width: 400px) {
  .core-container {
    padding: 5rem 0.75rem 1rem;
    gap: 0.75rem;
    grid-template-columns: 1fr; /* Single column on very small screens */
  }
  
  .core-item {
    padding-bottom: 125% !important;
  }
  
  .item-3.center-image {
    padding-bottom: 75% !important;
  }
}

/* Extra small devices (< 600px) - Even smaller, perfectly spaced */
@media screen and (max-width: 600px) {
  .core-container {
    height: 100vh;
    overflow: hidden;
  }
  
  /* Top row - 2 images */
  .item-1 { 
    width: 26vw; 
    height: 34vw; 
    top: 2%; 
    left: 8%; 
    z-index: 3;
  }
  
  .item-2 { 
    width: 26vw; 
    height: 34vw; 
    top: 10%; 
    right: 8%; 
    z-index: 3;
  }
  
  /* Center - Hero image */
  .item-3.center-image { 
    width: 36vw; 
    height: 46vw; 
    top: 30%; 
    left: 30%;
    transform: translate(-50%, -50%);
    z-index: 5;
  }
  
  /* Middle row - 2 images */
  .item-4 { 
    width: 24vw; 
    height: 32vw; 
    top: 48%; 
    left: 4%; 
    z-index: 2;
  }
  
  .item-5 { 
    width: 24vw; 
    height: 32vw; 
    top: 58%; 
    right: 10%; 
    z-index: 2;
  }
  
  /* Bottom row - 3 images */
  .item-6 { 
    width: 20vw; 
    height: 26vw; 
    bottom: 16%; 
    left: 10%; 
    z-index: 4;
  }
  
  .item-7 { 
    width: 20vw; 
    height: 26vw; 
    bottom: 10%; 
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
  }
}

/* Tiny devices (< 400px) - Ultra compact layout */
@media screen and (max-width: 400px) {
  .core-container {
    height: 100vh;
    overflow: hidden;
  }
  
  /* Top row - 2 smaller images */
  .item-1 { 
    width: 24vw; 
    height: 32vw; 
    top: 12%; 
    left: 10%; 
  }
  
  .item-2 { 
    width: 24vw; 
    height: 32vw; 
    top: 12%; 
    right: 10%; 
  }
  
  /* Center hero - slightly smaller */
  .item-3.center-image { 
    width: 34vw; 
    height: 44vw; 
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%);
  }
  
  /* Middle row */
  .item-4 { 
    width: 22vw; 
    height: 29vw; 
    top: 47%; 
    left: 5%; 
  }
  
  .item-5 { 
    width: 22vw; 
    height: 29vw; 
    top: 47%; 
    right: 5%; 
  }
  
  /* Bottom row - 3 tiny images */
  .item-6 { 
    width: 18vw; 
    height: 24vw; 
    bottom: 8%; 
    left: 12%; 
  }
  
  .item-7 { 
    width: 18vw; 
    height: 24vw; 
    bottom: 8%; 
    left: 50%;
    transform: translateX(-50%);
  }
}
