:root {
  color-scheme: light;
  --ink: #181817;
  --muted: #575753;
  --paper: #f7f7f4;
  --white: #fff;
  --line: #deded8;
  --accent: #c52e1e;
  --max-width: 82rem;
  --gutter: clamp(1rem, 3.8vw, 3.5rem);
  --gap: clamp(0.9rem, 2vw, 1.6rem);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-synthesis: none;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}

h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.25; }
a { color: inherit; text-underline-offset: 0.24em; }
button { font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }

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

.wrap {
  width: min(var(--max-width), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 3;
  inset: 0 auto auto 0;
  padding: 0.65rem 1rem;
  background: var(--white);
  transform: translateY(-130%);
}
.skip-link:focus { transform: none; }

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  min-height: 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.wordmark {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}
.wordmark img { width: 10.4rem; }
.site-nav {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  gap: clamp(1rem, 2.9vw, 2.65rem);
}
.site-nav a {
  position: relative;
  display: grid;
  place-items: center;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
}
.site-nav a:hover, .site-nav [aria-current] { color: var(--accent); }
.site-nav [aria-current]::after {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: currentColor;
  content: "";
}

.main {
  flex: 1;
  padding-block: clamp(1.25rem, 3.1vw, 2.9rem) clamp(3rem, 7vw, 6rem);
}
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  column-gap: 2rem;
  row-gap: 0.7rem;
  padding-block: 1.35rem;
  font-size: 0.875rem;
}
.footer-contact { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }
.footer-inner a { white-space: nowrap; }

.home-lead, .about-grid, .project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.lead-tile {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: end;
  overflow: hidden;
  background: #202020;
  color: var(--white);
}
.tile-picture {
  position: absolute;
  z-index: -2;
  inset: 0;
}
.tile-picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lead-tile::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(0deg, rgb(0 0 0 / 78%), rgb(0 0 0 / 38%) 72%);
  content: "";
}
.tile-content {
  width: 100%;
  padding: clamp(1.25rem, 3.2vw, 3.1rem);
}
.tile-label {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}
.tile-label::before {
  width: 1.5rem;
  height: 3px;
  background: #fa513e;
  content: "";
}
.intro-tile {
  grid-column: span 2;
  min-height: clamp(20rem, 31vw, 27.5rem);
}
.intro-tile::after {
  background: linear-gradient(90deg, #151515 0%, rgb(15 15 15 / 75%) 50%, rgb(15 15 15 / 25%) 100%),
              linear-gradient(0deg, rgb(0 0 0 / 65%), transparent 68%);
}
.intro-tile .tile-picture img { object-position: center 51%; }
.intro-tile h1, .about-intro h1 {
  max-width: 19em;
  font-size: clamp(1.7rem, 3.15vw, 3rem);
  line-height: 1.42;
  letter-spacing: -0.025em;
  text-wrap: pretty;
}
.services-heading {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.28em;
}
.services-heading > span { white-space: nowrap; }
.service-divider { margin-left: 0.28em; color: #aaa; }
.reel-tile { text-decoration: none; }
.reel-tile h2 { font-size: clamp(1.6rem, 2.8vw, 2.45rem); }
.reel-tile .tile-picture img {
  transition: transform 240ms ease;
  object-position: 45% center;
}
.reel-tile:hover img, .project-link:hover img { transform: scale(1.045); }
.reel-action {
  display: inline-flex;
  gap: 0.65rem;
  align-items: center;
  margin-top: 1.25rem;
  font-weight: 600;
}
.play-icon {
  display: grid;
  flex: 0 0 auto;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
}
.play-icon::after {
  width: 0;
  height: 0;
  margin-left: 0.16rem;
  border-block: 0.37rem solid transparent;
  border-left: 0.58rem solid white;
  content: "";
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-block: clamp(1.8rem, 4vw, 3.3rem) 1.1rem;
}
.section-heading h2 { font-size: clamp(1.6rem, 2.5vw, 2.2rem); }
.section-heading a, .back-link, .external-video {
  width: fit-content;
  font-weight: 600;
  color: var(--accent);
}
.project {
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--line);
}
.project-link {
  height: 100%;
  display: flex;
  flex-direction: column;
  text-decoration: none;
}
.project-image {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #e6e6e3;
}
.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}
.project-caption {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.95rem clamp(0.7rem, 1.35vw, 1.15rem);
}
.project-caption h3 { font-size: clamp(1rem, 1.6vw, 1.18rem); overflow-wrap: anywhere; }
.project-caption p, .project-more { color: var(--muted); font-size: 0.875rem; }
.project-caption p { margin-top: 0.4rem; }
.project-more { white-space: nowrap; }
.project-link:hover .project-more { color: var(--accent); }

.filter-tile {
  min-height: 15rem;
  margin-bottom: var(--gap);
}
.filter-tile .tile-picture img { object-position: 60% 54%; }
.filter-tile::after {
  background: linear-gradient(90deg, rgb(17 17 17 / 90%), rgb(17 17 17 / 35%)),
              linear-gradient(0deg, rgb(0 0 0 / 45%), transparent);
}
.filter-tile h1, .page-title, .case-heading h1, .contact-panel h1, .not-found h1, .attachment h1 {
  font-size: clamp(2rem, 4.7vw, 3.5rem);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.35rem;
}
.filters a {
  padding: 0.35rem 0.9rem;
  border: 1px solid rgb(255 255 255 / 50%);
  text-decoration: none;
  background: rgb(0 0 0 / 23%);
}
.filters a:hover, .filters [aria-current] {
  background: var(--white);
  border-color: var(--white);
  color: var(--ink);
}
.lead-tile :focus-visible { outline-offset: 2px; }

.page-title { margin-bottom: 1.4rem; }
.services-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: var(--gap);
}
.info-card { background: var(--white); border: 1px solid var(--line); }
.info-image { aspect-ratio: 1.94; overflow: hidden; background: #e6e6e3; }
.info-image img { width: 100%; height: 100%; object-fit: cover; }
.service-primary { grid-row: span 2; }
.service-primary .info-image { aspect-ratio: 620 / 358; }
.info-body { padding: clamp(1rem, 2.2vw, 2rem); }
.info-body h2 { font-size: clamp(1.35rem, 2.3vw, 1.9rem); }
.info-body h3 { font-size: 1.05rem; margin-top: 1.25rem; }
.info-body p { margin-top: 0.75rem; }
.info-body ul, .info-body ol { margin: 0.6rem 0 0; padding-inline-start: 1.45rem; }
.info-body li + li { margin-top: 0.42rem; }

.about-intro { grid-column: span 2; min-height: 20rem; }
.about-intro::after {
  background: linear-gradient(0deg, rgb(9 19 29 / 90%), rgb(9 19 29 / 26%));
}
.about-grid .info-image { aspect-ratio: 1.65; }
.qr-image { background: var(--white); }
.qr-image img { object-fit: contain; }

.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  background: var(--white);
  border: 1px solid var(--line);
}
.contact-details { padding: clamp(1.25rem, 4.5vw, 4rem); }
.contact-details dl { margin-top: 1.65rem; }
.contact-details dl > div {
  display: grid;
  grid-template-columns: minmax(5.25em, 23%) minmax(0, 1fr);
  gap: 0.4rem 0.8rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}
.contact-details dt, .case-info dt { color: var(--muted); }
.contact-details dd, .case-info dd { overflow-wrap: anywhere; }
.contact-details dd a { color: var(--accent); }
.contact-image img { width: 100%; height: 100%; min-height: 22rem; object-fit: cover; }

.case-heading { margin-bottom: clamp(1rem, 3vw, 2rem); }
.case-heading h1, .attachment h1 { margin-top: 0.55rem; }
.case-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(13rem, 1fr);
  gap: var(--gap);
  align-items: start;
}
.case-media { display: grid; gap: 1rem; }
.case-info {
  background: var(--white);
  border: 1px solid var(--line);
  padding: clamp(1rem, 2.25vw, 1.75rem);
}
.case-info dl > div + div { border-top: 1px solid var(--line); margin-top: 0.75rem; padding-top: 0.75rem; }
.case-info dd { margin-top: 0.2rem; }
.case-info dt { font-size: 0.875rem; }
.share-button {
  padding: 0.35rem 0.75rem;
  margin-top: 1.2rem;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
}
.share-button:hover { border-color: var(--accent); color: var(--accent); }
.share-status:not(:empty) { margin-top: 0.5rem; color: var(--muted); font-size: 0.875rem; }
.video-player iframe, .case-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #151515;
}
.external-video { display: inline-block; margin-top: 0.5rem; font-size: 0.9rem; }
.case-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.gallery-single { grid-template-columns: minmax(0, 1fr); }
.gallery-link {
  display: block;
  align-content: center;
  overflow: hidden;
  background: #ebeae6;
  cursor: zoom-in;
}
.gallery-link img { width: 100%; }
.cover-only { background: #1c1c1c; }
.cover-only img { width: min(100%, 38rem); margin: auto; }
.media-note { padding: 0.75rem 1rem; border-left: 3px solid var(--accent); background: var(--white); }
.attachment img { margin-top: 1.25rem; }
.not-found .back-link { display: inline-block; margin-top: 1rem; }

.media-dialog {
  width: min(59rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: 0;
  border: 1px solid #3d3d3d;
  color: var(--white);
  background: #191919;
}
.media-dialog::backdrop { background: rgb(0 0 0 / 79%); }
body:has(dialog[open]) { overflow: hidden; }
.dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #444;
}
.dialog-bar h2 { font-size: 1.1rem; }
.dialog-bar button, .lightbox-controls button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  color: var(--white);
  background: #272727;
  border: 1px solid #595959;
}
.dialog-bar button { font-size: 1.55rem; line-height: 1; }
.dialog-bar button:hover, .lightbox-controls button:hover { background: #414141; }
.dialog-body .external-video { margin: 0.75rem 1rem; color: var(--white); }
.lightbox { width: min(76rem, calc(100% - 2rem)); }
.lightbox img {
  width: 100%;
  height: min(70vh, 50rem);
  object-fit: contain;
}
.lightbox-controls { display: flex; justify-content: center; gap: 0.65rem; padding: 0.65rem; }
.lightbox-controls button { display: block; padding: 0.35rem 0.9rem; }

@media (max-width: 56rem) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-layout { grid-template-columns: minmax(0, 1fr); }
  .case-info { grid-row: 1; }
  .case-info dl { display: flex; flex-wrap: wrap; gap: 0.9rem 1.5rem; }
  .case-info dl > div + div { margin: 0; padding: 0; border: 0; }
}

@media (max-width: 42rem) {
  .header-inner { min-height: 0; flex-direction: column; gap: 0; align-items: flex-start; }
  .wordmark { margin-block: 0.72rem 0.4rem; }
  .wordmark img { width: 8.85rem; }
  .site-nav { width: 100%; gap: 0; justify-content: space-between; }
  .site-nav a { min-height: 2.75rem; flex: 1; }
  .home-lead, .services-grid, .contact-panel { grid-template-columns: minmax(0, 1fr); }
  .intro-tile { grid-column: 1; min-height: 16.5rem; }
  .reel-tile { min-height: 11.5rem; }
  .reel-tile .tile-picture img { object-position: center 46%; }
  .reel-action { margin-top: 0.8rem; }
  .service-primary { grid-row: auto; }
  .about-intro { min-height: 15rem; }
  .contact-image img { min-height: 0; max-height: 15rem; }
  .project-more { display: none; }
}

@media (max-width: 23rem) {
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .about-intro { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
