:root {
  color-scheme: light;
  --page: #fcfcfb;
  --paper: #fff;
  --ink: #161619;
  --body: #49494f;
  --muted: #64646e;
  --line: #dedee2;
  --band: #f2f1f6;
  --quiet: #f5f4f7;
  --brand: #5e43ff;
  --link: #5036db;
  --tint: #ece8fb;
  --glass: rgb(252 252 251 / 94%);
  --menu-surface: #2e2e32;
  --menu-glass: rgb(31 31 35 / 90%);
  --contact-surface: #19181e;
  --viewer-surface: #19191c;
  --menu-shadow: 0 16px 45px rgb(26 24 43 / 10%);
  --head: 78px;
  --side: clamp(1.5rem, 6.5vw, 6rem);
  --edge: clamp(12px, 2.5vw, 40px);
  --wide: 1160px;
  --reading: 844px;
  --section-space: clamp(4.5rem, 8.5vw, 7.5rem);
  --heading-gap: clamp(2.5rem, 4.8vw, 4.25rem);
  --row-space: clamp(1.375rem, 2.1vw, 2rem);
  --item-title: clamp(1.0625rem, 1rem + .2vw, 1.25rem);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Inter", "Noto Sans TC", sans-serif;
}
:root[data-ddw-theme="dark"] {
  color-scheme: dark;
  --page: #101012;
  --paper: #19191d;
  --ink: #f4f3f6;
  --body: #c6c5cc;
  --muted: #aaa9b3;
  --line: #36363d;
  --band: #1c1b22;
  --quiet: #211f28;
  --brand: #7055f6;
  --link: #baaeff;
  --tint: #2b2441;
  --glass: rgb(16 16 18 / 94%);
  --menu-surface: #1c1b21;
  --menu-glass: rgb(18 17 22 / 92%);
  --contact-surface: #292730;
  --viewer-surface: #242329;
  --menu-shadow: 0 16px 45px rgb(0 0 0 / 35%);
}
*, *::before, *::after { box-sizing: border-box; }
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 16px/1.75 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, figure { margin: 0; }
button, summary { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--link); text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { color: var(--ink); background: var(--tint); }
:where(a, button, summary) { -webkit-tap-highlight-color: transparent; }
:where(a, button, summary, dialog, [tabindex]):focus { outline: 0; }
:root:not([data-pointer-input]) :is(a, button, summary):focus-visible {
  text-decoration: underline solid currentColor 2px;
  text-underline-offset: .22em;
}
:root:not([data-pointer-input]) a:focus-visible img { opacity: .65; }
:where(main, section, article, h2, h3, h4)[id] { scroll-margin-block-start: calc(var(--head) + 15px); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.version-preview-label { position: fixed; z-index: 38; bottom: max(1rem, env(safe-area-inset-bottom)); left: var(--side); padding: .35rem .8rem; border-radius: 1rem; background: var(--ink); color: var(--page); font: 500 .75rem/1.5 var(--font); pointer-events: none; }
.skip { position: fixed; z-index: 60; left: 12px; top: 8px; transform: translateY(-170%); padding: 8px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.skip:focus { transform: none; }

/* Reserve the opening space while each fixed control blends with the page beneath it. */
.bar { height: var(--head); background: transparent; pointer-events: none; }
.bar-inner { --bar-inset: calc(max(0px, 50vw - 800px) + clamp(16px, 3.5vw, 58px)); }
.brand, #menu {
  position: fixed; z-index: 42; top: calc(var(--head) / 2); translate: 0 -50%; pointer-events: auto;
}
.brand { inset-inline-start: var(--bar-inset); display: block; width: clamp(44px, 4vw, 50px); aspect-ratio: 1; }
#menu { inset-inline-end: var(--bar-inset); }
.brand img { display: block; width: 100%; height: 100%; }
.brand > picture { display:contents; }
:root[data-ddw-theme="dark"] .brand:has(img[data-custom-dark]) { mix-blend-mode:normal; }
.control { width: 42px; height: 42px; display: inline-grid; place-items: center; background: transparent; border: 0; border-radius: 50%; padding: 0; }
.control:hover { color: var(--link); }
.theme-icon { width: 17px; height: 17px; display: block; border: 1.5px solid currentColor; border-radius: 50%; background: linear-gradient(90deg, transparent 50%, currentColor 50%); transform: rotate(-32deg); }

/* One shared centre line; wide plates for work, a shorter measure for reading. */
main { min-width: 0; overflow-wrap: anywhere; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; min-height: clamp(570px, 74svh, 790px); padding: clamp(56px, 7.4vh, 90px) var(--side) clamp(72px, 9vh, 110px); text-align: center; }
/* Give the longer English statement room to stay on one line on desktop. */
.hero:lang(en) { --side: clamp(1rem, 1.75vw, 2.5rem); }
.hero-inner {
  --signature-size: clamp(3.375rem, min(12.56vw, 23svh), 11.75rem);
  width: 100%; max-width: 92rem; margin-inline: auto;
}
.signature-stage {
  --portrait-size: 2.02em;
  /* Align the caption to the portrait's lower edge. The g can descend beside it. */
  height: var(--portrait-size);
  max-width: 100%;
  font-size: var(--signature-size);
  font-weight: 600;
  line-height: 1;
}
.signature {
  --portrait-offset: .31em;
  --portrait-width: min(var(--portrait-size), calc(var(--portrait-size) * var(--portrait-ratio, 1)));
  --portrait-height: min(var(--portrait-size), calc(var(--portrait-size) / var(--portrait-ratio, 1)));
  /* Keep the stroke tied to the earlier type size as the composition grows. */
  --stroke-reference-size: calc(1.125 * clamp(2.5rem, min(1.6rem + 6.4vw, 15svh), 7rem));
  position: relative;
  isolation: isolate;
  display: grid;
  width: max-content;
  max-width: 100%;
  /* Leave room below the portrait for the descending stroke of the g. */
  height: calc(var(--portrait-size) + .38em);
  margin-inline: auto;
}
.signature-line {
  grid-area: 1 / 1;
  align-self: end;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: .15em;
  font: 400 1.62em/1 "Explora", cursive;
  font-synthesis: none;
  letter-spacing: normal;
  white-space: nowrap;
}
.signature > .signature-line {
  z-index: 1;
  -webkit-text-stroke: .015em currentColor;
}
[data-fit-name] .signature-line { font-size: calc(1.62em * var(--name-scale, 1)); }
[data-fit-name] .signature-line > span { flex: none; }
.signature .portrait {
  position: absolute;
  top: calc(var(--portrait-size) - var(--portrait-height));
  left: calc(50% + var(--portrait-offset) - var(--portrait-width) / 2);
  width: var(--portrait-width);
  height: var(--portrait-height);
  max-width: none;
}
.signature-outline { display: none; }
/* The bitmap and the outline mask share the same size and optical centre. */
@supports ((mask-image: linear-gradient(black, black)) or (-webkit-mask-image: linear-gradient(black, black))) and (-webkit-text-stroke: 1px white) {
  .signature > .signature-line { z-index: 0; }
  .signature .portrait { z-index: 1; }
  .signature-outline {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    color: transparent;
    -webkit-text-stroke: clamp(1.2px, calc(.016 * var(--stroke-reference-size)), 1.9px) #fff;
    -webkit-mask: var(--portrait-mask) calc(50% + var(--portrait-offset)) calc(var(--portrait-size) - var(--portrait-height)) / var(--portrait-width) var(--portrait-height) no-repeat;
    mask: var(--portrait-mask) calc(50% + var(--portrait-offset)) calc(var(--portrait-size) - var(--portrait-height)) / var(--portrait-width) var(--portrait-height) no-repeat;
    mask-mode: alpha;
    pointer-events: none;
    user-select: none;
  }
}
@media (forced-colors: active) {
  .signature-stage, .signature { height: auto; }
  .signature :is(.portrait, .signature-outline) { display: none; }
}
.role {
  container: signature-caption / inline-size;
  width: 100%;
  margin: clamp(.5rem, .6vw, .625rem) auto 0;
  color: var(--link);
  font-size: .9375rem;
  font-weight: 550;
  letter-spacing: .025em;
  word-break: keep-all;
}
.role-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 .35em;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}
.role .native-name {
  display: inline-block;
  margin-inline-end: .35em;
  color: var(--body);
  font-size: clamp(1rem, .95rem + .15vw, 1.0625rem);
  font-weight: 480;
  line-height: 1.05;
  letter-spacing: .04em;
  max-width: 100%;
}
.role-line > span { min-width: 0; max-width: 100%; }
.name-divider { margin-inline-start: .65em; color: var(--line); font-weight: 400; }
.role-divider { margin-inline-end: .35em; }
.name-divider:empty, .role-divider:empty { display: none; }
@container signature-caption (width > 32rem) {
  /* As the centred line reaches the tail of the g, clear its .45em descent. */
  .role-line > * {
    margin-block-start: clamp(0px, 100% - 3 * var(--signature-size), .45 * var(--signature-size));
  }
}
@container signature-caption (max-width: 32rem) {
  .role-line { flex-wrap: wrap; align-items: center; row-gap: .15em; line-height: 1.4; }
  .role .native-name { width: 100%; margin: 0; padding: 0; border: 0; }
  .role:lang(en) .role-line { flex-direction: column; }
  .role .name-divider, .role:lang(en) .role-divider { display: none; }
}
.hero-statement {
  container-type: inline-size;
  width: 100%;
  margin-inline: auto;
  padding-block: clamp(3.5rem, 8svh, 6rem) clamp(2rem, 4svh, 3.5rem);
}
.bio {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  color: var(--body);
  font-size: clamp(1.0625rem, 3.05cqi, 2.25rem);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -.02em;
  text-align: center;
  text-wrap: balance;
  line-break: strict;
}
.bio strong { color: var(--ink); font-weight: 640; }
.bio mark {
  --marker-color: #ffe600;
  --marker-height: .34em;
  --marker-inset: .08em;
  padding-block-end: .13em;
  color: inherit;
  background: linear-gradient(var(--marker-color), var(--marker-color))
    left bottom var(--marker-inset) / 100% var(--marker-height) no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
/* Latin letters meet the baseline a little higher than the Chinese glyphs. */
.bio:lang(en) mark { --marker-inset: .18em; }
@media (forced-colors: active) {
  .bio mark { background: none; color: inherit; text-decoration: underline; }
}
.bio:lang(en) { font-size: clamp(1rem, 1.84cqi, 1.625rem); letter-spacing: -.025em; overflow-wrap: anywhere; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 45px; padding: 10px 25px; border-radius: 999px; border: 1px solid transparent; font-size: 15px; font-weight: 620; line-height: 1.45; }
.primary { background: var(--brand); color: white; }
.primary:hover { background: #4e34dc; }
.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.secondary:hover { border-color: var(--muted); background: var(--paper); }

.section, .site-footer { width: min(calc(100% - var(--side) - var(--side)), var(--reading)); margin-inline: auto; }
.section { padding-block: var(--section-space); }
.section h2 { font-size: clamp(1.375rem, 1.15rem + .65vw, 1.875rem); font-weight: 560; line-height: 1.4; letter-spacing: -.015em; text-align: center; text-wrap: balance; }
.section-heading { display: grid; justify-items: center; gap: 12px; margin-bottom: clamp(34px, 4vw, 62px); }
.section > h2 { margin-bottom: var(--heading-gap); }
.section h3, .section h4 { line-height: 1.38; letter-spacing: -.028em; text-wrap: pretty; }
.text-link, .project-links a, .site-footer a { color: var(--link); font-size: 14px; line-height: 1.5; font-weight: 590; text-underline-offset: .3em; }
.text-link:hover, .project-links a:hover, .site-footer a:hover, .contact-item a:hover { text-decoration: underline; }
.text-link { display: inline-flex; align-items: center; min-height: 33px; min-width: 0; max-width: 100%; padding-inline: 4px; }
.featured, #contact {
  width: min(calc(100% - var(--edge) - var(--edge)), 1552px);
  padding: clamp(52px, 6.1vw, 92px) var(--side) clamp(62px, 6.8vw, 104px);
  background: var(--band);
  border-radius: clamp(22px, 2.8vw, 44px);
}
.gallery { width: min(calc(100% - var(--side) - var(--side)), var(--wide)); padding-block: clamp(86px, 10vw, 150px); }
.featured-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: clamp(34px, 4vw, 64px); max-width: var(--wide); margin-inline: auto; }
.case { min-width: 0; }
.case-visual { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1.8; overflow: hidden; padding: 4% 6%; border-radius: clamp(12px, 1.35vw, 21px); background: #e5dff6; }
.case:nth-child(even) .case-visual { background: #dfe3e6; }
.case-visual img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 5px; box-shadow: 0 5px 20px rgb(23 21 37 / 11%); }
.case-heading { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 18px; row-gap: 4px; justify-content: space-between; margin-bottom: 8px; }
.case-visual + .case-heading { margin-top: 21px; }
.case-heading :is(h3, h4) { font-size: clamp(21px, 1.8vw, 29px); font-weight: 670; overflow-wrap: anywhere; }
.project-type { color: var(--muted); font-size: 13px; font-weight: 510; line-height: 1.5; }
.case-copy p { color: var(--body); line-height: 1.85; text-wrap: pretty; }
.project-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-top: 13px; }
.project-links a { display: inline-flex; align-items: center; min-height: 35px; min-width: 0; max-width: 100%; }
.gallery-grid { row-gap: clamp(46px, 5.8vw, 86px); }
.gallery-title { margin: 0 0 clamp(24px, 2.5vw, 38px); color: var(--body); font-size: clamp(17px, 1.5vw, 22px); text-align: center; font-weight: 580; }
.gallery-group + .gallery-group { margin-top: clamp(56px, 6.6vw, 98px); padding-top: clamp(38px, 4.9vw, 72px); }
.gallery-group:not(:has(> .gallery-grid > *, > .cms-section-content)) { display: none; }
.text-case { padding-top: 16px; }
.gallery-index { margin-top: clamp(35px, 4.3vw, 64px); justify-content: center; }

.timeline-entry, .activity { display: grid; grid-template-columns: minmax(165px, .82fr) minmax(0, 2fr); gap: 5px clamp(24px, 4vw, 64px); padding-block: clamp(24px, 2.7vw, 38px); }
.timeline-entry:first-child, h2 + .activity { padding-top: 0; border: 0; }
.timeline-entry:last-child, .activity:last-child { padding-bottom: 0; }
.timeline-entry > :not(.period) { grid-column: 2; }
.period, .date, .school-date { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.timeline-entry .period, .activity .date { grid-column: 1; padding-top: 4px; }
.timeline-entry h3, .activity h3, .school h3, .skill h3 { font-size: clamp(20px, 1.7vw, 26px); font-weight: 630; }
.timeline-entry p, .timeline-entry li, .activity p, .skill p, .school p, .intro-copy, .note { color: var(--body); }
.timeline-entry .job-title { color: var(--link); font-weight: 570; }
.timeline-entry ul { margin: 4px 0 0; padding-left: 1.4em; }
.activity p, .skill p { margin-top: 6px; }
.school { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 22px 0; }
h2 + .school { border: 0; padding-top: 0; }
.school .school-date { color: var(--muted); margin-top: 4px; }
.pill, .keywords span { display: inline-block; border-radius: 999px; padding: 5px 13px; font-size: 13px; font-weight: 540; }
.pill { flex: none; background: var(--tint); color: var(--link); }
.intro-copy, .research-intro, .note { max-width: 44em; margin-inline: auto; text-align: center; text-wrap: balance; }
.intro-copy { margin-top: 22px; }
.keywords { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.keywords span { border: 1px solid var(--line); color: var(--body); }
.skill-grid, .doc-grid { display: grid; gap: 24px clamp(26px, 4vw, 64px); }
.skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.skill { padding: 19px 0; }
.research-intro { font-size: var(--item-title); font-weight: 560; }
.note { margin-block: .65rem clamp(2rem, 3.4vw, 3rem); }
.doc-grid { grid-template-columns: repeat(2, minmax(0, max-content)); justify-content: center; row-gap: 0; }
.doc-link {
  display: flex; align-items: center; gap: .5rem; min-width: 0; min-height: 44px; padding: 17px 3px; color: var(--ink);
  font-weight: 540; text-align: start; text-wrap: balance;
}
.doc-link > :is(svg,img) { flex: none; }
.doc-grid > .doc-link:nth-child(odd of .doc-link):nth-last-child(1 of .doc-link) {
  grid-column: 1 / -1; justify-self: center; max-width: 100%;
}
.doc-link svg {
  width: 1.25rem; height: 1.25rem;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.doc-link:hover { color: var(--link); }
#contact { padding-block: var(--section-space); }
.contact-list { display: flex; justify-content: center; flex-wrap: wrap; gap: clamp(1.75rem, 3.6vw, 3.25rem) 38px; text-align: center; }
.contact-item { display: grid; gap: .4rem; justify-items: center; min-width: 0; }
.contact-item > span { color: var(--muted); font-size: 13px; }
.contact-item a { max-width: 100%; overflow-wrap: anywhere; text-underline-offset: .15em; }
.contact-item:first-child { width: 100%; }
.contact-item:first-child a { font-size: clamp(1.1875rem, 1rem + .75vw, 1.625rem); line-height: 1.5; letter-spacing: -.025em; color: var(--ink); font-weight: 540; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: var(--wide); width: min(calc(100% - var(--side) - var(--side)), var(--wide)); padding-block: 32px; color: var(--muted); font-size: 13px; }

@media (max-width: 840px) {
  :root { --head: 66px; }
  .hero { min-height: clamp(520px, 70svh, 680px); }
  .featured { padding-inline: clamp(18px, 4vw, 36px); }
  .featured-grid { column-gap: 26px; }
}
@media (max-width: 48rem) {
  .hero-inner { --signature-size: min(17vw, 2rem + 8.4vw, 23svh); }
}
@media (max-width: 899px) {
  .bio { max-width: min(100%, 32rem); font-size: clamp(1.3125rem, 5.65vw, 1.625rem); }
  .bio:lang(en) { font-size: clamp(1.25rem, 4.9vw, 1.5rem); }
  .bio strong { display: block; margin-block-start: .12em; }
  .bio:lang(zh-Hant) strong > span { display: inline-block; max-width: 100%; }
}
@media (max-width: 620px) {
  :root { --head: 62px; --side: clamp(1.5rem, 6.7vw, 2.375rem); --edge: 10px; }
  .bar-inner { --bar-inset: 16px; }
  .control { width: 41px; height: 42px; }
  .hero { min-height: min(82svh, 46rem); padding: clamp(3rem, 7svh, 4.5rem) max(.5rem, 2vw) clamp(4rem, 9svh, 6rem); }
  .hero-statement { width: calc(100% - 1.5rem); }
  .role { letter-spacing: .015em; }
  .featured-grid, .skill-grid, .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .doc-link { justify-content: center; text-align: center; }
  .featured-grid, .gallery-grid { row-gap: 43px; }
  .featured { padding-inline: 17px; }
  .case-visual + .case-heading { margin-top: 15px; }
  .case-heading { column-gap: 10px; }
  .case-copy p { line-height: 1.8; }
  .project-links { margin-top: 9px; }
  .timeline-entry, .activity { display: block; }
  .timeline-entry .period, .activity .date { padding: 0; margin: 0 0 7px; }
  .timeline-entry p { margin-top: 4px; }
  .school { gap: 10px; }
  .skill-grid { gap: 8px; }
  .site-footer { padding-block: 24px; }
}
@media (max-width: 360px) {
  .hero .role { font-size: .875rem; letter-spacing: 0; }
  .role .native-name { font-size: .9375rem; }
  .bar-inner { --bar-inset: 11px; }
}
@media (prefers-reduced-motion: no-preference) {
  :is(.control, .button) { transition: color .18s ease, background-color .2s ease, border-color .2s ease, transform .2s var(--ease); }
  .button:active { transform: scale(.97); }
  .case-visual img { transition: transform .55s var(--ease); }
  @media (hover: hover) and (pointer: fine) {
    .button:hover { transform: translateY(-2px); }
    .case-visual:hover img { transform: scale(1.026); }
  }
}
@media print {
  .bar, .skip, .site-footer a { display: none; }
  .hero { min-height: 0; padding-block: 2rem; }
  .hero-statement { width: 100%; padding-block: 1.5rem; }
  .bio, .bio:lang(en) { font-size: 14pt; }
  .section { width: 95%; padding: 2rem 0; }
  .case, .timeline-entry, .activity { break-inside: avoid; }
}

/* A full-width chapter between the introduction and the project archive. */
#portfolio {
  --stage: #141416;
  --featured-title-scale: 1.25;
  --ink: #f8f7f4;
  --body: #cccbcf;
  --muted: #aaa9b0;
  --link: #d2c7ff;
  --line: #39383e;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(43px, 6vw, 98px) 0 clamp(28px, 4vw, 70px);
  border-radius: clamp(26px, 4.4vw, 82px);
  background: var(--stage);
  color: var(--ink);
  isolation: isolate;
}
#portfolio > .section-heading {
  margin: 0 auto;
  width: min(100% - 2 * var(--side), 1520px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: baseline;
  gap: clamp(8px, 2vw, 28px);
  padding-bottom: clamp(16px, 1.8vw, 32px);
}
#portfolio > .section-heading h2 {
  grid-column: 2;
  font-size: clamp(24px, 2.55vw, 44px);
  font-weight: 570;
  letter-spacing: -.045em;
}
#portfolio .section-heading .text-link { grid-column: 3; justify-self: end; min-height: 34px; color: var(--body); }
#portfolio .section-heading .text-link::after { content: "↓"; margin-inline-start: .5em; }
.work-story {
  position: relative;
  width: min(100%, 1920px);
  margin-inline: auto;
  --gutter: clamp(24px, 3.8vw, 80px);
  --middle: clamp(300px, 33vw, 550px);
  --lane-gap: clamp(18px, 2.3vw, 45px);
}
.story-pin { text-align: center; padding: clamp(46px, 6vw, 95px) var(--gutter) clamp(28px, 3.5vw, 54px); }
.story-copy { max-width: 36rem; margin-inline: auto; }
.story-category {
  margin-bottom: clamp(12px, 1.2vw, 22px);
  color: var(--muted);
  font-size: clamp(12px, .95vw, 16px);
  font-weight: 520;
  line-height: 1.45;
  letter-spacing: .09em;
}
#portfolio .story-title {
  font-size: clamp(34px, 4.4vw, 79px);
  line-height: 1.04;
  text-wrap: balance;
}
#portfolio .story-title-pair { line-height: 1.17; letter-spacing: -.055em; }
.story-title-pair span { display: inline-block; }
.story-title-pair:lang(en) span + span { margin-inline-start: .17em; }
.story-description {
  margin: clamp(16px, 1.6vw, 26px) auto 0;
  max-width: 34em;
  color: var(--body);
  font-size: clamp(14px, 1.08vw, 18px);
  line-height: 1.85;
  text-wrap: pretty;
}
.story-copy .project-links { justify-content: center; gap: 3px clamp(11px, 1.35vw, 24px); margin-top: clamp(13px, 1.4vw, 22px); }
.story-copy .project-links a {
  min-height: 38px;
  color: var(--ink);
  font-size: clamp(12px, .97vw, 15px);
  font-weight: 520;
  text-decoration: underline;
  text-decoration-color: #77757e;
  text-decoration-thickness: 1px;
  text-underline-offset: .45em;
}
.story-copy .project-links a:is(:hover, :focus-visible) { color: var(--link); text-decoration-color: currentColor; }
.story-reel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(32px, 5vw, 86px);
  padding: 0 var(--gutter) clamp(50px, 6vw, 108px);
}
.story-shot { min-width: 0; }
.story-reel .phone-shot { width: min(100%, 240px); justify-self: center; }
.phone-shot img { outline: 1px solid #37363c; outline-offset: -1px; }
.story-shot > a { display: block; border-radius: clamp(8px, .95vw, 17px); }
.story-shot img {
  width: 100%;
  height: auto;
  border-radius: inherit;
  background: #28282c;
}
.story-shot figcaption {
  margin-top: clamp(8px, .8vw, 15px);
  color: var(--muted);
  font-size: clamp(12px, .9vw, 15px);
  line-height: 1.55;
}
.bar.over-story {
  --page: #141416;
  --paper: #202023;
  --glass: rgb(20 20 22 / 96%);
  --ink: #f8f7f4;
  --body: #d1d0d4;
  --line: #38373d;
  --quiet: #302e33;
  --tint: #353043;
  --link: #d4c9ff;
  --brand: #b2a3ff;
  color: var(--ink);
}
@media (min-width: 900px) {
  #portfolio .story-title-pair { font-size: clamp(33px, 3.8vw, 70px); }
  .story-title-pair span { display: block; }
  .story-title-pair:lang(en) span + span { margin-inline-start: 0; }
}
@media (max-width: 620px) {
  #portfolio { border-radius: 28px; }
  .work-story { --gutter: clamp(19px, 6vw, 34px); }
  .story-pin { padding: 38px var(--gutter) 26px; }
  #portfolio .story-title-pair { font-size: clamp(26px, 7.25vw, 39px); }
  .story-reel { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .story-description { max-width: 32em; }
}

@media print {
  #portfolio { --ink: #101012; --body: #29292c; --muted: #535358; --line: #ccc; color: var(--ink); background: white; padding: 20px 0; }
  .story-pin { padding: 24px 0; }
  .story-reel { gap: 1rem; padding: 0 0 1rem; }
  .story-shot { break-inside: avoid; }
}

.archive-inner { width: min(calc(100% - var(--side) - var(--side)), var(--wide)); margin-inline: auto; }
#projects { width: 100%; }
:root[data-ddw-theme="dark"] #portfolio { --stage: #25232b; }

:root {
  --theme-duration: 950ms;
  --work-width: 60rem;
  --work-image-radius: clamp(.875rem, 1.7vw, 1.5rem);
  --reading: 46rem;
  --column-gap: clamp(1.75rem, 4.5vw, 3.75rem);
  --date-width: clamp(10rem, 15vw, 12rem);
}
.work-story > :is(.story-pin, .story-links), .site-footer {
  width: min(calc(100% - var(--side) - var(--side)), var(--work-width));
  margin-inline: auto;
}

#portfolio > .section-heading {
  width: min(calc(100% - var(--side) - var(--side)), var(--work-width));
  padding: 0; display: flex; align-items: center; justify-content: center;
}
#portfolio > .section-heading h2 {
  color: var(--body); font-size: 1rem; font-weight: 530; line-height: 1.5; letter-spacing: .02em;
}
.work-story { width: 100%; isolation: isolate; padding-block: clamp(3.75rem, 7.5vw, 7rem); }
.story-backdrop {
  position: absolute; inset: 0; z-index: -1; overflow: clip;
  pointer-events: none; user-select: none;
}
.story-backdrop img {
  position: sticky; top: var(--head); display: block;
  width: min(100%, 90rem); height: auto; margin-inline: auto; opacity: .15;
}
#millennium-website .story-backdrop img { width: min(96%, 70rem); }
.story-pin { display: grid; align-items: center; min-height: clamp(9rem, 15vw, 14rem); padding: 0; }
.story-copy { max-width: 100%; }
#portfolio .story-title {
  font-size: calc(var(--featured-title-scale) * clamp(1.5rem, 1.15rem + 1.15vw, 2.125rem));
  line-height: 1.35;
}
.story-title:lang(zh-Hant) > span { display: inline-block; max-width: 100%; }
#portfolio .story-description {
  margin-top: 0; max-width: 32rem;
  font-size: 1rem; line-height: 1.8; text-wrap: balance;
}
.story-reel {
  width: min(calc(100% - 2 * var(--side)), var(--work-width));
  margin: var(--heading-gap) auto 0; padding: 0;
  display: grid; align-items: start;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.75rem, 3.5vw, 2.6rem) clamp(.75rem, 2.25vw, 2rem);
}
.story-reel .story-shot { width: 100%; margin: 0; }
#crossgen-tech { --shot-mat: #e6e2ee; }
#millennium-website { --shot-mat: #e3e8e6; }
.story-shot:first-of-type { grid-column: 1 / -1; --mat-ratio: 2.12; }
.story-shot > a, .gallery-grid .case-visual {
  position: relative; display: block; width: 100%; padding: 0; overflow: hidden;
  container-type: size; aspect-ratio: var(--mat-ratio, 1.85);
  border-radius: clamp(.625rem, 1.25vw, 1.125rem);
  background: var(--shot-mat, #ebe8f2);
}
.gallery-case[data-record-mat] a.case-visual { background: var(--shot-mat); }
.case-extra-photos {
  container: case-shots / inline-size; display: flex; flex-wrap: wrap; justify-content: center;
  align-items: flex-start; gap: .5rem; margin-block: .65rem 1rem;
}
.case-extra-shot { flex: 0 0 calc((100% - .5rem) / 2); min-width: 0; margin: 0; }
@container case-shots (min-width: 19rem) {
  .case-extra-photos:has(> :nth-child(3)) > .case-extra-shot { flex-basis: calc((100% - 1rem) / 3); }
}
@container case-shots (max-width: 12.49rem) {
  .case-extra-shot { flex-basis: 100%; }
}
.case-cover, .cms-record-figure { min-width: 0; margin: 0; }
.case-cover + .case-heading { margin-block-start: clamp(15px,1.5vw,21px); }
.case-extra-shot figcaption { color: var(--muted); font-size: .8rem; margin-block-start: .4rem; }
.case-extra-photos .case-visual { min-height: 0; }
.cms-page-block { width: min(100%,var(--reading)); margin: 0 auto; padding-block: var(--heading-gap); overflow-wrap: anywhere; }
.cms-page-block img, .section[data-record-id] > .chapter-body img { width: auto; height: auto; max-width: 100%; max-height: 70vh; margin: 1rem auto; border-radius: var(--work-image-radius); }
.section[data-record-id] .chapter-body { text-align: center; }
.section[data-record-id] .project-links,.cms-page-block .project-links { justify-content: center; }
.cms-inline-link { color: inherit; }
.cms-media-link { display: contents; }
.gallery-case.with-screens { display: block; }
.gallery-case.with-screens .case-heading { margin-block-start: 1rem; }
.story-shot figcaption {
  margin: .5rem 0 0; color: var(--muted); font-size: .875rem; text-align: center; line-height: 1.45;
}
.story-shot:first-of-type figcaption { display: none; }
.story-links { justify-content: center; gap: .375rem clamp(1rem, 2.4vw, 2.125rem); margin-top: clamp(1.75rem, 3.2vw, 3rem); }
.story-links a, .gallery-index a {
  min-height: 44px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .38em;
}
.story-links a { color: var(--ink); text-decoration-color: var(--muted); }
.story-links a:hover { color: var(--link); }

.design-selection {
  width: min(calc(100% - 2 * var(--side)), var(--work-width));
  margin-inline: auto;
  padding-block: clamp(4rem, 9vw, 9rem) clamp(3rem, 6vw, 6rem);
}
.design-intro { margin: 0 auto clamp(3rem, 6vw, 5rem); text-align: center; }
.design-intro h3 {
  margin: 0; color: var(--ink); font-size: calc(var(--featured-title-scale) * clamp(1.6rem, 3vw, 2.55rem));
  line-height: 1.25; text-wrap: balance;
}
#portfolio :is(.story-title, .design-intro > h3) {
  font-weight: 850;
  letter-spacing: -.012em;
  scale: 1 .78;
}
.design-intro p { max-width: 39rem; margin: .125rem auto 0; color: var(--body); font-size: 1rem; line-height: 1.9; text-wrap: pretty; }
.design-grid {
  --art-gap: clamp(.875rem, 2vw, 1.75rem);
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center;
  gap: clamp(2.75rem, 6vw, 5rem) var(--art-gap);
}
.design-series {
  --series-span: 6;
  flex: 0 0 calc((100% + var(--art-gap)) * var(--series-span) / 6 - var(--art-gap));
  min-width: 0; container: design-series / inline-size; overflow-wrap: anywhere;
}
.design-series--pair { --series-span: 4; }
.design-series--single { --series-span: 2; }
.design-series--half { --series-span: 3; }
.design-series:not(:has(> .design-pieces > *)) { display: none; }
@media (min-width: 42.01rem) {
  :is(.design-series--four, .design-series--pair):has(> .design-pieces > figure:only-of-type) { --series-span: 2; }
}
@media (max-width: 42rem) {
  .design-series { --series-span: 6; }
}
.design-series h4 { margin: 0 0 .875rem; color: var(--ink); font-size: 1rem; font-weight: 560; line-height: 1.5; }
.design-pieces {
  --preset-columns: var(--balanced-2, 2);
  --space-columns: 1;
  --art-columns: min(var(--preset-columns), var(--space-columns));
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start;
  gap: 1.375rem var(--art-gap);
}
.design-series--four > .design-pieces { --preset-columns: var(--balanced-4, 4); }
.design-series--single > .design-pieces { --preset-columns: 1; }
.design-pieces > figure {
  flex: 0 0 calc((100% + var(--art-gap)) / var(--art-columns) - var(--art-gap));
  min-width: 0; margin: 0; break-inside: avoid;
}
.design-pieces > figure:only-of-type, .design-pieces > :not(figure) { flex: 0 0 100%; min-width: 0; }
@container design-series (min-width: 16rem) {
  .design-pieces { --space-columns: var(--balanced-2, 2); }
}
@container design-series (min-width: 32rem) {
  .design-pieces { --space-columns: var(--balanced-3, 3); }
}
@container design-series (min-width: 40rem) {
  .design-pieces { --space-columns: var(--balanced-4, 4); }
}
.design-series--banner > .design-pieces { --preset-columns: 1; }
@container design-series (min-width: 36rem) {
  .design-series--banner > .design-pieces { --preset-columns: var(--balanced-2, 2); }
}
.design-art { display: block; overflow: hidden; aspect-ratio: 1; border-radius: var(--work-image-radius); }
.design-series--banner .design-art { aspect-ratio: 2.5; }
.design-art, .story-shot > a, .gallery-grid a.case-visual { cursor: zoom-in; }
.design-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.design-pieces figcaption { margin-top: .625rem; color: var(--muted); font-size: .8125rem; line-height: 1.55; }

html:has(.design-viewer[open]) { overflow: hidden; }
.design-viewer {
  box-sizing: border-box; inset: 0; margin: auto; padding: clamp(.875rem, 2vw, 1.75rem);
  width: min(76rem, calc(100% - 2rem)); height: calc(100% - 2rem); height: min(64rem, calc(100dvh - 2rem));
  max-width: 100%; max-height: 100%; border: 0; border-radius: clamp(1.75rem, 3vw, 2.5rem);
  background: var(--viewer-surface); color: #f8f7f4; font: inherit; overscroll-behavior: contain;
}
.design-viewer::backdrop { background: rgb(10 10 13 / .88); }
.design-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: .875rem; }
.design-viewer-bar, .design-viewer-info { display: flex; align-items: center; gap: clamp(.625rem, 1.6vw, 1.5rem); }
.design-viewer-bar { line-height: 1.35; }
.design-viewer-info { flex: 1; font-size: .9375rem; }
.design-viewer-count { flex: none; color: #c4c4ca; font-size: .8125rem; font-variant-numeric: tabular-nums; }
.design-original {
  display: inline-flex; align-items: center; flex: none; min-height: 2.75rem;
  color: #d4d4d9; font-size: .8125rem; text-decoration: underline transparent; text-underline-offset: .27em;
}
.design-viewer button {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  padding: 0; border: 1px solid #68686e; border-radius: 50%; background: transparent;
  color: inherit; cursor: pointer;
}
.design-viewer button svg {
  display: block; fill: none; stroke: currentColor; stroke-width: 2.25;
  stroke-linecap: round; stroke-linejoin: round; transform-origin: center; pointer-events: none;
}
:root:not([data-pointer-input]) .design-viewer button:focus-visible { background-color: #5c5c65; }
.design-original:is(:active, :focus-visible) { color: white; text-decoration-color: currentColor; }
@media (hover: hover) {
  .design-viewer button:hover { background-color: #343438; border-color: #babad0; }
  .design-original:hover { color: white; text-decoration-color: currentColor; }
}
.design-viewer button:active { background-color: #48484e; border-color: #dddddf; }
.design-viewer-stage {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr);
  align-items: center; gap: clamp(.75rem, 1.6vw, 1.5rem); min-height: 0;
}
.design-viewer-frame { position: relative; align-self: stretch; min-width: 0; min-height: 0; overflow: hidden; }
.design-viewer-frame img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 42rem) {
  .design-viewer { width: calc(100% - 1rem); height: calc(100% - 1rem); height: calc(100dvh - 1rem); }
  .design-viewer-info { align-items: start; flex-direction: column; gap: .25rem; font-size: .875rem; }
  .design-viewer-stage { grid-template: "art art" minmax(0, 1fr) "prev next" auto / 1fr 1fr; }
  .design-viewer-frame { grid-area: art; }
  .design-prev { grid-area: prev; justify-self: end; }
  .design-next { grid-area: next; }
}
@media (prefers-reduced-motion: no-preference) {
  .design-viewer[open], .design-viewer[open]::backdrop { opacity: 1; transition: opacity .24s ease; }
  @starting-style {
    .design-viewer[open], .design-viewer[open]::backdrop { opacity: 0; }
  }
  .design-viewer[data-closing], .design-viewer[data-closing]::backdrop { opacity: 0; }
  .design-viewer button { transition: background-color .24s ease, border-color .24s ease; }
  .design-viewer button svg { transition: scale .2s var(--ease), transform .28s var(--ease); }
  .design-viewer button:active svg { scale: .86; transition-duration: .1s; }
  .design-original { transition: color .24s ease, text-decoration-color .24s ease, text-underline-offset .2s var(--ease); }
  .design-original:active { text-underline-offset: .12em; }
  .design-viewer-frame { --slide-by: 1.125rem; }
  .design-viewer-frame[data-direction="prev"] { --slide-by: -1.125rem; }
  .design-viewer-frame img + img { animation: viewer-slide-in .36s var(--ease) both; }
  .design-viewer-frame img[aria-hidden="true"] { animation: viewer-slide-out .36s ease-out both; }
  .design-viewer:has(.design-viewer-frame img + img) .design-viewer-info { animation: viewer-caption-in .28s ease-out; }
  @keyframes viewer-slide-in { from { opacity: 0; transform: translateX(var(--slide-by)); } }
  @keyframes viewer-slide-out { to { opacity: 0; transform: translateX(calc(-1 * var(--slide-by))); } }
  @keyframes viewer-caption-in { from { opacity: .45; transform: translateY(3px); } }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .design-prev:hover svg { transform: translateX(-3px); }
  .design-next:hover svg { transform: translateX(3px); }
  .design-viewer form button:hover svg { transform: rotate(12deg); }
}

#projects { --chapter-measure: var(--work-width); }
/* The vertical chapter title reduces the space available for cards on landscape screens. */
#projects > .archive-inner { container: project-gallery / inline-size; }
.brand-work { --chapter-measure: 83rem; }
.brand-work > .chapter-body { text-align: center; container: clients / inline-size; }
.brand-work .brand-group > h3 {
  margin: 0 auto 1.5rem; font-size: 1rem; letter-spacing: .02em; font-weight: 550;
}
.brand-grid {
  --client-basis: 16.6666%; display: flex; flex-wrap: wrap; justify-content: center;
  list-style: none; margin: 0; padding: clamp(1.5rem, 3vw, 3rem) clamp(.4rem, 1.5vw, 1.5rem);
  row-gap: clamp(1rem, 2.25vw, 2.25rem); color: var(--ink);
}
.brand-grid > :is(li,.identity-piece) { flex: 0 0 var(--client-basis); min-width: 0; }
.client {
  display: grid; place-items: center; color: inherit;
  width: 100%; height: 100%; padding: .5rem clamp(.4rem, 1vw, .9rem);
}
.client-mark, .brand-grid .identity-plate {
  --mark-height: clamp(4rem, 5.2vw, 5rem);
  position: relative; display: flex; justify-content: center; align-items: center; width: 100%; height: var(--mark-height);
}
.client-mark img, .brand-grid .identity-plate img {
  position: relative; display: block; width: auto; height: auto; max-width: 100%; max-height: var(--mark-height); object-fit: contain;
}
.client-mark picture { display: contents; }
.mark-filters { position: absolute; pointer-events: none; }
.identity-muse img { filter: brightness(.57) saturate(1.4); }
@media screen {
  :root[data-ddw-theme="dark"] .mark-dark-type { filter: url("#lighten-logo-ink"); }
  :root[data-ddw-theme="dark"] .mark-single-ink { filter: brightness(0) invert(.94); }
  :root[data-ddw-theme="dark"] .mark-deep-color { filter: brightness(1.65); }
  :root[data-ddw-theme="dark"] .identity-loan img { filter: url("#lighten-logo-ink") brightness(1.28); }
  :root[data-ddw-theme="dark"] .identity-muse img { filter: none; }
  :root[data-ddw-theme="dark"] .org-mark-esico { filter: brightness(2.5) saturate(.72); }
  :root[data-ddw-theme="dark"] picture > img[data-custom-dark] { filter:none; }
}
:root[data-effects="full"] .client-mark img { transition: transform .3s var(--ease); }
@media (hover: hover) {
  :root[data-effects="full"] .client:hover img { transform: translateY(-3px); }
}
.brand-group + .brand-group { margin-top: clamp(3.25rem, 6.5vw, 6.25rem); }
.identity-pair {
  --identity-gap: clamp(1.25rem, 3vw, 2.75rem);
  width: min(100%, var(--work-width)); margin-inline: auto; display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--identity-gap);
}
@media (width > 35rem) {
  .identity-pair > :nth-child(odd of li:not(.cms-copy), .identity-piece):nth-last-child(1 of li:not(.cms-copy), .identity-piece) {
    grid-column: 1 / -1; width: calc((100% - var(--identity-gap)) / 2); justify-self: center;
  }
}
.identity-plate, .identity-pair .client-mark {
  display: grid; place-items: center; aspect-ratio: 1.8; padding: 1rem;
}
.identity-plate img, .identity-pair .client-mark img { width: auto; height: auto; max-width: 72%; max-height: clamp(6rem, 10.2vw, 10rem); }
ul.identity-pair { padding: 0; list-style: none; }
.identity-pair .client { padding: 0; }
.identity-pair .client-mark { height: auto; }
.brand-grid .identity-plate { aspect-ratio: auto; padding: .5rem clamp(.4rem, 1vw, .9rem); }
@media (max-width: 68rem) { .brand-grid { --client-basis: 25%; } }
@media (max-width: 44rem) { .brand-grid { --client-basis: 33.3333%; } }
@media (max-width: 35rem) {
  .brand-grid { --client-basis: 50%; }
  .identity-pair { max-width: 26rem; grid-template-columns: minmax(0, 1fr); }
}
@container clients (max-width: 62rem) { .brand-grid { --client-basis: 20%; } }
@container clients (max-width: 48rem) { .brand-grid { --client-basis: 25%; } }
@container clients (max-width: 38rem) { .brand-grid { --client-basis: 33.3333%; } }
@container clients (max-width: 28rem) { .brand-grid { --client-basis: 50%; } }
@media print {
  .brand-work { --ink: #161619; --body: #49494f; }
  .brand-grid { --client-basis: 20%; padding: .5rem 0; row-gap: .5rem; }
  .brand-grid li, .identity-piece { break-inside: avoid; }
  .identity-plate img, .client-mark img { print-color-adjust: exact; }
}
.project-tabs {
  display: flex; flex-wrap: wrap; justify-content: center; width: fit-content; max-width: 100%; margin: 0 auto var(--heading-gap);
}
.project-tabs button {
  display: grid; place-items: center; position: relative; min-width: 0; min-height: 44px;
  background: transparent; border: 0; border-radius: 999px; color: var(--muted); font: 530 .9375rem/1.4 var(--font);
  padding: .6rem clamp(.875rem, 2.2vw, 2rem); max-width: 100%; overflow-wrap: anywhere; text-wrap: balance;
}
.project-tabs button[aria-selected="true"] { color: var(--link); background: var(--tint); }
.project-tabs button:hover { color: var(--link); }
.archive-inner[data-filtered] .gallery-group { border: 0; margin: 0; padding: 0; }
.archive-inner[data-filtered] .gallery-group[hidden="until-found"] {
  display: block !important; content-visibility: hidden; contain-intrinsic-size: 0 0;
}
.archive-inner[data-filtered] .gallery-title {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.gallery-grid {
  grid-template-columns: minmax(0, 1fr); align-items: start;
  gap: clamp(2.75rem, 5vw, 4.5rem) var(--column-gap);
}
.gallery-case { display: flex; flex-direction: column; }
.gallery-grid .case-visual { --mat-ratio: 1.8; }
.gallery-grid .gallery-case:nth-child(even) .case-visual { background: var(--shot-mat, #e5e9e9); }
.doc-link img.doc-icon { width:1.35em; height:1.35em; object-fit:contain; }
.bar .brand img.custom-brand-logo { filter:none; object-fit:contain; }
.gallery-case .case-heading { display: block; margin: clamp(1.25rem, 2vw, 1.875rem) 0 .5rem; }
.gallery-case .case-heading h4 { font-size: var(--item-title); line-height: 1.5; font-weight: 570; }
.gallery-case .case-copy { flex: 1; display: flex; flex-direction: column; }
.gallery-case .case-copy p { font-size: 1rem; line-height: 1.8; }
.gallery-case .project-links { margin-top: auto; padding-top: .75rem; gap: .25rem 1.25rem; }
.gallery-case .project-links a { min-height: 40px; }
.gallery-index { margin-top: var(--heading-gap); }
.text-case { padding-block: 0; }
.text-case .case-heading { margin: 0 0 .25rem; }
@media screen {
  .gallery-grid { --project-inset: clamp(1.25rem, 12%, 4rem); }
  .gallery-case:nth-child(odd) { margin-inline-end: var(--project-inset); }
  .gallery-case:nth-child(even) { margin-inline-start: var(--project-inset); text-align: end; }
  .gallery-case:nth-child(even) .project-links { justify-content: flex-end; }
  @container project-gallery (min-width: 38rem) {
    .gallery-grid {
      --project-inset: 0px;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: clamp(2.75rem, 5.5cqi, 3.75rem) clamp(1.75rem, 4.5cqi, 3.5rem);
    }
    /* Stagger whole articles so each preview, description and set of links share an edge. */
    .gallery-case:nth-child(4n + 2) {
      margin-inline-start: clamp(1.5rem, 6cqi, 3.75rem);
      margin-block-start: clamp(4rem, 12cqi, 7.25rem);
    }
    .gallery-case:nth-child(4n + 3) { margin-inline-start: clamp(1.25rem, 4cqi, 2.5rem); }
    .gallery-case:nth-child(4n) { margin-block-start: clamp(2.75rem, 8cqi, 4.75rem); }
  }
}

/* Equal outer tracks keep the reading column on the centre line as titles change sides. */
.section[data-heading-side] {
  --chapter-stage: calc(100svh - var(--head));
  --chapter-radius: clamp(28px, 4vw, 72px);
  --title-gutter: clamp(.625rem, 1.4vw, 1.5rem);
  --title-line: calc(var(--chapter-stage) - 2 * var(--title-gutter));
  --title-advance: var(--measured-advance, var(--title-characters, 4));
  --chapter-type: min(calc(var(--title-line) / var(--title-advance)), var(--title-width-limit, calc(100vw - 2 * var(--title-gutter))));
  --chapter-track: calc(var(--chapter-type) + var(--title-gutter));
  --chapter-ink: rgb(0 0 0 / 10%);
  position: relative; width: 100%; max-width: none; min-height: var(--chapter-stage); padding: 0;
  scroll-margin-block-start: var(--head);
  display: grid; align-items: center; column-gap: clamp(1rem, 2.5vw, 2.75rem);
  grid-template-columns: var(--chapter-track) minmax(0, 1fr) var(--chapter-track); overflow-x: clip;
}
#education { --title-advance: max(var(--work-title-advance, 4), var(--measured-advance, 2)); }
@media screen and (min-width: 48.01rem) and (orientation: landscape) {
  .section[data-heading-side] { --title-width-limit: 20vw; }
}
#education .card-title .title { inline-size: max-content; text-align: start; text-align-last: auto; }
@media screen {
  #education .chapter-heading-surface { display: flex; align-items: center; justify-content: flex-end; }
  #education .card-title { position: static; flex: none; margin: 0; }
}
#activities { --title-characters: 7; --chapter-measure: 56rem; }
:root[data-ddw-theme="dark"] .section[data-heading-side] { --chapter-ink: rgb(255 255 255 / 10%); }
@media screen and (min-width: 900px) {
  #contact[data-heading-side] { --chapter-ink: rgb(255 255 255 / 10%); }
}
.section[data-heading-side]:lang(en) { --title-advance: var(--measured-advance, 8); }
#contact[data-heading-side] { width: 100%; padding: 0; }
/* The paper and its lettering share a clipped surface throughout the scroll animation. */
.chapter-heading-surface {
  position: absolute; inset: 0; z-index: 0; padding: var(--title-gutter);
  overflow: clip; pointer-events: none;
}
.chapter-heading-surface > .card-title {
  position: sticky; top: calc(var(--head) + var(--title-gutter)); width: max-content;
  margin: 0; padding: 0; writing-mode: vertical-rl; text-orientation: mixed;
  white-space: nowrap; font-size: var(--chapter-type); font-weight: 610;
  line-height: 1; letter-spacing: 0; text-align: start; color: var(--chapter-ink); pointer-events: none;
}
.card-title .title { display: inline-block; inline-size: max-content; vertical-align: top; }
.chapter-heading-surface > .card-title:lang(zh-Hant) { font-family: "Noto Sans TC", sans-serif; }
.card-title:lang(zh-Hant) .title {
  inline-size: var(--title-line); text-align: justify; text-align-last: justify; text-justify: inter-character;
}
.chapter-heading-surface > .card-title:lang(en) { text-orientation: sideways; letter-spacing: -.025em; }
.section[data-heading-side="right"] .card-title { margin-left: auto; }
.section[data-heading-side] > .chapter-body {
  position: relative; z-index: 1; grid-row: 1; grid-column: 2; justify-self: center; min-width: 0;
  width: min(100%, var(--chapter-measure, var(--reading))); margin-inline: auto; padding-block: var(--section-space);
}
@media (max-width: 48rem), (orientation: portrait) {
  .section[data-heading-side] { grid-template-columns: minmax(0, 1fr); column-gap: 0; isolation: isolate; }
  .section[data-heading-side] > .chapter-body {
    grid-column: 1; z-index: 1; width: min(calc(100% - 2 * var(--side)), var(--chapter-measure, var(--reading)));
  }
}
@media screen and (max-width: 899px) {
  /* Keep the vertical title on the right. Let the timeline wrap below it when it needs more reading space. */
  #education {
    display: flex; flex-flow: row-reverse wrap; align-content: center;
    gap: var(--title-gutter) max(var(--title-gutter), calc(.1 * var(--chapter-type) + .375rem));
    padding: var(--title-gutter) var(--title-gutter) var(--title-gutter) var(--side);
  }
  #education > .chapter-heading-surface {
    position: static; flex: 0 0 var(--chapter-type); min-width: 0; padding: 0; overflow: visible;
  }
  #education > .chapter-body { flex: 1 1 10rem; width: auto; margin: 0; padding-block: 1rem; }
}

/* Dates, organizations and supporting lines repeat the same rhythm in the résumé. */
.profile-chapter .timeline-entry, .profile-chapter .school, .profile-chapter .activity {
  display: grid; grid-template-columns: var(--date-width) minmax(0, 1fr);
  align-items: baseline; gap: .35rem var(--column-gap); padding: var(--row-space) 0;
}
.profile-chapter :is(.timeline-entry, .school, .activity) :is(.period, .date) {
  margin: 0; padding: 0; font-size: .9375rem; line-height: 1.55; font-variant-numeric: tabular-nums;
}
.profile-chapter :is(.timeline-entry, .activity, .school, .skill) h3 {
  font-size: var(--item-title); font-weight: 570; line-height: 1.5;
}
.timeline-entry .job-detail { font-size: .9375rem; color: var(--muted); }
.activity p, .school p:not(.period), .org-info .job-title { margin-top: .35rem; }
.skill-grid { gap: 0 var(--column-gap); }
@media (width > 620px) {
  .skill-grid > .skill:nth-child(odd of .skill):nth-last-child(1 of .skill) {
    grid-column: 1 / -1; width: calc((100% - var(--column-gap)) / 2); justify-self: center;
  }
}
.skill { padding: var(--row-space) 0; }
.skill p { margin-top: .35rem; }
.skill-tools {
  grid-column: 1 / -1; container: skill-tools / inline-size;
  margin-block-start: clamp(2.5rem, 5vw, 4.5rem);
}
.skill-tools h3 { text-align: center; font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 570; }
.tool-groups {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 1.5rem var(--column-gap);
  width: fit-content; max-width: 100%;
  margin: clamp(1.75rem, 3vw, 2.5rem) auto 0;
}
.tool-groups > div {
  display: grid; grid-column: 1 / -1; grid-template-columns: subgrid;
  align-items: center; break-inside: avoid;
}
.tool-groups dt { color: var(--muted); font-size: .9375rem; line-height: 1.4; text-align: end; }
.tool-groups dd { margin: 0; }
.tool-groups ul { display: flex; flex-wrap: wrap; gap: .875rem 1.375rem; margin: 0; padding: 0; list-style: none; }
.tool-groups li { display: flex; align-items: center; gap: .5rem; font-weight: 510; line-height: 1.4; }
.tool-groups li > a:not(.cms-media-link) { display: inline-flex; align-items: center; gap: inherit; max-width: 100%; }
.tool-groups img { flex: none; width: 2.25rem; height: 2rem; object-fit: contain; }
.tool-groups .mark-single-ink { filter: brightness(0); }
@container skill-tools (max-width: 39rem) {
  .tool-groups { grid-template-columns: minmax(0, 1fr); width: 100%; row-gap: 1.875rem; }
  .tool-groups > div { grid-template-columns: minmax(0, 1fr); row-gap: .625rem; }
  .tool-groups dt { text-align: center; }
  .tool-groups ul { justify-content: center; }
}
.doc-grid { column-gap: var(--column-gap); }
.research-intro a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .3em; }
.doc-link { padding: 1.125rem 0; }
#contact .contact-list { column-gap: clamp(1.5rem, 4vw, 3.25rem); }
.site-footer { font-size: .875rem; }
.site-footer { flex-wrap: wrap; }
.page-links {
  flex: 1 0 100%; display: flex; flex-wrap: wrap; justify-content: center;
  gap: .35rem clamp(.8rem, 2.2vw, 2rem); margin: 0 0 1.25rem;
}
.page-links a, .page-intro a { display: inline-flex; align-items: center; min-height: 44px; color: var(--body); }
.page-links a[aria-current="page"] { color: var(--link); }
.page-intro { padding: clamp(2rem, 6vw, 5rem) var(--side) clamp(2rem, 5vw, 4rem); text-align: center; }
.page-intro a { font-size: .9rem; }
.page-intro > a { column-gap: .25em; position: relative; inset-block-start: clamp(.375rem, .6vw, .5rem); }
.page-intro a:hover { text-decoration: underline; }
.page-intro h1 { margin: .6rem 0 0; font-size: clamp(1.65rem, 4vw, 3rem); font-weight: 570; line-height: 1.35; }
.detail-page .detail-lead { width: 100%; max-width: none; min-height: 0; padding-block: 0 var(--section-space); }
.detail-page #portfolio.detail-lead { margin-top: 0; padding-top: 0; background: var(--stage); }
.detail-page #projects.detail-lead { margin-top: 0; background: var(--page); }
.detail-page #portfolio.detail-lead::before, .detail-page #projects.detail-lead::before { content: none; }
.detail-page .detail-lead > .chapter-body {
  width: min(calc(100% - var(--side) - var(--side)), var(--chapter-measure, var(--work-width))); margin-inline: auto;
}
.detail-page #contact.detail-lead { min-height: 0; padding-block: var(--heading-gap) var(--section-space); }
.detail-page #contact.detail-lead::before { inset: 0; }
@media (max-width: 700px) {
  .project-tabs button { font-size: .875rem; padding-inline: clamp(.42rem, 2.6vw, 1.2rem); }
  .text-case .case-heading { margin: 0 0 .25rem; }
  .story-reel {
    width: calc(100% - 2 * var(--edge)); grid-template-columns: minmax(0, 1fr);
    row-gap: clamp(1.75rem, 6vw, 2.75rem);
  }
  .story-shot figcaption { font-size: .8125rem; text-wrap: balance; }
  .profile-chapter :is(.timeline-entry, .school, .activity) {
    grid-template-columns: minmax(0, 1fr); gap: .25rem;
  }
  .profile-chapter .timeline-entry > :not(.period) { grid-column: auto; }
  .profile-chapter :is(.timeline-entry, .school, .activity) :is(.period, .date) { margin-bottom: .25rem; }
}
.org-mark {
  display: block; width: var(--mark-size, 4rem); height: var(--mark-size, 4rem);
  object-fit: contain; padding: .2rem;
}
.profile-chapter .identity-row {
  --mark-size: clamp(3.5rem, 5vw, 4rem);
  grid-template-columns: var(--date-width) var(--mark-size) minmax(0, 1fr);
  grid-template-areas: "date mark description";
  align-items: center; column-gap: clamp(1.25rem, 2.25vw, 2rem);
}
.profile-chapter .identity-row > :is(.period, .date) { grid-area: date; }
.profile-chapter .identity-row > .org-mark { grid-area: mark; }
.profile-chapter .identity-row > picture:has(> .org-mark) { grid-area:mark; align-self:center; justify-self:center; }
.story-backdrop > picture { display:contents; }
.profile-chapter .identity-row > .org-info { grid-area: description; min-width: 0; }
.org-info { --detail-leading: 1.5; --detail-gap: .0625rem; }
.org-info > .job-title { line-height: 1.5; }
.org-info > .job-detail { line-height: var(--detail-leading); margin-block: .25rem 0; }
.org-info > .job-detail + .job-detail { margin-block-start: var(--detail-gap); }
.activity-gallery {
  --activity-gap: clamp(2.75rem, 5vw, 4rem);
  container: activity-gallery / inline-size; display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--activity-gap);
}
.activity-gallery > .activity {
  flex: 0 0 100%; display: flex; flex-direction: column; align-items: stretch; gap: 0; min-width: 0; padding: 0;
}
@container activity-gallery (min-width: 41rem) {
  .activity-gallery > .activity { flex-basis: calc((100% - var(--activity-gap)) / 2); }
}
.activity-gallery > .cms-section-content { flex-basis: 100%; }
.activity-heading { display: flex; align-items: center; gap: .875rem; }
.activity-heading .org-mark { --mark-size: 3rem; flex: none; }
.activity-gallery .activity > p { margin: .65rem 0 1.25rem; text-wrap: balance; }
.activity-photo {
  display: block; width: 100%; aspect-ratio: 7 / 5; margin-top: auto;
  border-radius: clamp(1.25rem, 2vw, 1.75rem); overflow: hidden; cursor: zoom-in;
}
.activity-photo img { width: 100%; height: 100%; object-fit: cover; }
.activity-photo .lecture-photo { object-position: 50% 46%; }
.resume-timeline {
  --timeline-gap: clamp(1.25rem, 2.25vw, 2rem);
  --rail-x: calc(var(--date-width) + var(--timeline-gap) / 2);
  --pin-y: 50%; list-style: none; margin-block: 0; padding-inline: 0;
}
.resume-timeline > .identity-row {
  position: relative; column-gap: var(--timeline-gap); border: 0;
}
.resume-timeline .period { text-align: end; }
.resume-timeline > .identity-row::before, .resume-timeline > .identity-row::after {
  content: ""; position: absolute; left: var(--rail-x); pointer-events: none;
}
.resume-timeline > .identity-row::before {
  width: 2px; top: 0; bottom: 0; transform: translateX(-50%); background: var(--line);
}
.resume-timeline > :nth-child(1 of .identity-row)::before { top: var(--pin-y); }
.resume-timeline > :nth-last-child(1 of .identity-row)::before { bottom: calc(100% - var(--pin-y)); }
.resume-timeline > :nth-child(1 of .identity-row):nth-last-child(1 of .identity-row)::before { display: none; }
.resume-timeline > .identity-row::after {
  top: var(--pin-y); width: .625rem; height: .625rem; transform: translate(-50%, -50%);
  border-radius: 50%; border: 2px solid var(--muted); background: var(--chapter-paper, var(--page));
}
.resume-timeline > :nth-child(1 of .identity-row)::after { border-color: var(--link); background: var(--link); }
@media (max-width: 700px) {
  .profile-chapter .identity-row {
    --mark-size: clamp(3rem, 12.5vw, 3.5rem);
    grid-template-columns: var(--mark-size) minmax(0, 1fr);
    grid-template-areas: "mark date" "mark description";
    column-gap: .875rem; row-gap: .125rem;
  }
  .profile-chapter .identity-row > :is(.period, .date) { margin: 0; }
  .profile-chapter .identity-row > .org-mark { padding: .125rem; }
  .resume-timeline { --rail-x: .375rem; --pin-y: calc(var(--row-space) + .72rem); }
  .resume-timeline > .identity-row { padding-inline-start: 1.6rem; }
  .resume-timeline .period { text-align: start; }
}
@media screen and (max-width: 48rem), screen and (orientation: portrait) {
  #work[data-heading-side] {
    --work-title-width: clamp(2.25rem, 10vw, 3.75rem);
    --chapter-type: min(calc(var(--title-line) / var(--title-advance)), var(--work-title-width));
    grid-template-columns: var(--chapter-type) minmax(0, 1fr);
    gap: .75rem;
    padding-inline: var(--title-gutter) var(--side);
  }
  #work[data-heading-side="right"] {
    grid-template-columns: minmax(0, 1fr) var(--chapter-type);
    padding-inline: var(--side) var(--title-gutter);
  }
  #work > .chapter-heading-surface {
    position: relative; inset: auto; grid-row: 1; grid-column: 1;
    align-self: stretch; overflow: visible; padding: 0;
  }
  #work .card-title .title { inline-size: auto; text-align-last: auto; }
  #work > .chapter-body { grid-column: 2; width: 100%; }
  #work[data-heading-side="right"] > .chapter-heading-surface { grid-column: 2; }
  #work[data-heading-side="right"] > .chapter-body { grid-column: 1; }
}
@media screen and (max-width: 700px) {
  #work .identity-row {
    --mark-size: 2.25rem;
    grid-template-areas: "mark date" "description description";
    gap: .375rem .625rem;
  }
  #work .resume-timeline { --pin-y: calc(var(--row-space) + 1.125rem); }
}
@media screen and (max-width: 700px) {
  #education .identity-row {
    --mark-size: clamp(2rem, 8vw, 2.5rem);
    grid-template-areas: "mark date" "description description";
    gap: .5rem; padding-inline-start: 1.125rem;
  }
  #education .period :is(time, span) { display: inline-block; max-width: 100%; }
}
@media print {
  .section[data-heading-side] { display: block; min-height: 0; padding: 1.5rem 0; }
  .chapter-heading-surface { position: static; padding: 0; overflow: visible; }
  .section[data-heading-side] .card-title {
    position: static; writing-mode: horizontal-tb; font-size: 1.5rem; color: #161619; margin: 0 0 1rem;
  }
  .card-title:lang(zh-Hant) .title { inline-size: auto; text-align-last: auto; }
  .section[data-heading-side] > .chapter-body { width: 100%; margin: 0; padding: 0; }
  .story-backdrop { display: none; }
  .project-tabs { display: none; }
  .archive-inner[data-filtered] .gallery-group[hidden] { display: block !important; content-visibility: visible; }
  .archive-inner[data-filtered] .gallery-title { position: static; width: auto; height: auto; clip-path: none; margin-block: 1.5rem 1rem; }
  .story-shot, .gallery-case, .activity-gallery .activity { break-inside: avoid; }
  .text-case { grid-column: 1 / -1; padding-block: var(--row-space); }
  #research-projects .gallery-grid { row-gap: 0; }
  @container project-gallery (min-width: 40rem) {
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery-case:has(.case-visual):nth-child(odd):has(+ .text-case) {
      grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: 1fr 1fr; column-gap: var(--column-gap);
    }
    .gallery-case:has(.case-visual):nth-child(odd):has(+ .text-case) > :is(.case-visual,.case-cover) { grid-row: 1 / 3; }
    .gallery-case:has(.case-visual):nth-child(odd):has(+ .text-case) > .case-heading { align-self: end; }
    .gallery-case:has(.case-visual):nth-child(odd):has(+ .text-case) > .case-copy { align-self: start; }
    .text-case {
      display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.7fr);
      align-items: baseline; column-gap: var(--column-gap);
    }
    .text-case .case-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 1rem; }
    .text-case .project-links { justify-content: end; margin: 0; padding: 0; }
  }
}

/* The drawer slides behind the fixed logo and menu button. */
html[data-menu-open] { overflow: hidden; overscroll-behavior: none; }
.section-menu summary { list-style: none; }
.section-menu summary::-webkit-details-marker { display: none; }
#menu { width: 46px; height: 44px; }
.menu-icon { display: grid; place-items: center; width: 29px; height: 18px; }
.menu-icon::before, .menu-icon::after {
  content: ""; grid-area: 1 / 1; width: 100%; height: 2px; background: currentColor;
}
.menu-icon::before { transform: translateY(-3.5px); }
.menu-icon::after { transform: translateY(3.5px); }
.section-menu[open] .menu-icon::before { transform: rotate(45deg); }
.section-menu[open] .menu-icon::after { transform: rotate(-45deg); }
:root[data-ddw-theme="dark"] .theme-icon { transform: rotate(148deg); }
:root[data-ddw-theme="dark"] .brand img,
.bar.over-story .brand img { filter: brightness(0) invert(1); }
@media screen and (forced-colors: none) {
  @supports (mix-blend-mode: difference) {
    .brand, #menu { mix-blend-mode: difference; }
    .brand img { filter: brightness(0) invert(1); }
    #menu { color: white; }
  }
}
@media (hover: hover) and (pointer: fine) {
  #menu:hover .menu-icon { scale: .88; }
}
:root:not([data-pointer-input]) #menu:focus-visible .menu-icon { scale: .82; }
:root:not([data-pointer-input]) #menu:focus-visible .menu-icon::before,
:root:not([data-pointer-input]) #menu:focus-visible .menu-icon::after { height: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .menu-icon { transition: scale .2s var(--ease); }
}
@media (forced-colors: active) {
  .menu-icon { forced-color-adjust: none; color: ButtonText; }
  :root:not([data-pointer-input]) #menu:focus-visible .menu-icon { color: Highlight; }
  :root:not([data-pointer-input]) .design-viewer button:focus-visible {
    forced-color-adjust: none; background: Highlight; color: HighlightText;
  }
}
.menu-dismiss { position: fixed; z-index: 40; inset: 0; pointer-events: auto; }
.menu-viewport { position: fixed; z-index: 41; inset: 0; overflow: hidden; pointer-events: none; }
.menu-panel {
  --menu-fg: #fbfaf9; --menu-soft: #c7c5cc; --menu-accent: #cfbfff;
  position: absolute; inset: 0 0 auto; pointer-events: auto;
  height: min(83vh, 54rem); height: min(83dvh, 54rem);
  overflow: hidden; color: var(--menu-fg); color-scheme: dark;
}
.menu-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; background-color: var(--menu-surface);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .menu-panel::before {
    background-color: var(--menu-glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
}
:root[data-menu-open] :is(.brand, #menu) { mix-blend-mode: normal; color: #fbfaf9; }
:root[data-menu-open] .brand img { filter: brightness(0) invert(1); }
.menu-scroll {
  position: absolute; inset: var(--head) 0 0; overflow: auto; overscroll-behavior: contain;
  scroll-padding-block: 1rem; scrollbar-width: none;
}
.menu-inner {
  min-height: 100%; max-width: 86rem; margin-inline: auto;
  padding: clamp(1.25rem, 4vh, 3.5rem) clamp(2rem, 11vw, 11rem) clamp(2.5rem, 11vh, 7.5rem);
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(14rem, 18vw, 18rem);
  grid-template-areas: "utilities links"; align-content: end; align-items: end; gap: 2rem;
}
.menu-panel a { color: inherit; }
.section-nav { grid-area: links; min-width: 0; overflow-wrap: anywhere; }
.section-nav a, .menu-utilities a { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.menu-primary { display: grid; grid-template-columns: minmax(0,1fr); justify-items: start; gap: clamp(.625rem, 1.8vh, 1.125rem); }
.menu-more:not(:has(.menu-secondary a)) { display: none; }
.menu-primary a {
  display: grid; align-content: center; position: relative; min-height: 44px;
  font-size: clamp(1.125rem, 1rem + .7vw, 1.625rem); font-weight: 560;
  line-height: 1.5; letter-spacing: -.015em;
}
.menu-primary a[aria-current]::before {
  content: ""; position: absolute; top: 50%; left: -.45em; width: .16em; height: .16em;
  background: var(--menu-accent); border-radius: 50%; transform: translateY(-50%);
}
.menu-word { overflow: hidden; }
.menu-word > span { display: block; position: relative; }
.menu-more { margin-top: clamp(.35rem, 1.1vh, .9rem); }
.menu-more summary, .menu-shortcuts a, .menu-preferences { font-size: .875rem; }
.menu-more summary {
  display: inline-flex; align-items: center; gap: .65rem; min-height: 40px; color: var(--menu-soft);
}
.menu-more summary::after {
  content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1px 1px 0;
  transform: translateY(-2px) rotate(45deg);
}
.menu-more[open] > summary:not([aria-expanded])::after,
.menu-more > summary[aria-expanded="true"]::after { transform: translateY(2px) rotate(225deg); }
.menu-more-reveal { display: grid; grid-template-rows: 1fr; }
.menu-more-clip { min-height: 0; overflow: hidden; }
.menu-more summary[aria-expanded="false"] + .menu-more-reveal { grid-template-rows: 0fr; opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .menu-more-reveal { transition: grid-template-rows .42s var(--ease), opacity .3s ease; }
  .menu-more summary::after { transition: transform .42s var(--ease); }
}
@media (prefers-reduced-motion: reduce) {
  .menu-more-reveal { transition: opacity .12s linear; }
  .menu-more summary[aria-expanded="false"] + .menu-more-reveal {
    transition: opacity .12s linear, grid-template-rows 0s .12s;
  }
}
.menu-secondary {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem;
  max-width: 23rem; margin-top: .35rem; padding-block: .4rem;
}
.menu-secondary a { padding-block: .5rem; font-size: .9rem; line-height: 1.35; }
.menu-secondary a[aria-current] { color: var(--menu-accent); }
.menu-utilities { grid-area: utilities; justify-self: start; min-width: 0; }
.menu-scroll { overflow: hidden; }
.menu-inner { height: 100%; grid-template-rows: minmax(0,1fr); align-content: stretch; }
.menu-inner > :is(.section-nav,.menu-utilities) {
  min-height: 0; max-height: 100%; overflow-y: auto; overflow-anchor: none; overscroll-behavior: contain;
  scrollbar-width: none; margin-inline: -.875rem; padding-inline: .875rem;
}
.menu-email { display: inline-block; font-weight: 530; font-size: clamp(.95rem, 1.3vw, 1.15rem); }
.menu-shortcuts { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; }
.menu-shortcuts a { padding-block: .3rem; }
.menu-panel :is(.menu-utilities a, .menu-more summary, .menu-secondary a):hover { color: var(--menu-accent); }
.menu-preferences {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.5rem; margin-top: .85rem;
}
.menu-preferences button {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; min-width: 44px;
  padding: .25rem 0; color: var(--menu-soft); font: inherit; background: transparent; border: 0;
}
.menu-preferences button:is(:hover, :focus-visible) { color: var(--menu-accent); }
#language { min-inline-size: 4.25em; }
#theme .to-light, :root[data-ddw-theme="dark"] #theme .to-dark { display: none; }
:root[data-ddw-theme="dark"] #theme .to-light { display: inline; }
:root[data-effects="full"] .menu-icon::before, :root[data-effects="full"] .menu-icon::after {
  transition: transform .32s var(--ease);
}
:root[data-effects="full"] .section-menu[data-managed] .menu-panel {
  transform: translateY(-101%); border-radius: 0 0 50% 50% / 0 0 23% 23%;
  transition: transform .54s cubic-bezier(.55,.02,.45,1), border-radius .54s ease-in;
}
:root[data-effects="full"] .section-menu.is-revealed .menu-panel {
  transform: none; border-radius: 0;
  transition: transform .68s cubic-bezier(.58,.04,.18,1), border-radius .78s cubic-bezier(.6,0,.3,1);
}
:root[data-effects="full"] .section-menu[data-managed] :is(.menu-primary a, .menu-more, .menu-utilities) {
  opacity: 0; transform: translateY(12px); transition: opacity .15s ease, transform .23s ease;
}
:root[data-effects="full"] .section-menu.is-revealed :is(.menu-primary a, .menu-more, .menu-utilities) {
  opacity: 1; transform: none;
  transition: opacity .35s ease var(--delay, .24s), transform .48s var(--ease) var(--delay, .24s);
}
.menu-primary a:nth-child(2) { --delay: .28s; }
.section-menu[data-managed].is-preparing :is(.menu-panel, .menu-primary a, .menu-more, .menu-utilities) {
  transition: none !important;
}
:root { --workbench-login-bg: #fcfcfb; }
@media (prefers-color-scheme: dark) {
  :root { --workbench-login-bg: #101012; }
}
:root[data-workbench-tone="dark"] { --workbench-login-bg: #101012; }
:root[data-workbench-tone="light"] { --workbench-login-bg: #fcfcfb; }
.workbench-departure {
  position: fixed; inset: 0; z-index: 110; background: var(--workbench-login-bg);
}
.workbench-departure.admin-departure { background: var(--page); }
:root[data-workspace-handoff] { --handoff-bg: var(--workbench-login-bg); background-color: var(--handoff-bg); }
:root[data-workspace-handoff="editor"] { --handoff-bg: var(--page); }
:root[data-workspace-handoff] body { background-color: var(--handoff-bg); }
:root[data-workspace-handoff] body > :not(.workbench-departure) { opacity: 0 !important; }
@media (prefers-reduced-motion: no-preference) {
  :root[data-workbench-return] { background-color: var(--workbench-login-bg); }
  :root[data-workbench-return]::after {
    content: ""; position: fixed; inset: 0; z-index: 109;
    pointer-events: none; background: var(--workbench-login-bg);
  }
  :root[data-workbench-return="reveal"]::after {
    animation: workbench-home-return .6s cubic-bezier(.33,0,.22,1) both;
  }
  :root[data-workbench-return][data-menu-open]::after { z-index: 39; }
}
@keyframes workbench-home-return { from { opacity: 1; } to { opacity: 0; } }
.chapter-transition { display: none; }
@media screen and (prefers-reduced-motion: no-preference) {
  :root[data-chapter-transition] .chapter-transition {
    display: grid; place-items: center; position: fixed; inset: 0; z-index: 115;
    background: var(--page); color: var(--ink); user-select: none;
  }
  .chapter-transition > span {
    font: 400 clamp(4.25rem, 12vw, 6rem)/1 "Explora", cursive;
    font-synthesis: none; -webkit-text-stroke: .015em currentColor;
    max-width: 90vw; text-align: center; overflow-wrap: anywhere;
  }
  [data-chapter-transition="out"] .chapter-transition > span {
    animation: chapter-signature-in .72s .06s ease-in-out both;
  }
  [data-chapter-transition="parked"] body > :not(.chapter-transition) { opacity: 0 !important; }
  [data-chapter-transition="reveal"] .chapter-transition {
    animation: chapter-arrive .46s cubic-bezier(.33,0,.22,1) both; pointer-events: none;
  }
}
@keyframes chapter-signature-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes chapter-arrive { from { opacity: 1; } to { opacity: 0; } }
/* Keep the editor's masthead visible across the document handoff. */
.admin-departure::before {
  content: ""; position: absolute;
  inset-inline-start: max(calc((100% - 1440px) / 2), clamp(1.5rem, 6.5vw, 6rem));
  top: 39px; transform: translateY(-50%); width: clamp(44px, 4vw, 50px); aspect-ratio: 1;
  background: var(--ink);
  -webkit-mask: var(--site-mark, url("/profile-assets/dt-mark.svg")) center / contain no-repeat;
  mask: var(--site-mark, url("/profile-assets/dt-mark.svg")) center / contain no-repeat;
}
:root[data-ddw-theme="dark"] .admin-departure::before {
  -webkit-mask-image:var(--site-dark-mark,var(--site-mark,url("/profile-assets/dt-mark.svg")));
  mask-image:var(--site-dark-mark,var(--site-mark,url("/profile-assets/dt-mark.svg")));
}
@media (max-width: 760px) {
  .admin-departure::before { inset-inline-start: clamp(1.25rem, 6.5vw, 2.4rem); top: 31px; }
}
.menu-primary a:nth-child(3) { --delay: .32s; }
.menu-primary a:nth-child(4) { --delay: .36s; }
.menu-more { --delay: .4s; }
@media (hover: hover) and (pointer: fine) {
  :root[data-effects="full"] .menu-word > span { transition: transform .35s var(--ease); }
  :root[data-effects="full"] .menu-word > span::after {
    content: attr(data-zh) / ""; position: absolute; inset: 100% 0 auto; color: var(--menu-accent);
  }
  :root[data-effects="full"]:lang(en) .menu-word > span::after { content: attr(data-en) / ""; }
  :root[data-effects="full"] .menu-primary a:hover .menu-word > span { transform: translateY(-100%); }
}
@media (max-width: 700px) {
  .menu-panel { height: 78vh; height: 78dvh; }
  .menu-inner {
    padding: 1.5rem 8vw clamp(1.75rem, 6.5vh, 4rem); grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "links" "utilities"; grid-template-rows: minmax(0, 1fr) fit-content(42%); gap: clamp(1rem, 4vh, 2.5rem);
  }
  .menu-primary { gap: .375rem; }
  .menu-utilities { max-width: 100%; }
  .menu-secondary { gap: 0 1.5rem; }
  .menu-preferences { margin-top: .4rem; }
}
@media (max-height: 550px) {
  .menu-panel { height: 92vh; height: 92dvh; }
  .menu-inner { padding-block: 1rem 1.5rem; }
}
@media print {
  html[data-menu-open] { overflow: visible; }
  .menu-panel, .menu-dismiss { display: none !important; }
}

.cursor-ball { display: none; pointer-events: none; }
@media screen and (any-hover: hover) and (any-pointer: fine) {
  :root[data-ball-cursor]:not(:has(dialog:modal)), :root[data-ball-cursor]:not(:has(dialog:modal)) * { cursor: none !important; }
  :root[data-ball-cursor]:not(:has(dialog:modal)) .cursor-ball {
    display: grid; place-items: center; position: fixed; z-index: 100;
    top: -40px; left: -40px; width: 80px; height: 80px;
    will-change: transform; user-select: none;
  }
  .cursor-ball { --cursor-fill: #161619; --cursor-text: #fff; }
  :root[data-ddw-theme="dark"] .cursor-ball, .cursor-ball[data-dark-surface] {
    --cursor-fill: #fff; --cursor-text: #161619;
  }
  .cursor-ball::before, .cursor-label { grid-area: 1 / 1; }
  .cursor-ball::before {
    content: ""; width: 80px; height: 80px; border-radius: 50%;
    background: var(--cursor-fill); transform: var(--cursor-warp, none);
  }
  .cursor-label {
    position: relative; color: var(--cursor-text); font: 700 13px/1 var(--font);
    letter-spacing: 0; white-space: nowrap;
  }
  .cursor-ball[data-control] { mix-blend-mode: difference; }
  :root[data-menu-open] .cursor-ball[data-control][data-dark-surface] { mix-blend-mode: normal; }
  .cursor-ball[data-control]::before { width: 36px; height: 36px; background: #fff; }
  .cursor-ball[data-control] .cursor-label { opacity: 0; }
  :root[data-effects="full"] .cursor-ball::before {
    transition: width .18s var(--ease), height .18s var(--ease);
  }
  :root[data-effects="full"] .cursor-label { transition: opacity .12s ease; }
  :root[data-effects="full"] .cursor-ball[data-pressed]::before { scale: 1.08 .9; }
  :root[data-effects="full"] .cursor-ball[data-rebound]::before {
    animation: cursor-rebound .4s cubic-bezier(.25,.62,.36,1);
  }
}
@keyframes cursor-rebound {
  0% { scale: 1.08 .9; }
  35% { scale: .95 1.06; }
  70% { scale: 1.025 .98; }
  100% { scale: 1; }
}
.cms-section-content {
  position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem;
  width: min(100%, var(--reading)); margin: clamp(1.75rem, 4vw, 3rem) auto 0; padding-inline: 1rem; text-align: center;
}
.cms-copy { min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
.cms-standalone-separator {
  grid-column: 1 / -1; flex: 0 0 100%; margin: 0; min-width: 0;
  color: inherit; font-size: .95em; line-height: 1.5; text-align: center; overflow-wrap: anywhere;
}
.cms-standalone-separator:empty { display: none; }
.cms-entry-heading { margin: 0; font-size: var(--item-title); font-weight: 650; line-height: 1.45; letter-spacing: -.025em; }
.cms-entry-body { color: var(--body); line-height: 1.85; }
.cms-entry-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.cms-emphasis { color: inherit; background: linear-gradient(var(--marker-color, #ffea00),var(--marker-color, #ffea00)) left bottom / 100% .23em no-repeat; }
.cms-image-caption { margin: .625rem 0 0; color: var(--muted); font-size: .875rem; line-height: 1.55; overflow-wrap: anywhere; }
.cms-caption-original, .cms-caption-line { display: block; }
.story-shot:first-of-type figcaption.cms-image-caption { display: block; }
.story-shot:first-of-type .cms-caption-original { display: none; }
.cms-figure { min-width: 0; max-width: 100%; margin: 0 auto; }
.cms-figure img { display: block; width: auto; height: auto; max-width: 100%; max-height: min(55svh, 32rem); margin: auto; border-radius: 18px; }
.cms-figure figcaption { margin-top: .65rem; color: var(--muted); font-size: .875rem; }
[data-cms-populated] :is(figcaption, .project-links, .text-link) { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
#portfolio > .section-heading[data-cms-populated] { flex-direction: column; align-items: center; }
:is(.section-heading,.page-intro,.design-intro,.hero-statement) > .cms-section-content { margin-top: 1rem; padding: 0; }
#portfolio > .section-heading > .cms-section-content { margin-top: 0; }
.identity-pair > .cms-copy { grid-column: 1 / -1; }
.brand-grid .brand-note { flex-basis: 100%; max-width: var(--reading); padding-inline: 1rem; }
.activity figure { margin-top: auto; min-width: 0; }
.activity figcaption { margin-top: .625rem; color: var(--muted); font-size: .875rem; }
.site-footer > .cms-section-content { flex-basis: 100%; }
.chapter-body > .cms-section-content {
  grid-column: 1 / -1; width: 100%; margin: var(--row-space) 0 0; padding-inline: 0;
}
.activity-gallery > .cms-section-content, .contact-list > .cms-section-content { margin-block-start: 0; }
[data-cms-insert="start"] > .cms-section-content { margin: 0 auto var(--heading-gap); max-width: var(--reading); }

/* Keep reading and navigating the portfolio separate from editing a text field. */
body { -webkit-user-select:none; user-select:none; }
body :is(input:read-write,textarea:read-write,[contenteditable]:read-write) {
  -webkit-user-select:text; user-select:text;
}
