/* assets/css/main.css */

/* Hero Section */
.hero {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #000000;
}

.hero .background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero .content {
  text-align: center;
  z-index: 1;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero .logoContainer {
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

.hero .star {
  position: absolute;
  top: 10px;
  left: -10px;
  width: 48px;
  height: 48px;
  animation: twinkle 3s infinite ease-in-out;
  z-index: 2;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(0.3);
  }
}

.hero .logo {
  object-fit: contain;
  filter: invert(1);
}

.hero .sloganEnglish {
  font-family: var(--font-main);
  font-size: 1.5rem;
  font-weight: 400;
  font-style: italic;
  color: #ffffff;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero .sloganKorean {
  font-family: var(--font-main);
  font-size: 1.5rem;
  font-weight: 400;
  font-style: italic;
  color: #ffffff;
  letter-spacing: -0.02em;
}

@media (max-width: 768px) {
  .hero .sloganEnglish,
  .hero .sloganKorean {
    font-size: 1.8rem;
  }
}

@media (max-width: 400px) {
  .hero .sloganEnglish,
  .hero .sloganKorean {
    font-size: 1.4rem;
    line-height: 1.3;
  }
}

/* About Section */
.about {
  padding: 8rem 0;
  background-color: #efefef;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.about .container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: center;
}

.about .content {
  max-width: 800px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.about .logoContainer {
  margin-bottom: 2rem;
}

.about .logo {
  width: 200px;
  height: auto;
  object-fit: contain;
}

.about .heading {
  font-family: var(--font-main);
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 3rem;
  line-height: 1.2;
  color: #000000;
  text-transform: uppercase;
}

.about .paragraph {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  color: #000000;
}

.about .paragraph:last-child {
  margin-bottom: 0;
}

.about .brandName {
  font-size: 1.2rem;
  font-weight: 800;
  display: inline-block;
  margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .about .heading {
    font-size: 1.8rem;
  }
  .about .paragraph {
    font-size: 1rem;
  }
}

@media (max-width: 450px) {
  .about .container {
    padding: 0 1rem;
  }
  .about .heading {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    word-break: keep-all;
  }
}

/* About: 낮은 높이에서 상단 빈칸 축소 */
@media (max-height: 900px) {
  .about {
    padding: 4rem 0;
  }
  .about .heading {
    margin-bottom: 2rem;
  }
  .about .logoContainer {
    margin-bottom: 1.5rem;
  }
  .about .paragraph {
    margin-bottom: 1.5rem;
  }
}

@media (max-height: 750px) {
  .about {
    padding: 2rem 0;
  }
  .about .heading {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }
  .about .logoContainer {
    margin-bottom: 1rem;
  }
  .about .logo {
    width: 160px;
  }
  .about .paragraph {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
}

@media (max-height: 600px) {
  .about {
    padding: 1rem 0;
  }
  .about .heading {
    font-size: 1.6rem;
    margin-bottom: 1rem;
  }
  .about .logoContainer {
    margin-bottom: 0.75rem;
  }
  .about .logo {
    width: 120px;
  }
  .about .paragraph {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
  }
  .about .brandName {
    font-size: 1rem;
  }
}

/* Business Scope Section */
.scope {
  padding: 8rem 0;
  background-color: #efefef;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.scope .container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.scope .heading {
  font-family: var(--font-main);
  font-size: 2rem; /* Match Works: 2rem */
  font-weight: 700;
  margin-bottom: 4rem; /* Match Works: 4rem */
  text-align: left; /* Left align */
  color: #000000;
  text-transform: none; /* Remove uppercase */
  letter-spacing: -0.02em;
}

.scope .grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.scope .card {
  padding: 2rem;
  border-radius: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Default (PC - 3 columns): Odd=Light, Even=Dark -> Checkerboard */
.scope .card:nth-child(odd) {
  background-color: #ffffff;
  color: #000000;
  border: 1px solid #e0e0e0;
}

.scope .card:nth-child(even) {
  background-color: #333;
  color: #ffffff;
  border: none;
}

.scope .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Mobile (2 columns): Checkerboard Pattern (L, D, D, L) */
@media (max-width: 768px) {
  /* Reset default styles first if needed, but specificity should handle it */

  /* Light: 1, 4, 5, 8... -> 4n+1, 4n+4 (or 4n) */
  .scope .card:nth-child(4n + 1),
  .scope .card:nth-child(4n) {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #e0e0e0;
  }

  /* Dark: 2, 3, 6, 7... -> 4n+2, 4n+3 */
  .scope .card:nth-child(4n + 2),
  .scope .card:nth-child(4n + 3) {
    background-color: #333;
    color: #ffffff;
    border: none;
  }
}

.scope .title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.scope .description {
  font-size: 0.9rem;
  line-height: 1.5;
  opacity: 0.8;
}

@media (max-width: 1024px) {
  .scope .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .scope {
    padding: 4rem 0; /* Reduce section padding */
  }
  .scope .heading {
    font-size: 1.8rem;
    margin-bottom: 2rem; /* Reduce heading margin */
  }
  .scope .grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
    gap: 0.5rem; /* Tighter gap */
  }
  .scope .card {
    min-height: 90px; /* Reduced min-height */
    padding: 0.5rem; /* Reduced padding */
    text-align: center; /* Center text like Next.js */
    justify-content: center; /* Center content vertically */
    align-items: center; /* Center content horizontally */
  }
  .scope .title {
    font-size: 0.9rem; /* Smaller title */
    margin-bottom: 0.5rem;
  }
  .scope .description {
    font-size: 0.65rem; /* Smaller description */
    line-height: 1.3;
  }
  .scope .container {
    padding: 0 1rem; /* Reduce container padding */
  }
}

/* Business Scope: 낮은 높이에서 상단 빈칸 축소 */
@media (max-height: 900px) {
  .scope {
    padding: 4rem 0;
  }
  .scope .heading {
    margin-bottom: 2rem;
  }
  .scope .grid {
    gap: 1rem;
  }
  .scope .card {
    min-height: 150px;
  }
}

@media (max-height: 750px) {
  .scope {
    padding: 2rem 0;
  }
  .scope .heading {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
  }
  .scope .grid {
    gap: 0.75rem;
  }
  .scope .card {
    min-height: 120px;
    padding: 1.2rem;
  }
  .scope .title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  .scope .description {
    font-size: 0.8rem;
    line-height: 1.3;
  }
}

@media (max-height: 600px) {
  .scope {
    padding: 1rem 0;
  }
  .scope .heading {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }
  .scope .grid {
    gap: 0.5rem;
  }
  .scope .card {
    min-height: 100px;
    padding: 0.75rem;
  }
  .scope .title {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }
  .scope .description {
    font-size: 0.7rem;
    line-height: 1.25;
  }
}

/* Works Section */
.works {
  padding: 8rem 0;
  background-color: #efefef;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.works .container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Works Section Updates */
/* Works Section Updates */
.works .heading {
  font-family: var(--font-main);
  font-size: 2rem; /* Next.js: 2rem */
  font-weight: 700;
  margin-bottom: 4rem; /* Next.js: 4rem */
  text-align: left;
  color: #000000;
  text-transform: none;
  padding-left: 0.5rem;
  letter-spacing: -0.02em; /* Next.js */
}

.works .sliderWrapper {
  position: relative;
  width: 100%;
  /* Removed display: flex and gap to prevent buttons from taking space */
}

.works .carouselContainer {
  overflow: hidden;
  width: 100%;
  touch-action: pan-y pinch-zoom;
}

.works .carouselTrack {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  width: 100%;
}

.works .carouselPage {
  min-width: 100%;
  padding: 0 0.5rem;
}

.works .grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.works .card {
  position: relative;
  /* aspect-ratio removed here, handled in imageWrapper */
  cursor: pointer;
  overflow: hidden;
  background-color: #ddd;
}

.works .imageWrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  margin-bottom: 0;
  background-color: #fff;
}

.works .image {
  object-fit: cover;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}

.works .card:hover .image {
  transform: scale(1.05);
}

.works .titleOverlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.works .title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 1rem;
  text-shadow: none;
}

.works .navButton {
  position: absolute; /* Changed to absolute */
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #000000;
  padding: 0; /* Reset padding */
  width: 30px; /* Fixed width */
  height: 60px; /* Fixed height */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.works .prevButton {
  left: -60px; /* Position outside */
}

.works .nextButton {
  right: -60px; /* Position outside */
}

.works .navButton:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

/* Responsive adjustments for buttons */
@media (max-width: 1600px) {
  .works .sliderWrapper {
    padding: 0 40px; /* Add padding to wrapper to prevent overlap if screen is smaller */
  }
  .works .prevButton {
    left: 0;
  }
  .works .nextButton {
    right: 0;
  }
}

.works .pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.works .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ccc;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.3s ease;
}

.works .dot.dotActive {
  background-color: #000000;
}

@media (max-width: 1024px) {
  .works .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .works {
    padding: 4rem 0; /* Reduce section padding */
  }
  .works .heading {
    font-size: 1.8rem;
    margin-bottom: 2rem; /* Reduce heading margin */
  }
  .works .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .works .navButton {
    display: flex;
    width: 18px;
    height: 36px;
  }
  .works .navButton svg {
    width: 100%;
    height: 100%;
  }
  .works .sliderWrapper {
    padding: 0 20px; /* Reduced padding for smaller buttons */
  }
  .works .container {
    padding: 0 1rem; /* Reduce container padding */
  }
}

/* Works: 낮은 높이에서 상단 빈칸 축소 */
@media (max-height: 900px) {
  .works {
    padding: 4rem 0;
  }
  .works .heading {
    margin-bottom: 2rem;
  }
  .works .grid {
    gap: 1.5rem;
  }
}

@media (max-height: 750px) {
  .works {
    padding: 2rem 0;
  }
  .works .heading {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
  }
  .works .grid {
    gap: 1rem;
  }
  .works .imageWrapper {
    aspect-ratio: 3 / 1.8;
  }
  .works .title {
    font-size: 0.9rem;
  }
  .works .pagination {
    margin-top: 1rem;
  }
}

@media (max-height: 600px) {
  .works {
    padding: 1rem 0;
  }
  .works .heading {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }
  .works .grid {
    gap: 0.75rem;
  }
  .works .imageWrapper {
    aspect-ratio: 3 / 1.6;
  }
  .works .title {
    font-size: 0.8rem;
  }
  .works .titleOverlay {
    padding: 0.5rem;
  }
  .works .pagination {
    margin-top: 0.5rem;
  }
}

/* Contact Section */
.contact {
  padding: 0;
  box-sizing: border-box;
  background-color: #efefef;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.contact .contactWrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0 1rem;
  min-height: 0;
}

.contact .container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.contact .heading {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  color: var(--text-white);
  flex-shrink: 0;
}

.contact .content {
  display: flex;
  width: 100%;
  max-width: 150vh;
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  gap: 4rem;
  align-items: center;
  justify-content: center;
}

.contact .mapContainer {
  flex: 1.2;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  align-self: stretch;
  justify-content: center;
}

.contact .mapWrapper {
  width: 100%;
  flex: none;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background-color: transparent;
  height: 80%;
  max-height: 80%;
}

.contact .mapImage {
  border-radius: 8px;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.contact .infoContainer {
  flex: 1;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  justify-content: center;
}

.contact .companyName {
  font-size: 1.8rem;
  font-weight: 700;
  color: #000;
  margin-bottom: 0.5rem;
}

.contact .infoItem {
  display: flex;
  align-items: baseline;
  gap: 2rem;
}

.contact .label {
  font-size: 1.2rem;
  font-weight: 800;
  color: #000;
  min-width: 80px;
}

.contact .value {
  font-size: 1.1rem;
  color: #333;
  font-weight: 400;
}

@media (max-width: 1024px) {
  .contact .content {
    flex-direction: column;
    gap: 3rem;
  }

  .contact .mapContainer,
  .contact .infoContainer {
    max-width: 100%;
    width: 100%;
  }
}

/* Short Screen Optimization */
@media (max-height: 800px) {
  .contact {
    padding-top: 1.5rem;
  }

  .contact .contactWrapper {
    min-height: 0;
  }

  .contact .heading {
    margin-bottom: 1.25rem;
    font-size: 1.8rem;
  }

  .contact .content {
    flex-direction: row !important;
    gap: 2.5rem;
    max-width: 160vh;
  }

  .contact .mapContainer {
    flex: 0 0 45%;
    width: 45%;
    max-width: 45%;
  }

  .contact .mapWrapper {
    height: 80%;
    max-height: none;
  }

  .contact .companyName {
    font-size: 1.5rem;
  }

  .contact .infoItem {
    gap: 1.5rem;
  }

  .contact .label,
  .contact .value {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .contact {
    display: flex;
    flex-direction: column;
    min-height: auto;
    justify-content: space-between;
  }

  .contact .contactWrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
  }

  .contact .container {
    margin: 0 auto;
    padding: 0 2rem;
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  .contact .heading {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    flex: none;
  }

  .contact .content {
    flex-direction: column !important;
    gap: 1rem !important;
    max-width: 100%;
    height: auto;
    display: flex;
    flex: 0 1 auto;
    justify-content: flex-start;
  }

  .contact .mapContainer {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 0;
  }

  .contact .mapWrapper {
    aspect-ratio: unset;
    height: 40vh;
    margin: 0 auto;
    width: 100%;
  }

  .contact .infoContainer {
    flex: none;
    width: 100%;
    max-width: 100%;
    align-items: flex-start;
    padding: 0;
    gap: 0.2rem;
    margin-bottom: 0;
  }

  .contact .companyName {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }

  .contact .infoItem {
    flex-direction: row;
    gap: 0.5rem;
    align-items: baseline;
    margin-bottom: 0.2rem;
  }

  .contact .label {
    min-width: 45px;
    margin-bottom: 0;
    font-size: 0.7rem;
    font-weight: 800;
  }

  .contact .value {
    font-size: 0.7rem;
    word-break: keep-all;
    flex: 1;
  }
}

@media (max-height: 700px) and (max-width: 768px) {
  .contact {
    justify-content: flex-start;
  }
  .contact .contactWrapper {
    padding: 2rem 0;
  }
  .contact .container {
    justify-content: flex-start;
  }
  .contact .mapWrapper {
    aspect-ratio: unset;
    height: 45vh;
  }
}

/* Contact: 낮은 높이에서 본문+푸터가 한 화면에 보이도록 */
@media (max-height: 900px) {
  .contact .contactWrapper {
    min-height: 0;
    padding: 1.5rem 0;
    align-items: flex-start;
  }
  .contact .heading {
    margin-bottom: 1.25rem;
    font-size: 1.75rem;
  }
  .contact .content {
    gap: 2.5rem;
  }
  .contact .mapWrapper {
    max-height: none;
  }
  .contact .infoContainer {
    gap: 1.25rem;
  }
}

@media (max-height: 750px) {
  .contact .contactWrapper {
    padding: 1rem 0;
  }
  .contact .heading {
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
  }
  .contact .content {
    gap: 1.5rem;
  }
  .contact .mapWrapper {
    max-height: none;
  }
  .contact .companyName {
    font-size: 1.4rem;
  }
  .contact .infoContainer {
    gap: 0.75rem;
  }
  .contact .label,
  .contact .value {
    font-size: 0.95rem;
  }
}

@media (max-height: 600px) {
  .contact {
    padding-top: 0.5rem;
  }
  .contact .contactWrapper {
    padding: 0.5rem 0;
  }
  .contact .heading {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
  }
  .contact .content {
    gap: 1rem;
  }
  .contact .mapWrapper {
    max-height: none;
  }
  .contact .companyName {
    font-size: 1.1rem;
  }
  .contact .infoContainer {
    gap: 0.5rem;
  }
  .contact .label,
  .contact .value {
    font-size: 0.85rem;
  }
}

/* Top Button */
.scrollTopBtn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: #000000;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scrollTopBtn.visible {
  opacity: 1;
  visibility: visible;
}

.scrollTopBtn:hover {
  transform: translateY(-5px);
  background-color: #333;
}

.scrollTopBtn svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .scrollTopBtn {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
  }
  .scrollTopBtn svg {
    width: 20px;
    height: 20px;
  }
}
