:root {
  --ink: #090a08;
  --ink-soft: #151713;
  --paper: #f1f0e9;
  --copper: #b97855;
  --acid: #dfff35;
  --line: rgba(242, 241, 234, 0.18);
  --muted: #999b93;
  --display: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

.case-header {
  min-height: 72px;
  padding: 0 4vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.case-header nav {
  display: flex;
  align-items: center;
  gap: 30px;
  color: #aaa9a3;
  font-size: 10px;
  letter-spacing: 0.1em;
}
.case-header nav a:first-child {
  padding-bottom: 3px;
  color: var(--paper);
  border-bottom: 1px solid currentColor;
}

.category-hero {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(500px, 1.18fr);
  border-bottom: 1px solid var(--line);
}
.category-copy {
  padding: clamp(68px, 9vh, 112px) 5vw 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.category-index,
.client-kicker,
.gallery-caption,
.next-label,
.cta-label {
  margin: 0;
  color: var(--acid);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.category-copy h1 {
  max-width: 720px;
  margin: 25px 0 0;
  font-family: var(--display);
  font-size: clamp(62px, 6.6vw, 108px);
  font-weight: 400;
  line-height: 0.98;
}
.category-copy h1 em {
  display: block;
  color: var(--copper);
  font-weight: 400;
}
.category-definition {
  max-width: 600px;
  margin: 38px 0 0;
  color: #aaa9a3;
  font-size: 16px;
  line-height: 1.9;
}
.category-count {
  width: fit-content;
  margin: auto 0 0;
  padding-top: 30px;
  color: #7f817a;
  font-size: 11px;
  border-bottom: 1px solid #6f5c20;
}

.category-visual {
  min-width: 0;
  margin: 0;
  padding: clamp(28px, 4vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--ink-soft);
}
.category-visual img {
  width: 100%;
  max-height: calc(100vh - 170px);
  object-fit: contain;
}
.gallery-caption {
  padding-top: 18px;
  color: #8d8f88;
}

.client-section {
  padding: clamp(90px, 12vw, 170px) 5vw;
  color: var(--ink);
  background: var(--paper);
}
.client-record {
  max-width: 1460px;
  margin: 0 auto;
  border-top: 1px solid #b7b8b0;
}
.client-record summary {
  padding: 25px 0;
  display: grid;
  grid-template-columns: minmax(130px, 0.28fr) 1fr auto;
  gap: 28px;
  align-items: baseline;
  list-style: none;
  cursor: pointer;
  border-bottom: 1px solid #b7b8b0;
}
.client-record summary::-webkit-details-marker { display: none; }
.client-record summary::after {
  content: "+";
  color: #5f625c;
  font-size: 24px;
  font-weight: 300;
}
.client-record[open] summary::after { content: "−"; }
.client-number {
  font-family: var(--display);
  font-size: clamp(58px, 8vw, 132px);
  line-height: 0.8;
}
.client-title {
  font-family: var(--display);
  font-size: clamp(31px, 3.6vw, 56px);
  line-height: 1.1;
}
.client-body {
  padding: 65px 0 0;
  display: grid;
  grid-template-columns: minmax(250px, 0.68fr) minmax(600px, 1.32fr);
  gap: 7vw;
}
.client-copy {
  padding-top: 12px;
}
.client-copy h2 {
  margin: 24px 0 0;
  font-family: var(--display);
  font-size: clamp(36px, 4.4vw, 68px);
  font-weight: 400;
  line-height: 1.08;
}
.client-copy p {
  max-width: 480px;
  margin: 28px 0 0;
  color: #555750;
  font-size: 14px;
}
.client-facts {
  margin-top: 44px;
  border-top: 1px solid #b7b8b0;
}
.client-fact {
  padding: 13px 0;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  color: #666861;
  font-size: 11px;
  border-bottom: 1px solid #c8c9c2;
}
.client-fact strong {
  color: #282a26;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.client-gallery {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 30px;
  align-items: start;
}
.gallery-item {
  min-width: 0;
  margin: 0;
}
.gallery-item:nth-child(1) { grid-column: 1 / span 7; }
.gallery-item:nth-child(2) {
  grid-column: 8 / span 5;
  margin-top: 100px;
}
.gallery-item:nth-child(3) {
  grid-column: 4 / span 7;
  margin-top: 10px;
}
.gallery-frame {
  min-height: 360px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #deddd6;
}
.gallery-frame img {
  width: 100%;
  max-height: 700px;
  object-fit: contain;
}
.gallery-frame--crop {
  min-height: 680px;
  padding: 0;
  overflow: hidden;
  background: #d7d6cf;
}
.gallery-frame--crop img {
  width: 100%;
  height: 680px;
  max-height: none;
  object-fit: cover;
  object-position: center 24%;
}
.gallery-placeholder {
  min-height: 320px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #777972;
  border: 1px solid #c7c8c0;
  background:
    linear-gradient(135deg, transparent calc(50% - 0.5px), #c7c8c0 50%, transparent calc(50% + 0.5px));
}
.gallery-placeholder span:first-child {
  color: #3e403b;
  font-family: var(--display);
  font-size: 24px;
}
.gallery-placeholder span:last-child {
  width: fit-content;
  padding: 4px 7px;
  color: #5c5e58;
  background: var(--paper);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.gallery-item figcaption {
  margin-top: 12px;
  color: #777972;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.next-category {
  padding: 68px 5vw 78px;
  display: grid;
  grid-template-columns: 0.35fr 1fr auto;
  gap: 35px;
  align-items: end;
  border-top: 1px solid var(--line);
}
.next-category h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(44px, 6vw, 94px);
  font-weight: 400;
  line-height: 1;
}
.next-category .arrow {
  color: var(--acid);
  font-size: 34px;
}

.wechat-cta {
  padding: 88px 5vw 96px;
  display: grid;
  grid-template-columns: 0.6fr 1fr auto;
  gap: 45px;
  align-items: center;
  color: var(--ink);
  background: var(--copper);
}
.wechat-cta .cta-label { color: var(--ink); }
.wechat-cta h2 {
  max-width: 700px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(40px, 5vw, 78px);
  font-weight: 400;
  line-height: 1.05;
}
.wechat-cta a {
  padding: 15px 20px;
  color: var(--paper);
  background: var(--ink);
  font-size: 11px;
  letter-spacing: 0.09em;
}

/* The case pages use the approved illustrated QR only on compact screens.
   Keeping it out of the desktop composition preserves the accepted layout. */
.wechat-cta__qr { display: none; }

.case-footer {
  min-height: 220px;
  padding: 52px 5vw;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  color: #8c8e87;
  border-top: 1px solid var(--line);
}
.case-footer strong {
  color: var(--paper);
  font-family: var(--display);
  font-size: 32px;
  font-weight: 400;
}

.case-footer__meta {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 12px;
}

.case-footer__meta a {
  color: inherit;
  text-decoration-color: rgba(140, 142, 135, 0.5);
  text-underline-offset: 0.25em;
}

.case-footer__meta a:hover,
.case-footer__meta a:focus-visible {
  color: var(--copper);
}

.fade {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}
.fade.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade { opacity: 1; transform: none; transition: none; }
}

/* Case pages — shared phone layout. Desktop rules above remain untouched. */
@media (max-width: 820px) {
  html { scroll-padding-top: 62px; }

  body {
    overflow-x: hidden;
    line-height: 1.75;
  }

  .case-header {
    min-height: 62px;
    padding: 0 18px;
    gap: 14px;
  }

  .brand {
    flex: 0 0 auto;
    font-size: 14px;
  }

  .case-header nav {
    min-width: 0;
    gap: 13px;
    font-size: 9px;
    letter-spacing: 0.07em;
  }

  .case-header nav a:nth-child(2),
  .case-header nav a:nth-child(3) { display: none; }

  .category-hero {
    min-height: 0;
    padding: 40px 20px 48px;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .category-copy {
    width: 100%;
    padding: 0;
    display: block;
    pointer-events: auto;
  }

  .category-copy h1 {
    max-width: 100%;
    margin: 18px 0 0;
    font-size: clamp(48px, 15vw, 70px);
    line-height: 0.98;
  }

  .category-copy h1 em {
    max-width: 100%;
    margin: 0.16em 0 0;
    font-size: 0.48em;
    line-height: 1.1;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .category-context {
    width: 100%;
    margin-top: 34px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .category-definition {
    width: 100%;
    max-width: 38em;
    font-size: 14px;
    line-height: 1.9;
    text-wrap: pretty;
  }

  .category-note-link {
    width: 100%;
    padding: 14px 0 13px;
  }

  .category-count {
    margin-top: 28px;
    padding-top: 13px;
  }

  .category-visual {
    width: 100%;
    margin: 34px 0 0;
    padding: 0;
    display: block;
    background: transparent;
  }

  .category-visual img {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
  }

  .category-visual .gallery-caption {
    padding-top: 10px;
    text-align: left;
  }

  .client-section {
    padding: 64px 20px 78px;
  }

  .client-record + .client-record { margin-top: 86px; }

  .client-record summary,
  .client-record__heading {
    padding: 18px 0 20px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
  }

  .client-record summary::after { display: none; }

  .client-number {
    font-size: 46px;
    line-height: 0.9;
  }

  .client-title {
    font-size: clamp(23px, 6.5vw, 28px);
    line-height: 1.25;
    text-wrap: pretty;
  }

  .client-body {
    padding-top: 38px;
    display: flex;
    flex-direction: column;
    gap: 38px;
  }

  .client-copy {
    width: 100%;
    padding-top: 0;
  }

  .client-copy h2 {
    max-width: 9.5em;
    margin-top: 18px;
    font-size: clamp(38px, 11.5vw, 50px);
    line-height: 1.15;
    text-wrap: pretty;
  }

  .client-copy p {
    width: 100%;
    max-width: 38em;
    margin-top: 24px;
    font-size: 15px;
    line-height: 1.9;
    text-wrap: pretty;
  }

  .client-facts { margin-top: 32px; }

  .client-fact {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
    font-size: 11px;
  }

  .client-gallery,
  .client-gallery--pair,
  .client-gallery--single,
  .client-gallery--triple,
  .client-gallery--extended {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .gallery-item,
  .gallery-item:nth-child(1),
  .gallery-item:nth-child(2),
  .gallery-item:nth-child(3) {
    width: 100%;
    grid-column: auto;
    margin-top: 0;
  }

  .gallery-frame,
  .gallery-frame--crop {
    width: 100%;
    min-height: 0;
    height: auto;
    padding: 12px;
    overflow: visible;
  }

  .gallery-frame img,
  .gallery-frame--crop img {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
  }

  .gallery-item figcaption {
    margin-top: 9px;
    font-size: 9px;
  }

  .next-category {
    padding: 50px 20px 56px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: end;
  }

  .next-category .next-label { grid-column: 1 / -1; }

  .next-category h2 {
    font-size: clamp(46px, 14vw, 62px);
    line-height: 1.05;
  }

  .wechat-cta {
    padding: 58px 20px 64px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
  }

  .wechat-cta h2 {
    max-width: 8.5em;
    font-size: clamp(42px, 12.5vw, 56px);
    line-height: 1.12;
    text-wrap: pretty;
  }

  .wechat-cta__qr {
    display: block;
    width: min(100%, 330px);
    margin: 4px auto 0;
  }

  .wechat-cta__qr img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .wechat-cta__qr figcaption {
    max-width: none;
    margin: 8px 0 0;
    color: rgba(9, 10, 8, 0.68);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-align: center;
  }

  .wechat-cta > a {
    width: 100%;
    padding: 16px 18px;
    text-align: center;
  }

  .case-footer {
    min-height: 0;
    padding: 46px 20px 38px;
    flex-direction: column;
    align-items: flex-start;
    gap: 34px;
  }

  .case-footer strong { font-size: 28px; }

  .case-footer__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  .case-header { padding-right: 14px; padding-left: 14px; }
  .brand { font-size: 13px; }
  .case-header nav { gap: 9px; font-size: 8px; }
  .category-hero,
  .client-section,
  .next-category,
  .wechat-cta { padding-right: 16px; padding-left: 16px; }
  .category-copy h1 { font-size: 45px; }
  .client-copy h2 { font-size: 38px; }
}
