:root {
  --bg: #ffffff;
  --bg-elevated: #f0f0f0;
  --text: #141414;
  --text-muted: #6b6b6b;
  --accent: #b8783a;
  --border: rgba(0, 0, 0, 0.1);
  --font-display: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

html { scroll-behavior: smooth; }

html {
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
  --header-text: #fff;
  --header-muted: rgba(255, 255, 255, 0.7);
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom-color: var(--border);
  --header-text: var(--text);
  --header-muted: var(--text-muted);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 56px);
}

.logo {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  letter-spacing: 1px;
  color: var(--header-text);
}

.nav {
  display: flex;
  gap: 32px;
}

.nav a {
  font-size: 0.9rem;
  color: var(--header-muted);
  transition: color 0.2s ease;
}

.nav a:hover, .nav a.active { color: var(--header-text); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--header-text);
  font-size: 1.3rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0b0b0d;
}

.hero-video,
.hero-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-fallback {
  display: none;
  background:
    radial-gradient(circle at 25% 30%, rgba(217, 178, 107, 0.25), transparent 55%),
    radial-gradient(circle at 75% 70%, rgba(120, 140, 190, 0.2), transparent 55%),
    linear-gradient(160deg, #111114, #0b0b0d 70%);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.25) 50%, rgba(0,0,0,0.55) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px;
}

.hero-content h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 5.5vw, 3.8rem);
  letter-spacing: 2px;
  position: relative;
  top: 14px;
  color: #fff;
}

.hero-content p {
  margin-top: 16px;
  color: rgba(244, 244, 242, 0.85);
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  letter-spacing: 0.5px;
}

/* ---------- Work grid ---------- */
.work-section {
  padding: clamp(96px, 16vh, 180px) clamp(20px, 5vw, 56px) clamp(48px, 8vw, 96px);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 32px);
}

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

@media (max-width: 600px) {
  .work-grid { grid-template-columns: 1fr; }
}

.work-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.work-card.in-view {
  opacity: 1;
  transform: translateY(0);
}

.work-thumb-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  outline: 0.5px solid transparent;
  outline-offset: 4px;
  transition: outline-color 0.35s ease;
}

.work-card:hover .work-thumb-frame {
  outline-color: #000;
}

.work-thumb {
  position: absolute;
  inset: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: inset 0.35s ease;
}

.work-card:hover .work-thumb {
  inset: -4px;
}

.work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.work-card:hover .thumb-preview-video,
.work-card.video-active .thumb-preview-video {
  opacity: 1;
}

.thumb-placeholder {
  width: 100%;
  height: 100%;
}

.ph-1 { background: linear-gradient(135deg, #d9b26b, #8a5a2e); }
.ph-2 { background: linear-gradient(135deg, #7c9cbf, #33475c); }
.ph-3 { background: linear-gradient(135deg, #b48ee0, #513a72); }
.ph-4 { background: linear-gradient(135deg, #d97a91, #7a2f42); }
.ph-5 { background: linear-gradient(135deg, #6bbf9c, #245239); }
.ph-6 { background: linear-gradient(135deg, #c9c9d1, #45454d); }
.ph-7 { background: linear-gradient(135deg, #e0a458, #5c3a1c); }
.ph-8 { background: linear-gradient(135deg, #8a8f98, #2b2d31); }

.media-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 9px;
  background: rgba(0,0,0,0.55);
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.work-meta {
  padding: 14px 2px 0;
}

.work-meta h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
}

.work-meta p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- About page ---------- */
.about-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(88px, 13vh, 120px) clamp(20px, 4vw, 40px) 64px;
  /* Fill the viewport so the footer stays below the fold on first load */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.about-topline {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.2px;
  margin-bottom: 40px;
}

.about-grid {
  display: grid;
  grid-template-columns: 24% 50%;
  justify-content: space-between;
  align-items: start;
  flex: 1;
}

.about-right {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.about-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.about-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-elevated);
}

.about-photo.about-photo-placeholder {
  background-image: linear-gradient(135deg, var(--accent), #7c9cbf);
}

.about-social {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.about-social a {
  color: var(--text);
}

.about-social a:hover {
  color: var(--accent);
}

/* Social entry with no URL filled in yet */
.pending {
  color: var(--text-muted);
}

/* ---------- Contact page ---------- */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 5vh, 52px);
}

.contact-value {
  display: inline-block;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  color: var(--text);
  transition: color 0.2s ease;
}

a.contact-value {
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: border-color 0.2s ease;
}

a.contact-value:hover {
  border-bottom-color: var(--text);
}

.contact-value.pending {
  color: var(--text-muted);
}

button.contact-wechat {
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0 0 2px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

button.contact-wechat:hover {
  border-bottom-color: var(--text);
}

.wechat-qr {
  margin-top: 16px;
  width: 180px;
  animation: qrFade 0.25s ease;
}

.wechat-qr img {
  width: 100%;
  height: auto;
  display: block;
}

@keyframes qrFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.about-bio {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: justify;
}

.about-awards {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
}

.about-award-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr auto;
  gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.about-award-row span:first-child {
  color: var(--text);
}

.about-services {
  /* Pushed to the bottom of the right column, well clear of the photo's caption */
  margin-top: auto;
  padding-top: clamp(72px, 14vh, 140px);
}

.about-services h2 {
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.12;
}

.about-services h2.dim {
  color: #c9c9c9;
}

.about-services h2.dim + h2.dim {
  color: #dcdcdc;
}

.about-services h2.dim + h2.dim + h2.dim {
  color: #e6e6e6;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ---------- Work detail page ---------- */
.page-work {
  background: #0b0b0d;
  color: #f4f4f2;
  min-height: 100vh;
}

.site-header.on-dark {
  background: rgba(11, 11, 13, 0.9);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  --header-text: #fff;
  --header-muted: rgba(255, 255, 255, 0.6);
}

.work-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(100px, 16vh, 160px) clamp(20px, 5vw, 56px) 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(244, 244, 242, 0.55);
  font-size: 0.9rem;
  letter-spacing: 0.2px;
  margin-bottom: clamp(24px, 5vh, 48px);
  transition: color 0.2s ease, gap 0.2s ease;
}

.back-link:hover {
  color: #fff;
  gap: 12px;
}

.back-arrow {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.back-link:hover .back-arrow {
  transform: translateX(-2px);
}

.work-viewer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.viewer-stage {
  max-width: 100%;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-stage img,
.viewer-stage video {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 0;
}

.stage-placeholder {
  width: min(90vw, 700px);
  aspect-ratio: 4 / 3;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
}

.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  line-height: 1;
  padding: 12px;
  opacity: 0.75;
  transition: opacity 0.2s ease;
  cursor: pointer;
}

.viewer-nav:hover { opacity: 1; }
.viewer-prev { left: clamp(-8px, 1vw, 8px); }
.viewer-next { right: clamp(-8px, 1vw, 8px); }

.work-page-info {
  text-align: center;
  margin-top: 32px;
}

.work-page-info h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.work-page-info p {
  margin-top: 6px;
  color: rgba(244, 244, 242, 0.65);
  font-size: 0.9rem;
}

.credits {
  max-width: 900px;
  margin: clamp(60px, 10vh, 100px) auto 0;
  padding-bottom: 80px;
}

.credits h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  margin-bottom: 24px;
}

.credits-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.credits-row:first-of-type {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.credits-label {
  color: rgba(244, 244, 242, 0.55);
  flex: 0 0 auto;
}

.credits-value {
  color: #f4f4f2;
  font-weight: 500;
  text-align: right;
}

/* ---------- Mobile nav ---------- */
@media (max-width: 700px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav.nav-open { max-height: 200px; }
  .nav a { padding: 16px clamp(20px, 5vw, 56px); border-top: 1px solid var(--border); color: var(--text); }

  .viewer-nav { font-size: 1.8rem; padding: 8px; }
  .credits-row { flex-direction: column; gap: 4px; }
  .credits-value { text-align: left; }

  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-photo { max-width: 260px; }
  .about-services { padding-top: 56px; }
  .about-award-row { grid-template-columns: 1fr 1fr; row-gap: 2px; }
}
