/* ===================================================================
   Jack -- 3D Creator  |  Global Styles
   =================================================================== */

/* ===== GLOBAL RESET ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== BASE STYLES ===== */
html,
body,
#root {
  background-color: #0c0c0c;
  font-family: 'Kanit', sans-serif;
}

body {
  width: 100%;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== HERO HEADING GRADIENT TEXT ===== */
.hero-heading {
  background: linear-gradient(180deg, #646973 0%, #bbccd7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
  background-color: #0c0c0c;
  overflow-x: clip;
}

/* ===== SCROLLBAR (subtle) ===== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0c0c0c;
}
::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
}

img {
  user-select: none;
  -webkit-user-drag: none;
}

/* ===================================================================
   FADE-IN (initial state; JS adds .is-visible)
   =================================================================== */
.fade-in {
  opacity: 0;
  transform: translate3d(0, 0, 0);
  transition: opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: opacity, transform;
}
.fade-in.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ===================================================================
   BUTTONS
   =================================================================== */
.contact-btn {
  background: linear-gradient(123deg, #18011f 7%, #b600a8 37%, #7621b0 72%, #be4c00 100%);
  box-shadow: 0px 4px 4px rgba(181, 1, 167, 0.25), inset 4px 4px 12px #7721b1;
  outline: 2px solid #ffffff;
  outline-offset: -3px;
  border: none;
  cursor: pointer;
  border-radius: 9999px;
  color: #ffffff;
  font-family: inherit;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.75rem 2rem;
  font-size: 0.75rem;
  transition: opacity 0.2s ease;
}
.contact-btn:hover {
  opacity: 0.9;
}

.live-project-btn {
  border-radius: 9999px;
  border: 2px solid #d7e2ea;
  background: transparent;
  color: #d7e2ea;
  font-family: inherit;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  padding: 0.75rem 2rem;
  font-size: 0.875rem;
  transition: background-color 0.2s ease;
}
.live-project-btn:hover {
  background-color: rgba(215, 226, 234, 0.1);
}

/* ===================================================================
   1. HERO SECTION
   =================================================================== */
.hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-x: clip;
}

.nav-wrap {
  width: 100%;
}

.navbar {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0;
}

.nav-link {
  color: #d7e2ea;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.nav-link:hover {
  opacity: 0.7;
}

/* Hero Heading */
.hero-heading-wrap {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-section .hero-heading {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
  width: 100%;
  font-size: clamp(2rem, 14.3vw, 30rem);
  margin-top: 1.5rem;
  text-align: center;
}

/* Hero Portrait */
.hero-portrait {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: clamp(260px, 70vw, 360px);
}
.hero-portrait .fade-in {
  display: block;
}

.portrait-img {
  width: 100%;
}

/* Bottom bar */
.hero-bottom {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 1.5rem 1.75rem;
}

.hero-text {
  color: #d7e2ea;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.4;
  max-width: 160px;
  font-size: clamp(0.75rem, 1.4vw, 1.5rem);
}

/* ----- Responsive: HERO ----- */
@media (min-width: 640px) {
  .navbar {
    padding: 1.5rem 2.5rem 0;
  }
  .nav-link {
    font-size: 1.125rem;
  }
  .hero-section .hero-heading {
    margin-top: 1rem;
  }
  .hero-portrait {
    width: 420px;
  }
  .hero-bottom {
    padding: 0 2.5rem 2rem;
  }
  .hero-text {
    max-width: 220px;
  }
  .contact-btn {
    padding: 0.875rem 2.5rem;
    font-size: 0.875rem;
  }
}

@media (min-width: 768px) {
  .navbar {
    padding-top: 2rem;
  }
  .nav-link {
    font-size: 1.25rem;
  }
  .hero-section .hero-heading {
    margin-top: -1.25rem;
  }
  .hero-portrait {
    top: auto;
    transform: translateX(-50%);
    bottom: 0;
    width: 520px;
  }
  .hero-bottom {
    padding: 0 2.5rem 2.5rem;
  }
  .hero-text {
    max-width: 260px;
  }
  .contact-btn {
    padding: 1rem 3rem;
    font-size: 1rem;
  }
}

@media (min-width: 1024px) {
  .nav-link {
    font-size: 1.4rem;
  }
  .hero-section .hero-heading {
    margin-top: -1.5rem;
  }
  .hero-portrait {
    width: 640px;
  }
}

/* ===================================================================
   2. MARQUEE SECTION
   =================================================================== */
.marquee-section {
  background-color: #0c0c0c;
  padding: 6rem 0 2.5rem;
}

.marquee-rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.marquee-row-wrap {
  width: 100%;
  overflow: hidden;
}

.marquee-track {
  display: flex;
  gap: 0.75rem;
  will-change: transform;
}

.marquee-tile {
  width: 420px;
  height: 270px;
  border-radius: 1rem;
  object-fit: cover;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .marquee-section {
    padding-top: 8rem;
  }
}
@media (min-width: 768px) {
  .marquee-section {
    padding-top: 10rem;
  }
}

/* ===================================================================
   3. ABOUT SECTION
   =================================================================== */
.about-section {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.25rem;
}

/* Decorative 3D images */
.deco {
  position: absolute;
  z-index: 0;
}
.deco-img {
  width: 100%;
}

.deco-tl {
  top: 4%;
  left: 1%;
  width: 120px;
}
.deco-bl {
  bottom: 8%;
  left: 3%;
  width: 100px;
}
.deco-tr {
  top: 4%;
  right: 1%;
  width: 120px;
}
.deco-br {
  bottom: 8%;
  right: 3%;
  width: 130px;
}

@media (min-width: 640px) {
  .about-section {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  .deco-tl {
    left: 2%;
    width: 160px;
  }
  .deco-bl {
    left: 6%;
    width: 140px;
  }
  .deco-tr {
    right: 2%;
    width: 160px;
  }
  .deco-br {
    right: 6%;
    width: 170px;
  }
}

@media (min-width: 768px) {
  .about-section {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
  .deco-tl {
    left: 4%;
    width: 210px;
  }
  .deco-bl {
    left: 10%;
    width: 180px;
  }
  .deco-tr {
    right: 4%;
    width: 210px;
  }
  .deco-br {
    right: 10%;
    width: 220px;
  }
}

/* About content */
.about-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4rem;
}

.about-text-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

.about-heading {
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  font-size: clamp(3rem, 12vw, 160px);
}

.animated-text {
  color: #d7e2ea;
  font-weight: 500;
  text-align: center;
  line-height: 1.6;
  max-width: 560px;
  font-size: clamp(1rem, 2vw, 1.35rem);
  margin: 0;
}

@media (min-width: 640px) {
  .about-content {
    gap: 5rem;
  }
  .about-text-block {
    gap: 3.5rem;
  }
}
@media (min-width: 768px) {
  .about-content {
    gap: 6rem;
  }
  .about-text-block {
    gap: 4rem;
  }
}

/* ===================================================================
   4. SERVICES SECTION
   =================================================================== */
.services-section {
  background-color: #ffffff;
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
  padding: 5rem 1.25rem;
}

.services-heading {
  color: #0c0c0c;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
  font-size: clamp(3rem, 12vw, 160px);
  line-height: 1;
  margin-bottom: 4rem;
}

.services-list {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  max-width: 64rem;
}

.service-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 2rem 0;
  border-top: 1px solid rgba(12, 12, 12, 0.15);
}

.service-number {
  color: #0c0c0c;
  font-weight: 900;
  flex-shrink: 0;
  font-size: clamp(3rem, 10vw, 140px);
  line-height: 1;
}

.service-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.service-name {
  color: #0c0c0c;
  font-weight: 500;
  text-transform: uppercase;
  font-size: clamp(1rem, 2.2vw, 2.1rem);
}

.service-desc {
  color: #0c0c0c;
  font-weight: 300;
  line-height: 1.6;
  max-width: 42rem;
  font-size: clamp(0.85rem, 1.6vw, 1.25rem);
  opacity: 0.6;
}

@media (min-width: 640px) {
  .services-section {
    border-top-left-radius: 50px;
    border-top-right-radius: 50px;
    padding: 6rem 2rem;
  }
  .services-heading {
    margin-bottom: 5rem;
  }
  .service-item {
    gap: 2.5rem;
    padding: 2.5rem 0;
  }
  .service-info {
    gap: 1rem;
    padding-top: 1rem;
  }
}
@media (min-width: 768px) {
  .services-section {
    border-top-left-radius: 60px;
    border-top-right-radius: 60px;
    padding: 8rem 2.5rem;
  }
  .services-heading {
    margin-bottom: 7rem;
  }
  .service-item {
    gap: 3rem;
    padding: 3rem 0;
  }
  .service-info {
    gap: 1.25rem;
    padding-top: 1.5rem;
  }
}

/* ===================================================================
   5. PROJECTS SECTION
   =================================================================== */
.projects-section {
  position: relative;
  z-index: 10;
  background-color: #0c0c0c;
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
  margin-top: -2.5rem;
  padding: 5rem 1.25rem;
}

@media (min-width: 640px) {
  .projects-section {
    border-top-left-radius: 50px;
    border-top-right-radius: 50px;
    margin-top: -3rem;
    padding: 6rem 2rem;
  }
}
@media (min-width: 768px) {
  .projects-section {
    border-top-left-radius: 60px;
    border-top-right-radius: 60px;
    margin-top: -3.5rem;
    padding: 8rem 2.5rem;
  }
}

.projects-heading {
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  font-size: clamp(3rem, 12vw, 160px);
  margin-bottom: 4rem;
}

.projects-list {
  display: block;
  position: relative;
}

/* Each spacer gives the next sticky card room to slide up from below and
   cover the previous one (card-stacking effect). */
.card-spacer {
  height: 80vh;
}

.project-card {
  position: sticky;
  top: calc(6rem + var(--card-offset, 0px));
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  border-radius: 40px;
  border: 2px solid #d7e2ea;
  background-color: #0c0c0c;
  padding: 1rem;
  transform-origin: top center;
  will-change: transform;
  z-index: 1;
}

@media (min-width: 640px) {
  .projects-heading {
    margin-bottom: 5rem;
  }
  .project-card {
    border-radius: 50px;
    padding: 1.5rem;
  }
}
@media (min-width: 768px) {
  .project-card {
    top: calc(8rem + var(--card-offset, 0px));
    border-radius: 60px;
    padding: 2rem;
  }
}

/* Card top row */
.project-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.project-card-numgroup {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.project-number {
  color: #d7e2ea;
  font-weight: 900;
  line-height: 1;
  font-size: clamp(3rem, 10vw, 140px);
}

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.project-category {
  color: rgba(215, 226, 234, 0.6);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
}

.project-name {
  color: #d7e2ea;
  font-weight: 500;
  text-transform: uppercase;
  font-size: clamp(1.25rem, 3vw, 2.5rem);
}

@media (min-width: 640px) {
  .project-card-top {
    margin-bottom: 1.5rem;
    gap: 1.5rem;
  }
  .project-card-numgroup {
    gap: 1.5rem;
  }
  .project-meta {
    gap: 0.5rem;
  }
  .project-category {
    font-size: 0.875rem;
  }
  .live-project-btn {
    font-size: 1rem;
  }
}
@media (min-width: 768px) {
  .project-card-top {
    margin-bottom: 2rem;
    gap: 2rem;
  }
  .project-card-numgroup {
    gap: 2rem;
  }
}

/* Card image grid */
.project-card-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-image {
  width: 100%;
}

.project-image img {
  display: block;
  width: 100%;
  height: clamp(220px, 50vw, 360px);
  border-radius: 40px;
  object-fit: cover;
}

@media (min-width: 640px) {
  .project-image img {
    height: clamp(360px, 48vw, 620px);
    border-radius: 50px;
  }
}
@media (min-width: 768px) {
  .project-image img {
    border-radius: 60px;
  }
}

/* ===================================================================
   ANIMATED TEXT chars
   =================================================================== */
.animated-text .char {
  position: relative;
  display: inline-block;
  opacity: 0.2;
  transition: opacity 0.18s ease-out;
}
.animated-text .char.is-lit {
  opacity: 1;
}

/* ===================================================================
   6. CONTACT SECTION  (white background)
   =================================================================== */
.contact-section {
  position: relative;
  z-index: 10;
  background-color: #ffffff;
  color: #0c0c0c;
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
  margin-top: -2.5rem;
  padding: 5rem 1.25rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.contact-inner {
  max-width: 72rem;
  margin: auto auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  flex: 1;
  justify-content: center;
}

.contact-heading {
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: -0.02em;
  font-size: clamp(3rem, 12vw, 160px);
  margin-bottom: 1.5rem;
  text-align: left;
  background: none;
  -webkit-text-fill-color: #0c0c0c;
  color: #0c0c0c;
}

.contact-desc {
  color: #3a3a3a;
  font-weight: 300;
  line-height: 1.6;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  max-width: 32rem;
  margin-bottom: 2.5rem;
}

.contact-info {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-info li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contact-label {
  color: rgba(12, 12, 12, 0.5);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
}

.contact-value {
  color: #0c0c0c;
  font-weight: 500;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a.contact-value:hover {
  opacity: 0.6;
}

.contact-map {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(12, 12, 12, 0.08);
}

.contact-map img {
  display: block;
  width: 100%;
  height: auto;
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  width: 100%;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  color: #0c0c0c;
  background-color: #f4f4f5;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 1rem 1.25rem;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(12, 12, 12, 0.4);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #0c0c0c;
  background-color: #ffffff;
}

.contact-submit-btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffffff;
  background-color: #0c0c0c;
  border: none;
  border-radius: 14px;
  padding: 1rem 2rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
  align-self: flex-start;
  margin-top: 0.5rem;
}

.contact-submit-btn:hover {
  background-color: #2a2a2a;
  transform: translateY(-2px);
}

/* Right column (social + form) */
.contact-right {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Social Links */
.social-links {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.social-label {
  color: #0c0c0c;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 1.125rem;
}

.social-icons {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.social-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #0c0c0c;
  background-color: #f4f4f5;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.social-icon:hover {
  background-color: #0c0c0c;
  color: #ffffff;
  transform: translateY(-2px);
}

/* QR tooltip */
.social-icon-qr .qr-popup {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  width: 140px;
  height: 140px;
  padding: 6px;
  background-color: #ffffff;
  border: 1px solid rgba(12, 12, 12, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.social-icon-qr .qr-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #ffffff;
}

.social-icon-qr .qr-popup img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.social-icon-qr:hover .qr-popup,
.social-icon-qr:focus-within .qr-popup {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Back to Top */
.back-to-top {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0c0c0c;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
  z-index: 100;
}

.back-to-top-label {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  color: #0c0c0c;
  white-space: nowrap;
}

.back-to-top.on-dark .back-to-top-label {
  color: #ffffff;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: #2a2a2a;
  transform: translateY(-2px);
}

/* 深色背景上的反色样式 */
.back-to-top.on-dark {
  background-color: #ffffff;
  color: #0c0c0c;
}

.back-to-top.on-dark:hover {
  background-color: #f0f0f0;
  color: #0c0c0c;
}

/* Footer */
.contact-footer {
  max-width: 72rem;
  margin: 4rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(12, 12, 12, 0.1);
  color: rgba(12, 12, 12, 0.5);
  font-size: 16px;
  text-align: center;
}

.footer-beian-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin: 0 2px;
}

.footer-link {
  color: inherit;
  text-decoration: none;
}

.footer-link:hover,
.footer-link:active,
.footer-link:focus,
.footer-link:visited {
  color: inherit;
  text-decoration: none;
}

/* ----- Responsive: CONTACT ----- */
@media (min-width: 640px) {
  .contact-section {
    border-top-left-radius: 50px;
    border-top-right-radius: 50px;
    margin-top: -3rem;
    padding: 6rem 2rem 2rem;
  }
}

@media (min-width: 768px) {
  .contact-section {
    border-top-left-radius: 60px;
    border-top-right-radius: 60px;
    margin-top: -3.5rem;
    padding: 8rem 2.5rem 2.5rem;
  }
  .contact-inner {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 4rem;
  }
  .contact-left {
    flex: 1 1 50%;
    max-width: 32rem;
  }
  .contact-right {
    flex: 1 1 40%;
    max-width: 28rem;
  }
}

@media (min-width: 1024px) {
  .contact-section {
    padding: 10rem 2.5rem 3rem;
  }
}
