/* d15 「方格」. The idea and the credits are in d15/README.md. */

@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fafaf6;
  --tint: #eef3e9;
  --ink: #161a15;
  --grey: #5a5f57;
  --seal: #44a428;   /* the logo's green */
  --green: #2e7a1c;  /* the same green, deep enough to carry white text */
  --deep: #1c4614;   /* ground for the logos drawn in white */
  --rule: #a3cf95;   /* manuscript lines */
  --rule-soft: #c9e3c0; /* ruled paper under running Latin text */
  --margin: clamp(20px, 3vw, 44px);
  --section: clamp(96px, 11vw, 176px);
  --latin: "Source Serif 4";
  --cjk-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "Noto Serif SC", "SimSun", serif;
  --cjk-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Noto Sans SC", sans-serif;
  --display: var(--latin), var(--cjk-serif);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); overflow-x: clip; }
html[lang="zh-CN"] body { font: 400 17px/1.85 var(--cjk-sans); letter-spacing: .02em; }
html[lang="en"] body { font: 400 19px/1.6 var(--latin), var(--cjk-serif); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
blockquote, figure { margin: 0; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
::selection { background: var(--seal); color: #fff; }

.wrap { width: min(100% - 2 * var(--margin), 1520px); margin-inline: auto; container-type: inline-size; }
.skip { position: absolute; left: var(--margin); top: -100px; z-index: 10; background: var(--ink); color: #fff; padding: 10px 16px; }
.skip:focus { top: 12px; }

/* ---------- buttons and links ---------- */
.btn {
  display: inline-block; background: var(--green); color: #fff; text-decoration: none;
  font-weight: 600; font-size: 16px; line-height: 1; padding: 13px 18px 12px; letter-spacing: .04em;
  transition: background-color .2s, transform .2s var(--ease);
}
.btn:hover { background: var(--deep); }
.btn:active { transform: translateY(1px); }
.more a, .bio a, .address a, .office a, .foot a {
  text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: .28em;
  text-decoration-color: var(--seal); transition: color .2s, text-decoration-color .2s;
}
.more a:hover, .bio a:hover, .address a:hover, .office a:hover, .foot a:hover { color: var(--green); text-decoration-color: currentColor; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: 20px clamp(20px, 3vw, 48px); padding-block: 18px; }
.brand { display: block; width: clamp(150px, 14vw, 196px); margin-right: auto; }
/* The logo file has a wide white margin: show only the drawn part (x 103–749, y 183–365 of 800×531). */
.brand-crop { display: block; aspect-ratio: 647 / 183; overflow: hidden; }
.brand-crop img { width: calc(800 / 647 * 100%); max-width: none; margin: calc(-183 / 647 * 100%) 0 0 calc(-103 / 647 * 100%); mix-blend-mode: multiply; }
/* The seal alone (x 104–284, y 184–365). */
.seal-crop { display: block; aspect-ratio: 1; overflow: hidden; }
.seal-crop img { width: calc(800 / 181 * 100%); max-width: none; margin: calc(-184 / 181 * 100%) 0 0 calc(-104 / 181 * 100%); mix-blend-mode: multiply; }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 40px); }
.nav ul { display: flex; gap: clamp(18px, 2.6vw, 40px); }
.nav a { text-decoration: none; font-size: 16px; padding-block: 6px; border-bottom: 2px solid transparent; transition: border-color .2s, color .2s; }
.nav a:hover { color: var(--green); }
.nav a[aria-current="page"] { border-bottom-color: var(--seal); }
.lang { color: var(--grey); }
html[lang="en"] .nav a { font-size: 17px; }

/* ---------- cells: CJK set into square cells ----------
   An element with .sheet writes its text into a grid of --cols cells per row. Each full-width glyph
   advances 1em plus letter-spacing, which together make one cell; half the spacing on the left
   centres the glyph in its cell. The grid lines are drawn by ::before (columns) and ::after (rows). */
.sheet, .lines {
  --cell: round(down, 100cqw / var(--cols), 1px);
  --fs: round(calc(var(--cell) * var(--fill, .62)), 1px);
  --ls: calc(var(--cell) - var(--fs));
  --pitch: var(--cell);
  --off: calc((var(--pitch) - var(--cell)) / 2);
  --line: var(--rule);
  position: relative; isolation: isolate;
}
.sheet {
  box-sizing: content-box;
  width: calc(var(--cols) * var(--cell));
  padding-left: calc(var(--ls) / 2);
  margin-right: calc(var(--ls) / -2);
  font-family: var(--cjk-serif);
  font-size: var(--fs);
  line-height: var(--pitch);
  letter-spacing: var(--ls);
  font-variant-east-asian: full-width;
  font-kerning: none;
  text-spacing-trim: space-all;
  text-autospace: no-autospace;
  line-break: strict;
}
.sheet::before, .sheet::after, .lines::before, .lines::after {
  content: ""; position: absolute; z-index: -1; left: 0; top: 0; pointer-events: none;
  width: calc(var(--cols) * var(--cell) + 1px); height: calc(100% + 1px);
}
.sheet::before, .lines::before {
  background: linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / var(--cell) 100% repeat-x;
  -webkit-mask: linear-gradient(180deg, #000 calc(var(--cell) + 1px), transparent 0) 0 var(--off) / 100% var(--pitch);
  mask: linear-gradient(180deg, #000 calc(var(--cell) + 1px), transparent 0) 0 var(--off) / 100% var(--pitch);
}
.sheet::after, .lines::after {
  background: linear-gradient(180deg, var(--line) 1px, transparent 1px var(--cell), var(--line) var(--cell) calc(var(--cell) + 1px), transparent 0) 0 var(--off) / 100% var(--pitch);
}

/* ---------- seals: headings set like the logo's 創業工場 ---------- */
.seal {
  --cell: clamp(40px, 4.2vw, 62px);
  --fs: round(calc(var(--cell) * .74), 1px);
  --ls: calc(var(--cell) - var(--fs));
  --pad: calc(var(--cell) * .3);
  display: block; width: max-content;
  background: var(--seal); color: #fff;
  font-family: var(--cjk-serif); font-weight: 900; font-size: var(--fs); line-height: var(--cell);
  letter-spacing: var(--ls);
  padding: var(--pad) calc(var(--pad) - var(--ls) / 2) var(--pad) calc(var(--pad) + var(--ls) / 2);
  box-shadow: inset 0 0 0 calc(var(--pad) * .32) var(--seal), inset 0 0 0 calc(var(--pad) * .32 + 2px) #fff;
  font-variant-east-asian: full-width; text-spacing-trim: space-all; font-kerning: none;
}
.seal[style*="--seal-cols"] { width: calc(var(--seal-cols) * var(--cell) + 2 * var(--pad)); }
.seal--latin {
  --cell: clamp(30px, 2.8vw, 42px);
  --pad: calc(var(--cell) * .5);
  width: min-content; text-align: center; text-transform: uppercase;
  font-family: var(--latin); font-variant-east-asian: normal; font-weight: 600; font-size: var(--cell); line-height: 1.12; letter-spacing: .09em;
  font-variation-settings: "opsz" 60;
  padding: calc(var(--pad) * .9) calc(var(--pad) - .045em) calc(var(--pad) * .8) calc(var(--pad) + .045em);
}
.seal--xl { --cell: var(--seal-xl, clamp(48px, 6vw, 92px)); }
.seal--latin.seal--xl { --cell: clamp(34px, 4vw, 60px); }
.seal--paper { background: #fff; color: var(--green); box-shadow: inset 0 0 0 calc(var(--pad) * .32) #fff, inset 0 0 0 calc(var(--pad) * .32 + 2px) var(--green); }

/* ---------- home: hero ---------- */
.hero { padding-top: clamp(24px, 5vw, 72px); }
.hero-wrap { --hero-cols: 9; }
.hero-title { --cols: var(--hero-cols); --fill: .7; --line: var(--seal); font-weight: 700; }
.hero-latin {
  font: 560 clamp(40px, 8.3cqw, 128px)/1.08 var(--latin), var(--cjk-serif);
  font-variation-settings: "opsz" 60;
  text-transform: uppercase; letter-spacing: .035em; text-wrap: balance;
  --b: calc(.54em + .3505em + .07em);
  background: linear-gradient(180deg, transparent var(--b), var(--seal) var(--b), var(--seal) calc(var(--b) + max(3px, .035em)), transparent 0) 0 0 / 100% 1.08em;
  padding-bottom: .02em;
}
.hero-lines {
  --cell: round(down, 100cqw / var(--hero-cols), 1px);
  display: grid; grid-template-columns: repeat(3, calc(3 * var(--cell)));
  margin-top: clamp(22px, 2.6vw, 40px);
  font-size: clamp(18px, 1.6cqw, 24px); line-height: 1.55; font-weight: 500; text-wrap: pretty;
}
.hero-lines li { padding-right: clamp(16px, 2cqw, 32px); }
html[lang="zh-CN"] .hero-lines li { padding-left: calc(var(--cell) * .15); }

/* ---------- home: the companies, one cell each ---------- */
.works { padding-top: clamp(48px, 6vw, 96px); }
.works-wrap { --cols: 9; }
.works-sheet { --line: var(--rule); width: calc(var(--cols) * var(--cell)); display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); grid-auto-rows: var(--cell); }
.works-list { display: contents; }
.works-seal { position: relative; }
.works-seal a {
  position: absolute; inset: 1px 0 0 1px; display: flex; align-items: center; justify-content: center;
  background: var(--seal); color: #fff; text-decoration: none;
  box-shadow: inset 0 0 0 calc(var(--cell) * .07) var(--seal), inset 0 0 0 calc(var(--cell) * .07 + 2px) #fff;
  transition: background-color .2s;
}
.works-seal span {
  --sc: round(calc(var(--cell) * .3), 1px); --sfs: round(calc(var(--sc) * .86), 1px); --sls: calc(var(--sc) - var(--sfs));
  display: block; box-sizing: content-box; width: calc(2 * var(--sc));
  padding-left: calc(var(--sls) / 2); margin-right: calc(var(--sls) / -2);
  font: 900 var(--sfs)/var(--sc) var(--cjk-serif); letter-spacing: var(--sls);
  font-variant-east-asian: full-width; text-spacing-trim: space-all; font-kerning: none;
}
.works-seal--latin { grid-column: span 2; }
.works-seal--latin span { width: auto; padding: 0 0 0 .1em; margin: 0; font: 600 max(19px, calc(var(--cell) * .2))/1.1 var(--latin); letter-spacing: .1em; text-transform: uppercase; }
.works-seal a:hover { background: var(--green); }
.cell { position: relative; display: grid; grid-template: 100% / 100%; place-items: center; text-decoration: none; overflow: hidden; }
.works .cell { width: 100%; height: 100%; }
.cell img { width: 72%; height: 54%; object-fit: contain; transition: transform .35s var(--ease); }
.cell[data-ground="light"] img { mix-blend-mode: multiply; }
.cell[data-ground="dark"] { background: var(--deep); }
.works .cell[data-ground="dark"] { margin: 1px 0 0 1px; width: calc(100% - 1px); height: calc(100% - 1px); }
.cell-type { font-family: var(--display); font-weight: 700; font-size: clamp(14px, 1.3vw, 20px); line-height: 1.25; text-align: center; padding: 0 10%; }
.cell-name {
  position: absolute; left: 1px; right: 0; bottom: 0; padding: 6px 8px; font-size: 13px; line-height: 1.3; text-align: center;
  background: var(--ink); color: #fff; transform: translateY(101%); transition: transform .25s var(--ease);
}
a.cell:hover img, a.cell:focus-visible img { transform: translateY(-10%); }
a.cell:hover .cell-name, a.cell:focus-visible .cell-name { transform: none; }
a.cell:focus-visible { outline-offset: -3px; }
.more { margin-top: 22px; font-size: 17px; }

/* ---------- home: the founder's letter ---------- */
.letter { padding-top: var(--section); }
.letter-wrap { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 5vw, 88px); align-items: start; container-type: normal; }
.letter-portrait { position: sticky; top: 24px; }
.letter-portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 28%; }
.letter-text { container-type: inline-size; min-width: 0; }
.letter-text .seal { margin-bottom: clamp(32px, 4vw, 56px); }
.manuscript { --cols: 24; --fill: .6; --pitch: round(calc(var(--cell) * 1.28), 1px); font-weight: 400; }
.manuscript p, .manuscript li { text-indent: calc(var(--cell) * 2); }
.manuscript p:empty, .ruled p:empty { display: none; }
.manuscript .sign { text-indent: 0; text-align: right; }
.sign-line { display: block; }
.sign { position: relative; }
.stamp { position: absolute; width: calc(var(--cell, 40px) * 2.3); right: calc(var(--cell, 40px) * 7.7); top: calc(var(--pitch, 40px) * .7); transform: rotate(-4deg); }
.letter-portrait figcaption { margin-top: 14px; font-size: 15px; color: var(--grey); }
.ruled {
  --lh: 36px;
  line-height: var(--lh); font-size: 19px;
  --y: calc(var(--lh) / 2 + .3505em + 1px);
  background: linear-gradient(180deg, transparent var(--y), var(--rule-soft) var(--y), var(--rule-soft) calc(var(--y) + 1px), transparent 0) 0 0 / 100% var(--lh);
  max-width: 40em;
}
.ruled p { margin-bottom: var(--lh); }
.ruled .sign { text-align: right; margin-bottom: 0; padding-right: 0; }
.ruled .stamp { --cell: 36px; --pitch: 36px; right: 12em; top: 18px; }

/* ---------- home: sayings ---------- */
.sayings { padding-top: var(--section); }
.sayings-wrap .seal { margin-bottom: clamp(28px, 3vw, 48px); }
.sayings-paper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px clamp(24px, 3vw, 48px); }
.saying p { font-family: var(--display); font-size: 19px; line-height: 1.85; }
html[lang="en"] .saying p { font-size: 20px; line-height: 1.55; }
.turn {
  font: inherit; font-size: 15px; background: none; border: 0; color: var(--green); cursor: pointer;
  padding: 6px 0; text-decoration: underline; text-underline-offset: .3em; text-decoration-color: var(--seal);
}
/* Wide screens read the sayings top to bottom, right to left, in ruled columns like letter paper. */
@media (min-width: 1200px) {
  .sayings[data-flow="vertical"] .sayings-wrap { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto 1fr; column-gap: clamp(28px, 3cqw, 56px); }
  .sayings[data-flow="vertical"] .seal { grid-column: 2; grid-row: 1; margin: 0; }
  .sayings[data-flow="vertical"] .turn { grid-column: 2; grid-row: 2; justify-self: end; margin-top: 16px; }
  .sayings[data-flow="vertical"] .sayings-paper {
    grid-column: 1; grid-row: 1 / span 3;
    --fs: round(calc(100cqw / 82), 1px);
    --pitch: round(calc(var(--fs) * 1.9), 1px);
    writing-mode: vertical-rl; display: block; font-size: var(--fs);
    box-sizing: content-box; height: var(--colh); overflow-x: auto; justify-self: end;
    border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule); padding: calc(var(--fs) * 1.2) 0;
    background: linear-gradient(270deg, var(--rule) 1px, transparent 1px) 0 0 / var(--pitch) 100% repeat-x;
    background-position: right 0 top 0;
  }
  .sayings[data-flow="vertical"] .saying { display: block; margin: 0 0 0 var(--pitch); }
  .sayings[data-flow="vertical"] .saying:last-child { margin-left: 0; }
  .sayings[data-flow="vertical"] .saying p { font-family: var(--cjk-serif); font-size: var(--fs); line-height: var(--pitch); letter-spacing: .1em; text-spacing-trim: space-all; }
}

/* ---------- home: strategy, a seal of four ---------- */
.strategy { margin-top: var(--section); background: var(--green); color: #fff; padding-block: clamp(72px, 9vw, 144px); }
.strategy-wrap { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 5vw, 88px); align-items: start; container-type: normal; }
.strategy-head { align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding-block: 13px; }
.strategy-head .statement { font-size: clamp(26px, 2.9vw, 44px); }
.statement { font-family: var(--display); font-weight: 600; font-size: clamp(24px, 2.4vw, 36px); line-height: 1.5; max-width: 17em; }
html[lang="zh-CN"] .strategy .statement, html[lang="zh-CN"] .hero-lines li { word-break: keep-all; overflow-wrap: anywhere; }
html[lang="en"] .statement { font-weight: 500; line-height: 1.3; font-variation-settings: "opsz" 48; }
.quad { display: grid; grid-template-columns: 1fr 1fr; background: #fff; gap: 3px; padding: 3px; outline: 10px solid var(--green); outline-offset: 0; box-shadow: 0 0 0 13px #fff; margin: 13px; }
.quad li { background: var(--green); padding: clamp(22px, 2.6vw, 44px); min-height: clamp(220px, 24vw, 360px); display: flex; flex-direction: column; gap: 18px; }
.quad h3 { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.1vw, 32px); line-height: 1.35; }
html[lang="en"] .quad h3 { font-weight: 600; line-height: 1.2; }
.quad p { font-size: 17px; line-height: 1.75; }
html[lang="en"] .quad p { font-size: 18px; line-height: 1.5; }

/* ---------- inner pages ---------- */
.page-head { padding-top: clamp(32px, 5vw, 80px); }
.page-head-wrap { display: grid; grid-template-columns: auto 1fr; gap: clamp(32px, 5vw, 96px); align-items: end; container-type: normal; }
.page-head .statement { font-weight: 500; font-size: clamp(20px, 1.9vw, 28px); line-height: 1.75; max-width: 30em; }
html[lang="en"] .page-head .statement { font-size: clamp(22px, 2.2vw, 32px); line-height: 1.4; max-width: 24em; }

/* portfolio */
.register { padding-top: clamp(56px, 7vw, 112px); padding-bottom: var(--section); }
.finder { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: clamp(36px, 4vw, 64px); }
.finder label { font-weight: 600; }
.finder input {
  font: inherit; font-size: 17px; color: var(--ink); background: #fff; width: min(100%, 22em);
  border: 2px solid var(--rule); border-radius: 0; padding: 10px 14px; transition: border-color .2s;
}
.finder input:focus { border-color: var(--green); outline: none; }
.finder input:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.finder output { color: var(--grey); font-size: 15px; }
/* The register: one company per row, its logo in a cell, its name, its description. */
.companies { display: grid; gap: clamp(40px, 4.4vw, 72px); }
.company { display: grid; grid-template-columns: 4fr 8fr; grid-template-rows: auto 1fr; gap: 14px clamp(28px, 3.4vw, 56px); align-items: start; scroll-margin-top: 24px; }
.company .cell { grid-row: span 2; height: clamp(110px, 9.4vw, 140px); border: 1px solid var(--rule); }
.company .cell[data-ground="dark"] { border-color: var(--deep); }
.company .cell img { width: 60%; height: 66%; }
.company:target .cell { outline: 3px solid var(--seal); outline-offset: 4px; }
.company h2 { font-family: var(--display); font-size: clamp(22px, 1.9vw, 28px); line-height: 1.3; }
.company-text { font-size: 16px; line-height: 1.85; max-width: 46em; }
html[lang="en"] .company-text { font-size: 17px; line-height: 1.55; }
.company-text p + p, .company-text p + ol, .company-text ol + p { margin-top: .7em; }
.company-text p:empty { display: none; }
.company-text ol { padding-left: 1.3em; }
.company[hidden] { display: none; }
.none { font-size: 20px; }

/* team */
.page-head--short { --head-gap: clamp(40px, 5vw, 80px); padding-bottom: var(--head-gap); }
.page-team { --seal-xl: clamp(48px, 6vw, 92px); --seal-h: calc(2 * var(--seal-xl) * 1.3); --head-gap: clamp(40px, 5vw, 80px); }
.member + .member { margin-top: var(--section); }
.member-wrap { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 5vw, 96px); align-items: start; container-type: normal; }
.member--flip .member-wrap { grid-template-columns: 7fr 5fr; }
.member--flip .member-photo { order: 2; }
.page-team .member:first-of-type .member-text { margin-top: calc(-1 * (var(--seal-h) + var(--head-gap))); }
.member-photo { position: sticky; top: 24px; }
.member-photo img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.member-name { font-family: var(--display); font-weight: 700; font-size: clamp(56px, 8vw, 128px); line-height: 1; letter-spacing: .04em; margin-bottom: clamp(28px, 3vw, 48px); }
html[lang="en"] .member-name { font-weight: 560; letter-spacing: 0; font-variation-settings: "opsz" 60; }
.bio { max-width: 36em; }
.bio p + p { margin-top: 1em; }
.bio p:empty { display: none; }
html[lang="en"] .bio { max-width: 34em; }

/* contact */
.reach { padding-top: clamp(32px, 5vw, 80px); }
.reach-wrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px clamp(28px, 3.4vw, 56px); container-type: normal; align-items: start; }
.label { font-family: var(--display); font-size: clamp(22px, 2vw, 30px); margin-bottom: 22px; }
.bp {
  --c: clamp(64px, 7vw, 108px);
  display: block; width: max-content; text-decoration: none; background: var(--seal); color: #fff;
  font: 900 calc(var(--c) * .74)/var(--c) var(--cjk-serif);
  letter-spacing: calc(var(--c) * .26);
  width: calc(var(--c) * 2 + var(--c) * .64);
  padding: calc(var(--c) * .32) calc(var(--c) * .32 - var(--c) * .13) calc(var(--c) * .32) calc(var(--c) * .32 + var(--c) * .13);
  font-variant-east-asian: full-width; text-spacing-trim: space-all; font-kerning: none;
  box-shadow: inset 0 0 0 calc(var(--c) * .1) var(--seal), inset 0 0 0 calc(var(--c) * .1 + 2px) #fff;
  transition: background-color .2s, transform .15s var(--ease);
}
.bp--latin { width: min-content; font: 600 calc(var(--c) * .5)/1.08 var(--latin); letter-spacing: .08em; text-transform: uppercase; text-align: center; padding: calc(var(--c) * .4) calc(var(--c) * .45); font-variation-settings: "opsz" 60; }
.bp:hover { background: var(--green); }
.bp:active { transform: scale(.97); }
.address { margin-top: 20px; font-size: 20px; }
.qr { width: clamp(180px, 18vw, 240px); mix-blend-mode: multiply; }
.account { margin-top: 12px; font-size: 22px; font-family: var(--latin), var(--cjk-sans); font-weight: 600; letter-spacing: .02em; }
.offices { padding-top: var(--section); padding-bottom: var(--section); }
.office-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px clamp(28px, 3.4vw, 56px); }
.city { font-family: var(--display); font-size: clamp(44px, 5.4vw, 84px); line-height: 1.1; margin-bottom: 20px; letter-spacing: .06em; }
html[lang="en"] .city { font-weight: 560; letter-spacing: 0; font-variation-settings: "opsz" 60; font-size: clamp(36px, 4vw, 60px); }
.office p { font-size: 17px; }

/* ---------- footer ---------- */
.foot { margin-top: var(--section); background: var(--tint); padding-block: clamp(56px, 6vw, 96px) 32px; }
.page-home .foot, .page-portfolio .foot, .page-contact .foot { margin-top: 0; }
.foot-grid { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "mark name btn" "mark nav nav" "line line cities"; gap: 20px clamp(24px, 3vw, 48px); align-items: center; container-type: normal; }
.foot-mark { grid-area: mark; width: clamp(88px, 9vw, 132px); align-self: start; }
.foot-name { grid-area: name; font-family: var(--display); font-weight: 700; font-size: clamp(26px, 3vw, 44px); line-height: 1.15; word-break: keep-all; overflow-wrap: anywhere; }
.foot-grid .btn { grid-area: btn; justify-self: end; }
.foot-nav { grid-area: nav; }
.foot-nav ul { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.foot-cities { grid-area: cities; justify-self: end; color: var(--grey); }
.foot-line { grid-area: line; color: var(--grey); font-size: 14px; margin-top: 40px; }
.foot-cities { margin-top: 40px; font-size: 14px; }

/* ---------- motion ---------- */
@keyframes draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes ink { from { opacity: 0; } to { opacity: 1; } }
@keyframes stamp { 0% { opacity: 0; transform: scale(1.14); } 60% { opacity: 1; } 100% { opacity: 1; transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero-title::before, .hero-title::after { animation: draw .9s var(--ease) both; }
.hero-title { animation: ink .9s .45s ease-out both; }
.hero-latin { animation: rise .8s var(--ease) both; }
.hero-lines li { animation: rise .7s var(--ease) both; }
.hero-lines li:nth-child(1) { animation-delay: .7s; }
.hero-lines li:nth-child(2) { animation-delay: .78s; }
.hero-lines li:nth-child(3) { animation-delay: .86s; }
.js .reveal { opacity: 0; }
.js .reveal.in { animation: rise .7s var(--ease) both; animation-delay: var(--d, 0s); }
.js .seal.reveal.in, .js .works-seal.reveal.in { animation-name: stamp; animation-duration: .45s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; }
}
@media print { .js .reveal { opacity: 1 !important; animation: none !important; } }

/* Browsers without round() size the cells unrounded; lines may then fall between pixels. */
@supports not (width: round(1.5px, 1px)) {
  .sheet, .lines { --cell: calc(100cqw / var(--cols)); --fs: calc(var(--cell) * var(--fill, .62)); }
  .hero-lines { --cell: calc(100cqw / var(--hero-cols)); }
  .manuscript { --pitch: calc(var(--cell) * 1.28); }
  .seal { --fs: calc(var(--cell) * .74); }
  .works-seal span { --sc: calc(var(--cell) * .3); --sfs: calc(var(--sc) * .86); }
  .sayings[data-flow] .sayings-paper { --fs: calc(100cqw / 82); --pitch: calc(var(--fs) * 1.9); }
}

/* ---------- narrow desktop ---------- */
@media (min-width: 1024px) and (max-width: 1279px) {
  .manuscript { --cols: 18; }
}

/* ---------- tablet ---------- */
@media (max-width: 1023px) {
  .works-wrap { --cols: 6; }
  .letter-wrap, .strategy-wrap { grid-template-columns: 1fr; }
  .letter-portrait { position: static; max-width: 520px; }
  .manuscript { --cols: 20; }
  .sayings-paper { grid-template-columns: 1fr 1fr; }
  .quad { max-width: 720px; }
  .page-head-wrap { grid-template-columns: 1fr; align-items: start; }
  .member-wrap, .member--flip .member-wrap { grid-template-columns: 1fr 1fr; }
  .reach-wrap { grid-template-columns: 1fr 1fr; }
  .reach-wrap .seal { grid-column: 1 / -1; }
  .office-list { grid-template-columns: 1fr; }
  .company { grid-template-columns: 1fr 2fr; }
  .office { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr; column-gap: 32px; }
  .office .city { grid-row: span 3; }
}

/* ---------- phone ---------- */
@media (max-width: 639px) {
  html[lang="zh-CN"] body { font-size: 16px; }
  html[lang="en"] body { font-size: 18px; }
  .top { flex-wrap: wrap; padding-block: 14px 10px; }
  .nav { order: 3; width: 100%; justify-content: space-between; gap: 12px; }
  .nav ul { gap: 18px; }
  .nav a, html[lang="en"] .nav a { font-size: 15px; }
  .btn--top { padding: 11px 14px 10px; font-size: 15px; }
  .hero-wrap { --hero-cols: 3; }
  .hero-lines { grid-template-columns: 1fr; gap: 10px; }
  .hero-lines li { padding-right: 0; }
  html[lang="zh-CN"] .hero-lines li { padding-left: 0; }
  .works-wrap { --cols: 4; }
  .cell-name { font-size: 11px; padding: 4px; }
  .manuscript { --cols: 14; --fill: .62; }
  .letter-portrait { max-width: none; }
  .letter-portrait img { aspect-ratio: 1; }
  .sayings-paper { grid-template-columns: 1fr; gap: 32px; }
  .saying p, html[lang="en"] .saying p { font-size: 18px; }
  .quad { grid-template-columns: 1fr; margin: 10px 10px 10px; box-shadow: 0 0 0 10px #fff; outline-width: 7px; }
  .quad li { min-height: 0; }
  .member-wrap, .member--flip .member-wrap { grid-template-columns: 1fr; }
  .member--flip .member-photo { order: 0; }
  .page-team .member:first-of-type .member-text { margin-top: 0; }
  .member-photo { position: static; }
  .member-photo img { aspect-ratio: 4 / 5; }
  .reach-wrap { grid-template-columns: 1fr; gap: 64px; }
  .office { grid-template-columns: 1fr; }
  .office .city { grid-row: auto; }
  .company { grid-template-columns: 1fr; }
  .company .cell { grid-row: auto; height: 120px; }
  .foot-grid { grid-template-columns: auto 1fr; grid-template-areas: "mark name" "nav nav" "btn btn" "cities cities" "line line"; }
  .foot-grid .btn { justify-self: start; }
  .foot-cities { justify-self: start; margin-top: 16px; }
  .foot-line { margin-top: 0; }
}
