/* ===== Variables ===== */
:root {
  --color-text: #ffffff;
  --color-text-muted: rgba(255, 255, 255, 0.78);
  --color-accent: #e8a317;
  --color-nav: #c41e3a;
  --color-overlay: rgba(0, 0, 0, 0.35);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --header-h: 5rem;
  --autoplay-ms: 6000;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: #0a0a0a;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.04);
  transition: opacity 0.8s var(--ease-out), transform 8s linear;
  will-change: opacity, transform;
}

.hero__bg.is-active {
  transform: scale(1);
}

.hero__bg.is-fading {
  opacity: 0;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.2) 45%, transparent 70%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.45) 0%, transparent 40%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 18%);
  pointer-events: none;
  z-index: 1;
}

/* ===== Header ===== */
.header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 clamp(1.5rem, 4vw, 3.5rem);
}

.logo {
  display: flex;
  align-items: center;
  z-index: 21;
}

.logo__img {
  height: 2.75rem;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.75rem);
}

.nav__link {
  display: inline-flex;
  align-items: center;
  font-size: clamp(1rem, 1.05vw, 1.12rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #fff;
  transition: color 0.25s ease, opacity 0.25s ease;
  position: relative;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.3rem;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s var(--ease-out);
}

.nav__link:hover {
  opacity: 0.85;
}

.nav__link:hover::after {
  width: 100%;
}

.nav__link--contact {
  color: #fff;
}

.nav__link--zt {
  color: #fff;
}

.nav__link--dt {
  color: #fff;
}

.nav__link--kz {
  color: #fff;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2rem;
  height: 2rem;
  z-index: 21;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Content ===== */
.hero__content {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 4vw, 3.5rem) clamp(4rem, 8vh, 6rem);
  gap: 2rem;
  pointer-events: none;
}

.project-info {
  max-width: min(38rem, 48vw);
  pointer-events: auto;
}

.project-info__title {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(1.25rem);
  animation: fadeUp 0.7s var(--ease-out) forwards;
}

.project-info__desc {
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  font-weight: 300;
  line-height: 1.85;
  color: var(--color-text-muted);
  white-space: pre-line;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(1.25rem);
  animation: fadeUp 0.7s var(--ease-out) 0.12s forwards;
}

.project-info.is-updating .project-info__title,
.project-info.is-updating .project-info__desc {
  animation: none;
  opacity: 0;
  transform: translateY(0.75rem);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.project-info.is-ready .project-info__title,
.project-info.is-ready .project-info__desc {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}

.project-info.is-ready .project-info__desc {
  transition-delay: 0.08s;
}

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

/* ===== Thumbnails (Swiper) ===== */
.thumbs {
  width: min(58vw, 48rem);
  flex-shrink: 0;
  pointer-events: auto;
  margin-bottom: 0.25rem;
}

.thumbs .swiper {
  overflow: visible;
  padding: 0.25rem 0;
}

.thumbs .swiper-slide {
  width: 10rem;
  height: 14.5rem;
  border-radius: 0.6rem;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease;
}

.thumbs .swiper-slide:hover {
  transform: translateY(-4px);
}

.thumbs .swiper-slide.is-active {
  box-shadow: 0 0 0 2px var(--color-accent), 0 10px 32px rgba(0, 0, 0, 0.45);
  transform: translateY(-6px);
}

.thumb__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2rem 0.6rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.04em;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumb__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.thumbs .swiper-slide.is-active .thumb__play {
  opacity: 1;
}

.thumb__play-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb__play-icon::after {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.5rem 0 0.5rem 0.8rem;
  border-color: transparent transparent transparent #1a1a1a;
  margin-left: 0.18rem;
}

/* ===== Progress bar ===== */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
}

.progress__bar {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  transform-origin: left center;
}

.progress__bar.is-running {
  animation: progressFill var(--autoplay-ms) linear forwards;
}

@keyframes progressFill {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

/* ===== Contact Modal ===== */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.contact-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.contact-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.contact-modal__panel {
  position: relative;
  width: min(92vw, 50rem);
  border-radius: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(165deg, rgba(11, 15, 20, 0.98) 0%, rgba(12, 17, 24, 0.96) 100%);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.45);
  padding: 3.25rem 3.5rem 2.85rem;
  z-index: 1;
}

.contact-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 1.1rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.72);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.contact-modal__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.contact-modal__layout {
  display: grid;
  grid-template-columns: minmax(11rem, 1fr) minmax(16rem, 1.25fr);
  gap: 2.4rem;
}

.contact-modal__intro {
  padding-right: 1.6rem;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.contact-modal__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.75rem;
}

.contact-modal__title {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.contact-modal__desc {
  font-size: 0.9rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.66);
}

.contact-modal__list {
  display: grid;
  gap: 0;
  align-content: center;
}

.contact-modal__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.contact-modal__item:last-child {
  border-bottom: none;
}

.contact-modal__label {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.68);
  letter-spacing: 0.02em;
}

.contact-modal__phone {
  font-size: 1.26rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

body.modal-open {
  overflow: hidden;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero__content {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    padding-bottom: clamp(3.5rem, 7vh, 5rem);
    gap: 1.75rem;
  }

  .project-info {
    max-width: 100%;
  }

  .thumbs {
    width: 100%;
  }

  .thumbs .swiper-slide {
    width: 8.25rem;
    height: 12rem;
  }
}

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

  .nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    background: rgba(8, 8, 8, 0.96);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
  }

  .nav__link {
    font-size: 1.25rem;
    color: #fff;
    letter-spacing: 0.02em;
  }

  .nav__link--zt {
    color: #fff;
  }

  .nav__link--dt {
    color: #fff;
  }

  .nav__link--kz {
    color: #fff;
  }

  .nav__link--contact {
    color: #fff;
  }

  .contact-modal__panel {
    width: min(94vw, 32rem);
    padding: 2.4rem 1.75rem 2rem;
  }

  .contact-modal__layout {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .contact-modal__intro {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding-right: 0;
    padding-bottom: 1.2rem;
  }

  .contact-modal__title {
    font-size: 1.35rem;
  }

  .contact-modal__item {
    align-items: center;
  }

  .contact-modal__phone {
    font-size: 1.02rem;
  }

  .project-info__title {
    font-size: clamp(1.65rem, 7vw, 2.25rem);
  }

  .thumbs .swiper-slide {
    width: 7rem;
    height: 10.25rem;
  }

  .thumb__label {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__bg,
  .project-info__title,
  .project-info__desc,
  .thumbs .swiper-slide,
  .progress__bar {
    animation: none !important;
    transition: none !important;
  }

  .hero__bg {
    transform: none;
  }
}
