:root {
  --paper: #f3eee6;
  --paper-2: #e9e1d4;
  --ink: #1b1a17;
  --ink-2: #57524a;
  --ink-3: #8a8378;
  --rule: rgba(27, 26, 23, 0.16);
  --accent: #8c3b2a;
  --teal: #1f4a47;
  --night: #161b1a;
  --night-ink: #ece6dc;
  --night-ink-2: #a39c90;
  --night-rule: rgba(236, 230, 220, 0.16);

  --serif: "Instrument Serif", "Noto Serif SC", "Songti SC", "Times New Roman", serif;
  --sans: "Geist", -apple-system, "PingFang SC", "Noto Sans SC", "Helvetica Neue", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
::selection { background: var(--accent); color: var(--paper); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.mark {
  text-decoration: none; font: 400 26px/1 var(--serif); letter-spacing: -0.01em;
  display: flex; align-items: baseline; gap: 12px; white-space: nowrap;
}
.mark span { font: 400 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); font-size: 14px; }
.nav a { text-decoration: none; color: var(--ink-2); transition: color .2s; }
.nav a:hover { color: var(--ink); }
.nav .nav-cta {
  color: var(--paper); background: var(--ink); padding: 9px 16px; border-radius: 999px;
  transition: background .2s;
}
.nav .nav-cta:hover { background: var(--accent); color: var(--paper); }
.lang {
  appearance: none; cursor: pointer;
  min-width: 52px; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--rule); background: transparent; color: var(--ink);
  font: 500 13px/1 var(--sans);
  transition: border-color .2s, background .2s;
}
.lang:hover { border-color: var(--ink); background: var(--paper-2); }

/* Chinese typography: CJK serif has no italic and needs looser leading */
html[lang="zh-CN"] em { font-style: normal; }
html[lang="zh-CN"] .hero-title { font-size: clamp(36px, 6vw, 84px); line-height: 1.18; letter-spacing: 0; font-weight: 500; max-width: 15em; }
html[lang="zh-CN"] .contact-title { font-size: clamp(36px, 6vw, 84px); line-height: 1.2; letter-spacing: 0; font-weight: 500; max-width: 12em; }
html[lang="zh-CN"] .sec-title,
html[lang="zh-CN"] .c-name,
html[lang="zh-CN"] .i-name,
html[lang="zh-CN"] .svc h3 { letter-spacing: 0; }
html[lang="zh-CN"] .sec-title { font-weight: 500; }
html[lang="zh-CN"] .svc h3 { font-size: 24px; font-weight: 500; }
html[lang="zh-CN"] .eyebrow,
html[lang="zh-CN"] .sec-note,
html[lang="zh-CN"] .c-no,
html[lang="zh-CN"] .c-facts dt,
html[lang="zh-CN"] .tally dt { letter-spacing: 0.04em; }
html[lang="zh-CN"] .c-sum,
html[lang="zh-CN"] .hero-lede { line-height: 1.75; }

/* Hero */
.hero { padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(48px, 7vw, 88px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 400 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(31, 74, 71, 0.15); }
.hero-title {
  margin-top: 28px;
  font: 400 clamp(44px, 7.4vw, 104px)/0.96 var(--serif);
  letter-spacing: -0.025em;
  max-width: 17ch;
  text-wrap: balance;
}
.hero-title em { font-style: italic; color: var(--accent); }
.hero-foot {
  margin-top: clamp(32px, 5vw, 56px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: end;
  padding-top: 24px; border-top: 1px solid var(--rule);
}
.hero-lede { max-width: 52ch; font-size: clamp(16px, 1.5vw, 19px); color: var(--ink-2); }
.tally { display: flex; gap: clamp(20px, 3.5vw, 48px); }
.tally dt { font: 400 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.tally dd { margin-top: 8px; font: 400 clamp(40px, 5vw, 64px)/1 var(--serif); }

/* Contact sheet of phone screenshots */
.sheet {
  margin-top: clamp(40px, 6vw, 72px);
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(8px, 1.4vw, 18px);
}
.sheet li:nth-child(even) { transform: translateY(28px); }
.sheet a { display: block; text-decoration: none; }
.sheet img {
  aspect-ratio: 390 / 844; width: 100%; object-fit: cover; object-position: top;
  border-radius: clamp(8px, 1.2vw, 16px);
  border: 1px solid var(--rule);
  box-shadow: 0 18px 40px -24px rgba(27, 26, 23, 0.45);
  transition: transform .45s cubic-bezier(.2,.7,.2,1);
}
.sheet a:hover img { transform: translateY(-8px); }
.sheet span { display: block; margin-top: 10px; font: 400 11px/1 var(--mono); color: var(--ink-3); }

/* Section heads */
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding-bottom: 20px; border-bottom: 1px solid var(--ink);
}
.sec-title { font: 400 clamp(36px, 5vw, 64px)/1 var(--serif); letter-spacing: -0.02em; }
.sec-note { font: 400 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }

/* Work index */
.index-sec { padding: clamp(64px, 9vw, 120px) 0 0; position: relative; }
.index li { border-bottom: 1px solid var(--rule); }
.index a {
  display: grid;
  grid-template-columns: 56px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.9fr) 32px;
  align-items: baseline; gap: 16px;
  padding: 22px 0; text-decoration: none;
  transition: padding .3s cubic-bezier(.2,.7,.2,1), color .2s;
}
.i-no { font: 400 12px/1 var(--mono); color: var(--ink-3); }
.i-name { font: 400 clamp(24px, 2.8vw, 38px)/1.1 var(--serif); letter-spacing: -0.01em; }
.i-ind, .i-loc { font-size: 14px; color: var(--ink-2); }
.i-go { justify-self: end; font-size: 18px; color: var(--ink-3); transition: transform .3s, color .2s; }
.index a:hover { padding-left: 12px; }
.index a:hover .i-name { color: var(--accent); }
.index a:hover .i-go { color: var(--accent); transform: translate(2px, 2px); }

.peek {
  position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none;
  width: 340px; aspect-ratio: 1440 / 900;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(27, 26, 23, 0.5);
  opacity: 0; scale: .92; transform: translate3d(-9999px, 0, 0);
  transition: opacity .2s, scale .25s;
}
.peek img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.peek.on { opacity: 1; scale: 1; }

/* Case studies */
.cases { padding: clamp(40px, 6vw, 80px) 0 clamp(64px, 9vw, 120px); }
.case {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(28px, 5vw, 72px); align-items: start;
  padding: clamp(48px, 7vw, 96px) 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 80px;
}
.case:last-child { border-bottom: 0; }
.case-meta { position: sticky; top: 96px; }
.c-no { font: 400 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.c-name { margin-top: 14px; font: 400 clamp(34px, 4vw, 52px)/1 var(--serif); letter-spacing: -0.02em; }
.c-sum { margin-top: 18px; color: var(--ink-2); max-width: 40ch; }
.c-did { margin-top: 22px; display: grid; gap: 10px; font-size: 14.5px; }
.c-did li { position: relative; padding-left: 20px; }
.c-did li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 10px; height: 1px; background: var(--ink); }
.c-facts { margin-top: 26px; display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid var(--rule); }
.c-facts div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
.c-facts dt { font: 400 11px/1.7 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.c-facts dd { font-size: 14px; }
.c-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 26px;
  font-size: 14px; font-weight: 500; text-decoration: none;
  padding-bottom: 4px; border-bottom: 1px solid currentColor;
  transition: color .2s, gap .2s;
}
a.c-link:hover { color: var(--accent); gap: 12px; }
.c-link.is-muted { color: var(--ink-3); border-bottom-style: dashed; font-weight: 400; }

.case-shot { position: relative; padding-bottom: 8%; }
.frame {
  border-radius: 12px; overflow: hidden; background: #fff;
  border: 1px solid var(--rule);
  box-shadow: 0 40px 80px -40px rgba(27, 26, 23, 0.45);
}
.bar {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  background: var(--paper-2); border-bottom: 1px solid var(--rule);
}
.bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(27, 26, 23, 0.18); }
.bar span {
  margin-left: 12px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 400 11px/1 var(--mono); color: var(--ink-3);
}
.frame img { width: 100%; aspect-ratio: 1440 / 900; object-fit: cover; object-position: top; }
.phone {
  position: absolute; right: -3%; bottom: 0; width: 21%;
  border-radius: clamp(12px, 2vw, 26px); overflow: hidden;
  border: clamp(3px, 0.5vw, 6px) solid var(--ink);
  background: var(--ink);
  box-shadow: 0 30px 50px -20px rgba(27, 26, 23, 0.55);
}
.phone img { width: 100%; aspect-ratio: 390 / 844; object-fit: cover; object-position: top; }

/* Platforms: night band */
.platforms {
  background: var(--night); color: var(--night-ink);
  padding: clamp(64px, 9vw, 120px) 0 clamp(32px, 5vw, 64px);
  --rule: var(--night-rule);
  --ink-2: var(--night-ink-2);
  --ink-3: #7c766c;
}
.platforms .sec-head { border-bottom-color: var(--night-ink); }
.platforms .c-no { color: #d9a07f; }
.platforms .c-did li::before { background: var(--night-ink); }
.platforms a.c-link:hover { color: #d9a07f; }
.platforms .frame { background: #000; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8); }
.platforms .bar { background: #222826; }
.platforms .bar i { background: rgba(236, 230, 220, 0.25); }
.platforms .phone { border-color: #000; background: #000; }

/* Services */
.services { padding: clamp(72px, 10vw, 136px) 0 0; }
.svc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.svc li { padding: 28px 24px 8px 0; }
.svc li + li { padding-left: 24px; border-left: 1px solid var(--rule); }
.svc h3 { font: 400 28px/1.1 var(--serif); }
.svc p { margin-top: 12px; font-size: 14.5px; color: var(--ink-2); }

/* Process */
.process { padding: clamp(72px, 10vw, 136px) 0; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.steps li { padding-top: 28px; }
.s-no { display: block; font: italic 400 56px/1 var(--serif); color: var(--teal); }
.steps h3 { margin-top: 16px; font-size: 17px; font-weight: 500; }
.steps p { margin-top: 8px; font-size: 14.5px; color: var(--ink-2); }

/* Contact */
.contact {
  background: var(--accent); color: var(--paper);
  padding: clamp(72px, 11vw, 150px) 0;
}
.contact-title { font: 400 clamp(44px, 7.5vw, 104px)/0.98 var(--serif); letter-spacing: -0.025em; max-width: 15ch; text-wrap: balance; }
.contact-title em { font-style: italic; }
.contact-row { margin-top: clamp(32px, 5vw, 56px); display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.btn {
  display: inline-block; text-decoration: none;
  background: var(--paper); color: var(--ink);
  font-size: clamp(16px, 1.8vw, 20px); font-weight: 500;
  padding: 18px 28px; border-radius: 999px;
  transition: transform .25s cubic-bezier(.2,.7,.2,1), background .2s;
}
.btn:hover { transform: translateY(-2px); background: #fff; }
.contact-note { max-width: 34ch; color: rgba(243, 238, 230, 0.82); }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); }
.foot-row {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 24px; padding-bottom: 24px;
  font: 400 12px/1.4 var(--mono); color: var(--ink-3);
}
.foot-row a { text-decoration: none; }
.foot-row a:hover { color: var(--ink); }

/* Reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }

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

/* Responsive */
@media (max-width: 960px) {
  .case { grid-template-columns: minmax(0, 1fr); }
  .case-meta { position: static; }
  .case-shot { order: -1; }
  .svc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .svc li:nth-child(3) { padding-left: 0; border-left: 0; }
  .svc li:nth-child(n+3) { border-top: 1px solid var(--rule); margin-top: 20px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .mark span { display: none; }
  .nav a:not(.nav-cta) { display: none; }
  .hero-foot { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .sheet {
    grid-template-columns: repeat(7, 38%); overflow-x: auto; scroll-snap-type: x mandatory;
    padding-bottom: 36px; margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter);
    scrollbar-width: none;
  }
  .sheet::-webkit-scrollbar { display: none; }
  .sheet li { scroll-snap-align: start; }
  .index a { grid-template-columns: 36px minmax(0, 1fr) 20px; row-gap: 6px; padding: 18px 0; }
  .i-ind { grid-column: 2; grid-row: 2; }
  .i-loc { display: none; }
  .i-go { grid-column: 3; grid-row: 1; }
  .index a:hover { padding-left: 0; }
  .phone { width: 26%; right: 0; }
  .svc, .steps { grid-template-columns: minmax(0, 1fr); }
  .svc li, .svc li + li { padding-left: 0; border-left: 0; }
  .svc li + li { border-top: 1px solid var(--rule); }
  .svc li:nth-child(n+3) { margin-top: 0; }
  .steps { gap: 0; }
  .steps li { padding: 22px 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 12px; }
  .s-no { font-size: 40px; grid-row: span 2; }
  .steps h3 { margin-top: 4px; }
  .foot-row span:nth-child(2) { display: none; }
}

@media (hover: none), (pointer: coarse) {
  .peek, .hover-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .sheet img, .index a, .btn, .peek { transition: none; }
}
