@import url("https://fonts.googleapis.com/css2?family=Google+Sans+Flex:opsz,wght@6..144,1..1000&display=swap");

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

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  pointer-events: none;
}

.works-item img,
.social-icon img,
.lightbox-img {
  pointer-events: auto;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Google Sans Flex", -apple-system, BlinkMacSystemFont, system-ui,
    sans-serif;
  font-optical-sizing: auto;
  font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0;
  line-height: 1.6;
  color: #333;
  background-color: #fafafa;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  transition: background 0.4s ease, box-shadow 0.4s ease,
    backdrop-filter 0.4s ease;
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 2px;
  transition: color 0.4s ease, opacity 0.4s ease;
  opacity: 0;
  pointer-events: none;
}

.header.scrolled .logo {
  color: #333;
  opacity: 1;
  pointer-events: auto;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 40px;
}

.nav-links a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.4s ease;
  position: relative;
}

.header.scrolled .nav-links a {
  color: #555;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: #fff;
  transition: width 0.3s ease, background 0.4s ease;
}

.header.scrolled .nav-links a::after {
  background: #333;
}

.nav-links a:hover {
  color: #fff;
}

.header.scrolled .nav-links a:hover {
  color: #000;
}

.nav-links a:hover::after {
  width: 100%;
}

.hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-image: url("assets/20.webp");
}

@media (max-aspect-ratio: 1/1) {
  .hero-bg {
    background-image: url("assets/21.webp");
  }
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.5) 100%
  );
  z-index: 1;
}

.hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  z-index: 2;
}

.hero-content h1 {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 4px;
  margin-bottom: 20px;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 1s ease-out;
}

.hero-content p {
  font-size: 1.3rem;
  margin-bottom: 40px;
  opacity: 0.9;
  animation: fadeInUp 1s ease-out 0.2s backwards;
}

.cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: white;
  color: #333;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 50px;
  transition: all 0.3s ease;
  animation: fadeInUp 1s ease-out 0.4s backwards;
}

.cta-button:hover {
  background: #333;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.social-icons {
  display: flex;
  gap: 20px;
  justify-content: center;
  animation: fadeInUp 1s ease-out 0.4s backwards;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-icon:hover {
  background: white;
  color: #333;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.social-icon img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
  transition: filter 0.3s ease;
}

.social-icon:hover img {
  filter: brightness(0);
}

.social-icon-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.social-icon.expandable {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.4);
  outline: none;
  font-family: inherit;
}

.social-text {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  transform-origin: top center;
  margin-top: 10px;
  white-space: nowrap;
  font-size: 0.9rem;
  color: white;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 10px 16px 10px 20px;
  border-radius: 25px;
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.social-icon-wrapper.expanded .social-text {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

.social-text-content {
  margin-right: 8px;
}

.copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.copy-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.copy-btn img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

.copy-btn.copied {
  opacity: 1;
}

.social-icon-wrapper.expanded .social-icon {
  background: white;
}

.social-icon-wrapper.expanded .social-icon img {
  filter: brightness(0);
}

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

.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: white;
  z-index: 2;
  animation: bounce 2s infinite;
}

.scroll-hint span {
  font-size: 0.85rem;
  letter-spacing: 2px;
  opacity: 0.8;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(45deg);
  margin: 10px auto 0;
  opacity: 0.8;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 60px;
  position: relative;
  color: #222;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: #333;
}

.works {
  padding: 120px 0;
  background: #f5f5f5;
}

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

.works .section-title {
  color: #222;
  margin-bottom: 50px;
}

.works-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.works-item {
  height: 280px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.works-item:hover {
  transform: translateY(-5px);
}

.works-item img {
  height: 100%;
  width: auto;
  display: block;
  transition: transform 0.4s ease;
}

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

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  touch-action: pan-y pinch-zoom;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: calc(100% - 160px);
  height: 90vh;
  position: relative;
  display: flex;
  touch-action: none;
  justify-content: center;
  align-items: center;
}

.lightbox-img {
  max-width: calc(100vw - 160px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0);
  opacity: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.lightbox-img.current {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.lightbox-img.slide-out-left {
  opacity: 0;
  transform: translate(-50%, -50%) translateX(-100px);
}

.lightbox-img.slide-out-right {
  opacity: 0;
  transform: translate(-50%, -50%) translateX(100px);
}

.lightbox-img.slide-in-left {
  animation: slideInFromRight 0.4s ease forwards;
}

.lightbox-img.slide-in-right {
  animation: slideInFromLeft 0.4s ease forwards;
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) translateX(100px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) translateX(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) translateX(0);
  }
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  z-index: 2000;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-close img {
  width: 20px;
  height: 20px;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.8rem;
  cursor: pointer;
  color: white;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.lightbox-nav img {
  width: 16px;
  height: 16px;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-prev img {
  transform: rotate(180deg);
}

.lightbox-next {
  right: 20px;
}

.footer {
  padding: 40px 0;
  background: #222;
  color: #999;
  text-align: center;
}

.footer p {
  font-size: 0.9rem;
}

@media (max-width: 992px) {
  .works-item {
    height: 220px;
  }
}

@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .nav-links {
    display: none;
  }

  .section-title {
    font-size: 2rem;
  }

  .works-item {
    height: 150px;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }

  .lightbox-close {
    width: 40px;
    height: 40px;
  }

  .lightbox-close img {
    width: 16px;
    height: 16px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-content {
    max-width: calc(100% - 120px);
  }

  .lightbox-img {
    max-width: calc(100vw - 120px);
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 2rem;
  }

  .cta-button {
    padding: 12px 30px;
    font-size: 0.9rem;
  }

  .works {
    padding: 80px 0;
  }
}
