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

/* LOADER (unchanged) */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

.loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-content {
  color: #fff;
  font-size: 24px;
  font-weight: bold;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-content::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-top: 3px solid transparent;
  border-radius: 50%;
  margin-left: 10px;
  animation: spin 1s linear infinite;
}

/* Links (unchanged) */
a {
  color: chocolate;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

a:hover {
  color: white;
}

/* Body */
body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #393939;
  font-family: "Roboto Condensed", sans-serif;
}

/* Main container */
.container {
  background-color: #393939;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  padding: 10px 0;
}

/* Content wrapper */
.content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  padding: 0 1rem;
  gap: 1rem;
}

/* Square Image */
.square-image {
  flex-shrink: 0;
  width: 100%;
  max-width: calc(100vh - 20px); /* Base image width */
  max-height: calc(100vh - 20px);
  height: auto;
  object-fit: contain;
  display: block;
}

/* Text styling */
.text {
  font-family: "Roboto Condensed", sans-serif;
  font-optical-sizing: auto;
  font-weight: 200;
  font-style: normal;
  flex: 1;
  color: white;
  padding: 1rem;
  text-align: center;
  min-width: 0;
  max-width: 350px; /* Default max-width for larger screens */
}

.text h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.text p {
  font-size: 1.0rem;
}

/* Adjust text width when screen matches image width + 50px */
@media (max-width: calc(100vh + 30px)) {
  .text {
    max-width: calc(100vh + 30px); /* Image width + 50px */
  }
}

/* Responsive Behavior - Adjusted to stack faster */
@media (max-width: 1024px) { /* Changed from 768px to 1024px */
  .container {
    height: auto;
    padding: 10px;
  }

  .content {
    flex-direction: column; /* Stack vertically earlier */
    gap: 1rem;
    padding-top: 10px;
  }

  .square-image {
    width: 100%;
    height: auto;
    max-width: calc(100% - 2rem);
    max-height: calc(70vh - 20px);
    margin-top: 0;
  }

  .text {
    padding: 1rem;
    max-width: none; /* Full width when stacked */
  }

  .left-text {
    order: 1;
  }

  .square-image {
    order: 0;
  }

  .right-text {
    order: 2;
  }

  body {
    align-items: flex-start;
    padding-top: 10px;
  }
}