/* ============================================
   DIUDIUWANG — Illustrator Portfolio
   White background, black text, naive handwriting
   ============================================ */

@font-face {
  font-family: 'ChillZhuo';
  src: url('../fonts/ChillZhuo.woff2') format('woff2'),
       url('../fonts/ChillZhuo.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Gaegu', 'ChillZhuo', cursive;
  background: #fff;
  color: #000;
  line-height: 1.6;
  overflow-x: hidden;
  font-weight: 300;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---- Navigation ---- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 72px;
  transition: background 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.nav-brand {
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 2px;
  color: #000;
}

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

.nav-links a {
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 2px;
  color: rgba(0, 0, 0, 0.4);
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: #000;
  transition: width 0.3s;
}

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

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background: #000;
  transition: transform 0.3s;
}

/* ---- Hero ---- */

.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  overflow: hidden;
}

.hero-content {
  text-align: center;
}

.hero-title {
  font-size: clamp(48px, 10vw, 140px);
  font-weight: 400;
  letter-spacing: 6px;
  color: #000;
  line-height: 1.1;
  opacity: 0;
  animation: fadeUp 1.2s ease 0.3s forwards;
}

.hero-subtitle {
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 300;
  letter-spacing: 10px;
  color: rgba(0, 0, 0, 0.3);
  margin-top: 12px;
  opacity: 0;
  animation: fadeUp 1.2s ease 0.6s forwards;
}

.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  animation: fadeUp 1s ease 1s forwards;
}

.scroll-arrow {
  display: block;
  width: 16px;
  height: 16px;
  border-right: 1px solid rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  transform: rotate(45deg);
  animation: bounceDown 2.5s ease infinite;
}

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

@keyframes bounceDown {
  0%, 100% {
    transform: rotate(45deg) translateY(0);
  }
  50% {
    transform: rotate(45deg) translateY(6px);
  }
}

/* ---- Sections ---- */

.section {
  padding: 120px 48px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 400;
  letter-spacing: 4px;
  text-align: center;
  margin-bottom: 64px;
  color: #000;
}

.section-title::after {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: rgba(0, 0, 0, 0.2);
  margin: 16px auto 0;
}

/* ---- Carousel / Works ---- */

.carousel {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.carousel-slide {
  min-width: 100%;
  position: relative;
}

.carousel-slide img {
  width: 100%;
  display: block;
}

.carousel-caption {
  text-align: center;
  margin-top: 20px;
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 2px;
  color: rgba(0, 0, 0, 0.4);
}

.carousel-btn {
  position: absolute;
  top: calc(50% - 20px);
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 48px;
  color: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  padding: 8px 16px;
  line-height: 1;
  transition: color 0.3s;
  user-select: none;
}

.carousel-btn:hover {
  color: rgba(0, 0, 0, 0.6);
}

.carousel-prev {
  left: -60px;
}

.carousel-next {
  right: -60px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.dot.active {
  background: rgba(0, 0, 0, 0.6);
  transform: scale(1.3);
}

/* ---- About ---- */

.about-content {
  display: flex;
  gap: 64px;
  align-items: center;
}

.about-photo {
  flex: 0 0 40%;
  max-width: 400px;
}

.about-photo img {
  width: 100%;
  filter: grayscale(100%);
}

.about-text {
  flex: 1;
}

.about-text h3 {
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 3px;
  margin-bottom: 24px;
}

.about-text p {
  font-size: 20px;
  line-height: 2;
  color: rgba(0, 0, 0, 0.45);
  margin-bottom: 16px;
}

/* ---- Contact ---- */

.contact {
  text-align: center;
  max-width: none;
  padding: 120px 48px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.contact .section-title::after {
  background: rgba(0, 0, 0, 0.2);
}

.contact-desc {
  font-size: 20px;
  color: rgba(0, 0, 0, 0.35);
  letter-spacing: 1px;
  margin-bottom: 48px;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  max-width: 800px;
  margin: 0 auto;
}

.qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.qr-image {
  width: 160px;
  height: 160px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 12px;
  transition: transform 0.3s ease;
}

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

.qr-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-label {
  font-size: 18px;
  letter-spacing: 2px;
  color: rgba(0, 0, 0, 0.35);
}

.contact-email {
  margin-top: 48px;
  font-size: 20px;
  letter-spacing: 2px;
  color: rgba(0, 0, 0, 0.25);
}

/* ---- Footer ---- */

.footer {
  text-align: center;
  padding: 40px 48px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.back-to-top {
  display: inline-block;
  font-size: 20px;
  margin-bottom: 16px;
  color: rgba(0, 0, 0, 0.2);
  transition: color 0.3s;
}

.back-to-top:hover {
  color: #000;
}

.footer p {
  font-size: 16px;
  letter-spacing: 2px;
  color: rgba(0, 0, 0, 0.2);
}

/* ---- Lightbox ---- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  font-size: 32px;
  color: #000;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.3;
  transition: opacity 0.3s;
  line-height: 1;
}

.lightbox-close:hover {
  opacity: 0.8;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  color: #000;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.2;
  transition: opacity 0.3s;
  padding: 16px;
  line-height: 1;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 0.7;
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

/* ---- Fade-in animation ---- */

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
  .about-content {
    flex-direction: column;
    text-align: center;
  }

  .about-photo {
    flex: none;
    max-width: 300px;
    margin: 0 auto;
  }

  .qr-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding: 80px 24px;
  }

  .contact {
    padding: 80px 24px;
  }

  .nav {
    padding: 0 24px;
  }

  .carousel-prev {
    left: 8px;
  }

  .carousel-next {
    right: 8px;
  }

  .carousel-btn {
    font-size: 36px;
    color: rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }
}

@media (max-width: 600px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: #fff;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    transition: right 0.4s ease;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.05);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    font-size: 26px;
    color: #000 !important;
    letter-spacing: 4px;
  }

  .nav-toggle.open span:first-child {
    transform: rotate(45deg) translate(3px, 3px);
  }

  .nav-toggle.open span:last-child {
    transform: rotate(-45deg) translate(3px, -3px);
  }

  .qr-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .qr-image {
    width: 130px;
    height: 130px;
  }

  .hero-title {
    letter-spacing: 3px;
  }

  .section {
    padding: 64px 20px;
  }

  .contact {
    padding: 64px 20px;
  }
}
