:root {
  --paper: #ecece8;
  --paper-light: #f5f5f1;
  --ink: #151714;
  --ink-soft: #51554f;
  --muted: #777c74;
  --line: rgba(21, 23, 20, 0.17);
  --accent: #914c40;
  --white: #fafaf7;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --page: min(91vw, 1500px);
}

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

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body:has(dialog[open]) {
  overflow: hidden;
}

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

button {
  padding: 0;
  color: inherit;
  font: inherit;
}

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

::selection {
  color: var(--white);
  background: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  display: flex;
  width: var(--page);
  min-height: 6rem;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.site-name {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  font-family: var(--serif);
  font-size: 1.18rem;
}

.site-name span {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.7rem;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 3vw, 2.8rem);
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.site-header nav a {
  position: relative;
}

.site-header nav a::after {
  position: absolute;
  right: 0;
  bottom: -0.28rem;
  left: 0;
  height: 1px;
  content: "";
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.site-header nav a:hover {
  color: var(--ink);
}

.site-header nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hero {
  display: grid;
  width: var(--page);
  min-height: clamp(20rem, 38vw, 32rem);
  margin-inline: auto;
  padding-block: clamp(3rem, 6vw, 6.2rem);
  grid-template-columns: minmax(0, 1.45fr) minmax(17rem, 0.55fr);
  gap: 4rem;
  align-items: end;
  border-bottom: 1px solid var(--line);
}

.hero-name {
  animation: enter 700ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.availability {
  display: flex;
  margin: 0 0 1rem;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.availability span {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(5.2rem, 12vw, 12.8rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.075em;
}

.hero-services {
  margin: 1.8rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(0.92rem, 1.3vw, 1.08rem);
}

.hero-contact {
  padding-bottom: 0.3rem;
  animation: enter 700ms 100ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.hero-contact p {
  max-width: 20rem;
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.hero-contact a {
  display: inline-block;
  padding-bottom: 0.22rem;
  border-bottom: 1px solid currentColor;
  font-size: clamp(0.88rem, 1.15vw, 1.02rem);
}

.hero-wechat {
  margin-top: 0.55rem !important;
  color: var(--ink-soft) !important;
  font-size: 0.78rem !important;
}

.works,
.services,
.contact {
  width: var(--page);
  margin-inline: auto;
  padding-block: clamp(4.5rem, 8vw, 8rem);
}

.section-heading {
  display: flex;
  margin-bottom: clamp(2.3rem, 4vw, 4rem);
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 4.2vw, 4.5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.045em;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(1rem, 1.8vw, 2rem);
  align-items: start;
}

.work-card {
  min-width: 0;
}

.work-card:nth-child(even) {
  margin-top: clamp(1.2rem, 3vw, 3.5rem);
}

.work-poster {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  border: 0;
  background: #c9c8c1;
  cursor: pointer;
}

.work-poster::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(8, 9, 8, 0.25), transparent 22%, transparent 72%, rgba(8, 9, 8, 0.42)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 40%);
  transition: opacity 220ms ease;
}

.work-poster:hover::after {
  opacity: 0.75;
}

.work-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 650ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.work-poster:hover img {
  transform: scale(1.025);
}

.work-type,
.work-duration {
  position: absolute;
  z-index: 2;
  color: var(--white);
  font-size: 0.66rem;
}

.work-type {
  top: 0.8rem;
  left: 0.8rem;
}

.work-duration {
  right: 0.8rem;
  bottom: 0.8rem;
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: clamp(2.8rem, 4.5vw, 4.6rem);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(20, 20, 18, 0.14);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(7px);
  transition:
    color 180ms ease,
    background 180ms ease;
}

.play-icon::before {
  width: 0;
  height: 0;
  margin-left: 0.17rem;
  content: "";
  border-top: 0.35rem solid transparent;
  border-bottom: 0.35rem solid transparent;
  border-left: 0.55rem solid var(--white);
}

.work-poster:hover .play-icon {
  color: var(--ink);
  background: var(--white);
}

.work-poster:hover .play-icon::before {
  border-left-color: var(--ink);
}

.work-title {
  display: flex;
  margin-top: 0.85rem;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.work-title h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.45vw, 1.35rem);
  font-weight: 500;
}

.work-title span {
  color: var(--muted);
  font-size: 0.67rem;
}

.services {
  border-top: 1px solid var(--line);
}

.service-list {
  display: grid;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  border-top: 1px solid var(--line);
}

.service-list li {
  position: relative;
  display: grid;
  min-height: 14rem;
  padding: 1.7rem clamp(1rem, 2.3vw, 2.3rem) 2rem;
  align-content: start;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.7rem;
  border-right: 1px solid var(--line);
}

.service-list li:first-child {
  padding-left: 0;
}

.service-list li:last-child {
  border-right: 0;
}

.service-list li > span {
  padding-top: 0.35rem;
  color: var(--accent);
  font-size: 0.65rem;
}

.service-list strong {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.2vw, 2.15rem);
  font-weight: 500;
}

.service-list p {
  max-width: 20rem;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  grid-column: 2;
}

.contact {
  padding-top: clamp(5rem, 10vw, 10rem);
  padding-bottom: clamp(5rem, 9vw, 9rem);
  border-top: 1px solid var(--line);
}

.contact > p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.contact h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 6vw, 6.5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}

.contact h2 a {
  display: inline-block;
  border-bottom: 1px solid transparent;
  transition: border-color 180ms ease;
}

.contact h2 a:hover {
  border-bottom-color: currentColor;
}

.contact-actions {
  display: flex;
  margin-top: 2rem;
  align-items: center;
  gap: 1.2rem;
}

.email-button,
.contact-actions button {
  min-height: 2.9rem;
  padding: 0 1.2rem;
  border: 1px solid var(--ink);
  font-size: 0.75rem;
  cursor: pointer;
}

.email-button {
  display: inline-flex;
  align-items: center;
  color: var(--white);
  background: var(--ink);
}

.contact-actions button {
  background: transparent;
}

.contact-actions button:hover,
.email-button:hover {
  color: var(--white);
  background: var(--accent);
  border-color: var(--accent);
}

.copy-status {
  color: var(--muted);
  font-size: 0.7rem;
}

.wechat-id {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

footer {
  display: flex;
  width: var(--page);
  min-height: 6rem;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
}

.video-dialog {
  width: min(92vw, 1120px);
  max-width: none;
  max-height: 90svh;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: var(--ink);
  background: var(--paper-light);
}

.video-dialog::backdrop {
  background: rgba(12, 13, 11, 0.82);
  backdrop-filter: blur(6px);
}

.video-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  animation: dialog-enter 220ms ease both;
}

.dialog-bar {
  display: flex;
  min-height: 4.5rem;
  padding: 0.85rem 1.1rem 0.85rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.dialog-bar div {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
}

.dialog-bar strong {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
}

.dialog-bar span {
  color: var(--muted);
  font-size: 0.68rem;
}

.dialog-bar button {
  position: relative;
  width: 2.7rem;
  height: 2.7rem;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.dialog-bar button span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.9rem;
  height: 1px;
  background: currentColor;
}

.dialog-bar button span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.dialog-bar button span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.dialog-video-wrap {
  display: grid;
  min-height: min(72svh, 48rem);
  place-items: center;
  overflow: hidden;
  background: #20211f;
}

.dialog-video-wrap video {
  display: block;
  max-width: 100%;
  max-height: min(72svh, 48rem);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1050px) {
  .works-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 3.5rem;
  }

  .work-card:nth-child(even) {
    margin-top: 0;
  }
}

@media (max-width: 720px) {
  :root {
    --page: 88vw;
  }

  .site-header {
    min-height: 5rem;
  }

  .site-name span {
    display: none;
  }

  .site-header nav {
    gap: 1.2rem;
    font-size: 0.72rem;
  }

  .hero {
    display: flex;
    min-height: 29rem;
    padding-block: 3.5rem 2.7rem;
    flex-direction: column;
    gap: 3rem;
    align-items: stretch;
    justify-content: space-between;
  }

  .hero h1 {
    font-size: clamp(4.8rem, 24vw, 7rem);
  }

  .hero-services {
    font-size: 0.84rem;
  }

  .hero-contact p {
    margin-bottom: 0.75rem;
  }

  .section-heading {
    display: block;
    margin-bottom: 2rem;
  }

  .section-heading h2 {
    font-size: clamp(2.4rem, 13vw, 3.8rem);
  }

  .section-heading p {
    margin-top: 0.8rem;
  }

  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.7rem 1rem;
  }

  .work-card:last-child {
    grid-column: 1 / -1;
    width: calc(50% - 0.5rem);
    justify-self: center;
  }

  .work-title {
    display: block;
  }

  .work-title span {
    display: block;
    margin-top: 0.25rem;
  }

  .service-list {
    display: block;
  }

  .service-list li {
    min-height: 0;
    padding: 1.5rem 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .service-list li:first-child {
    padding-top: 0;
  }

  .service-list li:last-child {
    border-bottom: 0;
  }

  .contact h2 {
    font-size: clamp(2rem, 10vw, 3.2rem);
  }

  .contact-actions {
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  .copy-status {
    flex-basis: 100%;
  }

  .video-dialog {
    width: 100vw;
    height: 100svh;
    max-height: none;
  }

  .video-dialog[open] {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .dialog-bar {
    padding-left: 1rem;
  }

  .dialog-video-wrap,
  .dialog-video-wrap video {
    max-height: calc(100svh - 4.5rem);
  }

  footer {
    padding-block: 1.5rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
